Skip to content

SpanAttributes

Source code in docs_src/capo_qconnect/types/span_attributes.py
class SpanAttributes(TypedDict, closed=True):
    operation_name: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Action being performed</p>"""
    provider_name: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Model provider identifier (e.g., aws.bedrock)</p>"""
    error_type: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Error classification if span failed (e.g., throttle, timeout)</p>"""
    agent_id: NotRequired["capo_qconnect.types.uuid.Uuid"]
    """<p>Amazon Connect agent ID</p>"""
    instance_arn: NotRequired["capo_qconnect.types.generic_arn.GenericArn"]
    """<p>Amazon Connect instance ARN</p>"""
    contact_id: NotRequired["capo_qconnect.types.uuid.Uuid"]
    """<p>Amazon Connect contact identifier</p>"""
    initial_contact_id: NotRequired["capo_qconnect.types.uuid.Uuid"]
    """<p>Amazon Connect contact identifier</p>"""
    session_name: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Session name</p>"""
    ai_agent_arn: NotRequired["capo_qconnect.types.arn_with_qualifier.ArnWithQualifier"]
    """<p>AI agent ARN</p>"""
    ai_agent_type: NotRequired["capo_qconnect.types.ai_agent_type.AIAgentType"]
    """<p>AI agent type</p>"""
    ai_agent_name: NotRequired["capo_qconnect.types.name.Name"]
    """<p>AI agent name</p>"""
    ai_agent_id: NotRequired["capo_qconnect.types.uuid.Uuid"]
    """<p>AI agent identifier</p>"""
    ai_agent_version: NotRequired["int"]
    """<p>AI agent version number</p>"""
    ai_agent_invoker: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Entity that invoked the AI agent</p>"""
    ai_agent_orchestrator_use_case: NotRequired[
        "capo_qconnect.types.non_empty_string.NonEmptyString"
    ]
    """<p>AI agent orchestrator use case</p>"""
    interaction_mode: NotRequired[
        "capo_qconnect.types.interaction_mode.InteractionMode"
    ]
    """<p>How the orchestrator engaged the collaborator agent. Present on spans that invoke a collaborator agent.</p>"""
    target_agent_id: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Identifier of the collaborator agent being invoked. For first-party collaborators this is the Amazon Connect AI agent ID; for third-party collaborators this is the external application ID.</p>"""
    return_reason: NotRequired["capo_qconnect.types.return_reason.ReturnReason"]
    """<p>Reason a sub-agent returned control to the calling agent. Present on return_to_agent spans.</p>"""
    request_model: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>LLM model ID for request (e.g., anthropic.claude-3-sonnet)</p>"""
    request_max_tokens: NotRequired["int"]
    """<p>Maximum tokens configured for generation</p>"""
    temperature: NotRequired["float"]
    """<p>Sampling temperature for generation</p>"""
    top_p: NotRequired["float"]
    """<p>Top-p sampling parameter for generation</p>"""
    response_model: NotRequired["capo_qconnect.types.non_empty_string.NonEmptyString"]
    """<p>Actual model used for response (usually matches requestModel)</p>"""
    response_finish_reasons: NotRequired[
        "capo_qconnect.types.span_finish_reason_list.SpanFinishReasonList"
    ]
    """<p>Generation termination reasons (e.g., stop, max_tokens)</p>"""
    usage_input_tokens: NotRequired["int"]
    """<p>Number of input tokens in prompt</p>"""
    usage_output_tokens: NotRequired["int"]
    """<p>Number of output tokens in response</p>"""
    usage_total_tokens: NotRequired["int"]
    """<p>Total tokens consumed (input + output)</p>"""
    cache_read_input_tokens: NotRequired["int"]
    """<p>Number of input tokens that were retrieved from cache</p>"""
    cache_write_input_tokens: NotRequired["int"]
    """<p>Number of input tokens that were written to cache in this request</p>"""
    input_messages: NotRequired["capo_qconnect.types.span_message_list.SpanMessageList"]
    """<p>Input message collection sent to LLM</p>"""
    output_messages: NotRequired[
        "capo_qconnect.types.span_message_list.SpanMessageList"
    ]
    """<p>Output message collection received from LLM</p>"""
    system_instructions: NotRequired[
        "capo_qconnect.types.span_message_value_list.SpanMessageValueList"
    ]
    """<p>System prompt instructions</p>"""
    prompt_arn: NotRequired["capo_qconnect.types.arn_with_qualifier.ArnWithQualifier"]
    """<p>AI prompt ARN</p>"""
    prompt_id: NotRequired["capo_qconnect.types.uuid.Uuid"]
    """<p>AI prompt identifier</p>"""
    prompt_type: NotRequired["capo_qconnect.types.ai_prompt_type.AIPromptType"]
    """<p>AI prompt type</p>"""
    prompt_name: NotRequired["capo_qconnect.types.name.Name"]
    """<p>AI prompt name</p>"""
    prompt_version: NotRequired["int"]
    """<p>AI prompt version number</p>"""
    time_to_first_token_ms: NotRequired["int"]
    """<p>Time to first token in milliseconds, measured from when Amazon Bedrock was invoked to when the first token was returned</p>"""
    guardrail_assessments: NotRequired[
        "capo_qconnect.types.span_guardrail_assessment_list.SpanGuardrailAssessmentList"
    ]
    """<p>Guardrail assessments for the inference span. Absent on other span types and when no AI Guardrail is attached to the AI Agent.</p>"""

agent_id instance-attribute

agent_id: NotRequired[Uuid]

Amazon Connect agent ID

ai_agent_arn instance-attribute

ai_agent_arn: NotRequired[ArnWithQualifier]

AI agent ARN

ai_agent_id instance-attribute

ai_agent_id: NotRequired[Uuid]

AI agent identifier

ai_agent_invoker instance-attribute

ai_agent_invoker: NotRequired[NonEmptyString]

Entity that invoked the AI agent

ai_agent_name instance-attribute

ai_agent_name: NotRequired[Name]

AI agent name

ai_agent_orchestrator_use_case instance-attribute

ai_agent_orchestrator_use_case: NotRequired[NonEmptyString]

AI agent orchestrator use case

ai_agent_type instance-attribute

ai_agent_type: NotRequired[AIAgentType]

AI agent type

ai_agent_version instance-attribute

ai_agent_version: NotRequired[int]

AI agent version number

cache_read_input_tokens instance-attribute

cache_read_input_tokens: NotRequired[int]

Number of input tokens that were retrieved from cache

cache_write_input_tokens instance-attribute

cache_write_input_tokens: NotRequired[int]

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

contact_id instance-attribute

contact_id: NotRequired[Uuid]

Amazon Connect contact identifier

error_type instance-attribute

error_type: NotRequired[NonEmptyString]

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

guardrail_assessments instance-attribute

guardrail_assessments: NotRequired[SpanGuardrailAssessmentList]

Guardrail assessments for the inference span. Absent on other span types and when no AI Guardrail is attached to the AI Agent.

initial_contact_id instance-attribute

initial_contact_id: NotRequired[Uuid]

Amazon Connect contact identifier

input_messages instance-attribute

input_messages: NotRequired[SpanMessageList]

Input message collection sent to LLM

instance_arn instance-attribute

instance_arn: NotRequired[GenericArn]

Amazon Connect instance ARN

interaction_mode instance-attribute

interaction_mode: NotRequired[InteractionMode]

How the orchestrator engaged the collaborator agent. Present on spans that invoke a collaborator agent.

operation_name instance-attribute

operation_name: NotRequired[NonEmptyString]

Action being performed

output_messages instance-attribute

output_messages: NotRequired[SpanMessageList]

Output message collection received from LLM

prompt_arn instance-attribute

prompt_arn: NotRequired[ArnWithQualifier]

AI prompt ARN

prompt_id instance-attribute

prompt_id: NotRequired[Uuid]

AI prompt identifier

prompt_name instance-attribute

prompt_name: NotRequired[Name]

AI prompt name

prompt_type instance-attribute

prompt_type: NotRequired[AIPromptType]

AI prompt type

prompt_version instance-attribute

prompt_version: NotRequired[int]

AI prompt version number

provider_name instance-attribute

provider_name: NotRequired[NonEmptyString]

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

request_max_tokens instance-attribute

request_max_tokens: NotRequired[int]

Maximum tokens configured for generation

request_model instance-attribute

request_model: NotRequired[NonEmptyString]

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

response_finish_reasons instance-attribute

response_finish_reasons: NotRequired[SpanFinishReasonList]

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

response_model instance-attribute

response_model: NotRequired[NonEmptyString]

Actual model used for response (usually matches requestModel)

return_reason instance-attribute

return_reason: NotRequired[ReturnReason]

Reason a sub-agent returned control to the calling agent. Present on return_to_agent spans.

session_name instance-attribute

session_name: NotRequired[NonEmptyString]

Session name

system_instructions instance-attribute

system_instructions: NotRequired[SpanMessageValueList]

System prompt instructions

target_agent_id instance-attribute

target_agent_id: NotRequired[NonEmptyString]

Identifier of the collaborator agent being invoked. For first-party collaborators this is the Amazon Connect AI agent ID; for third-party collaborators this is the external application ID.

temperature instance-attribute

temperature: NotRequired[float]

Sampling temperature for generation

time_to_first_token_ms instance-attribute

time_to_first_token_ms: NotRequired[int]

Time to first token in milliseconds, measured from when Amazon Bedrock was invoked to when the first token was returned

top_p instance-attribute

top_p: NotRequired[float]

Top-p sampling parameter for generation

usage_input_tokens instance-attribute

usage_input_tokens: NotRequired[int]

Number of input tokens in prompt

usage_output_tokens instance-attribute

usage_output_tokens: NotRequired[int]

Number of output tokens in response

usage_total_tokens instance-attribute

usage_total_tokens: NotRequired[int]

Total tokens consumed (input + output)