|
|
@@ -101,6 +101,7 @@ export function ModelForm({
|
|
|
cache: { enable: false, ...defaultValues.plugin?.cache },
|
|
|
"web-search": { enable: false, search_from: [], ...defaultValues.plugin?.["web-search"] },
|
|
|
"think-split": { enable: false, ...defaultValues.plugin?.["think-split"] },
|
|
|
+ "stream-fake": { enable: false, ...defaultValues.plugin?.["stream-fake"] },
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
@@ -271,6 +272,15 @@ export function ModelForm({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // Stream fake plugin - 如果开启,必须有 enable 字段
|
|
|
+ if (data.plugin?.["stream-fake"]?.enable) {
|
|
|
+ Object.assign(pluginData, {
|
|
|
+ "stream-fake": {
|
|
|
+ enable: true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// Prepare data for API - 如果没有启用的插件,则不传递 plugin 字段
|
|
|
const formData: {
|
|
|
model?: string;
|
|
|
@@ -831,6 +841,32 @@ export function ModelForm({
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <hr className="border-border" />
|
|
|
+
|
|
|
+ {/* Stream Fake Plugin */}
|
|
|
+ <div className="flex items-center justify-between py-2">
|
|
|
+ <div className="flex items-center space-x-3">
|
|
|
+ <FormField
|
|
|
+ control={form.control}
|
|
|
+ name="plugin.stream-fake.enable"
|
|
|
+ render={({ field }) => (
|
|
|
+ <FormItem className="flex items-center space-x-2">
|
|
|
+ <FormControl>
|
|
|
+ <Switch
|
|
|
+ checked={field.value}
|
|
|
+ onCheckedChange={field.onChange}
|
|
|
+ />
|
|
|
+ </FormControl>
|
|
|
+ </FormItem>
|
|
|
+ )}
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <Label className="text-sm font-medium">{t("model.dialog.streamFakePlugin.title")}</Label>
|
|
|
+ <p className="text-xs text-muted-foreground">{t("model.dialog.streamFakePlugin.description")}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
{/* Submit button */}
|