Skip to content

fix(langchain): allow to set strict tag manually in providerStrategy - #9578

Merged
Christian Bromann (christian-bromann) merged 5 commits into
mainfrom
cb/provider-strategy-strict-flag
Dec 13, 2025
Merged

Christian Bromann (christian-bromann) merged 5 commits into
mainfrom
cb/provider-strategy-strict-flag

Conversation

@christian-bromann

Copy link
Copy Markdown
Member

@changeset-bot

changeset-bot Bot commented Dec 5, 2025 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c3600b0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hntrl Hunter Lovell (hntrl) left a comment •

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.

I'm generally not a fan when libraries bring positional args to APIs. Instead of having the second arg be strict, can we have a union for the first type that allows for either: a generic schema object, or an object that has schema + strict args? E.g.

providerStrategy(z.object(...))
// or
providerStrategy({ schema: z.object(...), strict: true })

(this is how we do it in withStructuredOutput)

@christian-bromann

Copy link
Copy Markdown
Member Author

Hunter Lovell (@hntrl) thanks for the feedback! Updated PR accordingly.

Comment thread libs/langchain/src/agents/responses.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants