Remove mandatory model name in LangChain4j integration
@hemasekhar-p ya está trabajando en esto.
Desde el 9/4/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
🔴 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
- Lenguaje dominante
- Java
- Estrellas
- 1.7k
- Forks
- 421
- Merge medio
- 3 d 8 h
- PR fusionados (30 d)
- 36
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/adk-java
-
needs review
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
needs review
-
needs review
-
needs review
-
needs review
Todos los issues de google/adk-java
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
inu-appcenter/memorIN-backend#288 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
frontend maui-pilot pilot-ask question
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Abiertoarea/plugin
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
kestra-io/plugin-kestra#190 ·