Skip to content

Commit 794924b

Browse files
committed
Fix tools detection for OpenAI o1
1 parent fa2be6f commit 794924b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autogen/oai/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,11 @@ def _create_or_parse(*args, **kwargs):
639639
warnings.warn(
640640
f"The {params.get('model')} model does not support streaming. The stream will be set to False."
641641
)
642-
if params.get("tools", False):
643-
raise ModelToolNotSupportedError(params.get("model"))
642+
if "tools" in params:
643+
if params["tools"]: # If tools exist, raise as unsupported
644+
raise ModelToolNotSupportedError(params.get("model"))
645+
else:
646+
params.pop("tools") # Remove empty tools list
644647
self._process_reasoning_model_params(params)
645648
params["stream"] = False
646649
response = create_or_parse(**params)

0 commit comments

Comments
 (0)