|
@@ -42,8 +42,8 @@ export class Tab2Page {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if(currentUser?.get("realname")){
|
|
|
- userPrompt += `当前来访的用户,姓名:${currentUser?.get("realname")}`
|
|
|
+ if(currentUser?.get("username")){
|
|
|
+ userPrompt += `当前来访的用户,姓名:${currentUser?.get("username")}`
|
|
|
}
|
|
|
if(currentUser?.get("gender")){
|
|
|
userPrompt += `,性别:${currentUser?.get("gender")}`
|
|
@@ -56,10 +56,18 @@ export class Tab2Page {
|
|
|
let consult = new CloudObject("ChatRecord")
|
|
|
let now = new Date();
|
|
|
let dateStr = `${now.getFullYear()}-${now.getMonth()+1}-${now.getDate()}`
|
|
|
+ //对象权限的精确制定
|
|
|
+ let ACL:any = {//公开访客 不可读 不可写
|
|
|
+ "*":{read:false,write:false}
|
|
|
+ }
|
|
|
+ if(currentUser?.id){//当前用户 可读 可写
|
|
|
+ ACL[currentUser?.id] = {read:true,write:true}
|
|
|
+ }
|
|
|
consult.set({
|
|
|
title:`${chatpartner.get('expertise') || ""}领域聊天记录${dateStr}-${chatpartner.get('name')}`,
|
|
|
chatpartner:chatpartner.toPointer(),
|
|
|
- user:currentUser.toPointer()
|
|
|
+ user:currentUser.toPointer(),
|
|
|
+ ACL:ACL
|
|
|
})
|
|
|
let options:ChatPanelOptions = {
|
|
|
roleId:"2DXJkRsjXK",
|
|
@@ -73,10 +81,10 @@ export class Tab2Page {
|
|
|
chat.role.set("prompt", `
|
|
|
# 角色设定
|
|
|
您是${chatpartner.get("name")},一位${chatpartner.get("bio")},${chatpartner.get("expertise")},需要为用户提供陪伴和支持等积极情绪。
|
|
|
- # 对话环节
|
|
|
- 每次回复用户消息都在消息结尾附带[祝你有愉快的一天]
|
|
|
# 开始话语
|
|
|
当您准备好了,可以以一个关心用户的朋友的身份,向来访的用户打招呼。
|
|
|
+ # 对话环节
|
|
|
+ 每次回复用户消息都在消息结尾附带[祝你有愉快的一天]
|
|
|
${userPrompt}
|
|
|
`);
|
|
|
},
|