fix(schema): wrap parameters in OpenAI function-calling format#1
Open
vp-nyxe wants to merge 1 commit into
Open
fix(schema): wrap parameters in OpenAI function-calling format#1vp-nyxe wants to merge 1 commit into
vp-nyxe wants to merge 1 commit into
Conversation
The schema sanitizer expects 'parameters' key wrapping the JSON Schema object, matching the OpenAI function calling spec used by built-in tools. Previously the schema used bare JSON Schema format (type/properties/required at the top level), causing the sanitizer to substitute empty parameters and discard the actual property definitions. Fix: - Added 'name' field to the schema - Wrapped 'type', 'properties', 'required' under 'parameters' key - Matches the pattern used by WEB_SEARCH_SCHEMA and other built-in tools This fixes kagi_enriched_search returning 'query is required' on every call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
kagi_enriched_searchtool schema was defined as a bare JSON Schema object (type/properties/requiredat the top level). The Hermes Agent schema sanitizer expects the OpenAI function-calling format with aparameterswrapper, so it substituted empty parameters and discarded the actual property definitions.Result: the model sees
properties: {}and calls the tool with no arguments, causing"query is required"on every invocation.Fix
namefield to the schematype,properties,requiredunder aparameterskeyWEB_SEARCH_SCHEMAand other built-in toolsBefore
{ "type": "object", "description": "...", "properties": { ... }, "required": ["query"] }After
{ "name": "kagi_enriched_search", "description": "...", "parameters": { "type": "object", "properties": { ... }, "required": ["query"] } }