Skip to content

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

Merge origin/main into train/nov16-s2

milind-soni04fb7ab49d40
diff --cc server/live-config.ts
index f570dc716c,6687cc68a0..6a1a448a59
--- a/server/live-config.ts
+++ b/server/live-config.ts
@@@ -2,18 -2,20 +2,21 @@@
import { z } from "zod";
export const LIVE_KEY_NEEDS_ENDPOINT = "Save the Azure endpoint first: a Live key works only with the endpoint it was saved for.";
+ export const LIVE_KEY_NEEDS_CUSTOM_ENDPOINT = "Save the custom endpoint first: a Live key works only with the endpoint it was saved for.";
const NOWHERE = "nowhere";
- /** Live calls: `key` is a key for Live calls only; with `provider` "openai" (the default) a call without one uses `openai.key`, with "azure" it is the Azure resource's key and is required, with "fish", "gemini" or "elevenlabs" it is not used: Fish Audio calls use the Fish Audio key (`tts.fishKey`), Gemini calls the Gemini key (`tts.geminiKey`) and ElevenLabs calls the ElevenLabs key (`tts.key`). `keyFor` says where `key` may go (`liveKeyTarget`): the server sets it when the key is saved and never takes it from a request; absent, the key is from before Azure was offered, so OpenAI's. `azureEndpoint` is the resource URL and `azureDeployment` the gpt-live-1 deployment name. `fishAgentId` is the Fish Audio agent a "fish" call starts, which the harness sets up on the account of the key whose `fishKeyPrint` is `fishAgentFor`; without `fishAgentFor` (an operator's OMB_FISH_LIVE_AGENT_ID) it is used with any key, and `fishAgentLanguage` is the language the harness last set it to speak (absent: English, as agents were first set up). `elevenlabsAgentId` and `elevenlabsAgentFor` are the same for an "elevenlabs" call's ElevenLabs agent. `voice` is a GPT-Live voice, `geminiVoice` a Gemini Live voice. */
-/** Live calls: `key` is a key for Live calls only; with `provider` "openai" (the default) a call without one uses `openai.key`, with "azure" it is the Azure resource's key and is required, with "fish", "gemini" or "elevenlabs" it is not used: Fish Audio calls use the Fish Audio key (`tts.fishKey`), Gemini calls the Gemini key (`tts.geminiKey`) and ElevenLabs calls the ElevenLabs key (`tts.key`). `keyFor` says where `key` may go (`liveKeyTarget`): the server sets it when the key is saved and never takes it from a request; absent, the key is from before Azure was offered, so OpenAI's. `azureEndpoint` is the resource URL and `azureDeployment` the gpt-live-1 deployment name; with "custom", `key` is the key of the OpenAI-compatible server at `customEndpoint` and is required, and `customModel` its model. `fishAgentId` is the Fish Audio agent a "fish" call starts, which the harness sets up on the account of the key whose `fishKeyPrint` is `fishAgentFor`; without `fishAgentFor` (an operator's OMB_FISH_LIVE_AGENT_ID) it is used with any key. `elevenlabsAgentId` and `elevenlabsAgentFor` are the same for an "elevenlabs" call's ElevenLabs agent. `voice` is a GPT-Live voice, `geminiVoice` a Gemini Live voice. */
++/** Live calls: `key` is a key for Live calls only; with `provider` "openai" (the default) a call without one uses `openai.key`, with "azure" it is the Azure resource's key and is required, with "fish", "gemini" or "elevenlabs" it is not used: Fish Audio calls use the Fish Audio key (`tts.fishKey`), Gemini calls the Gemini key (`tts.geminiKey`) and ElevenLabs calls the ElevenLabs key (`tts.key`). `keyFor` says where `key` may go (`liveKeyTarget`): the server sets it when the key is saved and never takes it from a request; absent, the key is from before Azure was offered, so OpenAI's. `azureEndpoint` is the resource URL and `azureDeployment` the gpt-live-1 deployment name; with "custom", `key` is the key of the OpenAI-compatible server at `customEndpoint` and is required, and `customModel` its model. `fishAgentId` is the Fish Audio agent a "fish" call starts, which the harness sets up on the account of the key whose `fishKeyPrint` is `fishAgentFor`; without `fishAgentFor` (an operator's OMB_FISH_LIVE_AGENT_ID) it is used with any key, and `fishAgentLanguage` is the language the harness last set it to speak (absent: English, as agents were first set up). `elevenlabsAgentId` and `elevenlabsAgentFor` are the same for an "elevenlabs" call's ElevenLabs agent. `voice` is a GPT-Live voice, `geminiVoice` a Gemini Live voice. */
export const liveConfigSchema = z.object({
key: z.string().optional(),
keyFor: z.string().max(300).optional(),
- provider: z.enum(["openai", "azure", "fish", "gemini", "elevenlabs"]).optional(),
+ provider: z.enum(["openai", "azure", "fish", "gemini", "elevenlabs", "custom"]).optional(),
azureEndpoint: z.string().trim().max(300).optional(),
azureDeployment: z.string().trim().max(64).optional(),
+ customEndpoint: z.string().trim().max(300).optional(),
+ customModel: z.string().trim().max(64).optional(),
fishAgentId: z.string().trim().max(128).optional(),
fishAgentFor: z.string().max(64).optional(),
+ fishAgentLanguage: z.string().max(8).optional(),
elevenlabsAgentId: z.string().trim().max(128).optional(),
elevenlabsAgentFor: z.string().max(64).optional(),
voice: z.string().trim().max(40).regex(/^[a-z]*$/, "a Live voice is a lowercase built-in voice name").optional(),
@@@ -25,12 -27,13 +28,14 @@@
export interface LiveConfig {
key?: string;
keyFor?: string;
- provider?: "openai" | "azure" | "fish" | "gemini" | "elevenlabs";
+ provider?: "openai" | "azure" | "fish" | "gemini" | "elevenlabs" | "custom";
azureEndpoint?: string;
azureDeployment?: string;
+ customEndpoint?: string;
+ customModel?: string;
fishAgentId?: string;
fishAgentFor?: string;
+ fishAgentLanguage?: string;
elevenlabsAgentId?: string;
elevenlabsAgentFor?: string;
voice?: string;
@@@ -86,11 -91,11 +93,12 @@@ export function liveConfigWithEnv(live
if (env.OMB_FISH_LIVE_AGENT_ID?.trim()) {
next.fishAgentId = env.OMB_FISH_LIVE_AGENT_ID.trim();
delete next.fishAgentFor;
+ delete next.fishAgentLanguage;
}
- // Set together in the environment, the key and the Azure endpoint are the operator's own pairing. A `keyFor` from the
+ // Set together in the environment, the key and the Azure (or custom) endpoint are the operator's own pairing. A `keyFor` from the
// file stands: saves mirror settings into the environment, so they must not be able to pair a forgotten key.
- if (envKey?.trim() && provider === "azure" && env.OMB_AZURE_OPENAI_LIVE_ENDPOINT?.trim() && next.keyFor === undefined) next.keyFor = liveKeyTarget(next) ?? NOWHERE;
+ const envEndpoint = provider === "azure" ? env.OMB_AZURE_OPENAI_LIVE_ENDPOINT : provider === "custom" ? env.OMB_CUSTOM_LIVE_ENDPOINT : undefined;
+ if (envKey?.trim() && envEndpoint?.trim() && next.keyFor === undefined) next.keyFor = liveKeyTarget(next) ?? NOWHERE;
return next;
}
diff --cc src/components/LiveCallSettings.tsx
index 245bcf9117,c43c798677..3df825d5ab
--- a/src/components/LiveCallSettings.tsx
+++ b/src/components/LiveCallSettings.tsx
@@@ -1,9 -1,9 +1,9 @@@
import { useCallback, useId, useState } from "react";
-import { GEMINI_LIVE_VOICE_OPTIONS, geminiLiveVoice, LIVE_VOICE_OPTIONS } from "../../shared/live-call";
+import { botCallVoice, GEMINI_LIVE_VOICE_OPTIONS, geminiLiveVoice, LIVE_VOICE_OPTIONS } from "../../shared/live-call";
import { t } from "@/lib/i18n";
- import { liveDisclosure, liveKeyCopy } from "@/lib/call-mode";
+ import { liveDisclosure, liveKeyCopy, liveKeyFormKey } from "@/lib/call-mode";
-import { api, useStore, type ConfigStatus } from "@/state/store";
+import { api, useStore, type Bot, type ConfigStatus } from "@/state/store";
import type { LiveSettings } from "../../shared/wire";
import { LiveKeySetup } from "./LiveKeySetup";
import { LiveProviderSettings } from "./LiveProviderSettings";
diff --cc src/locales/source-hashes.json
index f4184773c2,79f80b89df..8733f99277
--- a/src/locales/source-hashes.json
+++ b/src/locales/source-hashes.json
@@@ -3993,10 -3993,11 +3993,13 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
"server.routines.turnedBackOn": "e091ee76b804f84c0ac8a9b0f40adefd1661708a4b933be334c4a398f6917b6d",
"server.routines.turnedBackOnMany": "b9b1f8055114f9a1b59fc53167a4d2d3be904e945cbe33f829142a8195a1ec4f",
+ "server.routines.card.conversationKept": "ea038ec2124d474aa977c0faeb838dae7c8c2436cc44fc5382c231a7539c0fb9",
+ "server.routines.card.sessionContinues": "af4dedfee873451f6b9f28c12ef5b4f683c98ae795a706fe7fd58da470374c47",
+ "server.routines.card.onceContinues": "47f36e2af395ab1cc4c1fa758a4e169404e1e0164fb07d2ad82914228cf99297",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -10509,8 -10510,10 +10512,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -26104,8 -26103,10 +26111,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -57646,10 -57674,9 +57696,13 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "chat.cloudGuest.ownerApproves": "aadd80b6e03cb0cd6d217c5365ea5bab64c4ab20460ae213b1ca6b0f3bac46c2",
+ "serverError.card.cloudOwnerOnly": "0e42ca25d5bb39f9d127462765bc2430a5c6792e130b80fbb30ea68e54be8ae4",
+ "server.routines.card.conversationKept": "ea038ec2124d474aa977c0faeb838dae7c8c2436cc44fc5382c231a7539c0fb9",
+ "server.routines.card.sessionContinues": "af4dedfee873451f6b9f28c12ef5b4f683c98ae795a706fe7fd58da470374c47",
+ "server.routines.card.onceContinues": "47f36e2af395ab1cc4c1fa758a4e169404e1e0164fb07d2ad82914228cf99297",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -81054,8 -81075,10 +81107,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -88386,8 -88409,10 +88443,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -95524,8 -95549,10 +95585,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"
@@@ -103323,8 -103350,10 +103388,12 @@@
"devices.computers.pairButton": "60f8288e33f9f57d2b51409fdb540b47a89c25447061bd354122442818a36ee0",
"devices.computers.pairTitle": "b7cda6a11ab410daa4b8977624ca72261c0168e7c3d83ae0eed93ac4e3540bc8",
"devices.computers.typeCode": "2a528dfe78f6b331e8cca951872961169ca6f340a886e40e84cc0b53d441c174",
+ "engineSetup.cloudPasteSummary": "99bef9b03db7662e2944939a6bf8e904d5c674c3577540ef994a9f5c4862ed5f",
+ "engineSetup.cloudPasteHint": "e6e7b723c8ec76caec36a54986610db04f079430fd3a7a1986c627e18480a7ea",
+ "task.bulk.retitle": "70425d709318f9bdf8830f149b5298d8aab8df851a0631bdc40e58759e81296b",
+ "task.bulk.retitling": "6570061ecf4e09f529036fa3bba7e33b8150c83dd11cdf3792c435ed9469e4dc",
+ "task.bulk.retitleResult": "83306c1404f4170a9594bb2238aeac49e469b340b2f45b5c01952faaf5bc0eb5",
+ "task.bulk.retitleFailed": "fe8013b5add18967ec7df89806ef632a9a0c40012e6f651c0b236cc4127fbab6",
"together.switch.title": "2829f92e4a9012d2265d7a82806d5750743ca14c0600d688485825dd4272938a",
"together.switch.line": "f1da9a3fe37ffcb0273f52889240d8e3d13709220eca9c08b5b923f9def19409",
"together.switch.failed": "ad8287436402edb5c91ee0cc4bfe88f3301bac459a7d49e4cd2c564fa20aa1b8"