You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove mandatory model name in LangChain4j integration聽#1124
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.
importcom.google.adk.agents.LlmAgent;
importcom.google.adk.models.langchain4j.LangChain4j;
importdev.langchain4j.model.anthropic.AnthropicChatModel;
// 1. Initialize LangChain4j modelAnthropicChatModelclaudeModel = AnthropicChatModel.builder()
.apiKey(System.getenv("ANTHROPIC_API_KEY"))
.modelName("claude-sonnet-4-6")
.build();
// 2. Wrap the LangChain4j model for ADKLangChain4jadkModel = LangChain4j.builder()
.chatModel(claudeModel)
.modelName("claude-sonnet-4-6") // <--- 馃憖 here
.build();
// 3. Create your agentLlmAgentagent = 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.
importcom.google.adk.agents.LlmAgent;
importcom.google.adk.models.langchain4j.LangChain4j;
importdev.langchain4j.model.anthropic.AnthropicChatModel;
// 1. Initialize LangChain4j modelAnthropicChatModelclaudeModel = AnthropicChatModel.builder()
.apiKey(System.getenv("ANTHROPIC_API_KEY"))
.modelName("claude-sonnet-4-6")
.build();
// 2. Wrap the LangChain4j model for ADKLangChain4jadkModel = LangChain4j.builder()
.chatModel(claudeModel)
.build();
// 3. Create your agentLlmAgentagent = 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
Hi @philippart-s, thank you for bringing this to our attention and @marttp, thank you for your contribution. The PR #1126 will address this feature request. Currently this Feature request and PR under review by our team. we will keep you updated if any additional information is required.
Activity
marttp commentedon Apr 8, 2026
I'd like to take a look at this.
hemasekhar-p commentedon Apr 9, 2026
Hi @philippart-s, thank you for bringing this to our attention and @marttp, thank you for your contribution. The PR #1126 will address this feature request. Currently this Feature request and PR under review by our team. we will keep you updated if any additional information is required.
Thank you.
hemasekhar-p commentedon Apr 9, 2026
@sherryfox, Please take a look into it.