提交 ba9db2ca authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 e722581d
......@@ -5,7 +5,7 @@ import { uploadFileByUrl } from '@/utils/upload'
const ChuangKitDesign = defineAsyncComponent(() => import('@/components/ChuangKitDesign.vue'))
const route = useRoute()
// const route = useRoute()
const userStore = useUserStore()
......@@ -46,10 +46,10 @@ function onClose() {
<template>
<div class="image-design">
<router-link :to="{ path: 'design', query: route.query }" target="_blank">
<!-- <router-link :to="{ path: 'design', query: route.query }" target="_blank">
<el-button type="primary">打开编辑器</el-button>
<!-- <el-button type="primary" @click="designVisible = true">打开编辑器</el-button> -->
</router-link>
</router-link> -->
<el-button type="primary" @click="designVisible = true">打开编辑器</el-button>
<ul>
<li
v-for="item in data.list"
......
......@@ -20,7 +20,7 @@ export function useChat(options: any) {
ai_creation_max_count: 5,
ai_polish_max_count: 5,
ai_expand_max_count: 5,
ai_refresh_max_count: 5
ai_refresh_max_count: 5,
})
async function fetchUsages() {
......@@ -91,7 +91,6 @@ export function useChat(options: any) {
* 假数据Start
*/
const customData: any = {
'13811534871': `【慧农贷】低利率,活体抵押,创新金融!11月15日厅堂沙龙,好礼相送,期待您的光临,共享财富盛宴!🚀🎉`,
'18810031001': `【慧农贷】低利率,活体抵押,创新金融!11月15日厅堂沙龙,好礼相送,期待您的光临,共享财富盛宴!🚀🎉`,
'18810031002': `【慧农贷·您的融资捷径】
......@@ -105,7 +104,7 @@ export function useChat(options: any) {
别错过,成功近在咫尺!立刻点击下方链接,开启您的财富快车道!👉[申请入口]👈
🔥立即行动,把握机遇,共赴丰收盛宴!🔥`
🔥立即行动,把握机遇,共赴丰收盛宴!🔥`,
}
const customContent = customData[mobile]
if (customContent) {
......@@ -124,7 +123,7 @@ export function useChat(options: any) {
let params = {}
if (data.type === '1') {
params = {
chat_history: messages.value
chat_history: messages.value,
}
} else {
const docAction: any = {
......@@ -133,25 +132,25 @@ export function useChat(options: any) {
4: 'expand',
5: 'rewrite',
7: 'abbreviate',
8: 'summary'
8: 'summary',
}
params = {
content: data.content,
doc_action: docAction[data.type],
full_text: !!(data.type === 2)
full_text: !!(data.type === 2),
}
}
await fetchEventSource('/api/lab/v1/experiment/marketing-ai/sky-agent3-chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
},
body: JSON.stringify({
...options,
...data,
api_type: parseInt(data.type) === 1 ? 1 : 2,
context: data.content,
params: params
params: params,
}),
async onopen(response) {
if (response.ok) {
......@@ -169,7 +168,7 @@ export function useChat(options: any) {
return
}
const conversationId = message.conversation_id
const messageIndex = messages.value.findIndex(session => session.conversationId === conversationId)
const messageIndex = messages.value.findIndex((session) => session.conversationId === conversationId)
const content = message?.arguments?.reduce((a: any, b: any) => {
a = b?.messages[0]?.text || ''
return a
......@@ -184,13 +183,13 @@ export function useChat(options: any) {
} else {
// 按钮功能返回内容
const requestId = message.request_id
const messageIndex = messages.value.findIndex(session => session.conversationId === requestId)
const messageIndex = messages.value.findIndex((session) => session.conversationId === requestId)
if (messageIndex === -1) {
messages.value.push({
conversationId: requestId,
role: 'bot',
content: message.data?.text || '',
input: data.context
input: data.context,
})
} else {
messages.value[messageIndex].content = message.data?.text
......@@ -206,7 +205,7 @@ export function useChat(options: any) {
console.log(err)
isLoading.value = false
throw err
}
},
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论