Interface AgentClientInSession


@DoNotInherit public interface AgentClientInSession
Not for user extension or instantiation, returned by the SDK component client
  • Method Details

    • method

      <T, R> ComponentMethodRef<R> method(akka.japi.function.Function<T,Agent.Effect<R>> methodRef)
      Pass in an Agent command handler method reference, e.g. SummarizerAgent::summarizeSession
    • method

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

      <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.
      
       var response =
         componentClient
           .forAgent().inSession(sessionId)
           .dynamicCall(agentId)
           .invoke(request);
       
      Type Parameters:
      A1 - the type of parameter expected by the call
      R - the return type of the call
      Parameters:
      agentId - the componentId of the agent