Commit c6b82368 authored by chenghong_tao's avatar chenghong_tao

add 深度思考

parent af883d01
...@@ -13,6 +13,7 @@ declare module 'vue' { ...@@ -13,6 +13,7 @@ declare module 'vue' {
ElAside: typeof import('element-plus/es')['ElAside'] ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
......
...@@ -130,7 +130,7 @@ async function startSSE(query) { ...@@ -130,7 +130,7 @@ async function startSSE(query) {
headers: chatMessageOptions.headers, headers: chatMessageOptions.headers,
method: chatMessageOptions.method, method: chatMessageOptions.method,
body: JSON.stringify({ body: JSON.stringify({
inputs: {}, inputs: {think: taskStore.deepThink ? '1' : '0'},
query, query,
response_mode: "streaming", response_mode: "streaming",
conversation_id: taskStore.conversation_id, conversation_id: taskStore.conversation_id,
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
> >
<template #action-list> <template #action-list>
<div class="action-list-self-wrap"> <div class="action-list-self-wrap">
<el-checkbox v-model="deepThink" label="深度思考" style="margin-right: 20px;" border />
<el-button <el-button
type="danger" type="danger"
link link
...@@ -88,6 +89,11 @@ const senderRef = ref(); ...@@ -88,6 +89,11 @@ const senderRef = ref();
const senderValue = ref(""); const senderValue = ref("");
const senderLoading = ref(false); const senderLoading = ref(false);
const inputRef = ref(null); const inputRef = ref(null);
const deepThink = ref(false);
watch(() => deepThink.value, (newValue) => {
taskStore.setDeepThink(newValue)
})
const emit = defineEmits(["userQuery", "getInputHeight"]); const emit = defineEmits(["userQuery", "getInputHeight"]);
function handleSubmit() { function handleSubmit() {
......
...@@ -7,7 +7,8 @@ export const useTaskStore = defineStore('task', { ...@@ -7,7 +7,8 @@ export const useTaskStore = defineStore('task', {
conversation_id: '', // 当前会话id conversation_id: '', // 当前会话id
message_id: '', // 当前消息id message_id: '', // 当前消息id
workflow_run_id: '', // 当前工作流运行id workflow_run_id: '', // 当前工作流运行id
isLoading: false isLoading: false,
deepThink: false,
} }
}, },
actions: { actions: {
...@@ -28,11 +29,16 @@ export const useTaskStore = defineStore('task', { ...@@ -28,11 +29,16 @@ export const useTaskStore = defineStore('task', {
setIsLoading(isLoading) { setIsLoading(isLoading) {
this.isLoading = isLoading this.isLoading = isLoading
}, },
setDeepThink(think) {
this.deepThink = think
},
clear () { clear () {
this.taskId = '' this.taskId = ''
this.conversation_id = '' this.conversation_id = ''
this.message_id = '' this.message_id = ''
this.workflow_run_id = '' this.workflow_run_id = ''
this.isLoading = false
this.deepThink = false
} }
}, },
persist: { persist: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment