Skip to content

Add test coverage for recent langchain4j-agent component enhancements #8857

Description

@jamesnetherton

Some features were added to the langchain4j-agent component recently. We should add coverage here, primarily to check that they work in native mode.

1. Structured output

Test the two endpoint options:

  • outputClass — derives a JSON schema from a Java POJO class
  • jsonSchema — loads a JSON schema from a classpath resource, file, or inline string

2. AgentConfiguration auto-provisioning mode for langchain4j-agent

All existing langchain4j-agent integration tests create pre-built Agent beans via CDI @Produces methods and reference them with agent=#beanName. The alternative — and simpler — approach where users set agentConfiguration on the endpoint and Camel automatically creates an AgentWithMemory or AgentWithoutMemory based on whether a ChatMemoryProvider is present is not currently tested.

3. MCP server configuration

The langchain4j-agent component supports declarative MCP server definitions via multi-value endpoint URI options (e.g. mcpServer.myServer.transportType=http&mcpServer.myServer.url=...). This allows users to configure MCP servers without writing CDI producer methods.

Currently only pre-built McpClient beans are tested (via the stdio transport with npx). The inline mcpServer.* configuration path — which involves runtime materialization of LangChain4jMcpServerDefinition objects and transport construction — is untested.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions