forked from livekit-examples/agent-starter-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
58 lines (54 loc) · 1.68 KB
/
taskfile.yaml
File metadata and controls
58 lines (54 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
version: "3"
output: interleaved
dotenv: [".env.local"]
vars:
INDENT: 4
REL_PATH: "{{ relPath .USER_WORKING_DIR .ROOT_DIR }}"
VENV_DIR: ".venv"
PYTHON_MAIN: '{{ joinPath "./src" "agent.py" }}'
tasks:
post_create:
desc: "Runs after this template is instantiated as a Sandbox or Bootstrap"
cmds:
- echo 'To try the new agent directly in your terminal:'
- echo ''
- echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}'
- echo '{{ indent .INDENT "uv sync" }}'
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} download-files'
- echo '{{ indent .INDENT "uv run" }} {{ .PYTHON_MAIN }} console'
- echo ''
- echo 'To deploy your agent to LiveKit cloud:'
- echo ''
- echo '{{ indent .INDENT "lk agent create" }}'
- echo ''
- task: set_agent_name_if_present
- task: help_open_sandbox_if_present
set_agent_name_if_present:
status:
- test -z "$LIVEKIT_AGENT_NAME"
cmds:
- |
old="WorkerOptions("
new="WorkerOptions(agent_name=\"{{ .LIVEKIT_AGENT_NAME }}\", "
file="{{ .PYTHON_MAIN }}"
tmp="$(mktemp)"
while IFS= read -r line; do
printf '%s\n' "${line//$old/$new}" >> "$tmp"
done < "$file"
mv "$tmp" "$file"
help_open_sandbox_if_present:
status:
- test -z "$LIVEKIT_SANDBOX_ID"
cmds:
- echo 'To chat with your running agent, visit:'
- echo ''
- echo '{{ indent .INDENT "https://" }}{{ .LIVEKIT_SANDBOX_ID }}.sandbox.livekit.io'
- echo ''
install:
desc: "Bootstrap application for local development"
cmds:
- "uv sync"
dev:
interactive: true
cmds:
- "uv run src/agent.py dev"