-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Summary
In PR #713, WorkerOptions was renamed to ServerOptions as part of the Worker → AgentServer renaming. However, the examples still use the deprecated WorkerOptions alias.
This issue proposes updating all examples to use the new ServerOptions class name for consistency and to follow best practices.
Current State
The WorkerOptions is marked as deprecated in agents/src/worker.ts:
/**
* @deprecated Use {@link ServerOptions} instead. This alias is provided for backward compatibility.
*/
export const WorkerOptions = ServerOptions;However, all 21 example files still use WorkerOptions:
examples/src/anam_realtime_agent.tsexamples/src/background_audio.tsexamples/src/basic_agent.tsexamples/src/basic_eou.tsexamples/src/basic_tool_call_agent.tsexamples/src/bey_avatar.tsexamples/src/cartersia_tts.tsexamples/src/comprehensive_test.tsexamples/src/custom_text_handler.tsexamples/src/drive-thru/drivethru_agent.tsexamples/src/frontdesk/frontdesk_agent.tsexamples/src/gemini_realtime_agent.tsexamples/src/idle_user_timeout_example.tsexamples/src/multi_agent.tsexamples/src/play_local_audio_file.tsexamples/src/push_to_talk.tsexamples/src/raw_function_description.tsexamples/src/realtime_agent.tsexamples/src/realtime_turn_detector.tsexamples/src/restaurant_agent.tsexamples/src/tool_call_disfluency.ts
Proposed Changes
Update all example files to:
- Change import from
WorkerOptionstoServerOptions - Change instantiation from
new WorkerOptions(...)tonew ServerOptions(...)
Before:
import { WorkerOptions, cli, defineAgent } from '@livekit/agents';
cli.runApp(new WorkerOptions({ agent: fileURLToPath(import.meta.url) }));After:
import { ServerOptions, cli, defineAgent } from '@livekit/agents';
cli.runApp(new ServerOptions({ agent: fileURLToPath(import.meta.url) }));I'd like to contribute by fixing this issue. It seems straightforward - updating the imports and class names across the example files. May I take this on?
If someone is already working on this, feel free to close this issue.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested