Skip to content

Lorenze/fix/issue 4472 - #4601

Closed
lorenzejay wants to merge 8 commits into
mainfrom
lorenze/fix/issue-4472
Closed

Lorenze/fix/issue 4472#4601
lorenzejay wants to merge 8 commits into
mainfrom
lorenze/fix/issue-4472

Conversation

@lorenzejay

@lorenzejay lorenzejay commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

on top of: #4579
address: #4472

lucasgomide and others added 8 commits February 24, 2026 10:06
Tool parameter schemas were stripping null from optional fields via
generate_model_description, forcing the LLM to provide non-null values
for fields.
Adds strip_null_types parameter to generate_model_description and passes False when generating tool
schemas, so optional fields keep anyOf: [{type: T}, {type: null}]
Co-authored-by: Gabe Milani <gabriel@crewai.com>
* Added a new utility function to remove OpenAI-specific fields from schemas, ensuring compatibility with Gemini and Bedrock APIs.
* Updated BedrockCompletion and GeminiCompletion classes to utilize this function for cleaning parameters before API calls.
* Introduced tests to validate the functionality of the new utility, ensuring it correctly strips incompatible fields while preserving required properties.

@greysonlalonde greysonlalonde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ag2ai/ag2#2421 this has since been fixed gemini side; anthropic does support/require additionalProperties during strictness

@greysonlalonde

Copy link
Copy Markdown
Contributor

ag2ai/ag2#2421 this has since been fixed gemini side; anthropic does support/require additionalProperties during strictness

- Gemini 2.0+: Uses response_json_schema (JSON Schema) with propertyOrdering

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants