mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-18 07:18:53 +00:00
Merge branch 'main' into santiagxf/azure-ai-inference
This commit is contained in:
commit
5c429b0b67
273 changed files with 5491 additions and 5418 deletions
|
@ -49,6 +49,9 @@ def text_from_choice(choice) -> str:
|
|||
if hasattr(choice, "message"):
|
||||
return choice.message.content
|
||||
|
||||
if hasattr(choice, "message"):
|
||||
return choice.message.content
|
||||
|
||||
return choice.text
|
||||
|
||||
|
||||
|
@ -102,7 +105,6 @@ def process_chat_completion_response(
|
|||
async def process_completion_stream_response(
|
||||
stream: AsyncGenerator[OpenAICompatCompletionResponse, None], formatter: ChatFormat
|
||||
) -> AsyncGenerator:
|
||||
|
||||
stop_reason = None
|
||||
|
||||
async for chunk in stream:
|
||||
|
@ -162,6 +164,7 @@ async def process_chat_completion_stream_response(
|
|||
|
||||
text = text_from_choice(choice)
|
||||
if not text:
|
||||
# Sometimes you get empty chunks from providers
|
||||
continue
|
||||
|
||||
# check if its a tool call ( aka starts with <|python_tag|> )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue