change model
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-03-31 05:50:33 -06:00
parent f16104b011
commit 91e1b2b48b
3 changed files with 20 additions and 7 deletions

View File

@@ -28,6 +28,12 @@
@keydown.enter.exact.prevent="send" @keydown.enter.exact.prevent="send"
/> />
<n-flex justify="flex-end" align="center" style="margin-top: 8px"> <n-flex justify="flex-end" align="center" style="margin-top: 8px">
<n-select
v-model:value="selectedModel"
:options="modelOptions"
style="width: 120px"
:disabled="streaming"
/>
<n-button <n-button
type="primary" type="primary"
:loading="streaming" :loading="streaming"
@@ -43,6 +49,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, nextTick } from "vue" import { ref, watch, nextTick } from "vue"
import { useStorage } from "@vueuse/core"
import { marked, Renderer } from "marked" import { marked, Renderer } from "marked"
import { import {
messages, messages,
@@ -54,10 +61,16 @@ import {
const input = ref("") const input = ref("")
const messagesRef = ref<HTMLElement>() const messagesRef = ref<HTMLElement>()
const modelOptions = [
{ label: "豆包", value: "doubao-seed-2-0-mini-260215" },
{ label: "DeepSeek", value: "deepseek-chat" },
]
const selectedModel = useStorage("prompt-model", "deepseek-chat")
function send() { function send() {
const text = input.value.trim() const text = input.value.trim()
if (!text || streaming.value) return if (!text || streaming.value) return
sendPrompt(text) sendPrompt(text, selectedModel.value)
input.value = "" input.value = ""
} }

View File

@@ -13,7 +13,7 @@
> >
<n-flex justify="space-between" style="flex-shrink: 0"> <n-flex justify="space-between" style="flex-shrink: 0">
<n-button secondary @click="() => goHome($router, taskTab, step)"> <n-button secondary @click="() => goHome($router, taskTab, step)">
返回首页 首页
</n-button> </n-button>
<n-flex align="center"> <n-flex align="center">
<n-select <n-select
@@ -28,11 +28,11 @@
v-model:value="query.zone" v-model:value="query.zone"
style="width: 100px" style="width: 100px"
clearable clearable
placeholder="分区" placeholder="从夯到拉"
:options="[ :options="[
{ label: '夯', value: 'featured' }, { label: '夯爆了', value: 'featured' },
{ label: 'NPC', value: 'pending' }, { label: 'NPC', value: 'pending' },
{ label: '拉', value: 'low' }, { label: '拉完了', value: 'low' },
]" ]"
/> />
<n-input <n-input

View File

@@ -103,10 +103,10 @@ export function disconnectPrompt() {
_onCodeComplete = null _onCodeComplete = null
} }
export function sendPrompt(content: string) { export function sendPrompt(content: string, model: string = "") {
if (!ws || ws.readyState !== WebSocket.OPEN) return if (!ws || ws.readyState !== WebSocket.OPEN) return
messages.value.push({ role: "user", content }) messages.value.push({ role: "user", content })
ws.send(JSON.stringify({ type: "message", content })) ws.send(JSON.stringify({ type: "message", content, model }))
} }
function applyCode(code: { function applyCode(code: {