Interface AgentMethodRef<R>

Type Parameters:
R - The type of value returned by executing the call
All Superinterfaces:
ComponentDeferredMethodRef<R>

@DoNotInherit public interface AgentMethodRef<R> extends ComponentDeferredMethodRef<R>
Zero argument agent component call representation.

Extends ComponentMethodRef with the ability to get a detailed reply including token usage through withDetailedReply().

Not for user extension or instantiation, returned by the SDK component client

  • Method Details

    • withMetadata

      AgentMethodRef<R> withMetadata(Metadata metadata)
      Specified by:
      withMetadata in interface ComponentDeferredMethodRef<R>
    • withRetry

      AgentInvokeOnlyMethodRef<R> withRetry(akka.pattern.RetrySettings retrySettings)
      Set the retry settings for this call.
      Parameters:
      retrySettings - The retry settings
      Returns:
      A new call with the retry settings set
    • withRetry

      AgentInvokeOnlyMethodRef<R> withRetry(int maxRetries)
      Set the retry settings for this call. A predefined backoff strategy will be calculated based on the number of maxRetries.
      Parameters:
      maxRetries - The number of retries to make
      Returns:
      A new call with the retry settings set
    • withDetailedReply

      AgentReplyInvokeOnlyMethodRef<R> withDetailedReply()
      Switch to a detailed reply mode that includes e.g. token usage information.
      Returns:
      A call representation that returns Agent.AgentReply
    • invokeAsync

      CompletionStage<R> invokeAsync()
    • invoke

      R invoke()