Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
ba9db2ca
提交
ba9db2ca
authored
12月 31, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
e722581d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
16 行删除
+15
-16
ImageDesign.vue
src/modules/material/all/components/ImageDesign.vue
+4
-4
useChat.ts
src/modules/material/all/composables/useChat.ts
+11
-12
没有找到文件。
src/modules/material/all/components/ImageDesign.vue
浏览文件 @
ba9db2ca
...
...
@@ -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"
...
...
src/modules/material/all/composables/useChat.ts
浏览文件 @
ba9db2ca
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论