Skip to content

Conversation

@hinnefe2
Copy link
Contributor

@hinnefe2 hinnefe2 commented Dec 11, 2025

Closes #3654 by adding a warning when an OpenAI-powered agent has a tool with a dict-typed argument.


def _map_tool_definition(self, f: ToolDefinition) -> responses.FunctionToolParam:
if _has_dict_typed_params(f.parameters_json_schema):
warnings.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the warning into the helper method so that we don't repeat the text

tools.append({'type': 'image_generation'})
return tools

def _map_tool_definition(self, f: ToolDefinition) -> responses.FunctionToolParam:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll also need to do the check in _map_json_schema

'properties': {
'dict_list': {'type': 'array', 'items': {'type': 'object', 'additionalProperties': {'type': 'integer'}}}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to test this with a tool function that actually has a dict argument, or a BaseModel argument that itself has a dict field, instead of testing the schemas directly.

So maybe can we build an agent with a tool like that, then run it, and test that a warning was emitted?

@hinnefe2
Copy link
Contributor Author

Ok @DouweM I think this is ready for another look.

@DouweM
Copy link
Collaborator

DouweM commented Dec 16, 2025

@hinnefe2 Please have a look at the coverage check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool arguments of type dict are invisible to OpenAI-powered agents

2 participants