Interface AgenticRetrieveResponse.Builder

  • Method Details

    • retrievedContext

      AgenticRetrieveResponse.Builder retrievedContext(Collection<RetrievedContext> retrievedContext)

      The ranked, structured context that the agent assembled across all iterations, without duplicates. Always present. Each entry is a graph node, a graph edge, or a document.

      Parameters:
      retrievedContext - The ranked, structured context that the agent assembled across all iterations, without duplicates. Always present. Each entry is a graph node, a graph edge, or a document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • retrievedContext

      AgenticRetrieveResponse.Builder retrievedContext(RetrievedContext... retrievedContext)

      The ranked, structured context that the agent assembled across all iterations, without duplicates. Always present. Each entry is a graph node, a graph edge, or a document.

      Parameters:
      retrievedContext - The ranked, structured context that the agent assembled across all iterations, without duplicates. Always present. Each entry is a graph node, a graph edge, or a document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • retrievedContext

      AgenticRetrieveResponse.Builder retrievedContext(Consumer<RetrievedContext.Builder>... retrievedContext)

      The ranked, structured context that the agent assembled across all iterations, without duplicates. Always present. Each entry is a graph node, a graph edge, or a document.

      This is a convenience method that creates an instance of the RetrievedContext.Builder avoiding the need to create one manually via RetrievedContext.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to retrievedContext(List<RetrievedContext>).

      Parameters:
      retrievedContext - a consumer that will call methods on RetrievedContext.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • answer

      The synthesized natural-language answer, when one was generated.

      Parameters:
      answer - The synthesized natural-language answer, when one was generated.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

      Maps spans of answer to the supporting entities, when an answer was generated.

      Parameters:
      citations - Maps spans of answer to the supporting entities, when an answer was generated.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

      AgenticRetrieveResponse.Builder citations(Citation... citations)

      Maps spans of answer to the supporting entities, when an answer was generated.

      Parameters:
      citations - Maps spans of answer to the supporting entities, when an answer was generated.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • citations

      Maps spans of answer to the supporting entities, when an answer was generated.

      This is a convenience method that creates an instance of the Citation.Builder avoiding the need to create one manually via Citation.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to citations(List<Citation>).

      Parameters:
      citations - a consumer that will call methods on Citation.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • authorizationRequired

      AgenticRetrieveResponse.Builder authorizationRequired(AuthorizationRequired authorizationRequired)

      Present when you must authorize access to a third-party resource. If retrievedContext is empty, no result was retrieved. Otherwise, the result leaves out one or more resources that you have not authorized. Show authorizationUrl to the user and retry after they consent.

      Parameters:
      authorizationRequired - Present when you must authorize access to a third-party resource. If retrievedContext is empty, no result was retrieved. Otherwise, the result leaves out one or more resources that you have not authorized. Show authorizationUrl to the user and retry after they consent.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • authorizationRequired

      default AgenticRetrieveResponse.Builder authorizationRequired(Consumer<AuthorizationRequired.Builder> authorizationRequired)

      Present when you must authorize access to a third-party resource. If retrievedContext is empty, no result was retrieved. Otherwise, the result leaves out one or more resources that you have not authorized. Show authorizationUrl to the user and retry after they consent.

      This is a convenience method that creates an instance of the AuthorizationRequired.Builder avoiding the need to create one manually via AuthorizationRequired.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to authorizationRequired(AuthorizationRequired).

      Parameters:
      authorizationRequired - a consumer that will call methods on AuthorizationRequired.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: