JAgent

org.llm4s.javaapi.JAgent
final class JAgent

Java-friendly wrapper around Agent.

Exposes a simplified run(query) entry point that returns LlmResult[AgentState] so Java callers do not need to deal with Scala's Either or Result types directly.

Obtain instances via Llm4s.createAgent.

JAgent agent = Llm4s.createAgent(client);
LlmResult<AgentState> result = agent.run("Summarise the news today");
result.ifSuccess(state -> System.out.println(state.conversation()))
     .ifFailure(e -> System.err.println(e.getMessage()));

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def run(query: String): LlmResult[AgentState]

Runs the agent with an empty tool registry. A null query yields a failed result.

Runs the agent with an empty tool registry. A null query yields a failed result.

Attributes

def run(query: String, tools: ToolRegistry): LlmResult[AgentState]

Runs the agent with an explicit ToolRegistry.

Runs the agent with an explicit ToolRegistry.

Attributes