Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(live): include all documented OpenAI voice options
playerpianoman13a3e8e4a197
diff --git a/packages/phone-protocol/src/live-call.ts b/packages/phone-protocol/src/live-call.tsindex b7cd99ef2a..becbae8022 100644--- a/packages/phone-protocol/src/live-call.ts+++ b/packages/phone-protocol/src/live-call.ts@@ -169,6 +169,15 @@ export const LIVE_VOICE_OPTIONS: ReadonlyArray<{ id: string; label: string }> ={ id: "beacon", label: "Beacon — Filipino, masculine" },{ id: "bossa", label: "Bossa — Brazilian Portuguese, feminine" },{ id: "tempo", label: "Tempo — Brazilian Portuguese, masculine" },+ { id: "nuri", label: "Nuri — German, feminine" },+ { id: "juni", label: "Juni — German, feminine" },+ { id: "flitz", label: "Flitz — German, masculine" },+ { id: "brise", label: "Brise — French, feminine" },+ { id: "sillage", label: "Sillage — French, masculine" },+ { id: "nira", label: "Nira — Hindi, feminine" },+ { id: "harema", label: "Harema — Japanese, feminine" },+ { id: "shida", label: "Shida — Japanese, masculine" },+ { id: "noeul", label: "Noeul — Korean, feminine" },];/** Gemini Live's prebuilt voices (Gemini API docs, "Live API capabilities", voices), with the docs' one-word character.diff --git a/server/live-call-controller.test.ts b/server/live-call-controller.test.tsindex 493e7de158..3db5fbf4b9 100644--- a/server/live-call-controller.test.ts+++ b/server/live-call-controller.test.ts@@ -110,6 +110,14 @@ describe("LiveCallController lifecycle", () => {expect(other.deps.createSession).toHaveBeenCalledWith(expect.objectContaining({ botId: "bot2", voice: "sol" }));});+ it.each(["nuri", "juni", "flitz", "brise", "sillage", "nira", "harema", "shida", "noeul"])("starts the called bot's session in %s instead of the app's voice", async (voice) => {+ const t = setup({ botVoice: () => voice });+ const started = await t.controller.start({ auth: owner, ...BOT, client: "desktop", sdp: "a" });+ expect(t.deps.createSession).toHaveBeenCalledWith(expect.objectContaining({ voice }));+ expect(started.call.voice).toBe(voice);+ await t.controller.shutdown();+ });+it("uses the app's voice when the bot's own is not a GPT-Live voice", async () => {const t = setup({ botVoice: () => "Kore" });await t.controller.start({ auth: owner, ...BOT, client: "desktop", sdp: "a" });diff --git a/server/routes/bot-patch.test.ts b/server/routes/bot-patch.test.tsindex 218eecc65f..17497c80db 100644--- a/server/routes/bot-patch.test.ts+++ b/server/routes/bot-patch.test.ts@@ -267,6 +267,14 @@ describe("PATCH /api/bots/:id toolsOff", () => {});describe("PATCH /api/bots/:id liveVoice", () => {+ it.each(["nuri", "juni", "flitz", "brise", "sillage", "nira", "harema", "shida", "noeul"])("saves %s as the bot's Live call voice", async (liveVoice) => {+ const { store, bot, patch } = fixture();+ const response = await patch(bot.id, { liveVoice });+ expect(response.status).toBe(200);+ expect(response.body.bot.liveVoice).toBe(liveVoice);+ expect(store.bot(bot.id)?.liveVoice).toBe(liveVoice);+ });+it("gives one bot its own Live call voice, leaves the others on the app's, clears it, and refuses a voice that is not a Live one", async () => {const { store, bot, patch } = fixture();const other = store.createBot({ name: "Echo" });diff --git a/shared/live-call.test.ts b/shared/live-call.test.tsindex 8d1fd3e6be..d0092deef7 100644--- a/shared/live-call.test.ts+++ b/shared/live-call.test.ts@@ -1,6 +1,28 @@import { describe, expect, it } from "vitest";-import { clampAppend, commentaryChunks, formatCallDuration, FULL_ANSWER_IN_CHAT, joinFragments, LiveTranscript, liveCallRowText, SpokenLines } from "./live-call.ts";+import { botCallVoice, clampAppend, commentaryChunks, formatCallDuration, FULL_ANSWER_IN_CHAT, geminiLiveVoice, isBotLiveVoice, joinFragments, LIVE_VOICE_OPTIONS, LiveTranscript, liveCallRowText, SpokenLines } from "./live-call.ts";++describe("Live call voices", () => {+ it.each(["nuri", "juni", "flitz", "brise", "sillage", "nira", "harema", "shida", "noeul"])("offers %s as a bot's OpenAI voice without using it for Gemini", (voice) => {+ expect(LIVE_VOICE_OPTIONS.filter((option) => option.id === voice)).toHaveLength(1);+ expect(isBotLiveVoice(voice)).toBe(true);+ expect(botCallVoice(voice, "marin", false)).toBe(voice);+ expect(botCallVoice(voice, "Charon", true)).toBe("Charon");+ expect(geminiLiveVoice(voice)).toBe("Puck");+ });++ it("keeps existing provider voices and app defaults", () => {+ expect(LIVE_VOICE_OPTIONS[0]).toEqual({ id: "marin", label: "Marin (default)" });+ expect(botCallVoice("cedar", "marin", false)).toBe("cedar");+ expect(botCallVoice("Kore", "Charon", true)).toBe("Kore");+ expect(botCallVoice("Kore", "marin", false)).toBe("marin");+ for (const voice of [undefined, "", "unknown", "Nuri", " nuri "]) {+ expect(isBotLiveVoice(voice)).toBe(false);+ expect(botCallVoice(voice, "marin", false)).toBe("marin");+ expect(botCallVoice(voice, undefined, false)).toBeUndefined();+ }+ });+});describe("SpokenLines", () => {it("keeps each stretch of the voice's speech as one line, stamped when it began", () => {