TranscriptMessage (voice.py)

dialIQ · voice-provider, voice, vapi-integration, transcript-handling

Voice layer: the VoiceProvider Protocol, shared IO models, and all three run-mode providers (mock, replay, live Vapi). mock/replay read canned transcripts from samples/transcripts/ and return the report synchronously; live Vapi returns immediately and the report arrives later via

"""Voice layer: the VoiceProvider Protocol, shared IO models, and all three
run-mode providers (mock, replay, live Vapi).

mock/replay read canned transcripts from samples/transcripts/ and return the
report synchronously; live Vapi returns immediately and the report arrives
later via POST /vapi/webhook.
"""

from __future__ import annotations

import json
import time
from datetime import datetime
from pathlib import Path
from typing import Any, Protocol, runtime_checkable

from pydantic import BaseModel, ConfigDict, Field

# samples/transcripts/ lives at the repo root; this module is dialiq/voice.py,
# so parents[1] is the repo root.
_FIXTURES = Path(__file__).resolve().parents[1] / "samples" / "transcripts"


class TranscriptMessage(BaseModel):
    """A single turn from a Vapi call transc

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

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

Get a free API key