Class SpanAttributes
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<SpanAttributes.Builder,SpanAttributes>
Contextual attributes capturing operation details, LLM configuration, usage metrics, and conversation data
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal StringagentId()Amazon Connect agent IDfinal StringAI agent ARNfinal StringAI agent identifierfinal StringEntity that invoked the AI agentfinal StringAI agent namefinal StringAI agent orchestrator use casefinal AIAgentTypeAI agent typefinal StringAI agent typefinal IntegerAI agent version numberstatic SpanAttributes.Builderbuilder()final IntegerNumber of input tokens that were retrieved from cachefinal IntegerNumber of input tokens that were written to cache in this requestfinal StringAmazon Connect contact identifierfinal booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final StringError classification if span failed (e.g., throttle, timeout)final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final booleanFor responses, this returns true if the service returned a value for the InputMessages property.final booleanFor responses, this returns true if the service returned a value for the OutputMessages property.final booleanFor responses, this returns true if the service returned a value for the ResponseFinishReasons property.final booleanFor responses, this returns true if the service returned a value for the SystemInstructions property.final StringAmazon Connect contact identifierfinal List<SpanMessage> Input message collection sent to LLMfinal StringAmazon Connect instance ARNfinal StringAction being performedfinal List<SpanMessage> Output message collection received from LLMfinal StringAI prompt ARNfinal StringpromptId()AI prompt identifierfinal StringAI prompt namefinal AIPromptTypeAI prompt typefinal StringAI prompt typefinal IntegerAI prompt version numberfinal StringModel provider identifier (e.g., aws.bedrock)final IntegerMaximum tokens configured for generationfinal StringLLM model ID for request (e.g., anthropic.claude-3-sonnet)Generation termination reasons (e.g., stop, max_tokens)final StringActual model used for response (usually matches requestModel)static Class<? extends SpanAttributes.Builder> final StringSession namefinal List<SpanMessageValue> System prompt instructionsfinal FloatSampling temperature for generationTake this object and create a builder that contains all of the current property values of this object.final FloattopP()Top-p sampling parameter for generationfinal StringtoString()Returns a string representation of this object.final IntegerNumber of input tokens in promptfinal IntegerNumber of output tokens in responsefinal IntegerTotal tokens consumed (input + output)Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
operationName
-
providerName
Model provider identifier (e.g., aws.bedrock)
- Returns:
- Model provider identifier (e.g., aws.bedrock)
-
errorType
Error classification if span failed (e.g., throttle, timeout)
- Returns:
- Error classification if span failed (e.g., throttle, timeout)
-
agentId
-
instanceArn
-
contactId
Amazon Connect contact identifier
- Returns:
- Amazon Connect contact identifier
-
initialContactId
Amazon Connect contact identifier
- Returns:
- Amazon Connect contact identifier
-
sessionName
-
aiAgentArn
-
aiAgentType
AI agent type
If the service returns an enum value that is not available in the current SDK version,
aiAgentTypewill returnAIAgentType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromaiAgentTypeAsString().- Returns:
- AI agent type
- See Also:
-
aiAgentTypeAsString
AI agent type
If the service returns an enum value that is not available in the current SDK version,
aiAgentTypewill returnAIAgentType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromaiAgentTypeAsString().- Returns:
- AI agent type
- See Also:
-
aiAgentName
-
aiAgentId
-
aiAgentVersion
-
aiAgentInvoker
Entity that invoked the AI agent
- Returns:
- Entity that invoked the AI agent
-
aiAgentOrchestratorUseCase
AI agent orchestrator use case
- Returns:
- AI agent orchestrator use case
-
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
Maximum tokens configured for generation
- Returns:
- Maximum tokens configured for generation
-
temperature
Sampling temperature for generation
- Returns:
- Sampling temperature for generation
-
topP
Top-p sampling parameter for generation
- Returns:
- Top-p sampling parameter for generation
-
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 theisEmpty()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
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
Number of input tokens in prompt
- Returns:
- Number of input tokens in prompt
-
usageOutputTokens
Number of output tokens in response
- Returns:
- Number of output tokens in response
-
usageTotalTokens
Total tokens consumed (input + output)
- Returns:
- Total tokens consumed (input + output)
-
cacheReadInputTokens
Number of input tokens that were retrieved from cache
- Returns:
- Number of input tokens that were retrieved from cache
-
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 theisEmpty()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
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 theisEmpty()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
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 theisEmpty()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
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
-
promptId
-
promptType
AI prompt type
If the service returns an enum value that is not available in the current SDK version,
promptTypewill returnAIPromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frompromptTypeAsString().- Returns:
- AI prompt type
- See Also:
-
promptTypeAsString
AI prompt type
If the service returns an enum value that is not available in the current SDK version,
promptTypewill returnAIPromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frompromptTypeAsString().- Returns:
- AI prompt type
- See Also:
-
promptName
-
promptVersion
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<SpanAttributes.Builder,SpanAttributes> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-