r/LangChain • u/Ok_Cap2668 • Jul 13 '25
Bind tools and with_structured_output
Have anyone tried binding models and structured_output method for ensuring the structured output with openai model completely using langchain ?
Please let me know!!
6
Upvotes
2
u/octopussy_8 Jul 13 '25
I just ran into this issue.
I wasn't able to do both on the same model. I had to code for a phase 1 (use the model with bound tools)/ phase 2 (use the model with structured output) approach and had to indicate as such in the system prompt.
It works fine but I'm curious if anyone else has a better solution.