airflow.providers.common.ai.utils.logging¶
Logging utilities for pydantic-ai agent runs.
Functions¶
|
Log model name, token usage, and tool call sequence from an agent run. |
|
Log token usage/cost for a run that never produced an |
|
Build the XCom |
|
Wrap each toolset in a LoggingToolset. |
Module Contents¶
- airflow.providers.common.ai.utils.logging.log_run_summary(logger, result, *, usage=None)[source]¶
Log model name, token usage, and tool call sequence from an agent run.
- Parameters:
usage (pydantic_ai.usage.RunUsage | None) – Usage to log instead of
result.usage– e.g. this attempt’s delta whenresult.usagewould report the cross-attempt cumulative total instead.
- airflow.providers.common.ai.utils.logging.log_run_usage(logger, usage, *, outcome)[source]¶
Log token usage/cost for a run that never produced an
AgentRunResult(the failure path).