Implement Tool Functions section in agent documentation, detailing how to register Java classes for agent functionality. Update YAML configuration instructions accordingly.

This commit is contained in:
amithkoujalgi 2025-10-20 23:36:29 +05:30
parent 7c0c4e38ed
commit 2e245a0e16
No known key found for this signature in database
GPG Key ID: E29A37746AF94B70

View File

@ -47,7 +47,17 @@ YAML makes it effortless to configure and tweak your agents powers and behavi
---
## Instantiating and Running Agents in Java
## Implement Tool Functions
Your agent calls out to Java classes (Tool Functions). Put these implementations on your classpath, register them in YAML, and your agent.
<CodeEmbed src="https://raw.githubusercontent.com/ollama4j/ollama4j-examples/refs/heads/main/src/main/java/io/github/ollama4j/examples/tools/toolfunctions/CalculatorToolFunction.java"/>
<CodeEmbed src="https://raw.githubusercontent.com/ollama4j/ollama4j-examples/refs/heads/main/src/main/java/io/github/ollama4j/examples/tools/toolfunctions/HotelBookingToolFunction.java"/>
---
## Instantiating and Running Agents
Once your agent is described in YAML, bringing it to life in Java takes only a couple of lines: