import type { RealtimeConfig } from '@/app/store';
import type { Voice } from 'rt-client';
import { InputRange } from '@/app/components/input-range';
import { ListItem, PasswordInput, Select } from '@/app/components/ui-lib';
import { ServiceProvider } from '@/app/constant';
import Locale from '@/app/locales';
const providers = [ServiceProvider.OpenAI, ServiceProvider.Azure];
const models = ['gpt-4o-realtime-preview-2024-10-01'];
const voice = ['alloy', 'shimmer', 'echo'];
export function RealtimeConfigList(props: {
realtimeConfig: RealtimeConfig;
updateConfig: (updater: (config: RealtimeConfig) => void) => void;
}) {
const azureConfigComponent = props.realtimeConfig.provider
=== ServiceProvider.Azure && (
<>
{
props.updateConfig(
config => (config.azure.endpoint = e.currentTarget.value),
);
}}
/>
{
props.updateConfig(
config => (config.azure.deployment = e.currentTarget.value),
);
}}
/>
>
);
return (
<>
props.updateConfig(
config => (config.enable = e.currentTarget.checked),
)}
>
{props.realtimeConfig.enable && (
<>
{
props.updateConfig(
config => (config.apiKey = e.currentTarget.value),
);
}}
/>
{azureConfigComponent}
{
props.updateConfig(
config =>
(config.temperature = e.currentTarget.valueAsNumber),
);
}}
>
>
)}
>
);
}