Skip to content

Commit

Permalink
adding model_dump_json()
Browse files Browse the repository at this point in the history
  • Loading branch information
alt-glitch committed May 31, 2024
1 parent f52f814 commit 036a1c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions agents-api/agents_api/routers/sessions/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ async def run(
# Ref: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_with_chat_models.ipynb
if not message.content and message.tool_calls:
role = "function_call"
function_call = message.tool_calls[0].function.model_dump()
content = json.dumps(function_call)
content = message.tool_calls[0].function.model_dump_json()

elif not message.content:
raise ValueError("No content in response")
Expand Down

0 comments on commit 036a1c3

Please sign in to comment.