zhaoyingbo b44f66f6be
All checks were successful
Egg Server CI/CD / build-image (push) Successful in 1m9s
Egg Server CI/CD / refresh-image (push) Successful in 14s
Egg Server CI/CD / fast-deploy (push) Successful in 5s
feat(mi-chat): 优化消息返回功能
2024-10-11 10:59:32 +00:00

233 lines
4.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const functionSelectorCard = {
elements: [
{
tag: "markdown",
content: "已经选中的群聊:**${chatName}**\n",
},
{
tag: "action",
actions: [
{
tag: "select_static",
placeholder: {
tag: "plain_text",
content: "请选择功能",
},
value: {
chatId: "${chatId}",
chatName: "${chatName}",
action: "sendTimeScopeSelector",
},
options: "${functions}",
},
],
},
{
tag: "hr",
},
{
tag: "note",
elements: [
{
tag: "plain_text",
content: "🍳 功能由AI创新应用组提供支持Rid${requestId}",
},
],
},
],
header: {
template: "purple",
title: {
content: "🧑‍💻 感谢使用 Group Agent",
tag: "plain_text",
},
},
}
const timeScopeSelectorCard = {
elements: [
{
tag: "markdown",
content:
"已经选中群聊:**${chatName}**\n\n已经选择功能**${functionName}**\n\n请选择时间范围",
},
{
tag: "action",
actions: [
{
tag: "button",
text: {
tag: "plain_text",
content: "过去一天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "1",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
{
tag: "button",
text: {
tag: "plain_text",
content: "过去三天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "3",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
{
tag: "button",
text: {
tag: "plain_text",
content: "过去七天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "7",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
],
},
{
tag: "hr",
},
{
tag: "note",
elements: [
{
tag: "plain_text",
content: "🍳 功能由AI创新应用组提供支持Rid${requestId}",
},
],
},
],
header: {
template: "purple",
title: {
content: "🧑‍💻 感谢使用 Group Agent",
tag: "plain_text",
},
},
}
const resultReportCard = {
elements: [
{
tag: "markdown",
content:
"群聊:**${chatName}**,功能:**${functionName}**,总结天数:**${timeScope}**\n\n以下内容由AI模型生成耗时**${processingTime}s**",
},
{
tag: "hr",
},
{
tag: "markdown",
content: "${llmRes}",
},
{
tag: "hr",
},
{
tag: "note",
elements: [
{
tag: "plain_text",
content: "🍳 功能由AI创新应用组提供支持Rid${requestId}",
},
],
},
],
header: {
template: "green",
title: {
content: "🧑‍💻 感谢使用 Group Agent",
tag: "plain_text",
},
},
}
const successMsgCard = {
elements: [
{
tag: "markdown",
content: "${content}",
},
{
tag: "hr",
},
{
tag: "note",
elements: [
{
tag: "plain_text",
content: "🍳 功能由${author}提供支持Rid${requestId}",
},
],
},
],
header: {
template: "green",
title: {
content: "🔥 感谢使用 ${app}",
tag: "plain_text",
},
},
}
const errorMsgCard = {
elements: [
{
tag: "markdown",
content: "${content}",
},
{
tag: "hr",
},
{
tag: "note",
elements: [
{
tag: "plain_text",
content: "🍳 功能由${author}提供支持Rid${requestId}",
},
],
},
],
header: {
template: "red",
title: {
content: "⛔ ${app} 错误提示",
tag: "plain_text",
},
},
}
const cardTemplateMap = {
functionSelector: functionSelectorCard,
timeScopeSelector: timeScopeSelectorCard,
resultReport: resultReportCard,
successMsg: successMsgCard,
errorMsg: errorMsgCard,
}
export default cardTemplateMap