What’s New in LangChain4j 1.2.0? Key AI Features and Enhancements

LangChain4j 1.2.0 introduces a suite of stable modules, advanced inference and thinking capabilities, streaming tool calls, and extensive AI service enhancements, offering developers finer control, lower latency, and richer debugging for LLM‑driven applications.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
What’s New in LangChain4j 1.2.0? Key AI Features and Enhancements

🎉 Important Announcement

LangChain4j team officially released version 1.2.0, a milestone update that enhances existing APIs and introduces a rich callback mechanism for precise control and monitoring of LLM calls.

Stable version modules

The following modules are now officially released in the 1.2.0 stable version: langchain4j-anthropic – Anthropic Claude model support langchain4j-azure-open-ai – Azure OpenAI service integration langchain4j-bedrock – AWS Bedrock service support langchain4j-google-ai-gemini – Google Gemini AI integration langchain4j-mistral-ai – Mistral AI model support langchain4j-ollama – Ollama local model execution

Other LangChain4j modules remain at version 1.2.0‑beta8 and are considered experimental/unstable.

BOM dependency management

The langchain4j-bom 1.2.0 release bundles the latest versions of all modules, simplifying dependency management.

⭐ Core Feature Highlights

1. Inference / Thinking capability

The update adds support for model inference and thinking processes, allowing AI to expose its reasoning steps for more transparent and explainable decisions. Typical use cases include complex problem analysis, logic‑chain display, and decision‑process transparency.

2. Streaming partial tool calls

Introduces streaming partial tool‑call functionality, enabling real‑time retrieval of intermediate results and reducing response latency.

Lower response latency

Improved real‑time experience

Enhanced user experience

3. MCP automatic resource exposure

Model Context Protocol (MCP) now automatically exposes resources as tools, simplifying resource management and tool configuration.

4. OpenAI enhancements

Custom chat request parameters

Access to raw HTTP responses

Support for Server‑Sent Events (SSE)

🔧 AI Services Enhancements

Request conversion capability

Convert ChatRequest before sending to LLM

Support custom request pre‑processing logic

Intermediate response exposure

Expose intermediate ChatResponse objects for debugging and monitoring

Token usage statistics

Azure OpenAI streaming models now report actual TokenUsage Provides more accurate resource usage statistics

Tool execution callbacks

New TokenStream callback processor before tool execution

Support for tool execution lifecycle management

⚠️ Breaking Changes

Vertex AI Gemini

Executor made asynchronous, which may affect existing async handling logic

Azure OpenAI

Removed TokenCountEstimator from streaming models; code must be updated to accommodate new token counting

🔄 Other Important Improvements

Ollama enhancements

Partial thinking support

Ability to trace and retrieve model capabilities

Error handling improvements

OpenAI and Azure OpenAI now throw ContentFilteredException on content filtering or refusal

More explicit error messages

Dependency updates

Updated core dependency versions, improving security and performance

📖 Summary

LangChain4j 1.2.0 is a milestone release that adds stable modules, inference capabilities, streaming tool calls, and numerous enhancements that significantly improve AI application development and user experience.

JavaAILLMStreamingInferenceLangchain4jrelease-notes
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.