Skip to content

Commit bf08b1c

Browse files
docs: clarify ProviderStrategy vs ToolStrategy in response_format note (#1524)
## Overview This PR fixes a confusing note in the `create_agent.response_format` documentation. The original text implied that `ToolStrategy` is used when passing a schema directly, which is incorrect. The update clarifies that `ProviderStrategy` is automatically used for models that support native structured output, and wrapping the schema explicitly is optional. ## Type of change **Type:** Update existing documentation ## Related issues/PRs - GitHub issue: - - Feature PR: - ## Checklist - [x] I have read the [contributing guidelines](README.md) - [ ] I have tested my changes locally using `docs dev` - [ ] All code examples have been tested and work correctly - [ ] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed Co-authored-by: Lauren Hirata Singh <[email protected]>
1 parent 631b9ca commit bf08b1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/oss/langchain/structured-output.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ Provider-native structured output provides high reliability and strict validatio
272272

273273
:::python
274274
<Note>
275-
If the provider natively supports structured output for your model choice, it is functionally equivalent to write `response_format=ProductReview` instead of `response_format=ToolStrategy(ProductReview)`. In either case, if structured output is not supported, the agent will fall back to a tool calling strategy.
275+
If the provider natively supports structured output for your model choice, it is functionally equivalent to write `response_format=ProductReview` instead of `response_format=ProviderStrategy(ProductReview)`. In either case, if structured output is not supported, the agent will fall back to a tool calling strategy.
276276
</Note>
277277
:::
278278
:::js
279279
<Note>
280-
If the provider natively supports structured output for your model choice, it is functionally equivalent to write `responseFormat: contactInfoSchema` instead of `responseFormat: toolStrategy(contactInfoSchema)`. In either case, if structured output is not supported, the agent will fall back to a tool calling strategy.
280+
If the provider natively supports structured output for your model choice, it is functionally equivalent to write `responseFormat: contactInfoSchema` instead of `responseFormat: providerStrategy(contactInfoSchema)`. In either case, if structured output is not supported, the agent will fall back to a tool calling strategy.
281281
</Note>
282282
:::
283283

0 commit comments

Comments
 (0)