feat: depending on the number of tools in use, this change should save ~50% of overall tokens used. fixes https://github.com/BeehiveInnovations/zen-mcp-server/issues/255 but also refactored individual tools to instead encourage the agent to use the listmodels tool if needed.
This commit is contained in:
@@ -87,6 +87,10 @@ class ChatTool(SimpleTool):
|
||||
the same schema generation approach while still benefiting from SimpleTool
|
||||
convenience methods.
|
||||
"""
|
||||
required_fields = ["prompt"]
|
||||
if self.is_effective_auto_mode():
|
||||
required_fields.append("model")
|
||||
|
||||
schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -121,7 +125,7 @@ class ChatTool(SimpleTool):
|
||||
"description": COMMON_FIELD_DESCRIPTIONS["continuation_id"],
|
||||
},
|
||||
},
|
||||
"required": ["prompt"] + (["model"] if self.is_effective_auto_mode() else []),
|
||||
"required": required_fields,
|
||||
}
|
||||
|
||||
return schema
|
||||
|
||||
Reference in New Issue
Block a user