Released livekit-agents@1.5.3 and livekit-agents@1.5.4

1.5.4

New features

Preemptive generation: added more granular options

Refines default behavior for preemptive generation to better handle long or intermittent user speech, reducing unnecessary downstream inference and associated cost increases.

Also introduces PreemptiveGenerationOptions for developers who need fine-grained control over this behavior.

https://github.com/livekit/agents/blob/78a66bcf79c5cea82989401c408f1dff4b961a5b/livekit-agents/livekit/agents/voice/turn.py#L115

class PreemptiveGenerationOptions(TypedDict, total=False):
    """Configuration for preemptive generation."""

    enabled: bool
    """Whether preemptive generation is enabled. Defaults to ``True``."""

    preemptive_tts: bool
    """Whether to also run TTS preemptively before the turn is confirmed.
    When ``False`` (default), only LLM runs preemptively; TTS starts once the
    turn is confirmed and the speech is scheduled."""

    max_speech_duration: float
    """Maximum user speech duration (s) for which preemptive generation
    is attempted. Beyond this threshold, preemptive generation is skipped
    since long utterances are more likely to change and users may expect
    slower responses. Defaults to ``10.0``."""

    max_retries: int
    """Maximum number of preemptive generation attempts per user turn.
    The counter resets when the turn completes. Defaults to ``3``."""

What’s Changed

  • fix(voice): add PreemptiveGenerationOptions for fine-grained control by @longcw in #5428

Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.3…livekit-agents@1.5.4

1.5.3

livekit-agents 1.5 introduced many new features. You can check out the changelog here.

What’s Changed

  • feat(amd): add OTEL span and tag for AMD by @chenghao-mou in #5376

  • fix(openai): prepend session instructions in realtime generate_reply by @longcw in #5394

  • fix: AgentTask deadlock when on_enter awaits generate_reply that triggers another AgentTask by @longcw in #5377

  • telemetry: emit OTel span events for developer-role messages by @joaquinhuigomez in #5403

  • feat(realtime): reuse realtime session across agent handoffs if supported by @longcw in #5229

  • fix(llm): handle double-encoded JSON tool arguments from providers by @prettyprettyprettygood in #5409

  • chore: exposed the max session duration in with_azure() function by @k-1208 in #5383

  • (gemini live 3.1): fix tool responses by @tinalenguyen in #5413

  • fix(google): capture usage_metadata before early continues in streaming by @Panmax in #5404

  • fix(voice): block new user turns immediately on update_agent() to prevent transition delay by @Panmax in #5396

  • fix(tests): update drive thru instructions by @chenghao-mou in #5405

  • feat(inference): handle preflight_transcript in inference STT plugin by @adrian-cowham in #5412

  • fix(aws): unwrap doubly-encoded JSON tool arguments from Nova Sonic by @rililinx in #5411

  • chore: pin GHA by commit by @davidzhao in #5415

  • chore(deps): update dependency langchain-core to v1.2.28 [security] by @renovate[bot] in #5417

  • chore(deps): update dependency aiohttp to v3.13.4 [security] by @renovate[bot] in #5416

  • chore(deps): update dependency nltk to v3.9.4 [security] by @renovate[bot] in #5418

  • (azure openai): ensure gpt-realtime-1.5 compatibility by @tinalenguyen in #5407

  • chore(deps): update github workflows (major) by @renovate[bot] in #5424

  • update: Sarvam STT - add verbose error loggin and remove retry connection by @dhruvladia-sarvam in #5373

  • fix(inworld): do not leak connections when when cancelled by @davidzhao in #5427

  • feat: add service_tier parameter to Responses API LLM by @piyush-gambhir in #5346

  • Feature/krisp viva sdk support by @realgarik in #4370

  • fix: empty transcript blocks commit_user_turn until timeout by @longcw in #5429

  • fix: allow multiple AsyncToolsets by deduplicating management tools by @longcw in #5369

  • feat(beta/workflows): add InstructionParts for modular instruction customization by @longcw in #5077

  • add ToolSearchToolset and ToolProxyToolset for dynamic tool discovery by @longcw in #5140

  • Feature - Configurable session close transcript timeout by @bml1g12 in #5328

  • Fix FrameProcessor lifecycle for selector based noise cancellation by @Topherhindman in #5433

  • feat: add Runway Characters avatar plugin by @robinandeer in #5355

  • Rename e2ee to encryption in JobContext.connect by @longcw in #5454

  • chore: reduce renovate noise by @davidzhao in #5421

  • fix(liveavatar): wait for connected state and chunk audio before sending by @dyi1 in #5453

  • (phonic): support realtimemodel say() by @tinalenguyen in #5293

  • feat: add Cerebras LLM plugin by @u9g in #5456

  • (google tts): add “gemini-3.1-flash-tts-preview” model by @tinalenguyen in #5459

  • (hedra) remove from examples and raise exception by @tinalenguyen in #5460

  • xai stt by @tinalenguyen in #5458

  • feat(openai): expose max_output_tokens on Responses API LLM by @piyush-gambhir in #5449

  • (xai stt): pass diarization capability + minor fix by @tinalenguyen in #5461

  • Adding xAI Grok llm support for inference by @russellmartin-livekit in #5201

  • (release workflow): allow spacing in dependency by @tinalenguyen in #5463

  • livekit-agents@1.5.3 by @github-actions[bot] in #5464

New Contributors

Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.2…livekit-agents@1.5.3