Skip to content

make deepgram / gateway the defaults in readme and examples - #1013

Merged
bcherry merged 5 commits into
mainfrom
bcherry/dg-default
Feb 5, 2026
Merged

make deepgram / gateway the defaults in readme and examples#1013
bcherry merged 5 commits into
mainfrom
bcherry/dg-default

Conversation

@bcherry

@bcherry bcherry commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

aligned with changes in docs and python sdk

Summary by CodeRabbit

  • Refactor

    • Examples and docs now use a unified inference API for STT, TTS, and LLMs, replacing plugin-specific setups.
    • Session initialization now constructs typed inference model instances instead of string identifiers.
    • Examples initialize structured logging at startup for clearer runtime diagnostics.
  • Chores

    • Updated examples and README to include explicit model and voice selections and consistent initialization patterns.

@bcherry
bcherry requested review from a team and tmshapland February 2, 2026 23:53
@changeset-bot

changeset-bot Bot commented Feb 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3cadae3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bcherry bcherry changed the title Bcherry/dg default make deepgram / gateway the defaults in readme and examples Feb 2, 2026
@coderabbitai

coderabbitai Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR updates examples and README to replace string-based STT/LLM/TTS configs with instantiated inference objects from @livekit/agents, adds initializeLogger({ pretty: true }) in some entries, and standardizes model and voice identifiers; control flow and public APIs remain unchanged.

Changes

Cohort / File(s) Summary
Documentation
README.md
Replaced string-based STT/LLM/TTS examples with instantiated inference objects and explicit model/voice parameters.
Core examples
examples/src/basic_agent.ts, examples/src/basic_tool_call_agent.ts, examples/src/custom_text_handler.ts, examples/src/manual_shutdown.ts, examples/src/raw_function_description.ts
Replaced string identifiers for STT/LLM/TTS with new inference.STT(...), new inference.LLM(...), new inference.TTS(...); added inference import and adjusted constructor argument shapes.
Realtime / avatar examples
examples/src/anam_realtime_agent.ts, examples/src/hedra/hedra_avatar.ts, examples/src/lemonslice_realtime_avatar.ts
Switched to inference constructors, added explicit TTS voice ID(s), and invoked initializeLogger({ pretty: true }) where applicable.
Interaction / UX examples
examples/src/push_to_talk.ts, examples/src/background_audio.ts, examples/src/idle_user_timeout_example.ts, examples/src/multi_agent.ts, examples/src/idle_user_timeout_example.ts
Unified STT/LLM/TTS initialization to use inference.* objects (models and voice IDs specified); removed plugin-specific imports (deepgram, elevenlabs, openai, assemblyai).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • toubatbrian

Poem

🐰 I swapped the strings for shiny toys,
Models and voices hum with new noise,
Deepgram hops, Cartesia finds a tune,
Examples wake and chatter by noon,
A happy hop — code blooming soon.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and does not follow the required template structure with Description, Changes Made, Pre-Review Checklist, Testing, or Additional Notes sections. Expand the description to follow the template: add a detailed Description section, itemize all Changes Made, complete the Pre-Review Checklist, document Testing performed, and add any Additional Notes for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'make deepgram / gateway the defaults in readme and examples' accurately reflects the main objective of the PR, which updates default configurations across documentation and example files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bcherry/dg-default

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bbca59 and 3cadae3.

📒 Files selected for processing (1)
  • examples/src/idle_user_timeout_example.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/src/idle_user_timeout_example.ts

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@toubatbrian toubatbrian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG! Can you fix the linting error?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
examples/src/basic_agent.ts (1)

42-55: ⚠️ Potential issue | 🟡 Minor

Initialize the logger before LLM usage.

This example uses inference.LLM but doesn't initialize the logger.

💡 Suggested fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   inference,
+  initializeLogger,
   llm,
   metrics,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
 import * as silero from '@livekit/agents-plugin-silero';
 import { BackgroundVoiceCancellation } from '@livekit/noise-cancellation-node';
 import { fileURLToPath } from 'node:url';
 import { z } from 'zod';
 
+initializeLogger({ pretty: true });

Per coding guidelines: **/*.{ts,tsx}?(test|example): Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'.

examples/src/manual_shutdown.ts (1)

4-13: ⚠️ Potential issue | 🟡 Minor

Initialize the logger before any LLM usage.

This example uses LLM tools (lines 29, 38) and inference.LLM (line 64), but doesn't initialize the logger. Add initializeLogger({ pretty: true }) at the start of the entry function before creating the Agent.

Proposed fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
+  initializeLogger,
   llm,
   inference,
   voice,
 } from '@livekit/agents';
@@
   entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const agent = new voice.Agent({
examples/src/multi_agent.ts (1)

4-13: ⚠️ Potential issue | 🟡 Minor

Initialize the logger before any LLM usage.

This example uses inference.LLM (line 82) and other inference components but doesn't initialize the logger. Add initializeLogger({ pretty: true }) at the beginning of the entry function.

✅ Proposed fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
+  initializeLogger,
   llm,
   inference,
   voice,
 } from '@livekit/agents';
@@
   entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const userdata: StoryData = {};
examples/src/basic_tool_call_agent.ts (1)

4-13: ⚠️ Potential issue | 🟡 Minor

Initialize the logger before any LLM usage.

This example uses LLM tools and inference.LLM, but doesn't initialize the logger. Add initializeLogger({ pretty: true }) at the start of the entry function.

Proposed fix
 import {
   type JobContext,
   type JobProcess,
   ServerOptions,
   cli,
   defineAgent,
+  initializeLogger,
   llm,
   inference,
   voice,
 } from '@livekit/agents';
@@ -43,6 +44,7 @@
   },
   entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const getWeather = llm.tool({
examples/src/custom_text_handler.ts (1)

4-12: ⚠️ Potential issue | 🟡 Minor

Initialize the logger before LLM usage.

This example uses inference.LLM but doesn't initialize the logger. Add initializeLogger({ pretty: true }) to the entry function before the LLM is instantiated.

✅ Proposed fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
+  initializeLogger,
   inference,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
@@ entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const agent = new voice.Agent({
examples/src/idle_user_timeout_example.ts (1)

9-20: ⚠️ Potential issue | 🟡 Minor

Add logger initialization before LLM usage.

This example uses log() and inference.LLM without initializing the logger. Add initializeLogger({ pretty: true }) at the start of the entry function.

✅ Proposed fix
 import {
   type JobContext,
   type JobProcess,
   Task,
   WorkerOptions,
   cli,
   defineAgent,
   delay,
+  initializeLogger,
   inference,
   log,
   voice,
 } from '@livekit/agents';
@@
   entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const logger = log();
🤖 Fix all issues with AI agents
In `@examples/src/anam_realtime_agent.ts`:
- Around line 30-34: The example initializes STT/TTS/RealtimeModel without
setting up the SDK logger first; add logger initialization at the top
(import/init area) and call the logger init before any LLM usage such as
voice.AgentSession, inference.STT, inference.TTS or RealtimeModel so logs are
available during model setup and calls; locate the import block and the code
that constructs AgentSession/RealtimeModel and insert the logger initialization
there (ensure it runs before new inference.STT, new inference.TTS, or new
voice.AgentSession).

In `@examples/src/background_audio.ts`:
- Around line 46-49: The example initializes and uses LLM functionality
(llm.tool and new voice.AgentSession) but never calls initializeLogger; add a
call to initializeLogger early in the file (before any llm usage or constructing
AgentSession) so the logger is set up for LLM operations, e.g., invoke
initializeLogger() near the top of examples/src/background_audio.ts before calls
to llm.tool and before creating new voice.AgentSession to ensure logging is
configured.

In `@examples/src/hedra/hedra_avatar.ts`:
- Around line 33-44: Call initializeLogger({ pretty: true }) from
'@livekit/agents' before any LLM usage—specifically before constructing
voice.AgentSession and creating inference.LLM—to satisfy the logging guideline;
add the initializeLogger call at the top of the example (prior to the new
voice.AgentSession(...) block) so logging is configured before inference.LLM is
instantiated.

In `@examples/src/push_to_talk.ts`:
- Around line 31-36: The example initializes an inference.LLM without first
initializing the logger; import initializeLogger and call initializeLogger({
pretty: true }) before creating the voice.AgentSession (where AgentSession and
inference.LLM are used) so the inference logging is configured; update the
top-level imports to include initializeLogger and invoke it prior to
constructing the session/AgentSession instance.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efa8a4b and 874858d.

📒 Files selected for processing (14)
  • README.md
  • examples/src/anam_realtime_agent.ts
  • examples/src/background_audio.ts
  • examples/src/basic_agent.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/cartesia_tts.ts
  • examples/src/custom_text_handler.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/manual_shutdown.ts
  • examples/src/multi_agent.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

Add SPDX-FileCopyrightText and SPDX-License-Identifier headers to all newly added files with '// SPDX-FileCopyrightText: 2025 LiveKit, Inc.' and '// SPDX-License-Identifier: Apache-2.0'

Files:

  • examples/src/basic_agent.ts
  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/multi_agent.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/background_audio.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
  • examples/src/manual_shutdown.ts
  • examples/src/anam_realtime_agent.ts
**/*.{ts,tsx}?(test|example|spec)

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

When testing inference LLM, always use full model names from agents/src/inference/models.ts (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')

Files:

  • examples/src/basic_agent.ts
  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/multi_agent.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/background_audio.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
  • examples/src/manual_shutdown.ts
  • examples/src/anam_realtime_agent.ts
**/*.{ts,tsx}?(test|example)

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'

Files:

  • examples/src/basic_agent.ts
  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/multi_agent.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/background_audio.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
  • examples/src/manual_shutdown.ts
  • examples/src/anam_realtime_agent.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example|spec) : When testing inference LLM, always use full model names from `agents/src/inference/models.ts` (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to examples/src/test_*.ts : For plugin component debugging (STT, TTS, LLM), create test example files prefixed with `test_` under the examples directory and run with `pnpm build && node ./examples/src/test_my_plugin.ts`
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example|spec) : When testing inference LLM, always use full model names from `agents/src/inference/models.ts` (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')

Applied to files:

  • README.md
  • examples/src/basic_agent.ts
  • examples/src/multi_agent.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
  • examples/src/manual_shutdown.ts
  • examples/src/anam_realtime_agent.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to examples/src/test_*.ts : For plugin component debugging (STT, TTS, LLM), create test example files prefixed with `test_` under the examples directory and run with `pnpm build && node ./examples/src/test_my_plugin.ts`

Applied to files:

  • examples/src/multi_agent.ts
  • examples/src/idle_user_timeout_example.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example) : Initialize logger before using any LLM functionality with `initializeLogger({ pretty: true })` from 'livekit/agents'

Applied to files:

  • examples/src/basic_tool_call_agent.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/custom_text_handler.ts
  • examples/src/manual_shutdown.ts
🧬 Code graph analysis (7)
examples/src/basic_agent.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/basic_tool_call_agent.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/custom_text_handler.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/push_to_talk.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/raw_function_description.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/manual_shutdown.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/anam_realtime_agent.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
🔇 Additional comments (9)
README.md (1)

145-153: Docs update looks good.

The examples now use explicit inference constructors and full model identifiers consistently.

Also applies to: 248-252

examples/src/lemonslice_realtime_avatar.ts (1)

31-35: LGTM for the STT model update.

No issues spotted with the new model configuration.

examples/src/basic_tool_call_agent.ts (1)

138-143: LGTM — inference-based session wiring looks consistent.

examples/src/manual_shutdown.ts (1)

62-66: LGTM — inference models are wired correctly here.

examples/src/multi_agent.ts (1)

78-83: LGTM — inference session config looks consistent.

examples/src/custom_text_handler.ts (1)

53-58: LGTM — inference model instances are set up cleanly.

examples/src/idle_user_timeout_example.ts (1)

32-36: LGTM — inference session wiring looks good.

examples/src/raw_function_description.ts (2)

57-65: LGTM — inference-based STT/TTS/LLM setup is clear.


4-13: Initialize the logger before any LLM usage.

This example uses inference.LLM (line 64), but doesn't initialize the logger. Add initializeLogger({ pretty: true }) from '@livekit/agents' at the start of the entry function.

Proposed fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
+  initializeLogger,
   inference,
   llm,
   voice,
 } from '@livekit/agents';
   entry: async (ctx: JobContext) => {
+    initializeLogger({ pretty: true });
     const vad = ctx.proc.userData.vad! as silero.VAD;

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread examples/src/anam_realtime_agent.ts
Comment thread examples/src/background_audio.ts
Comment thread examples/src/hedra/hedra_avatar.ts
Comment thread examples/src/push_to_talk.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

110-160: ⚠️ Potential issue | 🟠 Major

Missing livekit import for turnDetector.

Line 157 uses livekit.turnDetector.MultilingualModel() but the import block doesn't include livekit. Users copy-pasting this example will encounter a runtime error.

🐛 Proposed fix to add missing import
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   llm,
   voice,
   inference,
 } from '@livekit/agents';
 import * as silero from '@livekit/agents-plugin-silero';
+import * as livekit from '@livekit/agents-plugin-livekit';
 import { fileURLToPath } from 'node:url';
🤖 Fix all issues with AI agents
In `@examples/src/idle_user_timeout_example.ts`:
- Around line 17-20: The example fails to initialize the logger before using
LLM-related modules; add a call to initializeLogger({ pretty: true }) from
'@livekit/agents' at the top of the module before any use of inference, log, or
voice so the logger is configured first; locate the import group that includes
inference/log/voice and insert initializeLogger({ pretty: true }) immediately
after imports (or at module entry) so functions like inference.* run with a
configured logger.
🧹 Nitpick comments (4)
examples/src/multi_agent.ts (1)

4-13: Initialize the logger before LLM usage.

This example uses inference.LLM but doesn't initialize the logger. Add initializeLogger to the imports and call it before the agent definition for consistent logging behavior.

💡 Suggested fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   inference,
+  initializeLogger,
   llm,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
 import * as silero from '@livekit/agents-plugin-silero';
 import { fileURLToPath } from 'node:url';
 import { z } from 'zod';
+
+initializeLogger({ pretty: true });

As per coding guidelines: "Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'"

examples/src/basic_agent.ts (1)

4-14: Initialize the logger before LLM usage.

This basic example uses inference.LLM but doesn't initialize the logger. As this is likely the first example new users will try, proper logging setup would improve the developer experience.

💡 Suggested fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   inference,
+  initializeLogger,
   llm,
   metrics,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
 import * as silero from '@livekit/agents-plugin-silero';
 import { BackgroundVoiceCancellation } from '@livekit/noise-cancellation-node';
 import { fileURLToPath } from 'node:url';
 import { z } from 'zod';
+
+initializeLogger({ pretty: true });

As per coding guidelines: "Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'"

examples/src/custom_text_handler.ts (1)

4-12: Initialize the logger before LLM usage.

This example uses inference.LLM but doesn't initialize the logger. Add initializeLogger for consistent behavior with other examples in this PR.

💡 Suggested fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   inference,
+  initializeLogger,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
 import * as silero from '@livekit/agents-plugin-silero';
 import { BackgroundVoiceCancellation } from '@livekit/noise-cancellation-node';
 import { fileURLToPath } from 'node:url';
+
+initializeLogger({ pretty: true });

As per coding guidelines: "Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'"

examples/src/raw_function_description.ts (1)

4-13: Initialize the logger before LLM usage.

This example uses inference.LLM but doesn't initialize the logger.

💡 Suggested fix
 import {
   type JobContext,
   type JobProcess,
   WorkerOptions,
   cli,
   defineAgent,
   inference,
+  initializeLogger,
   llm,
   voice,
 } from '@livekit/agents';
 import * as livekit from '@livekit/agents-plugin-livekit';
 import * as silero from '@livekit/agents-plugin-silero';
 import { fileURLToPath } from 'node:url';
+
+initializeLogger({ pretty: true });

As per coding guidelines: "Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'"

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 874858d and 5bbca59.

📒 Files selected for processing (13)
  • README.md
  • examples/src/anam_realtime_agent.ts
  • examples/src/background_audio.ts
  • examples/src/basic_agent.ts
  • examples/src/basic_tool_call_agent.ts
  • examples/src/custom_text_handler.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/idle_user_timeout_example.ts
  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/manual_shutdown.ts
  • examples/src/multi_agent.ts
  • examples/src/push_to_talk.ts
  • examples/src/raw_function_description.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/src/basic_tool_call_agent.ts
  • examples/src/background_audio.ts
  • examples/src/hedra/hedra_avatar.ts
  • examples/src/manual_shutdown.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

Add SPDX-FileCopyrightText and SPDX-License-Identifier headers to all newly added files with '// SPDX-FileCopyrightText: 2025 LiveKit, Inc.' and '// SPDX-License-Identifier: Apache-2.0'

Files:

  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/raw_function_description.ts
  • examples/src/basic_agent.ts
  • examples/src/multi_agent.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
  • examples/src/idle_user_timeout_example.ts
**/*.{ts,tsx}?(test|example|spec)

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

When testing inference LLM, always use full model names from agents/src/inference/models.ts (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')

Files:

  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/raw_function_description.ts
  • examples/src/basic_agent.ts
  • examples/src/multi_agent.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
  • examples/src/idle_user_timeout_example.ts
**/*.{ts,tsx}?(test|example)

📄 CodeRabbit inference engine (.cursor/rules/agent-core.mdc)

Initialize logger before using any LLM functionality with initializeLogger({ pretty: true }) from '@livekit/agents'

Files:

  • examples/src/lemonslice_realtime_avatar.ts
  • examples/src/raw_function_description.ts
  • examples/src/basic_agent.ts
  • examples/src/multi_agent.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
  • examples/src/idle_user_timeout_example.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example|spec) : When testing inference LLM, always use full model names from `agents/src/inference/models.ts` (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example) : Initialize logger before using any LLM functionality with `initializeLogger({ pretty: true })` from 'livekit/agents'
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example|spec) : When testing inference LLM, always use full model names from `agents/src/inference/models.ts` (e.g., 'openai/gpt-4o-mini' instead of 'gpt-4o-mini')

Applied to files:

  • examples/src/raw_function_description.ts
  • examples/src/basic_agent.ts
  • examples/src/multi_agent.ts
  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
  • examples/src/idle_user_timeout_example.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to examples/src/test_*.ts : For plugin component debugging (STT, TTS, LLM), create test example files prefixed with `test_` under the examples directory and run with `pnpm build && node ./examples/src/test_my_plugin.ts`

Applied to files:

  • examples/src/multi_agent.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/*.{ts,tsx}?(test|example) : Initialize logger before using any LLM functionality with `initializeLogger({ pretty: true })` from 'livekit/agents'

Applied to files:

  • examples/src/custom_text_handler.ts
  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Use `pnpm build && pnpm dlx tsx ./examples/src/my_agent.ts dev|download-files --log-level=debug|info(default)` to run example agents from the examples directory

Applied to files:

  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
📚 Learning: 2026-01-16T14:33:39.551Z
Learnt from: CR
Repo: livekit/agents-js PR: 0
File: .cursor/rules/agent-core.mdc:0-0
Timestamp: 2026-01-16T14:33:39.551Z
Learning: Applies to **/{examples,test}/**/*.test.ts : Include both basic streaming and tool calling tests to verify full LLM functionality

Applied to files:

  • examples/src/push_to_talk.ts
  • examples/src/anam_realtime_agent.ts
🧬 Code graph analysis (5)
examples/src/raw_function_description.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/basic_agent.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/multi_agent.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/custom_text_handler.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
examples/src/idle_user_timeout_example.ts (1)
agents/src/index.ts (1)
  • inference (40-40)
🔇 Additional comments (10)
examples/src/lemonslice_realtime_avatar.ts (1)

32-34: LGTM!

The STT model update to deepgram/nova-3 aligns with the PR objective to standardize on Deepgram. Logger is properly initialized and full model names are used throughout.

examples/src/multi_agent.ts (1)

80-85: LGTM on the inference-based model instantiation.

The migration to inference.STT, inference.TTS, and inference.LLM with full model names (deepgram/nova-3, cartesia/sonic-3, openai/gpt-4.1-mini) is correctly implemented.

examples/src/push_to_talk.ts (1)

32-41: LGTM!

Logger initialization and inference-based model instantiation are correctly implemented. Full model names are used throughout.

examples/src/basic_agent.ts (1)

46-57: LGTM on the inference-based model instantiation.

The migration to inference-based STT/LLM/TTS with full model names is correctly implemented. The inline comments pointing to documentation are helpful for users.

examples/src/custom_text_handler.ts (1)

55-60: LGTM on the inference-based model instantiation.

The migration to inference-based STT/LLM/TTS with full model names is correctly implemented.

examples/src/raw_function_description.ts (1)

59-67: LGTM on the inference-based model instantiation.

The migration to inference-based STT/TTS/LLM with full model names is correctly implemented.

examples/src/anam_realtime_agent.ts (1)

27-39: LGTM!

Logger initialization and inference-based STT/TTS instantiation are correctly implemented. The configuration works well alongside the OpenAI Realtime model for the LLM.

examples/src/idle_user_timeout_example.ts (1)

34-39: LGTM!

The migration to inference-based components looks correct. Model names follow the full naming convention (e.g., 'openai/gpt-4.1-mini', 'deepgram/nova-3', 'cartesia/sonic-3') as required by the coding guidelines.

README.md (2)

147-153: LGTM!

The updated inference-based components with full model names ('deepgram/nova-3', 'openai/gpt-4.1-mini', 'cartesia/sonic-3') align well with the PR objective to make Deepgram/gateway the defaults.


250-252: LGTM!

The multi-agent example is consistently updated to use inference-based components with full model names.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread examples/src/idle_user_timeout_example.ts
@toubatbrian

Copy link
Copy Markdown
Contributor

Hey @bcherry, feel free to merge it whenever you feel ready on this PR

@bcherry
bcherry merged commit 4fc1082 into main Feb 5, 2026
8 checks passed
@bcherry
bcherry deleted the bcherry/dg-default branch February 5, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants