Skip to content

How to get reasoning_content with ChatVertexAI ? #1049

Closed Answered by chris-lee-lb
chris-lee-lb asked this question in Q&A
Discussion options

You must be logged in to vote

Update (self-resolved):

I found out that:
1. I needed to upgrade langchain-google-vertexai to v2.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 be

Just noting this difference in case others run into the same issue or expect the same structure as other models.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chris-lee-lb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant