import { RealtimeConfig } from "@/app/store";
import Locale from "@/app/locales";
import { ListItem, Select, PasswordInput } from "@/app/components/ui-lib";
import { InputRange } from "@/app/components/input-range";
import { Voice } from "rt-client";
import { ServiceProvider } from "@/app/constant";
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),
);
}}
>
>
)}
>
);
}