diff --git a/.env.development b/.env.development index 3f301b4..d84cc4f 100644 --- a/.env.development +++ b/.env.development @@ -3,5 +3,5 @@ ENV = 'development' # 本地环境接口地址 # VITE_API_URL = 'http://192.168.3.200:8808/' -VITE_API_URL = 'http://192.168.3.11:8808/' +VITE_API_URL = 'http://localhost:8808/' diff --git a/src/utils/request.ts b/src/utils/request.ts index 00d70fd..7497982 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -22,7 +22,7 @@ const service: AxiosInstance = axios.create({ const newService: AxiosInstance = axios.create({ // baseURL: 'http://192.168.3.95:8000/', // baseURL: 'http://192.168.3.49:8000/', - baseURL: 'http://192.168.3.11:8000/', + baseURL: 'http://localhost:8000/', // baseURL: 'http://192.168.3.200:8000/', timeout: 50000, headers: { 'Content-Type': 'application/json' }, diff --git a/src/views/customerService/account/component/editAccount.vue b/src/views/customerService/account/component/editAccount.vue index b1bcd63..87dcfc9 100644 --- a/src/views/customerService/account/component/editAccount.vue +++ b/src/views/customerService/account/component/editAccount.vue @@ -36,6 +36,19 @@ 提示:留空将使用系统默认提示词模板,创建后也可通过"配置提示词"按钮修改 + + +
+ 提示:留空将使用默认开场白,创建后也可通过"配置提示词"按钮修改 +
+
@@ -62,6 +75,7 @@ interface DialogFormData { accountName: string; platform: string; prompt?: string; + opener?: string; status: number; creator: ''; modifier: ''; @@ -80,6 +94,7 @@ const state = reactive({ accountName: '', platform: '', prompt: '', + opener: '', status: 1, creator: '', modifier: '', @@ -175,6 +190,7 @@ const resetForm = () => { accountName: '', platform: '', prompt: '', + opener: '', status: 1, creator: '', modifier: '', diff --git a/src/views/customerService/account/component/promptConfig.vue b/src/views/customerService/account/component/promptConfig.vue index 88db424..f7b6955 100644 --- a/src/views/customerService/account/component/promptConfig.vue +++ b/src/views/customerService/account/component/promptConfig.vue @@ -20,30 +20,19 @@ - 高级配置(可选) - - - - 建议范围:5-20,默认8 - - - - - 范围:0-1,越大越严格,默认0.2 - - - - - 范围:0-1,越大越依赖关键词,默认0.7 - - - + +
+ + 提示:开场白会在用户进入对话时自动发送 +
@@ -67,10 +56,7 @@ interface PromptFormData { accountName: string; platform: string; prompt: string; - topN: number; - similarityThreshold: number; - keywordsSimilarityWeight: number; - emptyResponse: string; + opener: string; } const emit = defineEmits<{ @@ -84,11 +70,8 @@ const state = reactive({ accountName: '', platform: '', prompt: '', - topN: 8, - similarityThreshold: 0.2, - keywordsSimilarityWeight: 0.7, - emptyResponse: '', - } as PromptFormData, + opener: '', + }, }); const defaultTemplate = `你是专业的客服顾问,负责帮助客户解答问题。 @@ -133,10 +116,7 @@ const openDialog = async (row: any) => { const res: any = await getRAGFlowConfig({ accountName: row.accountName }); if (res.code === 0 && res.data) { state.formData.prompt = res.data.prompt || ''; - state.formData.topN = res.data.topN || 8; - state.formData.similarityThreshold = res.data.similarityThreshold || 0.2; - state.formData.keywordsSimilarityWeight = res.data.keywordsSimilarityWeight || 0.7; - state.formData.emptyResponse = res.data.emptyResponse || ''; + state.formData.opener = res.data.opener || ''; } } catch (error) { console.log('获取配置失败,使用默认值', error); @@ -164,18 +144,13 @@ const onSubmit = async () => { state.loading = true; try { - const params: any = { - accountName: state.formData.accountName, - prompt: state.formData.prompt, + const reqData = { + accountName: formData.value.accountName, + prompt: formData.value.prompt, + opener: formData.value.opener, }; - // 只传递非默认值的参数 - if (state.formData.topN !== 8) params.topN = state.formData.topN; - if (state.formData.similarityThreshold !== 0.2) params.similarityThreshold = state.formData.similarityThreshold; - if (state.formData.keywordsSimilarityWeight !== 0.7) params.keywordsSimilarityWeight = state.formData.keywordsSimilarityWeight; - if (state.formData.emptyResponse) params.emptyResponse = state.formData.emptyResponse; - - const res: any = await updatePrompt(params); + const res: any = await updatePrompt(reqData); if (res.code === 0) { ElMessage.success('提示词配置成功'); closeDialog(); diff --git a/src/views/customerService/account/index.vue b/src/views/customerService/account/index.vue index bf5c56a..3b20fa1 100644 --- a/src/views/customerService/account/index.vue +++ b/src/views/customerService/account/index.vue @@ -148,6 +148,7 @@ const tableData = reactive({ // 模板引用 const editRoleRef = ref>(); +const promptConfigRef = ref>(); /** * 获取客服账号列表 diff --git a/vite.config.ts b/vite.config.ts index 97d67dc..31aa72e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,7 +55,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => { proxy: { '/api': { // target: 'http://192.168.3.200:8808', - target: 'http://192.168.3.49:8808', + target: 'http://localhost:8808', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '/api'), },