'use strict';
import { generateText, streamText } from 'ai';
import { getAiGroqGeneratedText, getAiGroqStreamText } from '../server/ai-groq.js';
import { getAiDeepInfraGeneratedText, getAiDeepInfraStreamText } from '../server/ai-deepinfra.js';
import { getStringEnvSetting } from '../../../fd-toolbox/infra/env-functions.js';
import { envSettingKeys } from '../../common/infra/env-setting-keys.js';
import { getAiGoogleGeneratedText, getAiGoogleStreamText } from '../server/ai-google.js';
import { defaultOAuthProviders } from '../../../fd-toolbox/auth/oauth-provider-types.js';

var __defProp=Object['defineProperty'],__name=(_0x4fe6cd,_0xb5e21d)=>__defProp(_0x4fe6cd,'name',{'value':_0xb5e21d,'configurable':!![]});const aiProviders={'groq':'groq','deepinfra':'deepinfra'};async function generateAiText(_0x50ef39){const _0x4303b6=getAiProviderName();switch(_0x4303b6){case aiProviders['groq']:return getAiGroqGeneratedText(_0x50ef39);case aiProviders['deepinfra']:return getAiDeepInfraGeneratedText(_0x50ef39);case defaultOAuthProviders['google']:return getAiGoogleGeneratedText(_0x50ef39);default:return generateText({'model':_0x4303b6+'/'+getStringEnvSetting(envSettingKeys['aiModelName']),'prompt':_0x50ef39['prompt'],'system':_0x50ef39['systemPrompt'],'tools':_0x50ef39['tools']});}}__name(generateAiText,'generateAiText');async function getAiStreamText(_0x4dac0a){const _0x181f6c=getAiProviderName();switch(_0x181f6c){case aiProviders['groq']:return getAiGroqStreamText(_0x4dac0a);case aiProviders['deepinfra']:return getAiDeepInfraStreamText(_0x4dac0a);case defaultOAuthProviders['google']:return getAiGoogleStreamText(_0x4dac0a);default:return streamText({'model':_0x181f6c+'/'+getStringEnvSetting(envSettingKeys['aiModelName']),'prompt':_0x4dac0a['prompt'],'system':_0x4dac0a['systemPrompt'],'tools':_0x4dac0a['tools']});}}__name(getAiStreamText,'getAiStreamText');function getAiProviderName(){return getStringEnvSetting(envSettingKeys['aiProviderName']);}__name(getAiProviderName,'getAiProviderName');

export { generateAiText, getAiStreamText };
