Skip to content

Which differences are between .with_structured_output & .bind_tools #25811

Answered by dosubot bot
Nachoeigu asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, the unique difference between .with_structured_output and .bind_tools is that .with_structured_output ensures structured output while .bind_tools allows calling external tools.

  • .with_structured_output: Ensures that the output conforms to a specific schema, either a dictionary or a Pydantic model. This is useful when you need the output to be in a specific format for further processing or validation.

  • .bind_tools: Binds external tools to the language model, allowing it to call these tools during its execution. This is useful when you need the language model to interact with external systems or perform specific actions that require external tools.

Example where .with_structured_o…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Nachoeigu
Comment options

@dosubot
Comment options

Answer selected by Nachoeigu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants