Optional chat completion mode#32
Merged
tisnik merged 2 commits intolightspeed-core:mainfrom May 15, 2025
Merged
Conversation
manstis
reviewed
May 15, 2025
| ) -> str: | ||
| if chat_completion_mode: | ||
| logger.info("Chat completion mode enabled") | ||
| response = client.inference.chat_completion( |
Contributor
There was a problem hiding this comment.
IMO all interactions with llama-stack will be through an agent.
Here you're calling the inference provider directly.
"Chat" can be implemented like this:
agent = Agent(client, ...)
# [session/conversation persistence but this is something else for the future...]
# session_id = agent.create_session("test-session")
prompt = input("Enter a prompt: ")
response = agent.create_turn(
messages=[UserMessage(
role="user",
content=prompt,
)],
session_id=session_id,
)
for log in EventLogger().log(response):
log.print()
Contributor
There was a problem hiding this comment.
Using the inference provider on it's own means you're skipping the Agent's support for "safety/shields (Question validity, Answer redaction)" and RAG and other things. You'd be left to implement support for these things yourself - which was OK in road-core but is supported "out of the box" with llama-stack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Optional chat completion mode
Type of change