Skip to content

Commit 5ae771f

Browse files
committed
fix a minor bug with openai query
1 parent eda4dbe commit 5ae771f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mirix/llm_api/openai_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ def build_request_data(
158158
except ValueError as e:
159159
logger.warning(f"Failed to convert tool function to structured output, tool={tool}, error={e}")
160160

161+
else:
162+
# When there are no tools, delete tool_choice entirely from the request
163+
delattr(data, 'tool_choice')
164+
161165
return data.model_dump(exclude_unset=True)
162166

163167
def fill_image_content_in_messages(self, openai_message_list):

0 commit comments

Comments
 (0)