Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented May 15, 2025

Description

Optional chat completion mode

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

@tisnik tisnik merged commit b09bd41 into lightspeed-core:main May 15, 2025
2 checks passed
) -> str:
if chat_completion_mode:
logger.info("Chat completion mode enabled")
response = client.inference.chat_completion(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Contributor

@manstis manstis May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants