@voicethere/agent 0.29.3 → 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/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/templates/flow-agent/agent.js +12 -6
- package/dist/templates/llm-agent/agent.js +12 -6
- package/dist/templates/llm-board/agent.js +60746 -0
- package/dist/templates/llm-docs-rag/agent.js +12 -6
- package/dist/templates/llm-language-tutor/agent.js +60549 -0
- package/dist/templates/llm-mcp-service/agent.js +12 -6
- package/dist/templates/llm-support-sticky-user/agent.js +12 -6
- 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/eject/llm/loop.ts +1 -1
- package/package.json +2 -1
- package/templates/README.md +2 -0
- 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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
export const NOTE_COLORS = ["yellow", "blue", "green", "pink"] as const;
|
|
2
|
+
export type NoteColor = (typeof NOTE_COLORS)[number];
|
|
3
|
+
|
|
4
|
+
export const MAX_NOTES = 60;
|
|
5
|
+
|
|
6
|
+
/** Room ids a client may join. A session that never joins has a private room. */
|
|
7
|
+
export const ROOM_RE = /^[a-z0-9-]{6,40}$/;
|
|
8
|
+
export const MAX_NOTE_TEXT = 200;
|
|
9
|
+
|
|
10
|
+
export type Note = {
|
|
11
|
+
id: string;
|
|
12
|
+
/** 1 to 200 characters. */
|
|
13
|
+
text: string;
|
|
14
|
+
/** 0 to 1, left to right. */
|
|
15
|
+
x: number;
|
|
16
|
+
/** 0 to 1, top to bottom. */
|
|
17
|
+
y: number;
|
|
18
|
+
color: NoteColor;
|
|
19
|
+
author: "user" | "ai";
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type NotePatch = {
|
|
23
|
+
text?: string;
|
|
24
|
+
x?: number;
|
|
25
|
+
y?: number;
|
|
26
|
+
color?: NoteColor;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type AddInput = {
|
|
30
|
+
text: string;
|
|
31
|
+
x?: number;
|
|
32
|
+
y?: number;
|
|
33
|
+
color?: NoteColor;
|
|
34
|
+
author: "user" | "ai";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Client to agent messages. Anything else is not a board message. */
|
|
38
|
+
export type BoardMessage =
|
|
39
|
+
| {
|
|
40
|
+
type: "note.add";
|
|
41
|
+
text: string;
|
|
42
|
+
x?: number;
|
|
43
|
+
y?: number;
|
|
44
|
+
color?: NoteColor;
|
|
45
|
+
}
|
|
46
|
+
| {
|
|
47
|
+
type: "note.update";
|
|
48
|
+
id: string;
|
|
49
|
+
text?: string;
|
|
50
|
+
x?: number;
|
|
51
|
+
y?: number;
|
|
52
|
+
color?: NoteColor;
|
|
53
|
+
}
|
|
54
|
+
| { type: "note.remove"; id: string }
|
|
55
|
+
| { type: "board.sync" }
|
|
56
|
+
| { type: "board.join"; room: string };
|
|
57
|
+
|
|
58
|
+
export type BoardResult<T> =
|
|
59
|
+
{ ok: true; value: T } | { ok: false; error: string };
|
|
60
|
+
|
|
61
|
+
function validText(v: unknown): v is string {
|
|
62
|
+
return typeof v === "string" && v.length >= 1 && v.length <= MAX_NOTE_TEXT;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function unit(v: unknown): v is number {
|
|
66
|
+
return typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function color(v: unknown): v is NoteColor {
|
|
70
|
+
return (
|
|
71
|
+
typeof v === "string" && (NOTE_COLORS as readonly string[]).includes(v)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** A free spot on a 6 by 5 grid: the first cell no note sits on, else the first cell. */
|
|
76
|
+
export function freeSlot(notes: readonly Note[]): { x: number; y: number } {
|
|
77
|
+
const cols = 6;
|
|
78
|
+
const rows = 5;
|
|
79
|
+
for (let i = 0; i < cols * rows; i++) {
|
|
80
|
+
const x = (i % cols) / cols + 0.04;
|
|
81
|
+
const y = Math.floor(i / cols) / rows + 0.04;
|
|
82
|
+
const taken = notes.some(
|
|
83
|
+
(n) => Math.abs(n.x - x) < 0.01 && Math.abs(n.y - y) < 0.01,
|
|
84
|
+
);
|
|
85
|
+
if (!taken) return { x, y };
|
|
86
|
+
}
|
|
87
|
+
return { x: 0.04, y: 0.04 };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export class Board {
|
|
91
|
+
private notes = new Map<string, Note>();
|
|
92
|
+
private seq = 0;
|
|
93
|
+
|
|
94
|
+
add(input: AddInput): BoardResult<Note> {
|
|
95
|
+
if (!validText(input.text)) {
|
|
96
|
+
return {
|
|
97
|
+
ok: false,
|
|
98
|
+
error: `note text must be 1 to ${MAX_NOTE_TEXT} characters`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (this.notes.size >= MAX_NOTES)
|
|
102
|
+
return { ok: false, error: "board is full" };
|
|
103
|
+
if (input.x !== undefined && !unit(input.x))
|
|
104
|
+
return { ok: false, error: "x must be between 0 and 1" };
|
|
105
|
+
if (input.y !== undefined && !unit(input.y))
|
|
106
|
+
return { ok: false, error: "y must be between 0 and 1" };
|
|
107
|
+
if (input.color !== undefined && !color(input.color))
|
|
108
|
+
return { ok: false, error: "unknown color" };
|
|
109
|
+
const slot = freeSlot(this.list());
|
|
110
|
+
this.seq += 1;
|
|
111
|
+
const note: Note = {
|
|
112
|
+
id: `n${this.seq}`,
|
|
113
|
+
text: input.text,
|
|
114
|
+
x: input.x ?? slot.x,
|
|
115
|
+
y: input.y ?? slot.y,
|
|
116
|
+
color: input.color ?? "yellow",
|
|
117
|
+
author: input.author,
|
|
118
|
+
};
|
|
119
|
+
this.notes.set(note.id, note);
|
|
120
|
+
return { ok: true, value: note };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
update(id: string, patch: NotePatch): BoardResult<Note> {
|
|
124
|
+
const note = this.notes.get(id);
|
|
125
|
+
if (!note) return { ok: false, error: `No note with id ${id}.` };
|
|
126
|
+
if (patch.text !== undefined && !validText(patch.text)) {
|
|
127
|
+
return {
|
|
128
|
+
ok: false,
|
|
129
|
+
error: `note text must be 1 to ${MAX_NOTE_TEXT} characters`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (patch.x !== undefined && !unit(patch.x))
|
|
133
|
+
return { ok: false, error: "x must be between 0 and 1" };
|
|
134
|
+
if (patch.y !== undefined && !unit(patch.y))
|
|
135
|
+
return { ok: false, error: "y must be between 0 and 1" };
|
|
136
|
+
if (patch.color !== undefined && !color(patch.color))
|
|
137
|
+
return { ok: false, error: "unknown color" };
|
|
138
|
+
const next: Note = {
|
|
139
|
+
...note,
|
|
140
|
+
...(patch.text !== undefined ? { text: patch.text } : {}),
|
|
141
|
+
...(patch.x !== undefined ? { x: patch.x } : {}),
|
|
142
|
+
...(patch.y !== undefined ? { y: patch.y } : {}),
|
|
143
|
+
...(patch.color !== undefined ? { color: patch.color } : {}),
|
|
144
|
+
};
|
|
145
|
+
this.notes.set(id, next);
|
|
146
|
+
return { ok: true, value: next };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
remove(id: string): boolean {
|
|
150
|
+
return this.notes.delete(id);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
list(): Note[] {
|
|
154
|
+
return [...this.notes.values()];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function parseBoardMessage(msg: unknown): BoardMessage | null {
|
|
159
|
+
if (!msg || typeof msg !== "object") return null;
|
|
160
|
+
const m = msg as Record<string, unknown>;
|
|
161
|
+
switch (m.type) {
|
|
162
|
+
case "board.sync":
|
|
163
|
+
return { type: "board.sync" };
|
|
164
|
+
case "board.join":
|
|
165
|
+
return typeof m.room === "string" && ROOM_RE.test(m.room)
|
|
166
|
+
? { type: "board.join", room: m.room }
|
|
167
|
+
: null;
|
|
168
|
+
case "note.remove":
|
|
169
|
+
return typeof m.id === "string" && m.id
|
|
170
|
+
? { type: "note.remove", id: m.id }
|
|
171
|
+
: null;
|
|
172
|
+
case "note.add": {
|
|
173
|
+
if (typeof m.text !== "string") return null;
|
|
174
|
+
return {
|
|
175
|
+
type: "note.add",
|
|
176
|
+
text: m.text,
|
|
177
|
+
...(m.x !== undefined ? { x: m.x as number } : {}),
|
|
178
|
+
...(m.y !== undefined ? { y: m.y as number } : {}),
|
|
179
|
+
...(m.color !== undefined ? { color: m.color as NoteColor } : {}),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
case "note.update": {
|
|
183
|
+
if (typeof m.id !== "string" || !m.id) return null;
|
|
184
|
+
return {
|
|
185
|
+
type: "note.update",
|
|
186
|
+
id: m.id,
|
|
187
|
+
...(m.text !== undefined ? { text: m.text as string } : {}),
|
|
188
|
+
...(m.x !== undefined ? { x: m.x as number } : {}),
|
|
189
|
+
...(m.y !== undefined ? { y: m.y as number } : {}),
|
|
190
|
+
...(m.color !== undefined ? { color: m.color as NoteColor } : {}),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
default:
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
You are the facilitator of a shared brainstorming board. The people in the room put sticky notes on it, and you can read, add and change notes with your tools. People talk to you by voice, so everything you say is read aloud.
|
|
2
|
+
|
|
3
|
+
Keep spoken replies to one or two short sentences. Do not use markdown, lists, emoji or special characters.
|
|
4
|
+
|
|
5
|
+
Call list_notes before you group, compare or summarise notes, and before you change one. Never guess what is on the board.
|
|
6
|
+
|
|
7
|
+
Add notes only when someone asks you to, or when you are asked to summarise; then add one short note per theme with add_note. Use update_note to fix a note's text, color or position when asked. Say briefly what you did, for example "I added a note about pricing."
|
|
8
|
+
|
|
9
|
+
If a tool says the board is full or a note does not exist, say so plainly and suggest what to do next.
|
|
10
|
+
|
|
11
|
+
Ask one question at a time, and only when you need it to do what was asked.
|
|
@@ -0,0 +1,49 @@
|
|
|
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 board facilitator. Add some notes, or ask me to group or summarise them.",
|
|
10
|
+
"interruptible": true
|
|
11
|
+
},
|
|
12
|
+
"bargeIn": {
|
|
13
|
+
"mode": "project"
|
|
14
|
+
},
|
|
15
|
+
"history": {
|
|
16
|
+
"turns": 20,
|
|
17
|
+
"interruptionNote": true
|
|
18
|
+
},
|
|
19
|
+
"fillers": {
|
|
20
|
+
"thinking": {
|
|
21
|
+
"phrases": ["Okay.", "Right.", "Sure.", "Let me see."],
|
|
22
|
+
"afterMs": 1500
|
|
23
|
+
},
|
|
24
|
+
"toolCall": {
|
|
25
|
+
"phrases": ["Let me look at the board.", "One moment."]
|
|
26
|
+
},
|
|
27
|
+
"toolWait": {
|
|
28
|
+
"phrases": ["Still checking, one moment.", "Almost there."],
|
|
29
|
+
"afterMs": 4000
|
|
30
|
+
},
|
|
31
|
+
"interruptible": true
|
|
32
|
+
},
|
|
33
|
+
"tools": {
|
|
34
|
+
"maxRounds": 5,
|
|
35
|
+
"timeoutMs": 15000
|
|
36
|
+
},
|
|
37
|
+
"toolSources": [],
|
|
38
|
+
"knowledge": {
|
|
39
|
+
"store": "off",
|
|
40
|
+
"topK": 4,
|
|
41
|
+
"embeddings": {
|
|
42
|
+
"provider": "openai",
|
|
43
|
+
"model": "text-embedding-3-small",
|
|
44
|
+
"dimensions": 512,
|
|
45
|
+
"apiKeySecret": "AGENT_OPENAI_API_KEY"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"interruptPolicy": "cancel"
|
|
49
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# llm-language-tutor
|
|
2
|
+
|
|
3
|
+
An English practice partner for learners at levels A2 to B2. It talks in short turns, corrects one mistake per turn, asks a follow-up question, and looks up phrases and idioms in a lessons file through `search_knowledge`. Source: `templates/llm-language-tutor/agent.ts`.
|
|
4
|
+
|
|
5
|
+
## What you need
|
|
6
|
+
|
|
7
|
+
- **Project Redis** turned on for the project. The agent indexes `knowledge/lessons.md` in Redis when it starts and skips the work when the file has not changed.
|
|
8
|
+
- A project secret named `AGENT_OPENROUTER_API_KEY` (a key from openrouter.ai). The same key serves the chat model and the embeddings, so `knowledge.embeddings` has no `apiKeySecret`.
|
|
9
|
+
|
|
10
|
+
Without Project Redis or the key the agent still answers, but `search_knowledge` is off.
|
|
11
|
+
|
|
12
|
+
## Files
|
|
13
|
+
|
|
14
|
+
- `agent.ts` wires the pieces together.
|
|
15
|
+
- `voicethere.llm.json` holds the model (`amazon/nova-micro-v1` on OpenRouter), greeting and the `knowledge` block (`store: "redis"`, `topK: 3`, namespace `tutor`).
|
|
16
|
+
- `prompt.md` is the tutor's system prompt.
|
|
17
|
+
- `knowledge/lessons.md` has eight lessons as `##` headings, each with useful phrases and two idioms. Each heading starts a retrievable chunk.
|
|
18
|
+
- `md.d.ts` lets TypeScript accept `import x from "./x.md"`.
|
|
19
|
+
|
|
20
|
+
## Embeddings model
|
|
21
|
+
|
|
22
|
+
The template uses `openai/text-embedding-3-small`. OpenRouter's embeddings guide names it (https://openrouter.ai/docs/api/reference/embeddings) and its embeddings request reference uses it as the `model` example (https://openrouter.ai/docs/api-reference/embeddings/create-embeddings). That reference documents `dimensions` as a request field (the number of dimensions of the output embeddings) but does not list which models accept it. `knowledge.embeddings.dimensions` is not set in `voicethere.llm.json`, so the agent uses its default of 512 and sends `dimensions: 512` with every embeddings request. Set the field to another value between 64 and 3072 to change it.
|
|
23
|
+
|
|
24
|
+
## Edit the lessons
|
|
25
|
+
|
|
26
|
+
Replace or add `##` sections in `knowledge/lessons.md`. A lesson is easiest to find when its heading names the topic and its phrases are written as the learner would ask about them. Redeploy; the index rebuilds because the file hash changes.
|
|
27
|
+
|
|
28
|
+
To teach another language, change `prompt.md` and the project's voice language (see `/docs/spoken-language` in the VoiceThere docs), then write the lessons in that language.
|
|
29
|
+
|
|
30
|
+
## Cost
|
|
31
|
+
|
|
32
|
+
Measured on VoiceThere's demo: see the use-case page.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineAgent } from "@voicethere/agent";
|
|
2
|
+
import { createLlmAgent } from "@voicethere/agent/llm";
|
|
3
|
+
import { openai } from "@voicethere/agent/llm/openai";
|
|
4
|
+
import config from "./voicethere.llm.json";
|
|
5
|
+
import systemPrompt from "./prompt.md";
|
|
6
|
+
import lessons from "./knowledge/lessons.md";
|
|
7
|
+
|
|
8
|
+
// Needs Project Redis enabled (the lessons are indexed there at start) and the
|
|
9
|
+
// project secret AGENT_OPENROUTER_API_KEY, which serves both the chat model
|
|
10
|
+
// and the embeddings. To teach another language, change prompt.md and the
|
|
11
|
+
// project's voice language (see /docs/spoken-language), then replace the
|
|
12
|
+
// lessons in knowledge/lessons.md.
|
|
13
|
+
defineAgent(
|
|
14
|
+
createLlmAgent({
|
|
15
|
+
config,
|
|
16
|
+
systemPrompt,
|
|
17
|
+
providers: [openai],
|
|
18
|
+
knowledge: {
|
|
19
|
+
documents: [{ id: "lessons", title: "Lessons", text: lessons }],
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# English practice lessons
|
|
2
|
+
|
|
3
|
+
## Ordering at a café
|
|
4
|
+
|
|
5
|
+
Useful phrases:
|
|
6
|
+
|
|
7
|
+
- Could I have a flat white, please?
|
|
8
|
+
- Can I get that to go?
|
|
9
|
+
- What do you recommend?
|
|
10
|
+
- Do you have anything without milk?
|
|
11
|
+
- Could I pay by card?
|
|
12
|
+
|
|
13
|
+
Idioms:
|
|
14
|
+
|
|
15
|
+
- "A piece of cake" means something is very easy. Example: Ordering coffee in English is a piece of cake for me now.
|
|
16
|
+
- "My cup of tea" means something you like. Example: Quiet cafés are my cup of tea.
|
|
17
|
+
|
|
18
|
+
## Small talk at work
|
|
19
|
+
|
|
20
|
+
Useful phrases:
|
|
21
|
+
|
|
22
|
+
- How was your weekend?
|
|
23
|
+
- Did you have a good commute?
|
|
24
|
+
- Any plans for the holidays?
|
|
25
|
+
- It's been a busy week, hasn't it?
|
|
26
|
+
- Nice to finally meet you in person.
|
|
27
|
+
|
|
28
|
+
Idioms:
|
|
29
|
+
|
|
30
|
+
- "Break the ice" means to start a conversation with people who don't know each other. Example: I asked about his trip to break the ice.
|
|
31
|
+
- "Catch up" means to talk about what has happened since you last met. Example: Let's catch up over lunch.
|
|
32
|
+
|
|
33
|
+
## A job interview
|
|
34
|
+
|
|
35
|
+
Useful phrases:
|
|
36
|
+
|
|
37
|
+
- Thank you for having me.
|
|
38
|
+
- I have three years of experience in this field.
|
|
39
|
+
- One of my strengths is working with a team.
|
|
40
|
+
- Could you tell me more about the role?
|
|
41
|
+
- When can I expect to hear from you?
|
|
42
|
+
|
|
43
|
+
Idioms:
|
|
44
|
+
|
|
45
|
+
- "Hit the ground running" means to start a new job and do well right away. Example: I want to hit the ground running in my first month.
|
|
46
|
+
- "Think outside the box" means to think in a new, creative way. Example: The team wants someone who can think outside the box.
|
|
47
|
+
|
|
48
|
+
## At the doctor
|
|
49
|
+
|
|
50
|
+
Useful phrases:
|
|
51
|
+
|
|
52
|
+
- I've had a sore throat since Monday.
|
|
53
|
+
- It hurts when I breathe in.
|
|
54
|
+
- I'm allergic to penicillin.
|
|
55
|
+
- How often should I take this medicine?
|
|
56
|
+
- Do I need to come back for a check-up?
|
|
57
|
+
|
|
58
|
+
Idioms:
|
|
59
|
+
|
|
60
|
+
- "Under the weather" means a little sick. Example: I'm feeling under the weather today.
|
|
61
|
+
- "Back on your feet" means well again after an illness. Example: You'll be back on your feet in a few days.
|
|
62
|
+
|
|
63
|
+
## Travel and directions
|
|
64
|
+
|
|
65
|
+
Useful phrases:
|
|
66
|
+
|
|
67
|
+
- Excuse me, how do I get to the station?
|
|
68
|
+
- Is it within walking distance?
|
|
69
|
+
- Turn left at the traffic lights.
|
|
70
|
+
- Which platform does the train to Boston leave from?
|
|
71
|
+
- Could you tell me when we get to my stop?
|
|
72
|
+
|
|
73
|
+
Idioms:
|
|
74
|
+
|
|
75
|
+
- "Off the beaten track" means away from the usual tourist places. Example: We found a small village off the beaten track.
|
|
76
|
+
- "On the right track" means doing something the correct way. Example: Keep going, you're on the right track.
|
|
77
|
+
|
|
78
|
+
## Phone calls
|
|
79
|
+
|
|
80
|
+
Useful phrases:
|
|
81
|
+
|
|
82
|
+
- Hello, this is Maria speaking.
|
|
83
|
+
- Could I speak to Mr. Brown, please?
|
|
84
|
+
- I'm calling about my reservation.
|
|
85
|
+
- Could you repeat that, please?
|
|
86
|
+
- I'll call you back later.
|
|
87
|
+
|
|
88
|
+
Idioms:
|
|
89
|
+
|
|
90
|
+
- "Hang on" means wait a moment. Example: Hang on, I'll get a pen.
|
|
91
|
+
- "Get back to someone" means to reply later. Example: I'll get back to you by tomorrow.
|
|
92
|
+
|
|
93
|
+
## Making plans
|
|
94
|
+
|
|
95
|
+
Useful phrases:
|
|
96
|
+
|
|
97
|
+
- Are you free on Saturday afternoon?
|
|
98
|
+
- How about we meet at six?
|
|
99
|
+
- Shall we get dinner after the film?
|
|
100
|
+
- That works for me.
|
|
101
|
+
- Let's keep in touch about the details.
|
|
102
|
+
|
|
103
|
+
Idioms:
|
|
104
|
+
|
|
105
|
+
- "Up in the air" means not decided yet. Example: Our holiday plans are still up in the air.
|
|
106
|
+
- "Play it by ear" means to decide as things happen. Example: We'll play it by ear and see how the weather is.
|
|
107
|
+
|
|
108
|
+
## Giving opinions
|
|
109
|
+
|
|
110
|
+
Useful phrases:
|
|
111
|
+
|
|
112
|
+
- In my opinion, this is a good idea.
|
|
113
|
+
- I see what you mean, but I disagree.
|
|
114
|
+
- As far as I'm concerned, it's worth the price.
|
|
115
|
+
- I'm not sure I agree.
|
|
116
|
+
- That's a fair point.
|
|
117
|
+
|
|
118
|
+
Idioms:
|
|
119
|
+
|
|
120
|
+
- "Take it with a grain of salt" means do not believe it completely. Example: Take online reviews with a grain of salt.
|
|
121
|
+
- "On the fence" means not able to decide between two choices. Example: I'm on the fence about moving to a new city.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
You are an English conversation tutor for learners at levels A2 to B2. People talk to you by voice, so everything you say is read aloud.
|
|
2
|
+
|
|
3
|
+
Speak English only, even if the learner switches to another language. Keep replies to one to three short sentences, in plain words. Do not use markdown, lists, emoji or special characters.
|
|
4
|
+
|
|
5
|
+
Correct at most one mistake per turn. Say the learner's sentence again the correct way, then give the reason in a few words. If there is no mistake, say something encouraging in a few words instead. Then ask one follow-up question that keeps the conversation going.
|
|
6
|
+
|
|
7
|
+
When the learner asks about a phrase, an idiom or a lesson topic, call search_knowledge first and answer from what it returns. Never make up the meaning of an idiom that the search did not return. If the search has nothing, say you are not sure and offer a different phrase to practice.
|
|
8
|
+
|
|
9
|
+
Be patient and friendly. Let the learner finish their thought before you correct anything.
|
|
@@ -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
|
+
}
|