Interface Metadata.Builder

All Superinterfaces:
Buildable, CopyableBuilder<Metadata.Builder,Metadata>, SdkBuilder<Metadata.Builder,Metadata>, SdkPojo
Enclosing class:
Metadata

@Mutable @NotThreadSafe public static interface Metadata.Builder extends SdkPojo, CopyableBuilder<Metadata.Builder,Metadata>
  • Method Details

    • clientRequestId

      Metadata.Builder clientRequestId(String clientRequestId)

      A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.

      Parameters:
      clientRequestId - A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • endTime

      Metadata.Builder endTime(Instant endTime)

      In the final response, endTime is the end time of the agent invocation operation.

      Parameters:
      endTime - In the final response, endTime is the end time of the agent invocation operation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • operationTotalTimeMs

      Metadata.Builder operationTotalTimeMs(Long operationTotalTimeMs)

      The total time it took for the agent to complete execution. This field is only set for the final response.

      Parameters:
      operationTotalTimeMs - The total time it took for the agent to complete execution. This field is only set for the final response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • startTime

      Metadata.Builder startTime(Instant startTime)

      In the final response, startTime is the start time of the agent invocation operation.

      Parameters:
      startTime - In the final response, startTime is the start time of the agent invocation operation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • totalTimeMs

      Metadata.Builder totalTimeMs(Long totalTimeMs)

      The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.

      Parameters:
      totalTimeMs - The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • usage

      Metadata.Builder usage(Usage usage)

      Specific to model invocation and contains details about the usage of a foundation model.

      Parameters:
      usage - Specific to model invocation and contains details about the usage of a foundation model.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • usage

      default Metadata.Builder usage(Consumer<Usage.Builder> usage)

      Specific to model invocation and contains details about the usage of a foundation model.

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

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

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