mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-01 16:24:44 +00:00
fix: message.content can be None
This commit is contained in:
parent
a7df3e539c
commit
061a1cc790
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ def text_from_choice(choice) -> str:
|
|||
return choice.delta.content
|
||||
|
||||
if hasattr(choice, "message"):
|
||||
return choice.message.content
|
||||
try:
|
||||
return choice.message.content
|
||||
except:
|
||||
return choice.text
|
||||
|
||||
return choice.text
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue