Skip to content

chore(js): Add the key to metadata#5267

Open
ifielker wants to merge 2 commits into
mainfrom
if-addKey
Open

chore(js): Add the key to metadata#5267
ifielker wants to merge 2 commits into
mainfrom
if-addKey

Conversation

@ifielker
Copy link
Copy Markdown
Collaborator

@ifielker ifielker commented May 8, 2026

Checklist (if applicable):

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a metadata field to tool definitions, specifically adding a key property derived from the tool's action key. The changes include updates to the toToolDefinition function to populate this metadata and extensive updates across several test files to reflect the new expected structure in tool and prompt-as-tool definitions. I have no feedback to provide.

@ifielker ifielker requested a review from pavelgj May 8, 2026 20:20
Comment thread js/ai/src/tool.ts
if (originalName !== name) {
out.metadata = { originalName };
const metadata = {
...(tool.__action.key ? { key: tool.__action.key } : {}),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we talked about adding this to the ToolDefinition, not metadata, no?

export const ToolDefinitionSchema = z.object({

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We talked about both, I thought we landed back on metadata... I can change it...

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.

2 participants