Package akka.javasdk.client
Interface AgentClientInSession
@DoNotInherit
public interface AgentClientInSession
Not for user extension or instantiation, returned by the SDK component client
-
Method Summary
Modifier and TypeMethodDescription<A1,
R> DynamicMethodRef <A1, R> dynamicCall
(String agentId) Agents can be called based on the id without knowing the exact agent class or lambda of the agent method by using the {dynamicCall
} of the component client.<T,
R> ComponentMethodRef <R> method
(akka.japi.function.Function<T, Agent.Effect<R>> methodRef) Pass in an Agent command handler method reference, e.g.<T,
A1, R> ComponentMethodRef1 <A1, R> method
(akka.japi.function.Function2<T, A1, Agent.Effect<R>> methodRef) Pass in an Agent command handler method reference, e.g.tokenStream
(akka.japi.function.Function<T, Agent.StreamEffect> methodRef) Pass in an Agent command handler method reference, e.g.<T,
A1> ComponentStreamMethodRef1 <A1, String> tokenStream
(akka.japi.function.Function2<T, A1, Agent.StreamEffect> methodRef) Pass in an Agent command handler method reference, e.g.
-
Method Details
-
method
Pass in an Agent command handler method reference, e.g.SummarizerAgent::summarizeSession
-
method
<T,A1, ComponentMethodRef1<A1,R> R> method(akka.japi.function.Function2<T, A1, Agent.Effect<R>> methodRef) Pass in an Agent command handler method reference, e.g.PlannerAgent::plan
-
tokenStream
<T> ComponentStreamMethodRef<String> tokenStream(akka.japi.function.Function<T, Agent.StreamEffect> methodRef) Pass in an Agent command handler method reference, e.g.ExpertAgent::ask
-
tokenStream
<T,A1> ComponentStreamMethodRef1<A1,String> tokenStream(akka.japi.function.Function2<T, A1, Agent.StreamEffect> methodRef) Pass in an Agent command handler method reference, e.g.ExpertAgent::ask
- Type Parameters:
A1
- the type of parameter expected by the call
-
dynamicCall
Agents can be called based on the id without knowing the exact agent class or lambda of the agent method by using the {dynamicCall
} of the component client.var response = componentClient .forAgent().inSession(sessionId) .dynamicCall(agentId) .invoke(request);
- Type Parameters:
A1
- the type of parameter expected by the callR
- the return type of the call- Parameters:
agentId
- the componentId of the agent
-