perf: outlink config (#3128)

* update action

* perf: outlink config
This commit is contained in:
Archer
2024-11-12 15:56:53 +08:00
committed by archer
parent 73d28d1fc3
commit 5e273341dd
38 changed files with 469 additions and 537 deletions

View File

@@ -89,7 +89,7 @@ try {
// get chat logs;
ChatSchema.index({ teamId: 1, appId: 1, updateTime: -1 }, { background: true });
// get share chat history
ChatSchema.index({ shareId: 1, outLinkUid: 1, updateTime: -1, source: 1 }, { background: true });
ChatSchema.index({ shareId: 1, outLinkUid: 1, updateTime: -1 }, { background: true });
// timer, clear history
ChatSchema.index({ teamId: 1, updateTime: -1 }, { background: true });

View File

@@ -42,27 +42,27 @@ export const getWorkflowResponseWrite = ({
if (!res || res.closed || !useStreamResponse) return;
const detailEvent = [
SseResponseEventEnum.error,
SseResponseEventEnum.flowNodeStatus,
SseResponseEventEnum.flowResponses,
SseResponseEventEnum.interactive,
SseResponseEventEnum.toolCall,
SseResponseEventEnum.toolParams,
SseResponseEventEnum.toolResponse,
SseResponseEventEnum.updateVariables
];
// Forbid show detail
const detailEvent: Record<string, 1> = {
[SseResponseEventEnum.error]: 1,
[SseResponseEventEnum.flowNodeStatus]: 1,
[SseResponseEventEnum.flowResponses]: 1,
[SseResponseEventEnum.interactive]: 1,
[SseResponseEventEnum.toolCall]: 1,
[SseResponseEventEnum.toolParams]: 1,
[SseResponseEventEnum.toolResponse]: 1,
[SseResponseEventEnum.updateVariables]: 1
};
if (!detail && detailEvent[event]) return;
if (!detail && detailEvent.includes(event)) return;
if (
!showNodeStatus &&
(event === SseResponseEventEnum.flowNodeStatus ||
event === SseResponseEventEnum.toolCall ||
event === SseResponseEventEnum.toolParams ||
event === SseResponseEventEnum.toolResponse)
)
return;
// Forbid show running status
const statusEvent: Record<string, 1> = {
[SseResponseEventEnum.flowNodeStatus]: 1,
[SseResponseEventEnum.toolCall]: 1,
[SseResponseEventEnum.toolParams]: 1,
[SseResponseEventEnum.toolResponse]: 1
};
if (!showNodeStatus && statusEvent[event]) return;
responseWrite({
res,

View File

@@ -42,6 +42,7 @@ const OutLinkSchema = new Schema({
lastTime: {
type: Date
},
responseDetail: {
type: Boolean,
default: false
@@ -50,7 +51,7 @@ const OutLinkSchema = new Schema({
type: Boolean,
default: false
},
showCompleteQuote: {
showRawSource: {
type: Boolean,
default: false
},
@@ -70,6 +71,8 @@ const OutLinkSchema = new Schema({
type: String
}
},
// Third part app config
app: {
type: Object // could be FeishuAppType | WecomAppType | ...
},