change model
This commit is contained in:
@@ -28,6 +28,12 @@
|
||||
@keydown.enter.exact.prevent="send"
|
||||
/>
|
||||
<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
|
||||
type="primary"
|
||||
:loading="streaming"
|
||||
@@ -43,6 +49,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, nextTick } from "vue"
|
||||
import { useStorage } from "@vueuse/core"
|
||||
import { marked, Renderer } from "marked"
|
||||
import {
|
||||
messages,
|
||||
@@ -54,10 +61,16 @@ import {
|
||||
const input = ref("")
|
||||
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() {
|
||||
const text = input.value.trim()
|
||||
if (!text || streaming.value) return
|
||||
sendPrompt(text)
|
||||
sendPrompt(text, selectedModel.value)
|
||||
input.value = ""
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
>
|
||||
<n-flex justify="space-between" style="flex-shrink: 0">
|
||||
<n-button secondary @click="() => goHome($router, taskTab, step)">
|
||||
返回首页
|
||||
首页
|
||||
</n-button>
|
||||
<n-flex align="center">
|
||||
<n-select
|
||||
@@ -28,11 +28,11 @@
|
||||
v-model:value="query.zone"
|
||||
style="width: 100px"
|
||||
clearable
|
||||
placeholder="分区"
|
||||
placeholder="从夯到拉"
|
||||
:options="[
|
||||
{ label: '夯', value: 'featured' },
|
||||
{ label: '夯爆了', value: 'featured' },
|
||||
{ label: 'NPC', value: 'pending' },
|
||||
{ label: '拉', value: 'low' },
|
||||
{ label: '拉完了', value: 'low' },
|
||||
]"
|
||||
/>
|
||||
<n-input
|
||||
|
||||
@@ -103,10 +103,10 @@ export function disconnectPrompt() {
|
||||
_onCodeComplete = null
|
||||
}
|
||||
|
||||
export function sendPrompt(content: string) {
|
||||
export function sendPrompt(content: string, model: string = "") {
|
||||
if (!ws || ws.readyState !== WebSocket.OPEN) return
|
||||
messages.value.push({ role: "user", content })
|
||||
ws.send(JSON.stringify({ type: "message", content }))
|
||||
ws.send(JSON.stringify({ type: "message", content, model }))
|
||||
}
|
||||
|
||||
function applyCode(code: {
|
||||
|
||||
Reference in New Issue
Block a user