Expand description
AI cost calculation.
Structs§
- Calculated
Cost - Calculated model call costs.
- Used
Tokens - Amount of used tokens for a model call.
Constants§
- DEFAULT_
AI_ OPERATION - Default AI operation stored in
GEN_AI_OPERATION_TYPEfor 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.