mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
feat(voice): harden Gemini Live provider integration
This commit is contained in:
1 parent
d4492d8f8c
commit
4fde920665
102 files changed
+28528
-1581
No files matched your search
@@ -0,0 +1,33 @@
|
||||
export const VOICE_PROVIDER_GUIDANCE =
|
||||
'I can’t switch voice providers directly. Hover over the Voice panel and use the provider dropdown.';
|
||||
export const HOST_VOICE_PROVIDER_GUIDANCE =
|
||||
'I can’t switch voice providers directly. Provider selection is managed by this app.';
|
||||
|
||||
/** Host construction decides which controls exist; tool text cannot add one. */
|
||||
export function voiceProviderGuidance({ providerDropdown = false } = {}) {
|
||||
return providerDropdown === true
|
||||
? VOICE_PROVIDER_GUIDANCE
|
||||
: HOST_VOICE_PROVIDER_GUIDANCE;
|
||||
}
|
||||
|
||||
export const VOICE_PROVIDERS = Object.freeze({
|
||||
openai: Object.freeze({ label: 'OpenAI' }),
|
||||
gemini: Object.freeze({ label: 'Gemini' }),
|
||||
});
|
||||
|
||||
/** Optional providers require an explicit host opt-in and an available factory. */
|
||||
export function supportedVoiceProviders(
|
||||
requested = ['openai'],
|
||||
factories = {},
|
||||
) {
|
||||
if (!Array.isArray(requested))
|
||||
throw new TypeError('supportedProviders must be an array');
|
||||
const selected = [...new Set(requested)].filter(
|
||||
(name) =>
|
||||
Object.hasOwn(VOICE_PROVIDERS, name) &&
|
||||
typeof factories[name] === 'function',
|
||||
);
|
||||
if (!selected.length)
|
||||
throw new Error('No supported voice provider is configured');
|
||||
return Object.freeze(selected);
|
||||
}
|
||||
Reference in new issue
Block a user