diff --git a/dto/openai_request.go b/dto/openai_request.go index 76a866621a71..5727327d9a5d 100644 --- a/dto/openai_request.go +++ b/dto/openai_request.go @@ -46,6 +46,8 @@ type GeneralOpenAIRequest struct { Input any `json:"input,omitempty"` Instruction string `json:"instruction,omitempty"` Size string `json:"size,omitempty"` + Seconds *int `json:"seconds,omitempty"` + Quality *string `json:"quality,omitempty"` Functions json.RawMessage `json:"functions,omitempty"` FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` PresencePenalty *float64 `json:"presence_penalty,omitempty"` diff --git a/web/src/components/playground/SettingsPanel.jsx b/web/src/components/playground/SettingsPanel.jsx index 3899e596fa6e..6bbcbc5fc0c4 100644 --- a/web/src/components/playground/SettingsPanel.jsx +++ b/web/src/components/playground/SettingsPanel.jsx @@ -47,6 +47,23 @@ const SettingsPanel = ({ messages, }) => { const { t } = useTranslation(); + const isVideoModel = + typeof inputs.model === 'string' && inputs.model.includes('video'); + const videoSizeOptions = [ + { label: '1280x720', value: '1280x720' }, + { label: '720x1280', value: '720x1280' }, + { label: '1792x1024', value: '1792x1024' }, + { label: '1024x1792', value: '1024x1792' }, + { label: '1024x1024', value: '1024x1024' }, + ]; + const videoSecondsOptions = [6, 8, 10, 12, 15, 20, 25, 30].map((v) => ({ + label: `${v}s`, + value: String(v), + })); + const videoQualityOptions = [ + { label: 'standard', value: 'standard' }, + { label: 'high', value: 'high' }, + ]; const currentConfig = { inputs, @@ -200,6 +217,50 @@ const SettingsPanel = ({ /> + {/* 视频参数(仅视频模型显示) */} + {isVideoModel && ( +
+
+
+ + {t('视频尺寸')} + + onInputChange('videoSeconds', value)} + disabled={customRequestMode} + /> +
+
+ + {t('视频质量')} + +