feat: share the tool catalog with voice

This commit is contained in:
Sameh Khamis committed 2026-10-01 13:52:36 -07:00
1 parent 0953ebb026
commit 1a03e7483d
19 files changed
+288 -15

No files matched your search

+6 -1
View File
@@ -4,6 +4,7 @@ import { createBrowserViteConfig } from '../../build/vite.js';
import { localProviderPlugins } from '../providers/local.js';
import { localMcpPlugin } from '../mcp/plugin.js';
import { apiNotFoundPlugin } from './api-not-found.js';
import { standaloneVoiceTools } from './voiceTools.js';
const root = fileURLToPath(new URL('../../', import.meta.url));
@@ -14,7 +15,11 @@ export default defineConfig(({ command, mode }) => {
if (process.env[key] === undefined) process.env[key] = value;
}
return createBrowserViteConfig({
plugins: [...localProviderPlugins(), localMcpPlugin(), apiNotFoundPlugin()],
plugins: [
...localProviderPlugins({ realtime: { tools: standaloneVoiceTools() } }),
localMcpPlugin(),
apiNotFoundPlugin(),
],
googleApiKey: process.env.GOOGLE_MAPS_API_KEY,
cesiumToken: process.env.CESIUM_ION_TOKEN,
host: process.env.HOST,
+16
View File
@@ -0,0 +1,16 @@
/**
* The voice session's tools for the standalone server: the app actions plus
* Core's catalog queries, which the browser runs through the same catalog.
* Links to the app are left out, since voice runs inside it.
*/
import { coreTools, toFunctionTools } from '../../src/tools/index.js';
import { realtimeSessionTools } from '../providers/openai/tools.js';
export const VOICE_EXCLUDED_QUERIES = Object.freeze(['open_in_gods_eye_view']);
export function standaloneVoiceTools() {
return realtimeSessionTools(
toFunctionTools(coreTools, { exclude: VOICE_EXCLUDED_QUERIES }),
);
}