mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-25 08:48:13 +02:00
feat: support flux for dograh multi
This commit is contained in:
parent
0956157029
commit
ca598933ef
7 changed files with 176 additions and 11 deletions
|
|
@ -21,6 +21,9 @@ import { LANGUAGE_DISPLAY_NAMES } from "@/constants/languages";
|
|||
|
||||
type ModelMode = "realtime" | "dograh" | "byok";
|
||||
|
||||
// Sentinel language value for "Multilingual (Auto-detect)".
|
||||
const MULTILINGUAL_LANGUAGE_CODE = "multi";
|
||||
|
||||
interface DograhDefaults {
|
||||
voices: string[];
|
||||
allow_custom_input?: boolean;
|
||||
|
|
@ -31,6 +34,8 @@ interface DograhDefaults {
|
|||
step?: number;
|
||||
};
|
||||
languages: string[];
|
||||
// Languages covered by the "multi" (Multilingual / Auto-detect) option.
|
||||
multilingual_languages?: string[];
|
||||
defaults: {
|
||||
voice: string;
|
||||
speed: number;
|
||||
|
|
@ -282,6 +287,11 @@ export function AIModelConfigurationV2Editor({
|
|||
|
||||
const allowCustomVoice = defaults.dograh.allow_custom_input ?? false;
|
||||
const dograhSpeedRange = defaults.dograh.speed_range ?? { min: 0.5, max: 2.0, step: 0.1 };
|
||||
const multilingualLanguageNames = useMemo(() => {
|
||||
const codes = defaults.dograh.multilingual_languages ?? [];
|
||||
if (codes.length === 0) return null;
|
||||
return codes.map((code) => LANGUAGE_DISPLAY_NAMES[code] || code).join(", ");
|
||||
}, [defaults.dograh.multilingual_languages]);
|
||||
|
||||
useEffect(() => {
|
||||
const rawConfiguration = asRecord(configuration);
|
||||
|
|
@ -412,6 +422,11 @@ export function AIModelConfigurationV2Editor({
|
|||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{dograh.language === MULTILINGUAL_LANGUAGE_CODE && multilingualLanguageNames && (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Auto-detects {multilingualLanguageNames}.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue