Skip to content

How to use JSON format equivalent in ChatGroq from langchain_groq? #28650

Closed Answered by feijoes
dinhvanlinh0610 asked this question in Q&A
Discussion options

You must be logged in to vote

@dinhvanlinh0610 You can achieve structured output with ChatGroq by using the with_structured_output method with json_mode

from langchain_groq import ChatGroq
llm = ChatGroq(model="", temperature=0)
structured_llm = llm.with_structured_output(method="json_mode", include_raw=True)

structured_llm.invoke("")

docs

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dinhvanlinh0610
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
2 participants