Cannot extract Reasoning tokens from ChatGoogleGenerativeAI #390

Open
opened 2026-02-15 18:16:23 -05:00 by yindo · 0 comments
Owner

Originally created by @DevDeepakBhattarai on GitHub (Dec 29, 2025).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).

Example Code

     new ChatGoogleGenerativeAI({
        model: resolvedModelId, // gemini-3-flash-preview for this case
        apiKey: env.GOOGLE_AI_API_KEY,
        outputVersion: "v1",
        thinkingConfig: {
          includeThoughts: true,
          thinkingLevel:"HIGH"
        },
      });

This is my code that defines the model and I am using the model.invoke() in some node of my langgraph agent. I want the ability to see the reasoning data. When ever i try to run it. I cannot extract the reasoning data.

This is the langsmith trace for my run

https://smith.langchain.com/public/7868aca0-a15c-4e1d-a879-118737d2d859/r

Seems like the reasoning data and the actual ai response are in the same field.

Error Message and Stack Trace (if applicable)

There are no visible errors but, the result is not as expected.

Description

I am trying to extract the reasoning data form the AI. But I can't do it !

System Info

Node version: v20.19.1
Operating system: win32 x64
Package manager: pnpm
Package manager version: 10.17.0

zod -> 3.25.76
@langchain/anthropic -> 1.3.3
@langchain/core -> 1.1.8
langsmith -> 0.4.2
@langchain/classic -> 1.0.7
@langchain/openai -> 1.2.0
@langchain/textsplitters -> 1.0.1, 0.1.0
@langchain/community -> 1.1.1
@langchain/exa -> 1.0.1
@langchain/google-genai -> 2.1.3
@langchain/google-vertexai -> 2.1.3
@langchain/google-gauth -> 2.1.3
@langchain/google-common -> 2.1.3
@langchain/google-vertexai-web -> 2.1.3
@langchain/google-webauth -> 2.1.3
@langchain/groq -> 1.0.2
@langchain/langgraph -> 1.0.7
@langchain/langgraph-checkpoint -> 1.0.0
@langchain/langgraph-sdk -> 1.3.1
@langchain/langgraph-checkpoint-postgres -> 1.0.0
@langchain/ollama -> 1.1.0
@langchain/pinecone -> 1.0.1
@langchain/tavily -> 1.2.0
langchain -> 1.2.3

Originally created by @DevDeepakBhattarai on GitHub (Dec 29, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I searched the LangGraph.js documentation with the integrated search. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangGraph.js rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package). ### Example Code ```ts new ChatGoogleGenerativeAI({ model: resolvedModelId, // gemini-3-flash-preview for this case apiKey: env.GOOGLE_AI_API_KEY, outputVersion: "v1", thinkingConfig: { includeThoughts: true, thinkingLevel:"HIGH" }, }); ``` This is my code that defines the model and I am using the `model.invoke()` in some node of my langgraph agent. I want the ability to see the reasoning data. When ever i try to run it. I cannot extract the reasoning data. This is the langsmith trace for my run https://smith.langchain.com/public/7868aca0-a15c-4e1d-a879-118737d2d859/r Seems like the reasoning data and the actual ai response are in the same field. ### Error Message and Stack Trace (if applicable) There are no visible errors but, the result is not as expected. ### Description I am trying to extract the reasoning data form the AI. But I can't do it ! ### System Info Node version: v20.19.1 Operating system: win32 x64 Package manager: pnpm Package manager version: 10.17.0 -------------------- zod -> 3.25.76 @langchain/anthropic -> 1.3.3 @langchain/core -> 1.1.8 langsmith -> 0.4.2 @langchain/classic -> 1.0.7 @langchain/openai -> 1.2.0 @langchain/textsplitters -> 1.0.1, 0.1.0 @langchain/community -> 1.1.1 @langchain/exa -> 1.0.1 @langchain/google-genai -> 2.1.3 @langchain/google-vertexai -> 2.1.3 @langchain/google-gauth -> 2.1.3 @langchain/google-common -> 2.1.3 @langchain/google-vertexai-web -> 2.1.3 @langchain/google-webauth -> 2.1.3 @langchain/groq -> 1.0.2 @langchain/langgraph -> 1.0.7 @langchain/langgraph-checkpoint -> 1.0.0 @langchain/langgraph-sdk -> 1.3.1 @langchain/langgraph-checkpoint-postgres -> 1.0.0 @langchain/ollama -> 1.1.0 @langchain/pinecone -> 1.0.1 @langchain/tavily -> 1.2.0 langchain -> 1.2.3
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#390