How to get reasoning_content with ChatVertexAI ? #1049
-
As title, currently I use following setup.
But i can not see any reasoning_content in any events. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Update (self-resolved): I found out that: After doing so, the model started to return thought reasoning content. Instead: Just noting this difference in case others run into the same issue or expect the same structure as other models. |
Beta Was this translation helpful? Give feedback.
Update (self-resolved):
I found out that:
1. I needed to upgrade
langchain-google-vertexai
tov2.0.27
2. I had to add the argument
include_thoughts=True
After doing so, the model started to return thought reasoning content.
However, unlike other LangChain chat models (e.g., OpenAI, xAI), the reasoning content is not placed under
additional_kwargs["reasoning_content"]
.Instead:
• It appears inside
AIMessageChunk.content
as a list of objects, e.g. {"type": "thinking", "thinking": "..."}• As a result,
AIMessageChunk.content
is now a list, not a string as it used to beJust noting this difference in case others run into the same issue or expect the same structure as other models.