diff --git a/llama_stack/providers/utils/inference/openai_compat.py b/llama_stack/providers/utils/inference/openai_compat.py index cc3e7a2ce..4123d07d6 100644 --- a/llama_stack/providers/utils/inference/openai_compat.py +++ b/llama_stack/providers/utils/inference/openai_compat.py @@ -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