# Capturing intermediate reasoning text between tool calls

**URL:** <https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786>\
**Category:** LangChain\
**Tags:** python-help\
**Created:** [January 22, 2026, 3:24pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786 "2026-01-22T15:24:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![morenoj11](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@morenoj11](https://forum.langchain.com/u/morenoj11)\
**Post date:** [January 22, 2026, 3:24pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/1 "2026-01-22T15:24:18Z")

</div>

Hi team! I’m building a streaming agent UI with LangChain and Azure OpenAI (GPT-5.2 with reasoning mode). I’m using `astream_events(version="v2")` to capture token-by-token streaming.

**Setup:**

- `langchain-openai` with `AzureChatOpenAI`
- `reasoning={"effort": "high", "summary": "detailed"}` and `output_version="responses/v1"`
- Using `astream_events` to capture `on_chat_model_stream` events

**What works:**

- Initial reasoning tokens stream correctly via `content_blocks` with `type="reasoning"`
- Tool calls and results are captured via `on_tool_start`/`on_tool_end`
- Final reasoning after all tools completes streams correctly

**Issue:**  
After a tool result returns, the model often goes directly to the next tool call (`tool_args` tokens) without emitting visible reasoning text. I see this pattern:

```auto
reasoning tokens → tool_call → tool_result → tool_args (next tool) → tool_result → ... → reasoning tokens (final)

```

I expected intermediate reasoning between each tool call, similar to how ChatGPT/Claude show “thinking” text between tool invocations.

**Questions:**

1. Is there a way to force/encourage the model to emit reasoning summaries between tool calls, not just at the start and end?
2. Are there different `astream_events` event types I should be listening for to capture this intermediate content?
3. Is this a model behavior limitation with the Responses API, or is there a configuration I’m missing?

Any guidance appreciated! 🙏

* * *

---

<div class="post-metadata">

**Author:** ![iamhassaan](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/iamhassaan/32/2268_2.png) [@iamhassaan](https://forum.langchain.com/u/iamhassaan)\
**Post date:** [January 28, 2026, 6:42pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/2 "2026-01-28T18:42:31Z")

</div>

Facing the same problem with Azure OpenAI 5.2 (chat completions). Would highly appreciate someone responding to this.

Using ChatAnthropic gives intermediate reasoning.

---

<div class="post-metadata">

**Author:** ![keenborder786](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/keenborder786/32/1757_2.png) [@keenborder786](https://forum.langchain.com/u/keenborder786)\
**Post date:** [January 29, 2026, 2:51pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/3 "2026-01-29T14:51:26Z")

</div>

Are you using Microsoft Foundry for Azure Deployment?

---

<div class="post-metadata">

**Author:** ![theodelobelle](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/theodelobelle/32/1934_2.png) [@theodelobelle](https://forum.langchain.com/u/theodelobelle)\
**Post date:** [February 19, 2026, 2:16pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/4 "2026-02-19T14:16:13Z")

</div>

The foundry is preview and and not fully well implemented, trust me use that for now :

AZURE\_OPENAI\_API\_KEY=”Your\_project\_foundry\_key”  
AZURE\_OPENAI\_ENDPOINT=”https://{foundry\_ressource\_name}.openai.azure.com/"

```python
 api_key = os.environ.get("AZURE_OPENAI_API_KEY", "")
    if not api_key:
        logging.error("AZURE_OPENAI_API_KEY environment variable not set.")
        raise EnvironmentError("AZURE_OPENAI_API_KEY must be set in environment variables.")

    azure_endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT", "")
    if not azure_endpoint:
        logging.error("AZURE_OPENAI_ENDPOINT environment variable not set.")
        raise EnvironmentError("AZURE_OPENAI_ENDPOINT must be set in environment variables.")

    logging.info(f"Loading {model_name} from Azure OpenAI.")
    return AzureChatOpenAI(
        api_key=api_key,
        azure_deployment=model_name,
        azure_endpoint=azure_endpoint,
        temperature=temperature,
    )

```

---

<div class="post-metadata">

**Author:** ![keenborder786](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/keenborder786/32/1757_2.png) [@keenborder786](https://forum.langchain.com/u/keenborder786)\
**Post date:** [February 21, 2026, 1:32am UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/5 "2026-02-21T01:32:18Z")

</div>

@morenoj11 were you able to verify it?

---

<div class="post-metadata">

**Author:** ![Bitcot\_Kaushal](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@Bitcot\_Kaushal](https://forum.langchain.com/u/Bitcot_Kaushal)\
**Post date:** [February 24, 2026, 5:10pm UTC](https://forum.langchain.com/t/capturing-intermediate-reasoning-text-between-tool-calls/2786/6 "2026-02-24T17:10:12Z")

</div>

Hi @morenoj11 ,

This is **expected behavior with GPT-5.2 via the Responses API on Azure**.

* * *

### What’s happening

With:

- `reasoning={"effort": "high"}`

- `output_version="responses/v1"`

- `astream_events(version="v2")`

The model typically emits:

```auto
initial reasoning → tool_call
tool_result → (silent internal reasoning) → next tool_call
...
final reasoning summary

```

The key point:

👉 The model **does not always externalize intermediate reasoning** between tool calls.  
It often performs that reasoning internally and jumps straight to the next tool invocation.

So what you’re seeing is normal for GPT-5.x on Responses API.

* * *

### ❓ Why ChatAnthropic shows intermediate reasoning

Claude exposes more “thinking text” between tool calls.

GPT-5.2 (especially via Azure Responses API) is more conservative and:

- Emits reasoning at the start

- Emits reasoning at the end

- May skip intermediate summaries

This is model behavior, not a LangChain streaming bug.

* * *

### Are you missing an event type?

No.

If you’re already listening to:

- `on_chat_model_stream`

- `on_tool_start`

- `on_tool_end`

Then you’re capturing everything the model is emitting.

There isn’t a hidden intermediate reasoning event you’re missing.

* * *

### Can you force intermediate reasoning?

Not reliably.

You can _encourage_ it by adding to your system prompt:

> After each tool result, briefly summarize your reasoning before deciding the next action.

But:

- It may increase token usage

- It’s not guaranteed

- The model may still choose silent reasoning

* * *

### Bottom Line

This is a **model-level behavior of GPT-5.2 + Responses API** , not a streaming configuration issue.

If intermediate reasoning between tool calls is critical for your UI, Claude currently exposes that more consistently.

Otherwise, the only lever you have is prompt steering — there’s no configuration flag that forces intermediate reasoning emission.

* * *

If you’re using Azure Foundry specifically, behavior can vary slightly by deployment mode — but structurally this is expected for GPT-5.x.
