mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
refactor(voice): isolate gemini live provider core
This commit is contained in:
commit
10916227cb
655 files changed
+45946
-26483
No files matched your search
+11
-20
@@ -2,26 +2,17 @@ import { createVoiceCommands as bindVoiceCommands } from './sessionCommands.js';
|
||||
import { createRealtimeSession } from './realtimeSession.js';
|
||||
import { createGeminiSession } from './geminiSession.js';
|
||||
import { createProviderCommands } from './providerCommands.js';
|
||||
import { supportedVoiceProviders } from './providerCapabilities.js';
|
||||
|
||||
/** Standalone provider selection; embedders may still supply their own adapter. */
|
||||
export function createVoiceCommands(options) {
|
||||
if (options.createSession) return bindVoiceCommands(options);
|
||||
const factories = {
|
||||
openai: createRealtimeSession,
|
||||
gemini: createGeminiSession,
|
||||
};
|
||||
const supportedProviders = supportedVoiceProviders(
|
||||
options.supportedProviders,
|
||||
factories,
|
||||
);
|
||||
return createProviderCommands(
|
||||
{ ...options, supportedProviders },
|
||||
{
|
||||
/** Default composition; callers may supply another session adapter factory. */
|
||||
export function createVoiceCommands(options = {}) {
|
||||
// Generic hosts retain the existing default; standalone opts in explicitly.
|
||||
if (!options.createSession && options.supportedProviders !== undefined)
|
||||
return createProviderCommands(options, {
|
||||
bind: bindVoiceCommands,
|
||||
factories: Object.fromEntries(
|
||||
supportedProviders.map((name) => [name, factories[name]]),
|
||||
),
|
||||
},
|
||||
);
|
||||
factories: { openai: createRealtimeSession, gemini: createGeminiSession },
|
||||
});
|
||||
return bindVoiceCommands({
|
||||
createSession: createRealtimeSession,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user