Fix #113: Add strict_mode parameter for OpenAI structured outputs compatibility #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #113
Summary
strict_modeparameter tocreate_manage_memory_toolandcreate_search_memory_tool_ToolStrictCompatibleclass that ensures OpenAI structured outputs strict mode compatibility by force to setrequiredto include all properties and setadditionalPropertiestofalsewhere it was previouslytrueProblem
OpenAI's structured outputs strict mode requires all properties to be in the
requiredarray, but the current implementation hasrequired: [], causing a 400 error:Solution
strict_mode: bool = Falseparameter to both tool creation functions_ToolStrictCompatibleclass that modifies the JSON schema to:requiredto include all properties:schema["required"] = list(props.keys())additionalPropertiestofalsewhere it was previouslytruestrict_mode=FalseUsage