Skip to content

Commit e397f1d

Browse files
committed
1.3 update
1 parent 3121b12 commit e397f1d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Clone the repository and install dependencies to a virtual environment:
5353

5454
```console
5555
cd agent-starter-python
56-
uv sync
56+
uv sync --prerelease=allow
5757
```
5858

5959
Sign up for [LiveKit Cloud](https://cloud.livekit.io/) then set up the environment by copying `.env.example` to `.env.local` and filling in the required keys:
@@ -139,4 +139,4 @@ You can also self-host LiveKit instead of using LiveKit Cloud. See the [self-hos
139139

140140
## License
141141

142-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
142+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "Simple voice AI assistant built with LiveKit Agents for Python"
99
requires-python = ">=3.9"
1010

1111
dependencies = [
12-
"livekit-agents[silero,turn-detector]~=1.2",
12+
"livekit-agents[silero,turn-detector]~=1.3.0rc1",
1313
"livekit-plugins-noise-cancellation~=0.2",
1414
"python-dotenv",
1515
]

src/agent.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from dotenv import load_dotenv
44
from livekit.agents import (
55
Agent,
6+
AgentServer,
67
AgentSession,
78
JobContext,
89
JobProcess,
@@ -48,11 +49,16 @@ def __init__(self) -> None:
4849
# return "sunny with a temperature of 70 degrees."
4950

5051

52+
server = AgentServer()
53+
54+
55+
@server.setup()
5156
def prewarm(proc: JobProcess):
5257
proc.userdata["vad"] = silero.VAD.load()
5358

5459

55-
async def entrypoint(ctx: JobContext):
60+
@server.rtc_session()
61+
async def my_agent(ctx: JobContext):
5662
# Logging setup
5763
# Add any other context you want in all log entries here
5864
ctx.log_context_fields = {
@@ -129,4 +135,4 @@ async def log_usage():
129135

130136

131137
if __name__ == "__main__":
132-
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))
138+
cli.run_app(server)

0 commit comments

Comments
 (0)