Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Remove mandatory model name in LangChain4j integration

Open
#1,124 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@hemasekhar-p is already working on this.

Since Apr 9, 2026.

  • #1126 by @marttp — open

Assessment

This issue has not been assessed yet.

Description

needs review

🔴 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Is your feature request related to a specific problem?

When I'm using the LangChain4J integration I need to set twice the model name: once in the LangCHain4j configuration and one when using the LangChain4j builder.

import com.google.adk.agents.LlmAgent;
import com.google.adk.models.langchain4j.LangChain4j;
import dev.langchain4j.model.anthropic.AnthropicChatModel;

// 1. Initialize LangChain4j model
AnthropicChatModel claudeModel = AnthropicChatModel.builder()
    .apiKey(System.getenv("ANTHROPIC_API_KEY"))
    .modelName("claude-sonnet-4-6")
    .build();

// 2. Wrap the LangChain4j model for ADK
LangChain4j adkModel = LangChain4j.builder()
    .chatModel(claudeModel)
    .modelName("claude-sonnet-4-6") // <--- 👀 here
    .build();

// 3. Create your agent
LlmAgent agent = LlmAgent.builder()
    .name("science-teacher")
    .description("A helpful science teacher")
    .model(adkModel)
    .instruction("You are a helpful science teacher that explains concepts clearly.")
    .build();
Describe the Solution You'd Like

As the model name is configured in the LangChain4j configuration, it should be more maintenable to not set it again with the LangChain4J builder.

import com.google.adk.agents.LlmAgent;
import com.google.adk.models.langchain4j.LangChain4j;
import dev.langchain4j.model.anthropic.AnthropicChatModel;

// 1. Initialize LangChain4j model
AnthropicChatModel claudeModel = AnthropicChatModel.builder()
    .apiKey(System.getenv("ANTHROPIC_API_KEY"))
    .modelName("claude-sonnet-4-6")
    .build();

// 2. Wrap the LangChain4j model for ADK
LangChain4j adkModel = LangChain4j.builder()
    .chatModel(claudeModel)
    .build();

// 3. Create your agent
LlmAgent agent = LlmAgent.builder()
    .name("science-teacher")
    .description("A helpful science teacher")
    .model(adkModel)
    .instruction("You are a helpful science teacher that explains concepts clearly.")
    .build();
Impact on your work

Minore impact, it's just more readable and maintainable.

Willingness to contribute

Are you interested in implementing this feature yourself or submitting a PR?
No


Dominant language
Java
Stars
1.7k
Forks
431
Avg merge
3d 2h
Merged PRs (30d)
46

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/adk-java

All issues in google/adk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.