Interface SpanAttributes.Builder

  • Method Details

    • operationName

      SpanAttributes.Builder operationName(String operationName)

      Action being performed

      Parameters:
      operationName - Action being performed
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • providerName

      SpanAttributes.Builder providerName(String providerName)

      Model provider identifier (e.g., aws.bedrock)

      Parameters:
      providerName - Model provider identifier (e.g., aws.bedrock)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • errorType

      SpanAttributes.Builder errorType(String errorType)

      Error classification if span failed (e.g., throttle, timeout)

      Parameters:
      errorType - Error classification if span failed (e.g., throttle, timeout)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • agentId

      SpanAttributes.Builder agentId(String agentId)

      Amazon Connect agent ID

      Parameters:
      agentId - Amazon Connect agent ID
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • instanceArn

      SpanAttributes.Builder instanceArn(String instanceArn)

      Amazon Connect instance ARN

      Parameters:
      instanceArn - Amazon Connect instance ARN
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • contactId

      SpanAttributes.Builder contactId(String contactId)

      Amazon Connect contact identifier

      Parameters:
      contactId - Amazon Connect contact identifier
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • initialContactId

      SpanAttributes.Builder initialContactId(String initialContactId)

      Amazon Connect contact identifier

      Parameters:
      initialContactId - Amazon Connect contact identifier
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • sessionName

      SpanAttributes.Builder sessionName(String sessionName)

      Session name

      Parameters:
      sessionName - Session name
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentArn

      SpanAttributes.Builder aiAgentArn(String aiAgentArn)

      AI agent ARN

      Parameters:
      aiAgentArn - AI agent ARN
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentType

      SpanAttributes.Builder aiAgentType(String aiAgentType)

      AI agent type

      Parameters:
      aiAgentType - AI agent type
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • aiAgentType

      SpanAttributes.Builder aiAgentType(AIAgentType aiAgentType)

      AI agent type

      Parameters:
      aiAgentType - AI agent type
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • aiAgentName

      SpanAttributes.Builder aiAgentName(String aiAgentName)

      AI agent name

      Parameters:
      aiAgentName - AI agent name
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentId

      SpanAttributes.Builder aiAgentId(String aiAgentId)

      AI agent identifier

      Parameters:
      aiAgentId - AI agent identifier
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentVersion

      SpanAttributes.Builder aiAgentVersion(Integer aiAgentVersion)

      AI agent version number

      Parameters:
      aiAgentVersion - AI agent version number
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentInvoker

      SpanAttributes.Builder aiAgentInvoker(String aiAgentInvoker)

      Entity that invoked the AI agent

      Parameters:
      aiAgentInvoker - Entity that invoked the AI agent
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • aiAgentOrchestratorUseCase

      SpanAttributes.Builder aiAgentOrchestratorUseCase(String aiAgentOrchestratorUseCase)

      AI agent orchestrator use case

      Parameters:
      aiAgentOrchestratorUseCase - AI agent orchestrator use case
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • requestModel

      SpanAttributes.Builder requestModel(String requestModel)

      LLM model ID for request (e.g., anthropic.claude-3-sonnet)

      Parameters:
      requestModel - LLM model ID for request (e.g., anthropic.claude-3-sonnet)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • requestMaxTokens

      SpanAttributes.Builder requestMaxTokens(Integer requestMaxTokens)

      Maximum tokens configured for generation

      Parameters:
      requestMaxTokens - Maximum tokens configured for generation
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • temperature

      SpanAttributes.Builder temperature(Float temperature)

      Sampling temperature for generation

      Parameters:
      temperature - Sampling temperature for generation
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • topP

      Top-p sampling parameter for generation

      Parameters:
      topP - Top-p sampling parameter for generation
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • responseModel

      SpanAttributes.Builder responseModel(String responseModel)

      Actual model used for response (usually matches requestModel)

      Parameters:
      responseModel - Actual model used for response (usually matches requestModel)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • responseFinishReasons

      SpanAttributes.Builder responseFinishReasons(Collection<String> responseFinishReasons)

      Generation termination reasons (e.g., stop, max_tokens)

      Parameters:
      responseFinishReasons - Generation termination reasons (e.g., stop, max_tokens)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • responseFinishReasons

      SpanAttributes.Builder responseFinishReasons(String... responseFinishReasons)

      Generation termination reasons (e.g., stop, max_tokens)

      Parameters:
      responseFinishReasons - Generation termination reasons (e.g., stop, max_tokens)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • usageInputTokens

      SpanAttributes.Builder usageInputTokens(Integer usageInputTokens)

      Number of input tokens in prompt

      Parameters:
      usageInputTokens - Number of input tokens in prompt
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • usageOutputTokens

      SpanAttributes.Builder usageOutputTokens(Integer usageOutputTokens)

      Number of output tokens in response

      Parameters:
      usageOutputTokens - Number of output tokens in response
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • usageTotalTokens

      SpanAttributes.Builder usageTotalTokens(Integer usageTotalTokens)

      Total tokens consumed (input + output)

      Parameters:
      usageTotalTokens - Total tokens consumed (input + output)
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • cacheReadInputTokens

      SpanAttributes.Builder cacheReadInputTokens(Integer cacheReadInputTokens)

      Number of input tokens that were retrieved from cache

      Parameters:
      cacheReadInputTokens - Number of input tokens that were retrieved from cache
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • cacheWriteInputTokens

      SpanAttributes.Builder cacheWriteInputTokens(Integer cacheWriteInputTokens)

      Number of input tokens that were written to cache in this request

      Parameters:
      cacheWriteInputTokens - Number of input tokens that were written to cache in this request
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • inputMessages

      SpanAttributes.Builder inputMessages(Collection<SpanMessage> inputMessages)

      Input message collection sent to LLM

      Parameters:
      inputMessages - Input message collection sent to LLM
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • inputMessages

      SpanAttributes.Builder inputMessages(SpanMessage... inputMessages)

      Input message collection sent to LLM

      Parameters:
      inputMessages - Input message collection sent to LLM
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • inputMessages

      SpanAttributes.Builder inputMessages(Consumer<SpanMessage.Builder>... inputMessages)

      Input message collection sent to LLM

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

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

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

      SpanAttributes.Builder outputMessages(Collection<SpanMessage> outputMessages)

      Output message collection received from LLM

      Parameters:
      outputMessages - Output message collection received from LLM
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • outputMessages

      SpanAttributes.Builder outputMessages(SpanMessage... outputMessages)

      Output message collection received from LLM

      Parameters:
      outputMessages - Output message collection received from LLM
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • outputMessages

      SpanAttributes.Builder outputMessages(Consumer<SpanMessage.Builder>... outputMessages)

      Output message collection received from LLM

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

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

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

      SpanAttributes.Builder systemInstructions(Collection<SpanMessageValue> systemInstructions)

      System prompt instructions

      Parameters:
      systemInstructions - System prompt instructions
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • systemInstructions

      SpanAttributes.Builder systemInstructions(SpanMessageValue... systemInstructions)

      System prompt instructions

      Parameters:
      systemInstructions - System prompt instructions
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • systemInstructions

      SpanAttributes.Builder systemInstructions(Consumer<SpanMessageValue.Builder>... systemInstructions)

      System prompt instructions

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

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

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

      SpanAttributes.Builder promptArn(String promptArn)

      AI prompt ARN

      Parameters:
      promptArn - AI prompt ARN
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • promptId

      SpanAttributes.Builder promptId(String promptId)

      AI prompt identifier

      Parameters:
      promptId - AI prompt identifier
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • promptType

      SpanAttributes.Builder promptType(String promptType)

      AI prompt type

      Parameters:
      promptType - AI prompt type
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • promptType

      SpanAttributes.Builder promptType(AIPromptType promptType)

      AI prompt type

      Parameters:
      promptType - AI prompt type
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • promptName

      SpanAttributes.Builder promptName(String promptName)

      AI prompt name

      Parameters:
      promptName - AI prompt name
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • promptVersion

      SpanAttributes.Builder promptVersion(Integer promptVersion)

      AI prompt version number

      Parameters:
      promptVersion - AI prompt version number
      Returns:
      Returns a reference to this object so that method calls can be chained together.