davsclaus commented on code in PR #26027:
URL: https://github.com/apache/camel/pull/26027#discussion_r3911035424


##########
components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-component.adoc:
##########
@@ -159,6 +159,48 @@ Agents are configured using the `AgentConfiguration` class 
which provides a flue
 * Retrieval Augmentor (for RAG functionality)
 * Input and Output Guardrails
 * Concurrent tool execution (`withExecuteToolsConcurrently`) for parallel 
Camel route tools and MCP tools within one LLM round trip
+* Tool-calling control: round-trip limits, hallucinated tool handling, and 
error compensation
+* AiServices builder customizer for advanced LangChain4j options
+
+==== Tool-calling options
+
+`AgentConfiguration` exposes the most common LangChain4j `AiServices` 
tool-calling settings as first-class fluent methods. These are applied 
automatically when Camel creates an agent from the configuration bean (inline 
agent mode or a registered `AgentWithMemory` / `AgentWithoutMemory` bean):
+
+[cols="1,2"]
+|===
+| Method | Purpose
+
+| `withMaxToolCallingRoundTrips(int)` | Limits how many tool-calling round 
trips the LLM may perform per request (`0` = unset)
+| `withHallucinatedToolNameStrategy(...)` | Handles requests for tool names 
that do not exist (for example a hallucinated `task_complete` tool)
+| `withToolExecutionErrorHandler(...)` | Converts tool execution exceptions 
into tool result messages for the LLM
+| `withToolArgumentsErrorHandler(...)` | Handles invalid or unparsable tool 
arguments
+| `withCompensateOnToolErrors(Boolean)` | Sends tool errors back to the LLM so 
it can recover instead of failing the exchange
+| `withExecuteToolsConcurrently()` / `withExecuteToolsConcurrently(Executor)` 
| Runs multiple tool calls from one LLM turn in parallel
+|===
+
+._Java-only: recover from a hallucinated tool name_

Review Comment:
   Minor accuracy nit: this example and the 
`withMaxToolCallingRoundTrips`/`withCompensateOnToolErrors` rows in the table 
above are labeled "Java-only", but CAMEL-23929 (already on `main`) exposes 
these two options directly as endpoint URI params (`maxToolCallingRoundTrips`, 
`compensateOnToolErrors`) — documented further down in the "Concurrent tool 
execution" section of this same file. Worth a cross-reference or a tweak to the 
"Java-only" label so readers don't conclude these two are Java-only, unlike 
`withHallucinatedToolNameStrategy`/`withToolExecutionErrorHandler`/`withToolArgumentsErrorHandler`/`withAiServicesCustomizer`,
 which genuinely are (functional-interface based). Not blocking.



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