@voicethere/agent 0.29.1 → 0.30.0
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 +3 -1
- package/dist/agent.js +61 -5
- package/dist/flow/effects-node.d.ts.map +1 -1
- package/dist/flow/effects-node.js +5 -1
- package/dist/flow/effects-node.js.map +1 -1
- package/dist/llm/agent/create-llm-agent.d.ts.map +1 -1
- package/dist/llm/agent/create-llm-agent.js +5 -1
- package/dist/llm/agent/create-llm-agent.js.map +1 -1
- package/dist/llm/agent/redact.d.ts +16 -0
- package/dist/llm/agent/redact.d.ts.map +1 -1
- package/dist/llm/agent/redact.js +28 -6
- package/dist/llm/agent/redact.js.map +1 -1
- package/dist/protocol.d.ts +16 -3
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +75 -4
- package/dist/runtime.js.map +1 -1
- package/dist/templates/echo/agent.js +59 -2
- package/dist/templates/echo-dc/agent.js +59 -2
- package/dist/templates/flow-agent/agent.js +76 -9
- package/dist/templates/game-sync/agent.js +59 -2
- package/dist/templates/language-switch/agent.js +59 -2
- package/dist/templates/llm-agent/agent.js +76 -9
- package/dist/templates/llm-board/agent.js +60746 -0
- package/dist/templates/llm-docs-rag/agent.js +76 -9
- package/dist/templates/llm-language-tutor/agent.js +60549 -0
- package/dist/templates/llm-mcp-service/agent.js +76 -9
- package/dist/templates/llm-support-sticky-user/agent.js +76 -9
- package/dist/templates/positional-tts/agent.js +59 -2
- package/dist/templates/recording-consent/agent.js +59 -2
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +50 -0
- package/dist/templates/registry.js.map +1 -1
- package/dist/templates/spatial-showcase/agent.js +59 -2
- package/dist/templates/speaker-gate/agent.js +61 -4
- package/dist/templates/voice-showcase/agent.js +59 -2
- package/dist/templates/voice-starter/agent.js +59 -2
- package/dist/templates/webhooks/agent.js +59 -2
- package/dist/templates/webhooks-redis/agent.js +59 -2
- package/dist/templates/world-sync/agent.js +59 -2
- package/dist/templates/world-sync-binary/agent.js +59 -2
- package/eject/llm/loop.ts +6 -2
- package/package.json +2 -1
- package/templates/README.md +7 -5
- package/templates/llm-agent/README.md +1 -1
- package/templates/llm-board/README.md +44 -0
- package/templates/llm-board/agent.ts +235 -0
- package/templates/llm-board/board.ts +196 -0
- package/templates/llm-board/md.d.ts +4 -0
- package/templates/llm-board/prompt.md +11 -0
- package/templates/llm-board/voicethere.llm.json +49 -0
- package/templates/llm-language-tutor/README.md +32 -0
- package/templates/llm-language-tutor/agent.ts +22 -0
- package/templates/llm-language-tutor/knowledge/lessons.md +121 -0
- package/templates/llm-language-tutor/md.d.ts +4 -0
- package/templates/llm-language-tutor/prompt.md +9 -0
- package/templates/llm-language-tutor/voicethere.llm.json +39 -0
- package/templates/speaker-gate/README.md +3 -1
- package/templates/speaker-gate/agent.ts +5 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@voicethere/agent/schema/voicethere.llm.schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"provider": "openrouter",
|
|
5
|
+
"model": "amazon/nova-micro-v1",
|
|
6
|
+
"apiKeySecret": "AGENT_OPENROUTER_API_KEY",
|
|
7
|
+
"maxOutputTokens": 512,
|
|
8
|
+
"greeting": {
|
|
9
|
+
"text": "Hi! I'm your English practice partner. What would you like to talk about today?",
|
|
10
|
+
"interruptible": true
|
|
11
|
+
},
|
|
12
|
+
"bargeIn": { "mode": "project" },
|
|
13
|
+
"history": { "turns": 20, "interruptionNote": true },
|
|
14
|
+
"fillers": {
|
|
15
|
+
"thinking": {
|
|
16
|
+
"phrases": ["Okay.", "Right.", "Let me think."],
|
|
17
|
+
"afterMs": 1500
|
|
18
|
+
},
|
|
19
|
+
"toolCall": {
|
|
20
|
+
"phrases": ["Let me check my lessons.", "One moment."]
|
|
21
|
+
},
|
|
22
|
+
"interruptible": true
|
|
23
|
+
},
|
|
24
|
+
"tools": {
|
|
25
|
+
"maxRounds": 3,
|
|
26
|
+
"timeoutMs": 15000
|
|
27
|
+
},
|
|
28
|
+
"toolSources": [],
|
|
29
|
+
"knowledge": {
|
|
30
|
+
"store": "redis",
|
|
31
|
+
"topK": 3,
|
|
32
|
+
"embeddings": {
|
|
33
|
+
"provider": "openrouter",
|
|
34
|
+
"model": "openai/text-embedding-3-small"
|
|
35
|
+
},
|
|
36
|
+
"redis": { "namespace": "tutor" }
|
|
37
|
+
},
|
|
38
|
+
"interruptPolicy": "cancel"
|
|
39
|
+
}
|
|
@@ -19,11 +19,13 @@ The project's voice settings pick the mode the call starts in (`speakerGate.mode
|
|
|
19
19
|
- In `manual` it answers `caller` and `unknown` finals. When it hears `other` it says one short line, at most once every 30 seconds, and otherwise stays quiet.
|
|
20
20
|
- Every event writes one agent log line with a counter `n` that starts at 1 and counts all lines of the session:
|
|
21
21
|
- `speaker_gate.mode n=1 mode=auto` at connect and after each applied mode command;
|
|
22
|
-
- `speaker_gate.final n=2 speaker=caller|other|unknown|none text="..."` for every final (`none` when the event has no verdict). This line includes the transcript, so treat these logs as call content;
|
|
22
|
+
- `speaker_gate.final n=2 speaker=caller|other|unknown|none utteranceId=<id> reason=<reason> text="..."` for every final (`none` when the event has no verdict; `utteranceId` and `reason`, the speaker unknown reason such as `not_enrolled`, appear only when the runner sets them, and `text` is always last). This line includes the transcript, so treat these logs as call content;
|
|
23
23
|
- `speaker_gate.ignored n=3 utteranceId=<id> reason=speaker_mismatch` for each utterance `auto` mode drops;
|
|
24
24
|
- `speaker_gate.reset n=4` after an enrollment reset.
|
|
25
25
|
- A bystander's voice cannot change the mode: spoken commands are ignored when the verdict is `other`.
|
|
26
26
|
|
|
27
|
+
The mode you request and the mode in effect can differ. If the speaker model fails to load, the runner switches the gate to `disabled` and tells the agent once; `getSpeakerGate(sessionId)` then returns `mode: "disabled"`. A pending `setSpeakerGate` or `resetSpeakerEnrollment` call resolves `{ ok: false, reason: "session_ended" }` as soon as the session ends.
|
|
28
|
+
|
|
27
29
|
## Switching the mode
|
|
28
30
|
|
|
29
31
|
Send a data-channel chat message, `{ "type": "chat", "text": "speaker-gate:auto" }`:
|
|
@@ -119,10 +119,14 @@ defineAgent({
|
|
|
119
119
|
},
|
|
120
120
|
|
|
121
121
|
async onUserSpeechFinal(ctx) {
|
|
122
|
+
const utterance = ctx.utteranceId ? ` utteranceId=${ctx.utteranceId}` : "";
|
|
123
|
+
const reason = ctx.speakerUnknownReason
|
|
124
|
+
? ` reason=${ctx.speakerUnknownReason}`
|
|
125
|
+
: "";
|
|
122
126
|
logLine(
|
|
123
127
|
ctx.sessionId,
|
|
124
128
|
"final",
|
|
125
|
-
`speaker=${ctx.speaker ?? "none"} text=${JSON.stringify(ctx.text)}`,
|
|
129
|
+
`speaker=${ctx.speaker ?? "none"}${utterance}${reason} text=${JSON.stringify(ctx.text)}`,
|
|
126
130
|
);
|
|
127
131
|
const spoken = parseSpokenCommand(ctx.text);
|
|
128
132
|
// A bystander cannot change the mode in manual mode.
|