Module Values.SpanAttributesSource

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

Sourcetype nonrec t = {
  1. operationName : NonEmptyString.t option;
    (*

    Action being performed

    *)
  2. providerName : NonEmptyString.t option;
    (*

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

    *)
  3. errorType : NonEmptyString.t option;
    (*

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

    *)
  4. agentId : Uuid.t option;
    (*

    Amazon Connect agent ID

    *)
  5. instanceArn : GenericArn.t option;
    (*

    Amazon Connect instance ARN

    *)
  6. contactId : Uuid.t option;
    (*

    Amazon Connect contact identifier

    *)
  7. initialContactId : Uuid.t option;
    (*

    Amazon Connect contact identifier

    *)
  8. sessionName : NonEmptyString.t option;
    (*

    Session name

    *)
  9. aiAgentArn : ArnWithQualifier.t option;
    (*

    AI agent ARN

    *)
  10. aiAgentType : AIAgentType.t option;
    (*

    AI agent type

    *)
  11. aiAgentName : Name.t option;
    (*

    AI agent name

    *)
  12. aiAgentId : Uuid.t option;
    (*

    AI agent identifier

    *)
  13. aiAgentVersion : Integer.t option;
    (*

    AI agent version number

    *)
  14. aiAgentInvoker : NonEmptyString.t option;
    (*

    Entity that invoked the AI agent

    *)
  15. aiAgentOrchestratorUseCase : NonEmptyString.t option;
    (*

    AI agent orchestrator use case

    *)
  16. requestModel : NonEmptyString.t option;
    (*

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

    *)
  17. requestMaxTokens : Integer.t option;
    (*

    Maximum tokens configured for generation

    *)
  18. temperature : SpanAttributesTemperatureFloat.t option;
    (*

    Sampling temperature for generation

    *)
  19. topP : SpanAttributesTopPFloat.t option;
    (*

    Top-p sampling parameter for generation

    *)
  20. responseModel : NonEmptyString.t option;
    (*

    Actual model used for response (usually matches requestModel)

    *)
  21. responseFinishReasons : SpanFinishReasonList.t option;
    (*

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

    *)
  22. usageInputTokens : Integer.t option;
    (*

    Number of input tokens in prompt

    *)
  23. usageOutputTokens : Integer.t option;
    (*

    Number of output tokens in response

    *)
  24. usageTotalTokens : Integer.t option;
    (*

    Total tokens consumed (input + output)

    *)
  25. cacheReadInputTokens : Integer.t option;
    (*

    Number of input tokens that were retrieved from cache

    *)
  26. cacheWriteInputTokens : Integer.t option;
    (*

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

    *)
  27. inputMessages : SpanMessageList.t option;
    (*

    Input message collection sent to LLM

    *)
  28. outputMessages : SpanMessageList.t option;
    (*

    Output message collection received from LLM

    *)
  29. systemInstructions : SpanMessageValueList.t option;
    (*

    System prompt instructions

    *)
  30. promptArn : ArnWithQualifier.t option;
    (*

    AI prompt ARN

    *)
  31. promptId : Uuid.t option;
    (*

    AI prompt identifier

    *)
  32. promptType : AIPromptType.t option;
    (*

    AI prompt type

    *)
  33. promptName : Name.t option;
    (*

    AI prompt name

    *)
  34. promptVersion : Integer.t option;
    (*

    AI prompt version number

    *)
  35. timeToFirstTokenMs : Integer.t option;
    (*

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

    *)
}
Sourceval make : ?operationName:NonEmptyString.t -> ?providerName:NonEmptyString.t -> ?errorType:NonEmptyString.t -> ?agentId:Uuid.t -> ?instanceArn:GenericArn.t -> ?contactId:Uuid.t -> ?initialContactId:Uuid.t -> ?sessionName:NonEmptyString.t -> ?aiAgentArn:ArnWithQualifier.t -> ?aiAgentType:AIAgentType.t -> ?aiAgentName:Name.t -> ?aiAgentId:Uuid.t -> ?aiAgentVersion:Integer.t -> ?aiAgentInvoker:NonEmptyString.t -> ?aiAgentOrchestratorUseCase:NonEmptyString.t -> ?requestModel:NonEmptyString.t -> ?requestMaxTokens:Integer.t -> ?temperature:SpanAttributesTemperatureFloat.t -> ?topP:SpanAttributesTopPFloat.t -> ?responseModel:NonEmptyString.t -> ?responseFinishReasons:SpanFinishReasonList.t -> ?usageInputTokens:Integer.t -> ?usageOutputTokens:Integer.t -> ?usageTotalTokens:Integer.t -> ?cacheReadInputTokens:Integer.t -> ?cacheWriteInputTokens:Integer.t -> ?inputMessages:SpanMessageList.t -> ?outputMessages:SpanMessageList.t -> ?systemInstructions:SpanMessageValueList.t -> ?promptArn:ArnWithQualifier.t -> ?promptId:Uuid.t -> ?promptType:AIPromptType.t -> ?promptName:Name.t -> ?promptVersion:Integer.t -> ?timeToFirstTokenMs:Integer.t -> unit -> t
Sourceval to_value : t -> [> `Structure of (string * Awso.Botodata.value) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t