Module ai

Module ai 

Source
Expand description

AI cost calculation.

Structs§

CalculatedCost
Calculated model call costs.
UsedTokens
Amount of used tokens for a model call.

Constants§

DEFAULT_AI_OPERATION
Default AI operation stored in GEN_AI_OPERATION_TYPE for AI spans without a well known AI span op.

Functions§

calculate_costs
Calculates the total cost for a model call.
enrich_ai_event_data
Extract the ai data from all of an event’s spans
enrich_ai_span
Enrich the AI span data
infer_ai_operation_type
Infers the AI operation from an AI operation name.