@alexkroman1/aai-cli 0.15.5 → 0.16.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/scaffold/CLAUDE.md +2 -2
- package/dist/scaffold/agent-guide/PIPELINE-TUNING.md +1 -1
- package/dist/scaffold/agent-guide/PROVIDERS.md +14 -15
- package/dist/scaffold/agent-guide/WORKFLOWS.md +1 -1
- package/dist/scaffold/package.json +4 -4
- package/dist/templates/call-audit-workflow/agent.eval.test.ts +1 -1
- package/dist/templates/call-audit-workflow/agent.test.ts +3 -2
- package/dist/templates/call-audit-workflow/agent.ts +6 -11
- package/dist/templates/call-audit-workflow/workflows/summarize.ts +1 -1
- package/dist/templates/custom-pipeline-agent/modes.test.ts +4 -4
- package/dist/templates/custom-pipeline-agent/stages.test.ts +8 -29
- package/dist/templates/home-assistant-agent/agent.ts +1 -1
- package/dist/templates/quickstart-agent/agent.ts +1 -1
- package/dist/templates/spoken-summary-workflow/agent.eval.test.ts +3 -3
- package/dist/templates/spoken-summary-workflow/agent.test.ts +11 -13
- package/dist/templates/spoken-summary-workflow/agent.ts +8 -24
- package/dist/templates/spoken-summary-workflow/workflows/summarize.ts +1 -1
- package/dist/templates/text-adventure-agent/agent.ts +1 -1
- package/package.json +4 -4
package/dist/scaffold/CLAUDE.md
CHANGED
|
@@ -168,7 +168,7 @@ import { assemblyAITts } from "@alexkroman1/aai/tts";
|
|
|
168
168
|
|
|
169
169
|
export default agent({
|
|
170
170
|
name: "My Agent",
|
|
171
|
-
tts: assemblyAITts({ voice: "paul" }),
|
|
171
|
+
tts: assemblyAITts({ voice: "aai-paul" }),
|
|
172
172
|
llm: "claude-sonnet-4-6",
|
|
173
173
|
greeting: "Hi, how can I help?",
|
|
174
174
|
builtinTools: ["think", "web_search"],
|
|
@@ -178,7 +178,7 @@ export default agent({
|
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
The fields almost every agent sets: `name` (required), `greeting` (default: "Hey
|
|
181
|
-
there..."; `""` starts silent), `tts` (voice `jane` unless set), `llm`,
|
|
181
|
+
there..."; `""` starts silent), `tts` (voice `aai-jane` unless set), `llm`,
|
|
182
182
|
`builtinTools` (omitted = `["think"]` only; setting it REPLACES the default),
|
|
183
183
|
`maxSteps` (default 10 tool-calling steps per reply) and `requiredEnv` (every
|
|
184
184
|
env var a tool or step reads; **publishing checks it**, so a missing key fails
|
|
@@ -100,7 +100,7 @@ export default agent({
|
|
|
100
100
|
|
|
101
101
|
| Factory | Default voice | Env var |
|
|
102
102
|
| --------------- | ---------------------------------------- | -------------------- |
|
|
103
|
-
| `assemblyAITts` | `"jane"`
|
|
103
|
+
| `assemblyAITts` | `"aai-jane"` | `ASSEMBLYAI_API_KEY` |
|
|
104
104
|
| `cartesiaTts` | `"f786b574-daa5-4673-aa0c-cbe3e8534c02"` | `CARTESIA_API_KEY` |
|
|
105
105
|
| `rimeTts` | `"cove"` (model `mistv2`) | `RIME_API_KEY` |
|
|
106
106
|
|
|
@@ -109,20 +109,19 @@ Override with `{ voice, model, language }`.
|
|
|
109
109
|
|
|
110
110
|
**AssemblyAI TTS** shares `ASSEMBLYAI_API_KEY` with AssemblyAI STT and the LLM
|
|
111
111
|
Gateway, so an all-AssemblyAI pipeline needs exactly one secret. On the default
|
|
112
|
-
pipeline, `tts: assemblyAITts({ voice: "michael" })` changes the voice and
|
|
113
|
-
leaves the other two stages on the default.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
and accent, and put the delivery in the system prompt instead.
|
|
112
|
+
pipeline, `tts: assemblyAITts({ voice: "aai-michael" })` changes the voice and
|
|
113
|
+
leaves the other two stages on the default. A voice is a `voice_id` SLUG — the
|
|
114
|
+
`aai-` prefix is part of it, and the bare name is refused — and **an unknown one
|
|
115
|
+
is refused when the session opens**, so pick from the library
|
|
116
|
+
(`ASSEMBLYAI_TTS_VOICES`) rather than guessing a plausible name:
|
|
117
|
+
|
|
118
|
+
`aai-alba`, `aai-anna`, `aai-charles`, `aai-eve`, `aai-george`, `aai-jane` (the
|
|
119
|
+
default), `aai-jean`, `aai-mary`, `aai-michael`, `aai-paul`, `aai-vera`
|
|
120
|
+
|
|
121
|
+
Every library voice speaks all six languages; `language` (`"en"`, `"fr"`,
|
|
122
|
+
`"de"`, `"it"`, `"pt"`, `"es"`) picks which. There is no separate
|
|
123
|
+
age/gender/style axis — match the persona by picking a voice, and put the
|
|
124
|
+
delivery in the system prompt instead.
|
|
126
125
|
|
|
127
126
|
Set `language` only alongside a voice that speaks it, as an ISO 639-1 code —
|
|
128
127
|
`"en"`, `"fr"`, `"de"`, `"it"`, `"pt"`, `"es"` are the six the catalog covers,
|
|
@@ -670,7 +670,7 @@ trip.
|
|
|
670
670
|
import { stepSpeak, stepWriteUpload } from "@alexkroman1/aai/step";
|
|
671
671
|
|
|
672
672
|
export async function narrate(script: string) {
|
|
673
|
-
const spoken = await stepSpeak(script, { voice: "jane" });
|
|
673
|
+
const spoken = await stepSpeak(script, { voice: "aai-jane" });
|
|
674
674
|
const stored = await stepWriteUpload(spoken.audio, { name: "summary.wav", type: "audio/wav" });
|
|
675
675
|
return { audio: stored.id, durationMs: spoken.durationMs };
|
|
676
676
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"publish:agent": "aai publish"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alexkroman1/aai": "^0.
|
|
19
|
-
"@alexkroman1/aai-cli": "^0.
|
|
20
|
-
"@alexkroman1/aai-runtime": "^0.
|
|
21
|
-
"@alexkroman1/aai-ui": "^0.
|
|
18
|
+
"@alexkroman1/aai": "^0.16.0",
|
|
19
|
+
"@alexkroman1/aai-cli": "^0.16.0",
|
|
20
|
+
"@alexkroman1/aai-runtime": "^0.16.0",
|
|
21
|
+
"@alexkroman1/aai-ui": "^0.16.0",
|
|
22
22
|
"react": "^19.3.0",
|
|
23
23
|
"react-dom": "^19.3.0",
|
|
24
24
|
"tailwindcss": "^4.0.0",
|
|
@@ -409,7 +409,7 @@ describeWorkflowEvalWithFfmpeg(
|
|
|
409
409
|
expect(output.audioBytes).toBeLessThan(wavBytes / 4);
|
|
410
410
|
// The run says both numbers, which is what makes the trade visible.
|
|
411
411
|
expect(run.reported.at(-1)).toMatch(
|
|
412
|
-
/^Recorded a \d+s audit
|
|
412
|
+
/^Recorded a \d+s audit with voice [\w-]+ — .* of MP3, from .* of WAV\.$/,
|
|
413
413
|
);
|
|
414
414
|
|
|
415
415
|
// The model really read the transcript, and the audit really reached the
|
|
@@ -220,7 +220,8 @@ describe("the declaration", () => {
|
|
|
220
220
|
?.issues,
|
|
221
221
|
).toBeTruthy();
|
|
222
222
|
expect(
|
|
223
|
-
(await audit.input?.["~standard"].validate({ recording: UPLOAD_ID, voice: "jane" }))
|
|
223
|
+
(await audit.input?.["~standard"].validate({ recording: UPLOAD_ID, voice: "aai-jane" }))
|
|
224
|
+
?.issues,
|
|
224
225
|
).toBeUndefined();
|
|
225
226
|
});
|
|
226
227
|
|
|
@@ -829,7 +830,7 @@ describe("the ffmpeg steps, up to the spawn", () => {
|
|
|
829
830
|
installStubReporter();
|
|
830
831
|
installStubUploads({}, { writable: true });
|
|
831
832
|
|
|
832
|
-
await expect(narrate("Read this back.", "jane")).rejects.toBeInstanceOf(FatalError);
|
|
833
|
+
await expect(narrate("Read this back.", "aai-jane")).rejects.toBeInstanceOf(FatalError);
|
|
833
834
|
expect(speech.calls.length).toBe(1);
|
|
834
835
|
expect(speech.calls[0]?.text).toBe("Read this back.");
|
|
835
836
|
});
|
|
@@ -86,23 +86,18 @@
|
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
88
|
import { workflow, workflowApp } from "@alexkroman1/aai";
|
|
89
|
-
import {
|
|
89
|
+
import { ASSEMBLYAI_TTS_VOICES } from "@alexkroman1/aai/tts";
|
|
90
90
|
import type { WorkflowDef } from "@alexkroman1/aai/workflow-api";
|
|
91
91
|
import { z } from "zod";
|
|
92
92
|
import { auditFlow, type CallAudit } from "./workflows/audit.ts";
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
* The voices the form offers, as the tuple `z.enum`
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* the socket is open, so the synthesis simply produces nothing. Narrowed to the
|
|
100
|
-
* English ones because the audit is written in the transcript's language and
|
|
101
|
-
* the prompt does not translate; every voice in the catalog speaks exactly one.
|
|
102
|
-
* `ttsVoiceIds` owns the derivation, including the fallback to the SDK's own
|
|
103
|
-
* default voice should the filter ever match nothing.
|
|
95
|
+
* The voices the form offers: the SDK's library voices, as the tuple `z.enum`
|
|
96
|
+
* takes. READ from the catalog rather than listed, because a wrong voice id is
|
|
97
|
+
* refused when the synthesis socket opens. Every library voice speaks every
|
|
98
|
+
* supported language, so none needs filtering out.
|
|
104
99
|
*/
|
|
105
|
-
const VOICES =
|
|
100
|
+
const VOICES = ASSEMBLYAI_TTS_VOICES;
|
|
106
101
|
|
|
107
102
|
/**
|
|
108
103
|
* The run input, as its own const.
|
|
@@ -186,7 +186,7 @@ export async function narrate(
|
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
await stepReport(
|
|
189
|
-
`Recorded a ${Math.round(spoken.durationMs / 1000)}s audit
|
|
189
|
+
`Recorded a ${Math.round(spoken.durationMs / 1000)}s audit with voice ${spoken.voice} — ` +
|
|
190
190
|
`${formatBytes(bytes)} of MP3, from ${formatBytes(spoken.audio.byteLength)} of WAV.`,
|
|
191
191
|
);
|
|
192
192
|
return {
|
|
@@ -86,11 +86,11 @@ describe("three modes, three members", () => {
|
|
|
86
86
|
// reads the second. A voice has no shorthand: it is the TTS descriptor's.
|
|
87
87
|
const def: AgentDef = agent({
|
|
88
88
|
...SHARED,
|
|
89
|
-
tts: assemblyAITts({ voice: "michael" }),
|
|
89
|
+
tts: assemblyAITts({ voice: "aai-michael" }),
|
|
90
90
|
llm: "claude-sonnet-4-6",
|
|
91
91
|
});
|
|
92
92
|
expect(def.tts?.kind).toBe("assemblyai");
|
|
93
|
-
expect(def.tts?.options.voice).toBe("michael");
|
|
93
|
+
expect(def.tts?.options.voice).toBe("aai-michael");
|
|
94
94
|
expect(def.llm?.options.model).toBe("claude-sonnet-4-6");
|
|
95
95
|
});
|
|
96
96
|
});
|
|
@@ -104,11 +104,11 @@ test("the preset takes OPTIONS — one setting across the three stages at once",
|
|
|
104
104
|
// on two descriptors that can drift apart, and `voice` to TTS. (An EU agent
|
|
105
105
|
// also has to name a model the EU gateway carries — Claude and most Gemini
|
|
106
106
|
// ids — which is the half no shorthand can do for you.)
|
|
107
|
-
const options: AssemblyAIPipelineOptions = { region: "eu", voice: "michael" };
|
|
107
|
+
const options: AssemblyAIPipelineOptions = { region: "eu", voice: "aai-michael" };
|
|
108
108
|
const pipeline = assemblyAIPipeline(options);
|
|
109
109
|
expect(pipeline.stt.options.region).toBe("eu");
|
|
110
110
|
expect(pipeline.llm.options.providerOptions).toMatchObject({ region: "eu" });
|
|
111
|
-
expect(pipeline.tts.options.voice).toBe("michael");
|
|
111
|
+
expect(pipeline.tts.options.voice).toBe("aai-michael");
|
|
112
112
|
|
|
113
113
|
// And a stage declared AFTER the spread still wins — that is the whole point
|
|
114
114
|
// of it being a plain object, and it is how this template's own `agent.ts`
|
|
@@ -58,7 +58,6 @@ import {
|
|
|
58
58
|
type AssemblyAITtsLanguage,
|
|
59
59
|
type AssemblyAITtsOptions,
|
|
60
60
|
type AssemblyAITtsVoice,
|
|
61
|
-
type AssemblyAITtsVoiceInfo,
|
|
62
61
|
assemblyAITts,
|
|
63
62
|
CARTESIA_DEFAULT_VOICE,
|
|
64
63
|
type CartesiaTtsOptions,
|
|
@@ -67,8 +66,6 @@ import {
|
|
|
67
66
|
type RimeTtsOptions,
|
|
68
67
|
rimeTts,
|
|
69
68
|
type TtsProvider,
|
|
70
|
-
ttsVoiceIds,
|
|
71
|
-
ttsVoiceInfo,
|
|
72
69
|
} from "@alexkroman1/aai/tts";
|
|
73
70
|
import { describe, expect, test } from "vitest";
|
|
74
71
|
|
|
@@ -261,34 +258,16 @@ describe("the TTS stage", () => {
|
|
|
261
258
|
}
|
|
262
259
|
});
|
|
263
260
|
|
|
264
|
-
test("
|
|
265
|
-
// The catalog is `
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
// speaks English, so asking for French and nothing else used to produce an
|
|
269
|
-
// agent that connected, reported ready, and never spoke.
|
|
270
|
-
// `ttsVoiceInfo` is the lookup by an OPEN voice id — `undefined` for one
|
|
271
|
-
// this release's catalog does not list — so it needs no cast.
|
|
272
|
-
const info: AssemblyAITtsVoiceInfo | undefined = ttsVoiceInfo(ASSEMBLYAI_TTS_DEFAULT_VOICE);
|
|
273
|
-
expect(info?.language).toBe("en");
|
|
274
|
-
expect(ttsVoiceInfo("a-voice-shipped-next-week")).toBeUndefined();
|
|
275
|
-
// With no language, `ttsVoiceIds()` is the whole catalog, in its order.
|
|
276
|
-
expect(ttsVoiceIds()).toEqual(Object.keys(ASSEMBLYAI_TTS_VOICES));
|
|
277
|
-
|
|
261
|
+
test("every library voice speaks every supported language", () => {
|
|
262
|
+
// The catalog is a tuple of `voice_id` slugs (what `z.enum` takes), and
|
|
263
|
+
// language is a separate axis: any voice, any of the six languages.
|
|
264
|
+
expect(ASSEMBLYAI_TTS_VOICES).toContain(ASSEMBLYAI_TTS_DEFAULT_VOICE);
|
|
278
265
|
for (const language of Object.keys(ASSEMBLYAI_TTS_LANGUAGES) as AssemblyAITtsLanguage[]) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const speaking = agent({ name: NAME, tts: assemblyAITts({ language, voice }) });
|
|
284
|
-
expect(() => toAgentConfig(speaking), language).not.toThrow();
|
|
266
|
+
for (const voice of ASSEMBLYAI_TTS_VOICES) {
|
|
267
|
+
const speaking = agent({ name: NAME, tts: assemblyAITts({ language, voice }) });
|
|
268
|
+
expect(() => toAgentConfig(speaking), `${voice}/${language}`).not.toThrow();
|
|
269
|
+
}
|
|
285
270
|
}
|
|
286
|
-
|
|
287
|
-
// `toAgentConfig` is the last layer that sees the mismatch while somebody
|
|
288
|
-
// is still authoring — after it, the refusal is in-band, after the socket
|
|
289
|
-
// opens, with the agent ready and mute.
|
|
290
|
-
const mismatched = agent({ name: NAME, tts: assemblyAITts({ language: "fr" }) });
|
|
291
|
-
expect(() => toAgentConfig(mismatched)).toThrow(/speaks en/);
|
|
292
271
|
});
|
|
293
272
|
|
|
294
273
|
test("the catalog is not an allow-list: a voice shipped later still compiles", () => {
|
|
@@ -23,7 +23,7 @@ export default agent({
|
|
|
23
23
|
// The first thing a caller hears. Without one the agent waits for them to speak.
|
|
24
24
|
greeting: "Hi, what can I do for you?",
|
|
25
25
|
// Only the speaking stage is declared; speech-to-text and the LLM are the defaults.
|
|
26
|
-
tts: assemblyAITts({ voice: "jane" }),
|
|
26
|
+
tts: assemblyAITts({ voice: "aai-jane" }),
|
|
27
27
|
// Setting this REPLACES the default (`["think"]`), so `think` is listed to keep it. All
|
|
28
28
|
// keyless but text_me, which reads TEXTBELT_KEY and SMS_TO_PHONE and texts only the
|
|
29
29
|
// owner: without them it says it can't, and nothing else here depends on it.
|
|
@@ -21,5 +21,5 @@ export default agent({
|
|
|
21
21
|
// Any name from `ASSEMBLYAI_TTS_VOICES`. The voice is the speaking stage's
|
|
22
22
|
// own option, so this replaces only that stage; the other two stay on the
|
|
23
23
|
// default pipeline.
|
|
24
|
-
tts: assemblyAITts({ voice: "jane" }),
|
|
24
|
+
tts: assemblyAITts({ voice: "aai-jane" }),
|
|
25
25
|
});
|
|
@@ -200,7 +200,7 @@ describeWorkflowEval(
|
|
|
200
200
|
// the run renders.
|
|
201
201
|
expect(run.reported[0]).toMatch(/^Uploading standup\.wav /);
|
|
202
202
|
expect(run.reported).toContain("Summarizing the transcript.");
|
|
203
|
-
expect(run.reported.at(-1)).toMatch(/^Recorded a 2s summary
|
|
203
|
+
expect(run.reported.at(-1)).toMatch(/^Recorded a 2s summary with voice [\w-]+\.$/);
|
|
204
204
|
// The job finished on its first poll, so no durable wait was asked for.
|
|
205
205
|
expect(run.slept).toEqual([]);
|
|
206
206
|
// One upload of the recording, and one submit — the split that exists so a
|
|
@@ -218,7 +218,7 @@ describeWorkflowEval(
|
|
|
218
218
|
const { model } = scriptProvider();
|
|
219
219
|
const speech = installStubSpeech();
|
|
220
220
|
|
|
221
|
-
const run = await app.run(spokenSummary, { recording: UPLOAD_ID, voice: "michael" });
|
|
221
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID, voice: "aai-michael" });
|
|
222
222
|
|
|
223
223
|
expect(run.error).toBeUndefined();
|
|
224
224
|
const spokenText = speech.calls[0]?.text;
|
|
@@ -227,7 +227,7 @@ describeWorkflowEval(
|
|
|
227
227
|
// whatever was spoken, it was not the list.
|
|
228
228
|
for (const point of REPLY.points) expect(spokenText).not.toContain(point);
|
|
229
229
|
// The form's choice really reaches the synthesizer.
|
|
230
|
-
expect(speech.calls[0]?.voice).toBe("michael");
|
|
230
|
+
expect(speech.calls[0]?.voice).toBe("aai-michael");
|
|
231
231
|
// Both shapes survive to the output — one to read, one that was heard.
|
|
232
232
|
expect(run.output?.points).toEqual(REPLY.points);
|
|
233
233
|
expect(run.output?.spoken).toBe(REPLY.spoken);
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
WAV_HEADER_BYTES,
|
|
27
27
|
} from "@alexkroman1/aai/step";
|
|
28
28
|
import { FatalError, RetryableError } from "@alexkroman1/aai/step-errors";
|
|
29
|
-
import { ASSEMBLYAI_TTS_DEFAULT_VOICE
|
|
29
|
+
import { ASSEMBLYAI_TTS_DEFAULT_VOICE } from "@alexkroman1/aai/tts";
|
|
30
30
|
import {
|
|
31
31
|
createWorkflowContext,
|
|
32
32
|
runWorkflow,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
installStubUploads,
|
|
42
42
|
} from "@alexkroman1/aai-runtime/testing/vitest";
|
|
43
43
|
import { beforeEach, describe, expect, test, vi } from "vitest";
|
|
44
|
-
import agentDef, {
|
|
44
|
+
import agentDef, { spokenSummary, VOICES } from "./agent.ts";
|
|
45
45
|
import { speak, spokenSummaryFlow, summarize } from "./workflows/summarize.ts";
|
|
46
46
|
import { createJob, pollTranscript, uploadToProvider } from "./workflows/transcribe.ts";
|
|
47
47
|
|
|
@@ -118,14 +118,9 @@ describe("the declaration", () => {
|
|
|
118
118
|
|
|
119
119
|
test("the voice that fills in when nobody chooses is one the form would have offered", () => {
|
|
120
120
|
// `voice` is OPTIONAL, so an unchosen summary is read by the SDK's own
|
|
121
|
-
// default rather than by anything this template names
|
|
122
|
-
//
|
|
123
|
-
// speaking `SUMMARY_LANGUAGE`, the form would still offer nothing but
|
|
124
|
-
// English while the common path spoke something else, which is the failure
|
|
125
|
-
// no voice-id validation can see: the id is real, it is simply the wrong
|
|
126
|
-
// one. Asked of the catalog rather than restated, so the answer stays true.
|
|
121
|
+
// default rather than by anything this template names. Asked of the
|
|
122
|
+
// catalog rather than restated, so the answer stays true.
|
|
127
123
|
expect(VOICES).toContain(ASSEMBLYAI_TTS_DEFAULT_VOICE);
|
|
128
|
-
expect(ttsVoiceInfo(ASSEMBLYAI_TTS_DEFAULT_VOICE)?.language).toBe(SUMMARY_LANGUAGE);
|
|
129
124
|
});
|
|
130
125
|
});
|
|
131
126
|
|
|
@@ -285,10 +280,10 @@ describe("speaking", () => {
|
|
|
285
280
|
const speech = installStubSpeech();
|
|
286
281
|
installStubReporter();
|
|
287
282
|
|
|
288
|
-
await speak("Hello.", { voice: "michael" });
|
|
283
|
+
await speak("Hello.", { voice: "aai-michael" });
|
|
289
284
|
await speak("Hello.");
|
|
290
285
|
|
|
291
|
-
expect(speech.calls[0]?.voice).toBe("michael");
|
|
286
|
+
expect(speech.calls[0]?.voice).toBe("aai-michael");
|
|
292
287
|
// The SDK's own default, named rather than restated — a literal here would
|
|
293
288
|
// have been this template quietly keeping a second copy of it.
|
|
294
289
|
expect(speech.calls[1]?.voice).toBe(ASSEMBLYAI_TTS_DEFAULT_VOICE);
|
|
@@ -369,9 +364,12 @@ describe("the whole run", () => {
|
|
|
369
364
|
installStubReporter();
|
|
370
365
|
const speech = installStubSpeech();
|
|
371
366
|
|
|
372
|
-
await spokenSummaryFlow(
|
|
367
|
+
await spokenSummaryFlow(
|
|
368
|
+
{ recording: UPLOAD_ID, voice: "aai-michael" },
|
|
369
|
+
createWorkflowContext(),
|
|
370
|
+
);
|
|
373
371
|
|
|
374
|
-
expect(speech.calls[0]).toMatchObject({ text: "Spoken.", voice: "michael" });
|
|
372
|
+
expect(speech.calls[0]).toMatchObject({ text: "Spoken.", voice: "aai-michael" });
|
|
375
373
|
});
|
|
376
374
|
|
|
377
375
|
test("a recording the provider gave up on fails the run rather than half-summarizing", async () => {
|
|
@@ -76,40 +76,24 @@
|
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
import { workflow, workflowApp } from "@alexkroman1/aai";
|
|
79
|
-
import {
|
|
79
|
+
import { ASSEMBLYAI_TTS_VOICES } from "@alexkroman1/aai/tts";
|
|
80
80
|
import type { WorkflowDef } from "@alexkroman1/aai/workflow-api";
|
|
81
81
|
import { z } from "zod";
|
|
82
82
|
import { type SpokenSummary, spokenSummaryFlow } from "./workflows/summarize.ts";
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* The
|
|
86
|
-
*
|
|
87
|
-
* The voice list below is filtered by it, and the prompt in
|
|
88
|
-
* `workflows/summarize.ts` writes the summary in the transcript's own language
|
|
89
|
-
* rather than translating — so this is a claim about the VOICES, which is why
|
|
90
|
-
* it lives next to them. Typed as the catalog's own union rather than the
|
|
91
|
-
* literal `"en"`, so a fork changing it can only name a language the voices
|
|
92
|
-
* actually cover — `ttsVoiceIds` answers the SDK's default voice ALONE when a
|
|
93
|
-
* filter matches nothing, and a select with one entry in it is not a failure
|
|
94
|
-
* anybody would look at twice.
|
|
95
|
-
*/
|
|
96
|
-
export const SUMMARY_LANGUAGE: AssemblyAITtsLanguage = "en";
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The voices the form offers, as the tuple `z.enum` takes.
|
|
85
|
+
* The voices the form offers: the SDK's library voices, as the tuple `z.enum`
|
|
86
|
+
* takes.
|
|
100
87
|
*
|
|
101
|
-
* READ from the SDK's catalog rather than listed, because a wrong voice id is
|
|
102
|
-
*
|
|
103
|
-
* the
|
|
104
|
-
*
|
|
105
|
-
* language and the prompt does not translate; every voice in the catalog speaks
|
|
106
|
-
* exactly one. `ttsVoiceIds` owns the derivation, including the fallback to the
|
|
107
|
-
* SDK's own default voice should the filter ever match nothing.
|
|
88
|
+
* READ from the SDK's catalog rather than listed, because a wrong voice id is
|
|
89
|
+
* refused when the synthesis socket opens — the run fails at the step rather
|
|
90
|
+
* than at the form. Every library voice speaks every supported language, so the
|
|
91
|
+
* summary (written in the transcript's own language) can be read by any of them.
|
|
108
92
|
*
|
|
109
93
|
* Exported so `agent.test.ts` can hold the list to the catalog it came from —
|
|
110
94
|
* in particular that the voice the SDK fills in for an unchosen one is on it.
|
|
111
95
|
*/
|
|
112
|
-
export const VOICES =
|
|
96
|
+
export const VOICES = ASSEMBLYAI_TTS_VOICES;
|
|
113
97
|
|
|
114
98
|
/**
|
|
115
99
|
* The run input, as its own const.
|
|
@@ -254,7 +254,7 @@ export async function speak(
|
|
|
254
254
|
});
|
|
255
255
|
|
|
256
256
|
await stepReport(
|
|
257
|
-
`Recorded a ${Math.round(spoken.durationMs / 1000)}s summary
|
|
257
|
+
`Recorded a ${Math.round(spoken.durationMs / 1000)}s summary with voice ${spoken.voice}.`,
|
|
258
258
|
);
|
|
259
259
|
return { audio: stored.id, durationMs: spoken.durationMs };
|
|
260
260
|
}
|
|
@@ -16,7 +16,7 @@ export default agent({
|
|
|
16
16
|
// something to project rather than an empty state object.
|
|
17
17
|
// A narrator wants a narrative voice; everything else stays on the
|
|
18
18
|
// default all-AssemblyAI pipeline.
|
|
19
|
-
tts: assemblyAITts({ voice: "paul" }),
|
|
19
|
+
tts: assemblyAITts({ voice: "aai-paul" }),
|
|
20
20
|
/**
|
|
21
21
|
* The status line, pushed to the CRT's top bar — where you are, your score,
|
|
22
22
|
* your rank and the turn count, the four facts the printed games put across
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexkroman1/aai-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"vite": "^8.3.1",
|
|
59
59
|
"xstate": "^5.33.2",
|
|
60
60
|
"zod": "^4.6.5",
|
|
61
|
-
"@alexkroman1/aai": "0.
|
|
62
|
-
"@alexkroman1/aai-runtime": "0.
|
|
63
|
-
"@alexkroman1/aai-ui": "0.
|
|
61
|
+
"@alexkroman1/aai": "0.16.0",
|
|
62
|
+
"@alexkroman1/aai-runtime": "0.16.0",
|
|
63
|
+
"@alexkroman1/aai-ui": "0.16.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"playwright": "^1.63.0",
|