airflow.providers.common.ai.toolsets.logging¶
Logging wrapper toolset for pydantic-ai tool calls.
Classes¶
Apply tool-call logging to the assembled function toolset for an agent run. |
Module Contents¶
- class airflow.providers.common.ai.toolsets.logging.ToolLoggingCapability[source]¶
Bases:
pydantic_ai.capabilities.AbstractCapability[Any]Apply tool-call logging to the assembled function toolset for an agent run.
Note
Experimental; see Stable and experimental features.
- logger: airflow.sdk.types.Logger | logging.Logger[source]¶
- classmethod get_serialization_name()[source]¶
Return the name used for spec serialization (CamelCase class name by default).
Return None to opt out of spec-based construction.
- get_ordering()[source]¶
Place logging innermost so outer capability wrappers delegate base-tool calls through it.
- get_wrapper_toolset(toolset)[source]¶
Wrap the agent’s assembled toolset, or return None to leave it unchanged.
Called per-run with the combined non-output toolset (after the [prepare_tools][pydantic_ai.capabilities.AbstractCapability.prepare_tools] hook has already wrapped it). Output tools are added separately and are not included.
Unlike value-contribution methods such as [get_instructions][pydantic_ai.capabilities.AbstractCapability.get_instructions], this receives the already assembled toolset and is called each run (after [for_run][pydantic_ai.capabilities.AbstractCapability.for_run]). When multiple capabilities provide wrappers, they follow middleware semantics: the first capability in the list wraps outermost (matching wrap_* hooks).
Use this to apply cross-cutting toolset wrappers like [PreparedToolset][pydantic_ai.toolsets.PreparedToolset], [FilteredToolset][pydantic_ai.toolsets.FilteredToolset], or custom [WrapperToolset][pydantic_ai.toolsets.WrapperToolset] subclasses.