Skip to content

Add basic tool infra and complete registerTool()#113

Open
domfarolino wants to merge 2 commits intomainfrom
tool-infra-and-registration
Open

Add basic tool infra and complete registerTool()#113
domfarolino wants to merge 2 commits intomainfrom
tool-infra-and-registration

Conversation

@domfarolino
Copy link
Collaborator

This PR adds some basic tool infrastructure and fills out the registerTool() method properly. After this PR, I will upload follow-ups for unregisterTool() 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.

[=structs=].
</dl>

A <dfn>tool data</dfn> is a [=struct=] with the following [=struct/items=]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the internal context for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants