fix: message.content can be None

This commit is contained in:
seyeong-han 2024-11-24 01:20:04 -06:00
parent a7df3e539c
commit 061a1cc790

View file

@ -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