mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 04:50:39 +00:00
check for text delta type
This commit is contained in:
parent
37b7390079
commit
52e533dc89
1 changed files with 2 additions and 1 deletions
|
@ -237,6 +237,7 @@ class InferenceRouter(Inference):
|
|||
completion_text = ""
|
||||
async for chunk in await provider.chat_completion(**params):
|
||||
if chunk.event.event_type == ChatCompletionResponseEventType.progress:
|
||||
if chunk.event.delta.type == "text":
|
||||
completion_text += chunk.event.delta.text
|
||||
if chunk.event.event_type == ChatCompletionResponseEventType.complete:
|
||||
model_output = self.formatter.encode_dialog_prompt(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue