Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Remove mandatory model name in LangChain4j integration

オープン
#1,124 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@hemasekhar-p がすでに取り組んでいます。

2026年4月9日 から。

評価

この issue はまだ評価されていません。

説明

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


主要言語
Java
スター
1.7k
フォーク
421
平均マージ
3日 8時間
マージ済み PR(30日)
36

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/adk-java のほかの issue

google/adk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。