Component evidence

ChatClient (llm/base.py)

OpenRath · src/rath/llm/base.py · python · BSD-3-Clause
ai

Runtime-checkable Protocol interfaces defining the contract for LLM chat clients and streaming adapters.

Source preview first 800 characters · full source over MCP
# Source: https://github.com/Rath-Team/OpenRath | License: BSD-3-Clause | Copyright 2026, Rath Team
# Provided via justclaw.it.com; keep this notice with the code.
"""Chat-client Protocols consumed by the session loop.

Two runtime-checkable Protocols define the contract every LLM adapter must
satisfy:

* :class:`ChatClient` — the minimum surface (``provider`` + blocking
  ``complete``). Sufficient for :class:`~rath.session.loop.run_session_loop`.
* :class:`StreamingChatClient` — extends :class:`ChatClient` with
  ``complete_stream``. :func:`~rath.session.loop.run_session_loop` switches to
  streaming when ``on_event`` is supplied and guards on this Protocol instead
  of inspecting :attr:`~rath.llm.Provider.provider_kind`, so any adapter that
  implements ``complete_stream`` gains streamin

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