1.3 update
This commit is contained in:
@@ -53,7 +53,7 @@ Clone the repository and install dependencies to a virtual environment:
|
|||||||
|
|
||||||
```console
|
```console
|
||||||
cd agent-starter-python
|
cd agent-starter-python
|
||||||
uv sync
|
uv sync --prerelease=allow
|
||||||
```
|
```
|
||||||
|
|
||||||
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:
|
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
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ description = "Simple voice AI assistant built with LiveKit Agents for Python"
|
|||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"livekit-agents[silero,turn-detector]~=1.2",
|
"livekit-agents[silero,turn-detector]~=1.3.0rc1",
|
||||||
"livekit-plugins-noise-cancellation~=0.2",
|
"livekit-plugins-noise-cancellation~=0.2",
|
||||||
"python-dotenv",
|
"python-dotenv",
|
||||||
]
|
]
|
||||||
|
|||||||
+8
-2
@@ -3,6 +3,7 @@ import logging
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from livekit.agents import (
|
from livekit.agents import (
|
||||||
Agent,
|
Agent,
|
||||||
|
AgentServer,
|
||||||
AgentSession,
|
AgentSession,
|
||||||
JobContext,
|
JobContext,
|
||||||
JobProcess,
|
JobProcess,
|
||||||
@@ -48,11 +49,16 @@ class Assistant(Agent):
|
|||||||
# return "sunny with a temperature of 70 degrees."
|
# return "sunny with a temperature of 70 degrees."
|
||||||
|
|
||||||
|
|
||||||
|
server = AgentServer()
|
||||||
|
|
||||||
|
|
||||||
|
@server.setup()
|
||||||
def prewarm(proc: JobProcess):
|
def prewarm(proc: JobProcess):
|
||||||
proc.userdata["vad"] = silero.VAD.load()
|
proc.userdata["vad"] = silero.VAD.load()
|
||||||
|
|
||||||
|
|
||||||
async def entrypoint(ctx: JobContext):
|
@server.rtc_session()
|
||||||
|
async def my_agent(ctx: JobContext):
|
||||||
# Logging setup
|
# Logging setup
|
||||||
# Add any other context you want in all log entries here
|
# Add any other context you want in all log entries here
|
||||||
ctx.log_context_fields = {
|
ctx.log_context_fields = {
|
||||||
@@ -129,4 +135,4 @@ async def entrypoint(ctx: JobContext):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))
|
cli.run_app(server)
|
||||||
|
|||||||
Reference in New Issue
Block a user