PatterDeprecationWarning (services/pipeline_hooks.py)

Patter · libraries/python/getpatter/services/pipeline_hooks.py · python · MIT
voice, Voice / Speech

Executor for pipeline hooks with fail-open semantics and deprecation warnings for legacy hooks.

# Source: https://github.com/PatterAI/Patter | License: MIT | Copyright 2026 Patter Contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""
Pipeline hook executor for pipeline mode.

Runs user-defined hooks at each stage of the STT → LLM → TTS pipeline.
Fail-open: if a hook throws, the error is logged and the original value
passes through unchanged.

The ``after_llm`` hook accepts two shapes for backward compatibility:

* **Legacy callable** ``(text, ctx) → str | None`` — runs once at end of LLM
  stream, blocks streaming TTS. Mapped internally to the ``on_response`` slot
  of the new 3-tier API. Emits a one-shot deprecation warning on first use.
* **New 3-tier object** with optional ``on_chunk`` (sync, ~0 ms),
  ``on_sentence`` (async, ~50–300 ms, between chunker 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key