diff --git a/agentverse/llms/openai.py b/agentverse/llms/openai.py index 11b17f02..3c9e874e 100644 --- a/agentverse/llms/openai.py +++ b/agentverse/llms/openai.py @@ -252,7 +252,7 @@ def generate_response( self.collect_metrics(response) return LLMResult( - content=response.choices[0].message.get("content", ""), + content=response.choices[0].message.content or "", function_name=response.choices[0].message.function_call.name, function_arguments=ast.literal_eval( response.choices[0].message.function_call.arguments diff --git a/requirements.txt b/requirements.txt index be80b602..4de663da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ fastapi==0.95.1 uvicorn py3langid setuptools-scm -openai==1.1.0 +openai>=1,<2 opencv-python==4.8.0.76 gradio httpx[socks]==0.25.0