Skip to content

Commit

Permalink
fix tool_choice auto
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Jun 19, 2024
1 parent 135b188 commit 99b818a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion impl/routes_v2/threads_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,10 @@ async def create_run(

if len(toolsJson) > 0:
litellm_kwargs["tools"] = toolsJson
litellm_kwargs["tool_choice"] = create_run_request.tool_choice.to_dict()
if create_run_request.tool_choice is not None and hasattr(create_run_request.tool_choice, "to_dict"):
litellm_kwargs["tool_choice"] = create_run_request.tool_choice.to_dict()
else:
litellm_kwargs["tool_choice"] = "auto"
message_content = summarize_message_content(instructions, messages.data, False)
message = await get_chat_completion(messages=message_content, model=model, **litellm_kwargs)

Expand Down

0 comments on commit 99b818a

Please sign in to comment.