Skip to content

Conversation

@ipince
Copy link
Contributor

@ipince ipince commented Nov 11, 2025

Summary

We need it so that we can specify whether the tool schema validation should be strict or not.

How was it tested?

Used with testpilot and its custom tools. I'll send a PR on axiom to show its usage too.

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 License.

By creating this pull request I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the Community Contribution License.

@ipince ipince requested a review from loreto November 11, 2025 00:10
Copy link
Contributor

@loreto loreto left a comment

Choose a reason for hiding this comment

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

LGTM
See comments.


strict := true // Default to true
if tool.ProviderMetadata != nil {
fmt.Println("provider metadata: ", tool.ProviderMetadata)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove debugging statement

return nil, nil, fmt.Errorf("failed to convert tool parameters: %w", err)
}

strict := true // Default to true
Copy link
Contributor

Choose a reason for hiding this comment

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

If I care too much what the right default is, I think both are sensible, but just FYI, I'm looking at the Vercel code and they seem to now default to false instead: https://github.com/vercel/ai/blob/main/packages/openai/src/responses/openai-responses-language-model.ts#L135

They also seem to have renamed it from StrictSchemas to StrictJSONSchema 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kept default true for now

strict := true // Default to true
if tool.ProviderMetadata != nil {
fmt.Println("provider metadata: ", tool.ProviderMetadata)
if metadata, ok := tool.ProviderMetadata.Get(ProviderName); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there's a GetMetadata helper that you should use here. You should be able to find examples of it being used elsewhere in the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ipince ipince merged commit 8df8f85 into main Nov 13, 2025
13 checks passed
@ipince ipince deleted the rodrigo/tool-md branch November 13, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants