Class SpanAttributes

java.lang.Object
software.amazon.awssdk.services.qconnect.model.SpanAttributes
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<SpanAttributes.Builder,SpanAttributes>

@Generated("software.amazon.awssdk:codegen") public final class SpanAttributes extends Object implements SdkPojo, Serializable, ToCopyableBuilder<SpanAttributes.Builder,SpanAttributes>

Contextual attributes capturing operation details, LLM configuration, usage metrics, and conversation data

See Also:
  • Method Details

    • operationName

      public final String operationName()

      Action being performed

      Returns:
      Action being performed
    • providerName

      public final String providerName()

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

      Returns:
      Model provider identifier (e.g., aws.bedrock)
    • errorType

      public final String errorType()

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

      Returns:
      Error classification if span failed (e.g., throttle, timeout)
    • agentId

      public final String agentId()

      Amazon Connect agent ID

      Returns:
      Amazon Connect agent ID
    • instanceArn

      public final String instanceArn()

      Amazon Connect instance ARN

      Returns:
      Amazon Connect instance ARN
    • contactId

      public final String contactId()

      Amazon Connect contact identifier

      Returns:
      Amazon Connect contact identifier
    • initialContactId

      public final String initialContactId()

      Amazon Connect contact identifier

      Returns:
      Amazon Connect contact identifier
    • sessionName

      public final String sessionName()

      Session name

      Returns:
      Session name
    • aiAgentArn

      public final String aiAgentArn()

      AI agent ARN

      Returns:
      AI agent ARN
    • aiAgentType

      public final AIAgentType aiAgentType()

      AI agent type

      If the service returns an enum value that is not available in the current SDK version, aiAgentType will return AIAgentType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from aiAgentTypeAsString().

      Returns:
      AI agent type
      See Also:
    • aiAgentTypeAsString

      public final String aiAgentTypeAsString()

      AI agent type

      If the service returns an enum value that is not available in the current SDK version, aiAgentType will return AIAgentType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from aiAgentTypeAsString().

      Returns:
      AI agent type
      See Also:
    • aiAgentName

      public final String aiAgentName()

      AI agent name

      Returns:
      AI agent name
    • aiAgentId

      public final String aiAgentId()

      AI agent identifier

      Returns:
      AI agent identifier
    • aiAgentVersion

      public final Integer aiAgentVersion()

      AI agent version number

      Returns:
      AI agent version number
    • aiAgentInvoker

      public final String aiAgentInvoker()

      Entity that invoked the AI agent

      Returns:
      Entity that invoked the AI agent
    • aiAgentOrchestratorUseCase

      public final String aiAgentOrchestratorUseCase()

      AI agent orchestrator use case

      Returns:
      AI agent orchestrator use case
    • requestModel

      public final String requestModel()

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

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

      public final Integer requestMaxTokens()

      Maximum tokens configured for generation

      Returns:
      Maximum tokens configured for generation
    • temperature

      public final Float temperature()

      Sampling temperature for generation

      Returns:
      Sampling temperature for generation
    • topP

      public final Float topP()

      Top-p sampling parameter for generation

      Returns:
      Top-p sampling parameter for generation
    • responseModel

      public final String responseModel()

      Actual model used for response (usually matches requestModel)

      Returns:
      Actual model used for response (usually matches requestModel)
    • hasResponseFinishReasons

      public final boolean hasResponseFinishReasons()
      For responses, this returns true if the service returned a value for the ResponseFinishReasons property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • responseFinishReasons

      public final List<String> responseFinishReasons()

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

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasResponseFinishReasons() method.

      Returns:
      Generation termination reasons (e.g., stop, max_tokens)
    • usageInputTokens

      public final Integer usageInputTokens()

      Number of input tokens in prompt

      Returns:
      Number of input tokens in prompt
    • usageOutputTokens

      public final Integer usageOutputTokens()

      Number of output tokens in response

      Returns:
      Number of output tokens in response
    • usageTotalTokens

      public final Integer usageTotalTokens()

      Total tokens consumed (input + output)

      Returns:
      Total tokens consumed (input + output)
    • cacheReadInputTokens

      public final Integer cacheReadInputTokens()

      Number of input tokens that were retrieved from cache

      Returns:
      Number of input tokens that were retrieved from cache
    • cacheWriteInputTokens

      public final Integer cacheWriteInputTokens()

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

      Returns:
      Number of input tokens that were written to cache in this request
    • hasInputMessages

      public final boolean hasInputMessages()
      For responses, this returns true if the service returned a value for the InputMessages property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • inputMessages

      public final List<SpanMessage> inputMessages()

      Input message collection sent to LLM

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasInputMessages() method.

      Returns:
      Input message collection sent to LLM
    • hasOutputMessages

      public final boolean hasOutputMessages()
      For responses, this returns true if the service returned a value for the OutputMessages property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • outputMessages

      public final List<SpanMessage> outputMessages()

      Output message collection received from LLM

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasOutputMessages() method.

      Returns:
      Output message collection received from LLM
    • hasSystemInstructions

      public final boolean hasSystemInstructions()
      For responses, this returns true if the service returned a value for the SystemInstructions property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • systemInstructions

      public final List<SpanMessageValue> systemInstructions()

      System prompt instructions

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSystemInstructions() method.

      Returns:
      System prompt instructions
    • promptArn

      public final String promptArn()

      AI prompt ARN

      Returns:
      AI prompt ARN
    • promptId

      public final String promptId()

      AI prompt identifier

      Returns:
      AI prompt identifier
    • promptType

      public final AIPromptType promptType()

      AI prompt type

      If the service returns an enum value that is not available in the current SDK version, promptType will return AIPromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptTypeAsString().

      Returns:
      AI prompt type
      See Also:
    • promptTypeAsString

      public final String promptTypeAsString()

      AI prompt type

      If the service returns an enum value that is not available in the current SDK version, promptType will return AIPromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptTypeAsString().

      Returns:
      AI prompt type
      See Also:
    • promptName

      public final String promptName()

      AI prompt name

      Returns:
      AI prompt name
    • promptVersion

      public final Integer promptVersion()

      AI prompt version number

      Returns:
      AI prompt version number
    • toBuilder

      public SpanAttributes.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<SpanAttributes.Builder,SpanAttributes>
      Returns:
      a builder for type T
    • builder

      public static SpanAttributes.Builder builder()
    • serializableBuilderClass

      public static Class<? extends SpanAttributes.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.