You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromlangchain_xaiimportChatXAIfromlangchain_core.messagesimportHumanMessagellm=ChatXAI(model="grok-2-1212", api_key=api_key).with_structured_output(Classification)
response=llm.invoke([HumanMessage(content='Hey how are you?')])
Description
Using the new grok-2-1212 with the langchain-xai package, with structured output returns None. I tested not using any structured output and the model does return a response. You can put any kind of structured output (here some dummy "Classification" is used)
Note, using grok-beta does support the structured output.
System Info
System Information
OS: Darwin
OS Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
Python Version: 3.12.6 (v3.12.6:a4a2d2b0d85, Sep 6 2024, 16:08:03) [Clang 13.0.0 (clang-1300.0.29.30)]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Checked other resources
Commit to Help
Example Code
Description
Note, using grok-beta does support the structured output.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
Beta Was this translation helpful? Give feedback.
All reactions