create-spatius-app 0.1.1 → 0.1.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -8
- package/dist/cli.js +8264 -162
- package/dist/templates.js +8226 -128
- package/package.json +5 -5
- package/schemas/result-v3.schema.json +174 -0
- package/schemas/result-v4.schema.json +170 -0
- package/templates/cloudflare-livekit/AGENTS.md +4 -0
- package/templates/cloudflare-livekit/README.md +41 -0
- package/templates/cloudflare-livekit/agent/README.md +0 -4
- package/templates/cloudflare-livekit/agent/env.example +3 -0
- package/templates/cloudflare-livekit/agent/pyproject.toml +1 -1
- package/templates/cloudflare-livekit/agent/src/agent.py +5 -3
- package/templates/cloudflare-livekit/agent/uv.lock +7 -7
- package/templates/cloudflare-livekit/package-lock.json +70 -142
- package/templates/cloudflare-livekit/package.json +2 -2
- package/templates/cloudflare-livekit/pnpm-lock.yaml +197 -153
- package/templates/cloudflare-livekit/tests/dev-events.test.mjs +23 -0
- package/templates/cloudflare-livekit/tests/dev-fixtures.mjs +7 -3
- package/templates/cloudflare-livekit/tsconfig.web.json +1 -0
- package/templates/cloudflare-livekit/tsconfig.worker.json +1 -0
- package/templates/cloudflare-livekit/web/api.ts +12 -0
- package/templates/cloudflare-livekit/web/components/agents-ui/agent-chat-transcript.tsx +6 -90
- package/templates/cloudflare-livekit/web/components/transcript-view.tsx +90 -0
- package/templates/cloudflare-livekit/web/session-attempt.ts +23 -2
- package/templates/cloudflare-livekit/worker/capability.test.ts +31 -0
- package/templates/cloudflare-livekit/worker/capability.ts +72 -0
- package/templates/cloudflare-livekit/worker/index.test.ts +2 -2
- package/templates/cloudflare-livekit/worker/index.ts +15 -3
- package/templates/cloudflare-livekit/worker/session.ts +34 -0
- package/templates/layers/agora/AGENTS.md +8 -0
- package/templates/layers/agora/README.md +19 -0
- package/templates/layers/agora/env.example +9 -0
- package/templates/layers/agora/package-lock.json +6068 -0
- package/templates/layers/agora/package.json +54 -0
- package/templates/layers/agora/pnpm-lock.yaml +3816 -0
- package/templates/layers/agora/tsconfig.json +16 -0
- package/templates/layers/agora/vitest.config.ts +4 -0
- package/templates/layers/agora/web/App.tsx +174 -0
- package/templates/layers/agora/web/agora-session.test.ts +70 -0
- package/templates/layers/agora/web/agora-session.ts +267 -0
- package/templates/layers/agora/worker/agora.test.ts +60 -0
- package/templates/layers/agora/worker/agora.ts +165 -0
- package/templates/layers/agora/worker/index.ts +50 -0
- package/templates/layers/catalog/DEPLOYMENT.md +3 -0
- package/templates/layers/catalog/spatius.config.json +1 -0
- package/templates/layers/node/Dockerfile +12 -0
- package/templates/layers/node/dockerignore +10 -0
- package/templates/layers/node/package-lock.json +5569 -0
- package/templates/layers/node/pnpm-lock.yaml +3470 -0
- package/templates/layers/node/railway.json +8 -0
- package/templates/layers/node/scripts/dev-service.mjs +14 -0
- package/templates/layers/node/scripts/dev-web.mjs +22 -0
- package/templates/layers/node/server/index.ts +92 -0
- package/templates/layers/node/vite.config.ts +17 -0
- package/templates/layers/railway-agent/agent/railway.json +5 -0
- package/dist/cli.js.map +0 -1
- package/dist/templates.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-spatius-app",
|
|
3
|
-
"version": "0.1.1",
|
|
4
|
-
"description": "Create a Spatius app with
|
|
3
|
+
"version": "0.1.3-beta.1",
|
|
4
|
+
"description": "Create a Spatius voice-avatar app with LiveKit or Agora and your choice of hosting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-spatius-app": "./dist/cli.js"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=22"
|
|
36
36
|
},
|
|
37
|
-
"packageManager": "pnpm@
|
|
37
|
+
"packageManager": "pnpm@12.3.4",
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public",
|
|
40
40
|
"provenance": true
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@eslint/js": "^10.0.1",
|
|
61
61
|
"@types/node": "^26.4.1",
|
|
62
62
|
"@vercel/detect-agent": "1.2.5",
|
|
63
|
-
"@vitest/coverage-v8": "
|
|
63
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
64
64
|
"ajv": "8.20.0",
|
|
65
65
|
"commander": "^15.0.0",
|
|
66
66
|
"concurrently": "10.0.5",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"tsx": "^4.23.13",
|
|
74
74
|
"typescript": "^6.0.2",
|
|
75
75
|
"typescript-eslint": "^8.69.0",
|
|
76
|
-
"vitest": "^
|
|
76
|
+
"vitest": "^5.0.0",
|
|
77
77
|
"yaml": "2.9.0"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "create-spatius-app result v3",
|
|
4
|
+
"oneOf": [
|
|
5
|
+
{
|
|
6
|
+
"$ref": "#/$defs/success"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"$ref": "#/$defs/failure"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"$defs": {
|
|
13
|
+
"success": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": [
|
|
17
|
+
"schemaVersion",
|
|
18
|
+
"ok",
|
|
19
|
+
"command",
|
|
20
|
+
"dryRun",
|
|
21
|
+
"generatorVersion",
|
|
22
|
+
"projectDirectory",
|
|
23
|
+
"template",
|
|
24
|
+
"created",
|
|
25
|
+
"wouldCreate",
|
|
26
|
+
"actions",
|
|
27
|
+
"packageManagers",
|
|
28
|
+
"nextSteps",
|
|
29
|
+
"stack",
|
|
30
|
+
"humanSteps"
|
|
31
|
+
],
|
|
32
|
+
"properties": {
|
|
33
|
+
"schemaVersion": {
|
|
34
|
+
"const": 3
|
|
35
|
+
},
|
|
36
|
+
"ok": {
|
|
37
|
+
"const": true
|
|
38
|
+
},
|
|
39
|
+
"command": {
|
|
40
|
+
"const": "create"
|
|
41
|
+
},
|
|
42
|
+
"dryRun": {
|
|
43
|
+
"type": "boolean"
|
|
44
|
+
},
|
|
45
|
+
"generatorVersion": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"projectDirectory": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"template": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"created": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"wouldCreate": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"actions": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"required": ["dependenciesInstalled", "gitInitialized", "deployed"],
|
|
70
|
+
"properties": {
|
|
71
|
+
"dependenciesInstalled": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"gitInitialized": {
|
|
75
|
+
"const": false
|
|
76
|
+
},
|
|
77
|
+
"deployed": {
|
|
78
|
+
"const": false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"packageManagers": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": ["javascript"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"javascript": {
|
|
88
|
+
"enum": ["npm", "pnpm", "bun"]
|
|
89
|
+
},
|
|
90
|
+
"python": {
|
|
91
|
+
"enum": ["pip", "uv"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"nextSteps": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"stack": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"humanSteps": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"description": "Human prerequisites before running the app. Commands run from projectDirectory. On dry runs these are planned steps after creation, not actions already performed.",
|
|
107
|
+
"items": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"required": ["command", "reason", "requiresHuman", "requiresTty"],
|
|
111
|
+
"properties": {
|
|
112
|
+
"command": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
},
|
|
115
|
+
"reason": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
},
|
|
118
|
+
"requiresHuman": {
|
|
119
|
+
"const": true
|
|
120
|
+
},
|
|
121
|
+
"requiresTty": {
|
|
122
|
+
"const": true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"failure": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": ["schemaVersion", "ok", "error"],
|
|
133
|
+
"properties": {
|
|
134
|
+
"schemaVersion": {
|
|
135
|
+
"const": 3
|
|
136
|
+
},
|
|
137
|
+
"ok": {
|
|
138
|
+
"const": false
|
|
139
|
+
},
|
|
140
|
+
"error": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": ["code", "message"],
|
|
144
|
+
"properties": {
|
|
145
|
+
"code": {
|
|
146
|
+
"enum": [
|
|
147
|
+
"CANCELLED",
|
|
148
|
+
"FILESYSTEM_ERROR",
|
|
149
|
+
"INSTALL_FAILED",
|
|
150
|
+
"INVALID_ARGUMENT",
|
|
151
|
+
"PACKAGE_MANAGER_NOT_FOUND",
|
|
152
|
+
"PACKAGE_MANAGER_UNAVAILABLE",
|
|
153
|
+
"TARGET_NOT_DIRECTORY",
|
|
154
|
+
"TARGET_NOT_EMPTY",
|
|
155
|
+
"TEMPLATE_NOT_FOUND",
|
|
156
|
+
"UNSAFE_TARGET",
|
|
157
|
+
"UNKNOWN_ERROR"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"message": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"path": {
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"recovery": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "create-spatius-app result v4",
|
|
4
|
+
"oneOf": [
|
|
5
|
+
{
|
|
6
|
+
"$ref": "#/$defs/success"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"$ref": "#/$defs/failure"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"$defs": {
|
|
13
|
+
"success": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": [
|
|
17
|
+
"schemaVersion",
|
|
18
|
+
"ok",
|
|
19
|
+
"command",
|
|
20
|
+
"dryRun",
|
|
21
|
+
"generatorVersion",
|
|
22
|
+
"projectDirectory",
|
|
23
|
+
"created",
|
|
24
|
+
"wouldCreate",
|
|
25
|
+
"actions",
|
|
26
|
+
"packageManagers",
|
|
27
|
+
"nextSteps",
|
|
28
|
+
"stack",
|
|
29
|
+
"humanSteps"
|
|
30
|
+
],
|
|
31
|
+
"properties": {
|
|
32
|
+
"schemaVersion": {
|
|
33
|
+
"const": 4
|
|
34
|
+
},
|
|
35
|
+
"ok": {
|
|
36
|
+
"const": true
|
|
37
|
+
},
|
|
38
|
+
"command": {
|
|
39
|
+
"const": "create"
|
|
40
|
+
},
|
|
41
|
+
"dryRun": {
|
|
42
|
+
"type": "boolean"
|
|
43
|
+
},
|
|
44
|
+
"generatorVersion": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"projectDirectory": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"created": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"wouldCreate": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"actions": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["dependenciesInstalled", "gitInitialized", "deployed"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"dependenciesInstalled": {
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
70
|
+
"gitInitialized": {
|
|
71
|
+
"const": false
|
|
72
|
+
},
|
|
73
|
+
"deployed": {
|
|
74
|
+
"const": false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"packageManagers": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"required": ["javascript"],
|
|
82
|
+
"properties": {
|
|
83
|
+
"javascript": {
|
|
84
|
+
"enum": ["npm", "pnpm", "bun"]
|
|
85
|
+
},
|
|
86
|
+
"python": {
|
|
87
|
+
"enum": ["pip", "uv"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"nextSteps": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"stack": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"humanSteps": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"description": "Human prerequisites before running the app. Commands run from projectDirectory. On dry runs these are planned steps after creation, not actions already performed.",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": ["command", "reason", "requiresHuman", "requiresTty"],
|
|
107
|
+
"properties": {
|
|
108
|
+
"command": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
"reason": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"requiresHuman": {
|
|
115
|
+
"const": true
|
|
116
|
+
},
|
|
117
|
+
"requiresTty": {
|
|
118
|
+
"const": true
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"failure": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": ["schemaVersion", "ok", "error"],
|
|
129
|
+
"properties": {
|
|
130
|
+
"schemaVersion": {
|
|
131
|
+
"const": 4
|
|
132
|
+
},
|
|
133
|
+
"ok": {
|
|
134
|
+
"const": false
|
|
135
|
+
},
|
|
136
|
+
"error": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["code", "message"],
|
|
140
|
+
"properties": {
|
|
141
|
+
"code": {
|
|
142
|
+
"enum": [
|
|
143
|
+
"CANCELLED",
|
|
144
|
+
"FILESYSTEM_ERROR",
|
|
145
|
+
"INSTALL_FAILED",
|
|
146
|
+
"INVALID_ARGUMENT",
|
|
147
|
+
"PACKAGE_MANAGER_NOT_FOUND",
|
|
148
|
+
"PACKAGE_MANAGER_UNAVAILABLE",
|
|
149
|
+
"TARGET_NOT_DIRECTORY",
|
|
150
|
+
"TARGET_NOT_EMPTY",
|
|
151
|
+
"TEMPLATE_NOT_FOUND",
|
|
152
|
+
"UNSAFE_TARGET",
|
|
153
|
+
"UNKNOWN_ERROR"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"message": {
|
|
157
|
+
"type": "string"
|
|
158
|
+
},
|
|
159
|
+
"path": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
},
|
|
162
|
+
"recovery": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -18,6 +18,10 @@ Run from the project root:
|
|
|
18
18
|
- Start only the Python agent: `__SPATIUS_AGENT_DEV_COMMAND__`
|
|
19
19
|
- Check frontend/Worker: `__SPATIUS_CHECK_COMMAND__`
|
|
20
20
|
- Check Python: `__SPATIUS_AGENT_CHECK_COMMAND__`
|
|
21
|
+
- Check browser flows with mocks: `__SPATIUS_E2E_COMMAND__`
|
|
22
|
+
|
|
23
|
+
All checks can run after dependency installation, before credential setup.
|
|
24
|
+
Browser tests require Chromium; see README.md for the installation command.
|
|
21
25
|
|
|
22
26
|
## Working guidelines
|
|
23
27
|
|
|
@@ -28,6 +28,22 @@ npx create-spatius-app setup . --interactive
|
|
|
28
28
|
Follow the prompts to connect LiveKit and Spatius, select an avatar, and choose
|
|
29
29
|
a matching voice. This configures local development only, not deployment.
|
|
30
30
|
|
|
31
|
+
#### Manual credential setup
|
|
32
|
+
|
|
33
|
+
Alternatively, copy `.dev.vars.example` to `.dev.vars` and
|
|
34
|
+
`agent/.env.example` to `agent/.env.local`, then edit the copies locally:
|
|
35
|
+
|
|
36
|
+
- Use the same LiveKit Cloud project’s `LIVEKIT_URL`, `LIVEKIT_API_KEY`, and
|
|
37
|
+
`LIVEKIT_API_SECRET` in both files.
|
|
38
|
+
- Set the same `SPATIUS_APP_ID` in both files and set `SPATIUS_API_KEY` in
|
|
39
|
+
`agent/.env.local` to a key for that app.
|
|
40
|
+
- In `.dev.vars`, set `SPATIUS_AVATAR_ID` to your chosen avatar.
|
|
41
|
+
`SPATIUS_AVATAR_BACKGROUND_URL` is optional and can stay empty. Keep the
|
|
42
|
+
example `CARTESIA_VOICE_ID` to use the default voice.
|
|
43
|
+
|
|
44
|
+
Keep the example `LIVEKIT_AGENT_NAME` so the Worker dispatches the bundled
|
|
45
|
+
agent. Both credential files are ignored by Git; keep their values local.
|
|
46
|
+
|
|
31
47
|
### 3. Start the app
|
|
32
48
|
|
|
33
49
|
```sh
|
|
@@ -37,3 +53,28 @@ __SPATIUS_DEV_COMMAND__
|
|
|
37
53
|
This starts the Python agent first, then starts the frontend and Cloudflare
|
|
38
54
|
Worker once the agent has registered with LiveKit. If registration takes more
|
|
39
55
|
than 60 seconds, startup stops with an error.
|
|
56
|
+
|
|
57
|
+
## Validate without credentials
|
|
58
|
+
|
|
59
|
+
After installing both dependency sets, you can run these checks before account
|
|
60
|
+
setup. Run them from the project root:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
__SPATIUS_CHECK_COMMAND__
|
|
64
|
+
__SPATIUS_AGENT_CHECK_COMMAND__
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
These check formatting, lint, types, unit tests, development-process behavior,
|
|
68
|
+
and the production build. They do not require LiveKit or Spatius credentials.
|
|
69
|
+
|
|
70
|
+
Browser tests use mocked services and also run without credentials:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npx playwright install chromium
|
|
74
|
+
__SPATIUS_E2E_COMMAND__
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The first command downloads Chromium if needed. On Linux, use
|
|
78
|
+
`npx playwright install --with-deps chromium` to also install required system
|
|
79
|
+
libraries. These tests verify the local UI flow; a real voice-avatar
|
|
80
|
+
conversation still requires account setup and starting the app.
|
|
@@ -22,10 +22,6 @@ LiveKit room as the browser.
|
|
|
22
22
|
enhanced noise-cancellation model in the browser; standard browser echo
|
|
23
23
|
cancellation can stay enabled.
|
|
24
24
|
|
|
25
|
-
The noise-cancellation dependency stays on the BVC-compatible `0.2.x` series.
|
|
26
|
-
LiveKit's newer voice-isolation recommendation is Krisp VIVA; switching to that
|
|
27
|
-
is a separate choice, not an implicit dependency upgrade.
|
|
28
|
-
|
|
29
25
|
See [Cartesia TTS](https://docs.livekit.io/agents/models/tts/cartesia/),
|
|
30
26
|
[expressive mode](https://docs.livekit.io/agents/models/tts/expressive/), and
|
|
31
27
|
[noise cancellation](https://docs.livekit.io/transport/media/noise-cancellation/).
|
|
@@ -25,10 +25,11 @@ load_dotenv(".env.local")
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class Assistant(Agent):
|
|
28
|
-
def __init__(self) -> None:
|
|
28
|
+
def __init__(self, instructions: str | None = None) -> None:
|
|
29
29
|
super().__init__(
|
|
30
30
|
llm=inference.LLM(model="google/gemma-4-31b-it"),
|
|
31
|
-
instructions=
|
|
31
|
+
instructions=instructions
|
|
32
|
+
or textwrap.dedent(
|
|
32
33
|
"""\
|
|
33
34
|
You are a warm, concise voice assistant speaking through a digital
|
|
34
35
|
avatar. Help the user directly and conversationally.
|
|
@@ -82,8 +83,9 @@ async def spatius_agent(ctx: JobContext) -> None:
|
|
|
82
83
|
avatar = spatius.AvatarSession(avatar_id=dispatch_metadata.avatar_id)
|
|
83
84
|
await avatar.start(session, room=ctx.room)
|
|
84
85
|
|
|
86
|
+
assistant = Assistant()
|
|
85
87
|
await session.start(
|
|
86
|
-
agent=
|
|
88
|
+
agent=assistant,
|
|
87
89
|
room=ctx.room,
|
|
88
90
|
room_options=room_io.RoomOptions(
|
|
89
91
|
audio_input=room_io.AudioInputOptions(
|
|
@@ -920,17 +920,17 @@ wheels = [
|
|
|
920
920
|
|
|
921
921
|
[[package]]
|
|
922
922
|
name = "livekit-plugins-noise-cancellation"
|
|
923
|
-
version = "0.
|
|
923
|
+
version = "0.3.0"
|
|
924
924
|
source = { registry = "https://pypi.org/simple" }
|
|
925
925
|
dependencies = [
|
|
926
926
|
{ name = "livekit" },
|
|
927
927
|
]
|
|
928
928
|
wheels = [
|
|
929
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
930
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
931
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
932
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
933
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
929
|
+
{ url = "https://files.pythonhosted.org/packages/d8/ad/e049eeca9c5175cc70c036c6dc5ce048215949b5d7ea83dbea6e2e06260c/livekit_plugins_noise_cancellation-0.3.0-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:6c877ca3f31278ce3b6ba7a3adc0eaaf813a53ba5a900445616be69ce7e4b3a8", size = 66079924, upload-time = "2026-07-17T10:35:02.671Z" },
|
|
930
|
+
{ url = "https://files.pythonhosted.org/packages/07/61/7a860386cf0c9d27f4d3fdcfeee411153e1618552d6a15ad46d32df64ac5/livekit_plugins_noise_cancellation-0.3.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:1d100f249d25556696d8fe358b7c22d81017df67f256ee3b5c9c36830409621f", size = 64625049, upload-time = "2026-07-17T10:35:06.186Z" },
|
|
931
|
+
{ url = "https://files.pythonhosted.org/packages/2d/0d/df886e71b463911a9190cea948100f89c1e0546cff7e84dd93862b73e2d9/livekit_plugins_noise_cancellation-0.3.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:4b48de9ffdb8af47820ecd5e44ef0dbb910dfd05f17f6fadcbfd64deceb7a09a", size = 70250046, upload-time = "2026-07-17T10:35:09.376Z" },
|
|
932
|
+
{ url = "https://files.pythonhosted.org/packages/d1/43/701df4746e4e8b660f1399ec0a3da80de211f1624725a7496d28f7443b4a/livekit_plugins_noise_cancellation-0.3.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:1703099d634d26171e2f0402c81fc84f13bf0bc92a7f9ba16f9af1d0eefee980", size = 73004876, upload-time = "2026-07-17T10:35:12.775Z" },
|
|
933
|
+
{ url = "https://files.pythonhosted.org/packages/6f/b4/3ed7bac7aabec196c1e8969b407b71f69bdb0c942b1b3cd2aed07ae276cf/livekit_plugins_noise_cancellation-0.3.0-py3-none-win_amd64.whl", hash = "sha256:7f6001d0dd3b00c7748949b7a8349de002118fc03faa2d38411ad0d05180ccab", size = 65788455, upload-time = "2026-07-17T10:35:15.759Z" },
|
|
934
934
|
]
|
|
935
935
|
|
|
936
936
|
[[package]]
|
|
@@ -1892,7 +1892,7 @@ dev = [
|
|
|
1892
1892
|
[package.metadata]
|
|
1893
1893
|
requires-dist = [
|
|
1894
1894
|
{ name = "livekit-agents", extras = ["spatius"], specifier = "~=1.8.0" },
|
|
1895
|
-
{ name = "livekit-plugins-noise-cancellation", specifier = "~=0.
|
|
1895
|
+
{ name = "livekit-plugins-noise-cancellation", specifier = "~=0.3.0" },
|
|
1896
1896
|
{ name = "python-dotenv", specifier = ">=1.2.1,<2" },
|
|
1897
1897
|
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.15,<1" },
|
|
1898
1898
|
]
|