change model
This commit is contained in:
@@ -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 = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user