Expand description
AI cost calculation.
Structs§
- Calculated
Cost - Calculated model call costs.
- Used
Tokens - Amount of used tokens for a model call.
Functions§
- calculate_
costs - Calculates the total cost for a model call.
- default_
ai_ operation_ type - Returns the fallback AI operation type based on whether model info is available.
- enrich_
ai_ event_ data - Extract the ai data from all of an event’s spans
- enrich_
ai_ span - Enrich the AI span data
- has_
valid_ total_ cost - Returns whether a valid total cost is attached.
- infer_
ai_ operation_ type - Infers the AI operation from an AI operation name.