Add basic tool infra and complete registerTool()#113
Open
domfarolino wants to merge 2 commits intomainfrom
Open
Add basic tool infra and complete registerTool()#113domfarolino wants to merge 2 commits intomainfrom
registerTool()#113domfarolino wants to merge 2 commits intomainfrom
Conversation
bwalderman
requested changes
Feb 27, 2026
| [=structs=]. | ||
| </dl> | ||
|
|
||
| A <dfn>tool data</dfn> is a [=struct=] with the following [=struct/items=]: |
Collaborator
There was a problem hiding this comment.
I'd suggest "tool definition" instead. Even though "data" is often used as if it's singular, it's plural so this reads a little awkward to me.
| : <dfn>description</dfn> | ||
| :: a [=string=]. | ||
|
|
||
| : <dfn>input schema</dfn> |
Collaborator
There was a problem hiding this comment.
Is there a particular reason this is being stored as a string in the tool map, and not an object? It seems like this is an optimization for passing the schema to an LLM, but here in the spec we'll likely have algorithms that need to retrieve the original object and read from it (e.g. input validation, listTools).
| }; | ||
| </xmp> | ||
|
|
||
| Each {{ModelContext}} object has an associated <dfn for=ModelContext>internal context</dfn>, which |
Collaborator
There was a problem hiding this comment.
What is the internal context for?
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.
This PR adds some basic tool infrastructure and fills out the
registerTool()method properly. After this PR, I will upload follow-ups forunregisterTool()and more infrastructure to expose/verbalize tools definitions to a model (much will be implementation-defined, since we're not defining the actual protocol through which this is carried out), and handle tool execution.