Cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user