oterm/tests/tools
Yiorgis Gozadinos f8c6edc2b5
Add the speak capability
Registers a "speak" capability that reads responses aloud through piper as it
streams, backed by pydantic-ai-tts and installed with the oterm[speak] extra.
The entry appears in the tool selector only when the package is importable, so
a base install pulls neither onnxruntime nor a voice model.

The extra carries a python_version >= '3.11' marker because pydantic-ai-tts
requires 3.11 while oterm supports 3.10; without it the extra cannot resolve.
On 3.10 the package is absent and the capability is simply not registered.

The factory is memoised: capabilities are built once per chat and every Speaks
owns worker threads the factory contract gives no place to close. It also sets
ORT_DISABLE_TELEMETRY before the import, which is where onnxruntime reads it,
leaving an explicit setting alone.

pydantic-ai-tts is MIT but pulls piper-tts, which is GPL-3.0-or-later, into
the environment of anyone installing the extra.
2026-09-01 18:35:43 +03:00
..
__init__.py Basic prototype for tools 2024-09-24 14:55:51 +02:00
mcp_servers.py Update dependencies and migrate the test MCP server to mcp 2.x 2026-09-01 13:00:29 +03:00
test_builtin_tools.py Rewrite tools-tier tests around TestModel, stdio MCP, no VCR 2026-04-24 20:20:37 +03:00
test_capabilities.py Add the speak capability 2026-09-01 18:35:43 +03:00
test_discovery.py Qualify MCP tool names by server 2026-07-31 15:46:30 +03:00
test_mcp_logging.py Drop pydantic-ai private import in test helper, type MCP log handler against public alias 2026-05-22 12:23:19 +03:00
test_mcp_setup.py Qualify MCP tool names by server 2026-07-31 15:46:30 +03:00
test_ollama_image.py Surface failing tool calls in logs and tool-call widget 2026-05-10 13:12:14 +03:00