Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Live calls: show the Service picker on the API keys page

prantikmedhic050f38f8ba6
diff --git a/src/components/keys/KeysPage.dom.test.ts b/src/components/keys/KeysPage.dom.test.ts
index cbbd051b2d..88defdb030 100644
--- a/src/components/keys/KeysPage.dom.test.ts
+++ b/src/components/keys/KeysPage.dom.test.ts
@@ -93,6 +93,15 @@ describe("the keys page", () => {
expect(rowsShown()).not.toContain("elevenlabs");
});
+ it("offers the Live calls service, OpenAI or Azure OpenAI, on the separate live key row", () => {
+ setConfig({ ...fx.config, live: { configured: false, provider: "azure", voice: "", readTypedReplies: true, idleMinutes: 5 } });
+ page();
+ const select = row("liveKey")!.querySelector<HTMLSelectElement>("select")!;
+ expect([...select.options].map((option) => option.value)).toEqual(["openai", "azure"]);
+ expect(select.value).toBe("azure");
+ expect(row("liveKey")!.querySelector('input[type="url"]')).not.toBeNull();
+ });
+
it("opens a section that holds a saved key, and counts what is connected", () => {
setConfig({ ...fx.config, box: { configured: true, last4: "c3d4" } });
page();
diff --git a/src/components/keys/KeysPage.tsx b/src/components/keys/KeysPage.tsx
index 30d89e7a31..ab09a40a2c 100644
--- a/src/components/keys/KeysPage.tsx
+++ b/src/components/keys/KeysPage.tsx
@@ -5,6 +5,7 @@ import { cn } from "@/lib/cn";
import { scrollParent, scrollWithin } from "@/lib/scroll-within";
import { t } from "@/lib/i18n";
import { BoatOfferPanel } from "../BoatOffer";
+import { LiveProviderSettings } from "../LiveProviderSettings";
import { LmStudioServer, OtherOpenAiCompatServers } from "../OpenAiCompatServers";
import { KEY_CATALOG, KEY_SECTIONS, keyMatches, savedState, type KeyEntry, type KeyId, type KeySectionId } from "./key-catalog";
import { finishKeyFocus, useKeyFocus, type KeyFocusRequest } from "./key-focus";
@@ -24,6 +25,7 @@ const EXTRAS: Partial<Record<KeyId, () => ReactNode>> = {
anthropic: () => <AnthropicEveryClaudeBot />,
openaiCompat: () => <><OpenAiCompatUrl /><OtherOpenAiCompatServers /></>,
box: () => <BoatOfferPanel />,
+ liveKey: () => <LiveProviderSettings />,
};
function connected(entry: KeyEntry, config: ConfigStatus | null | undefined): boolean {
diff --git a/src/components/keys/key-catalog.ts b/src/components/keys/key-catalog.ts
index f30d8ff150..e3f52ba022 100644
--- a/src/components/keys/key-catalog.ts
+++ b/src/components/keys/key-catalog.ts
@@ -123,7 +123,7 @@ export const KEY_CATALOG: readonly KeyEntry[] = [
{ id: "liveCalls", section: "voice", labelKey: "call.live.key", purposeKey: "keys.purpose.liveCalls", name: "OpenAI", env: [],
words: ["openai", "live calls", "calls", "voice", "talk", "gpt-live"], mark: { icon: Phone }, kind: "uses", uses: "openai" },
{ id: "liveKey", section: "voice", labelKey: "keys.label.liveKey", purposeKey: "keys.purpose.liveKey", name: "OpenAI", env: ["OMB_OPENAI_LIVE_KEY"],
- words: ["openai", "live calls", "calls", "voice", "gpt-live"], mark: { icon: Phone }, kind: "key",
+ words: ["openai", "live calls", "calls", "voice", "gpt-live", "azure", "foundry"], mark: { icon: Phone }, kind: "key",
target: { patch: (value) => ({ live: { key: value } }), slot: "openaiLiveKey",
saved: (config) => flag(config.savedKeys?.openaiLiveKey ?? { configured: config.live?.keySource === "live" }),
placeholder: "sk-…", href: "https://platform.openai.com/api-keys", analytics: "openai_live", shape: OPENAI_SHAPE } },