Skip to content

Commit f7c856c

Browse files
Remove raw image_generation tool remapping
Co-authored-by: eavanvalkenburg <13749212+eavanvalkenburg@users.noreply.github.com>
1 parent 3904d09 commit f7c856c

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

python/packages/core/agent_framework/openai/_responses_client.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -343,24 +343,7 @@ def _prepare_tools_for_openai(
343343
else:
344344
# Handle raw dictionary tools
345345
tool_dict = tool if isinstance(tool, dict) else dict(tool)
346-
347-
# Special handling for image_generation tools
348-
if tool_dict.get("type") == "image_generation":
349-
mapped_tool = tool_dict.copy()
350-
option_mapping = {
351-
"count": "n",
352-
"image_size": "size",
353-
"media_type": "media_type",
354-
"model_id": "model",
355-
"response_format": "response_format",
356-
"streaming_count": "partial_images",
357-
}
358-
for key, value in list(mapped_tool.items()):
359-
if key in option_mapping:
360-
mapped_tool[option_mapping[key]] = mapped_tool.pop(key)
361-
response_tools.append(mapped_tool)
362-
else:
363-
response_tools.append(tool_dict)
346+
response_tools.append(tool_dict)
364347
return response_tools
365348

366349
@staticmethod

0 commit comments

Comments
 (0)