Files
David SFandGitHub 310ffadf09 refactor: graduate capabilities out of experimental (ACP excepted) (#347)
* refactor: graduate capabilities out of `experimental` (ACP excepted)

The `experimental` label suppressed the try->fail->report->improve loop we
want from real usage, so drop it from the harness. Ten capabilities move to
top-level submodules; ACP stays experimental (it may still be reshaped or
moved to core, and can't be generic across agents).

- Old `pydantic_ai_harness.experimental.<name>` paths keep working as
  DeprecationWarning shims (via `warn_moved`), so existing imports don't break.
- Renames to match capability names: authoring -> runtime_authoring,
  overflow -> overflowing_tool_output.
- Capabilities stay in individual submodules with no top-level re-export, so
  importing the root package never pulls in a capability's optional deps.
- Docs drop the experimental framing and the "may be removed in any release"
  language in favor of "API subject to change".

* docs: tell capability authors to ask the user when unsure about a name

Per PR review: a name is a public commitment once shipped, so ask rather than guess.
2026-07-10 21:31:08 -05:00

40 lines
1.3 KiB
Python

"""Overflow capability: reduce oversized tool returns at production time.
`OverflowingToolOutput` intercepts a tool return when it is produced and reduces it --
truncating, spilling to a queryable file, or summarizing -- so an oversized payload does
not persist in history and get re-sent on every later model request. Combine the three
modes through an ordered list of size `bands`.
Spilled payloads are read back on demand through the registered `read_tool_result` tool;
the `OverflowStore` protocol is the seam for a durable backend (the local-file default
ships for single-process runs).
"""
from pydantic_ai_harness.overflowing_tool_output._bands import (
Action,
Band,
Passthrough,
Spill,
Summarize,
SummarizeFunc,
Truncate,
)
from pydantic_ai_harness.overflowing_tool_output._capability import READ_TOOL_NAME, OverflowingToolOutput
from pydantic_ai_harness.overflowing_tool_output._payload import TruncationStrategy
from pydantic_ai_harness.overflowing_tool_output._store import LocalFileStore, OverflowStore
__all__ = [
'READ_TOOL_NAME',
'Action',
'Band',
'LocalFileStore',
'OverflowStore',
'OverflowingToolOutput',
'Passthrough',
'Spill',
'Summarize',
'SummarizeFunc',
'Truncate',
'TruncationStrategy',
]