diff --git a/README.md b/README.md index a25703d..4b22e55 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,13 @@ lk app env -w .env ## Run the agent -Run this command to speak to your agent directly in your terminal: +Before your first run, you must download certain models such as [Silero VAD](https://docs.livekit.io/agents/build/turns/vad/) and the [LiveKit turn detector](https://docs.livekit.io/agents/build/turns/turn-detector/): + +```console +uv run python src/agent.py download-files +``` + +Next, run this command to speak to your agent directly in your terminal: ```console uv run python src/agent.py console diff --git a/pyproject.toml b/pyproject.toml index c62d6e0..c75ae0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,27 +21,6 @@ dev = [ "ruff", ] -# TODO: Remove these once agents 1.2 is released -# If you run into git lfs smudge issues when doing `uv sync`, do this: -# ``` -# uv cache clean -# UV_GIT_LFS=1 uv sync -# ``` -[tool.uv.sources] -# livekit-agents = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-agents" } -# livekit-plugins-openai = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-plugins/livekit-plugins-openai" } -# livekit-plugins-turn-detector = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-plugins/livekit-plugins-turn-detector" } -# livekit-plugins-silero = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-plugins/livekit-plugins-silero" } -# livekit-plugins-cartesia = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-plugins/livekit-plugins-cartesia" } -# livekit-plugins-deepgram = { git = "https://github.com/livekit/agents.git", branch = "theo/agents1.2", subdirectory = "livekit-plugins/livekit-plugins-deepgram" } -livekit-agents = { path = "../../livekit/agents/livekit-agents" } -livekit-plugins-openai = { path = "../../livekit/agents/livekit-plugins/livekit-plugins-openai" } -livekit-plugins-turn-detector = { path = "../../livekit/agents/livekit-plugins/livekit-plugins-turn-detector" } -livekit-plugins-silero = { path = "../../livekit/agents/livekit-plugins/livekit-plugins-silero" } -livekit-plugins-cartesia = { path = "../../livekit/agents/livekit-plugins/livekit-plugins-cartesia" } -livekit-plugins-deepgram = { path = "../../livekit/agents/livekit-plugins/livekit-plugins-deepgram" } - - [tool.setuptools.packages.find] where = ["src"] diff --git a/src/agent.py b/src/agent.py index 45a2826..7cc0140 100644 --- a/src/agent.py +++ b/src/agent.py @@ -13,7 +13,6 @@ from livekit.agents import ( WorkerOptions, cli, metrics, - workflows, ) from livekit.agents.llm import function_tool from livekit.agents.voice import MetricsCollectedEvent @@ -50,22 +49,6 @@ class Assistant(Agent): return "sunny with a temperature of 70 degrees." - @function_tool - async def send_email(self, context: RunContext, subject: str, body: str): - """Use this tool to send an email on behalf of the user. - - Args: - subject: The subject of the email - body: The body of the email - """ - - email_result = await workflows.GetEmailAgent(chat_ctx=self.chat_ctx) - send_to_email_address = email_result.email_address - - await asyncio.sleep(1) # simulate sending the email - return "Email sent to " + send_to_email_address - - def prewarm(proc: JobProcess): proc.userdata["vad"] = silero.VAD.load()