Repository navigation
Conversation
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
A tool passed to
llm.generatewithout adescriptionis silently left out of the request on the OpenAI, OpenAI-compatible and Google drivers. The model never sees the tool, and nothing reports why. The Claude and Bedrock drivers send the same tool, so one tool list behaves differently depending on the route.Cause
map_toolsinopenai/mapper.lua,openai_compat/mapper.luaandgoogle/mapper.luafilters ontool.name and tool.description and tool.schema. Claude and Bedrock filter on the schema only.Fix
The three mappers require
nameandschemaand send the tool with the description field omitted when none is given. Every provider API treats the description as optional:descriptionis optional.FunctionDeclaration.description: optional.description: optional (recommended).ToolSpecification.description: not required.Accepting the tool is the behavior Claude and Bedrock already have, so all drivers now share one tool contract. The README states it: a tool needs
nameandschema;descriptionis optional.Tests
New "should send a tool declared without a description" cases in
openai/mapper_test,openai_compat/mapper_testandgoogle/mapper_testcheck the tool is sent with its name and parameters and without a description field. They fail before the change. Existing cases for tools missingnameorschemaare unchanged.make testinsrc/llm/test: 2917 passed, 9 skipped.make lint: no issues.