Back Home

GitHub Repo

LangChain Mistral Integration Package 1.2.0 Released, Fixes Reasoning Model Stream Block Merging

LangChain released langchain-mistralai 1.2.0 on November 15, fixing stream handling when reasoning blocks and text are interleaved. The release also supports the LangSmith gateway and raises the minimum Python version to 3.11.

Dirck van Baburen · Public domain · Image source
zh-Hant

LangChain released version 1.2.0 of its Mistral integration package, langchain-mistralai, on November 15, incorporating a reasoning-model streaming fix merged that day. The release is listed on GitHub and PyPI, so users can install the package directly without applying a development branch themselves. Release notes, PyPI package

The fix addresses continuity in streamed content types: a model may first send reasoning blocks as a list, then switch to sending text as a string. Once streaming has entered block mode, the new version converts subsequent strings into text blocks, keeping the accumulated message structure consistent. The synchronous and asynchronous paths also skip genuinely empty chunks while preserving tool calls, usage, and finish information. These behaviors are especially important for applications that update their interfaces incrementally as responses arrive. Code changes

The fix also adds a reasoning_effort parameter, which can be passed when creating a model or making a call. It is omitted by default, and supported values depend on the model. New tests simulate interleaved reasoning lists, text blocks, and strings, checking that the merged result exposes reasoning and the answer separately. They cover synchronous and asynchronous paths, along with both output settings. This provides a concrete basis for regression testing, but does not establish that every model and agent workflow has been tested in practice. Fix and tests

Another change in the release connects ChatMistralAI to the shared gateway resolution mechanism, supporting LANGSMITH_GATEWAY and langsmith_gateway with the /mistral/v1 path. For teams that centrally manage model endpoints, this adds a routing option to the existing integration class. Gateway changes

Before upgrading, check the runtime environment: the new version drops Python 3.10 support, and PyPI lists 3.11 as the minimum version. Engineering teams should replay streams using the models they actually run to confirm that answer extraction, reasoning display, and tool calls still behave as expected. Public information does not yet report performance improvements or the full scope of the impact on older versions. Version changes, environment requirements

Sources

  1. langchain-mistralai 1.2.0 發布紀錄
  2. 修正推理模型串流處理:PR #41887
  3. ChatMistralAI 支援 LangSmith gateway:PR #41840
  4. langchain-mistralai 1.2.0