zbendhiba commented on code in PR #23793:
URL: https://github.com/apache/camel/pull/23793#discussion_r3363842458


##########
components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jAgentProducer.java:
##########
@@ -294,6 +303,48 @@ private Map<String, CamelToolSpecification> 
discoverToolsByName(String tags) {
         return toolsByName;
     }
 
+    /**
+     * Resolves the jsonSchema endpoint property: loads from 
classpath/filesystem if it is a resource URI, otherwise
+     * treats it as inline JSON. Converts the raw JSON string into a 
langchain4j ResponseFormat and sets it on the
+     * agent. Only called when the agent is created internally from 
agentConfiguration.
+     */
+    private void resolveAndApplyJsonSchema() throws Exception {
+        String jsonSchema = endpoint.getConfiguration().getJsonSchema();
+        if (ObjectHelper.isEmpty(jsonSchema)) {
+            return;
+        }
+
+        String resolved = 
endpoint.getCamelContext().resolvePropertyPlaceholders(jsonSchema);
+
+        String content = resolveResourceContent(resolved);
+        if (content != null) {

Review Comment:
   @Croway Good catch! I'll investigate proper error handling for those edge 
cases next Monday and address them in a follow-up. If one of the two concerns 
turns out to be overkill, I'll open a separate issue for it instead.



-- 
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]

Reply via email to