chore: 文案工具箱模型限定 mimo-v2.6-flash / glm-5.3-flash 两款, relay侧白名单校验
This commit is contained in:
1 parent
0bee6e4364
commit
93cd1cf2bd
2 files changed
+6
-22
No files matched your search
@@ -1572,7 +1572,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
reply = self._llm_chat([
|
||||
{"role": "system", "content": self.COPY_SCENES[scene]},
|
||||
{"role": "user", "content": text},
|
||||
], model=str(payload.get("model") or ""))
|
||||
], model=(str(payload.get("model") or "") if str(payload.get("model") or "") in ("mimo-v2.6-flash", "glm-5.3-flash") else ""))
|
||||
log_usage(machine, "copywriting")
|
||||
self._reply(200, json.dumps({"code": 200, "message": "ok", "data": {"reply": reply}}, ensure_ascii=False).encode("utf-8"), "application/json")
|
||||
except Exception as e: # noqa: BLE001
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useHead } from '@vueuse/head';
|
||||
import { getMachineId } from '@/tools/license/license';
|
||||
import { useGenHistory } from '@/tools/gen-history/gen-history';
|
||||
@@ -16,25 +16,10 @@ const SCENES = [
|
||||
] as const;
|
||||
|
||||
const scene = ref<(typeof SCENES)[number]['key']>('rewrite');
|
||||
// NewAPI 模型选择
|
||||
const model = ref('');
|
||||
const models = ref<string[]>([]);
|
||||
|
||||
async function loadModels() {
|
||||
try {
|
||||
const res = await fetch('/relay/ai/models');
|
||||
const j = await res.json();
|
||||
if (j.code === 200 && j.data.models.length) {
|
||||
models.value = j.data.models;
|
||||
if (!model.value || !models.value.includes(model.value)) {
|
||||
model.value = models.value.find(m => m.includes('qwen')) || models.value[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { /* 列表失败时留空走后端默认 */ }
|
||||
}
|
||||
|
||||
onMounted(loadModels);
|
||||
// NewAPI 模型选择(固定两款文案模型)
|
||||
const COPY_MODELS = ['mimo-v2.6-flash', 'glm-5.3-flash'];
|
||||
const models = ref<string[]>(COPY_MODELS);
|
||||
const model = ref(COPY_MODELS[0]);
|
||||
const input = ref('');
|
||||
const output = ref('');
|
||||
const busy = ref(false);
|
||||
@@ -94,7 +79,6 @@ function switchScene(k: (typeof SCENES)[number]['key']) {
|
||||
<label class="cw-model" title="由 NewAPI 网关提供模型">
|
||||
模型
|
||||
<select v-model="model" class="cw-model-sel">
|
||||
<option v-if="!models.length" value="">默认(qwen3.8-flash)</option>
|
||||
<option v-for="m in models" :key="m" :value="m">{{ m }}</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
Reference in new issue
Block a user