zbendhiba opened a new pull request, #23793:
URL: https://github.com/apache/camel/pull/23793
…operty for structured outputs
Add a jsonSchema URI property to the `langchain4j-agent` component that
loads a JSON schema (classpath, file, or inline) and applies it as a
ResponseFormat on the internal AIService. This works only in agentConfiguration
mode where Camel creates the agent internally.
## Summary
- Add a `jsonSchema` endpoint property to the `camel-langchain4j-agent`
component for structured LLM outputs
- Supports classpath resources, file paths, and inline JSON — same
resolution pattern as `camel-openai`
## Example usage
```java
from("direct:extract")
.to("langchain4j-agent:test?agentConfiguration=#myConfig"
+ "&jsonSchema=classpath:person-schema.json")
```
Test plan
- Integration test with classpath schema (classpath:person-schema.json)
- Integration test with inline schema (RAW(...))
- Integration test with file schema (file:...)
- All three routes validate responses with json-validator against the
schema
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]