@blueking/chat-helper 0.0.9 → 0.0.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,20 @@ import { transferMessage2MessageApi, transferMessageApi2Message } from '../trans
86
86
  const getFlowAgentTaskInfo = (taskId, config)=>fetchClient.get(`flow_agent/${taskId}/task_info/`, undefined, config);
87
87
  // 获取流程引擎任务节点详情
88
88
  const getFlowAgentTaskNodeInfo = (taskId, nodeId, config)=>fetchClient.get(`flow_agent/${taskId}/task_node_info/${nodeId}/`, undefined, config);
89
+ // 重试流程引擎任务节点
90
+ const retryFlowAgentTaskNode = (sessionCode, nodeId, taskId, config)=>fetchClient.post(`flow_agent/${sessionCode}/node/${nodeId}/retry/`, {
91
+ task_id: taskId
92
+ }, config);
93
+ // 跳过流程引擎任务节点
94
+ const skipFlowAgentTaskNode = (sessionCode, nodeId, taskId, config)=>fetchClient.post(`flow_agent/${sessionCode}/node/${nodeId}/skip/`, {
95
+ task_id: taskId
96
+ }, config);
97
+ // 用户操作
98
+ const userOperation = (sessionCode, operation, payload, config)=>fetchClient.post(`plugin_api/user_operation/`, {
99
+ session_code: sessionCode,
100
+ operation,
101
+ payload
102
+ }, config);
89
103
  return {
90
104
  getMessages,
91
105
  plusMessage,
@@ -95,6 +109,9 @@ import { transferMessage2MessageApi, transferMessageApi2Message } from '../trans
95
109
  shareMessages,
96
110
  stopChat,
97
111
  getFlowAgentTaskInfo,
98
- getFlowAgentTaskNodeInfo
112
+ getFlowAgentTaskNodeInfo,
113
+ retryFlowAgentTaskNode,
114
+ skipFlowAgentTaskNode,
115
+ userOperation
99
116
  };
100
117
  };
@@ -25,4 +25,5 @@ export declare const useSession: (fetchClient: FetchClient) => {
25
25
  uploadFile: (sessionCode: string, file: File, config?: IRequestConfig) => Promise<{
26
26
  download_url?: string;
27
27
  }>;
28
+ isResumeSession: (sessionCode: string, config?: IRequestConfig) => Promise<boolean>;
28
29
  };
@@ -113,6 +113,8 @@ import { transferSession2SessionApi, transferSessionApi2Session, transferSession
113
113
  }
114
114
  })));
115
115
  };
116
+ // 轮询接口,判断是否可以继续聊天
117
+ const isResumeSession = (sessionCode, config)=>fetchClient.get(`session/${sessionCode}/is_resume/`, undefined, config);
116
118
  return {
117
119
  clearSession,
118
120
  getSessions,
@@ -124,6 +126,7 @@ import { transferSession2SessionApi, transferSessionApi2Session, transferSession
124
126
  postSessionFeedback,
125
127
  getSessionFeedbackReasons,
126
128
  renameSession,
127
- uploadFile
129
+ uploadFile,
130
+ isResumeSession
128
131
  };
129
132
  };
@@ -337,6 +337,11 @@ import { ActivityType, MessageRole, MessageType } from '../../message/type.ts.js
337
337
  });
338
338
  return result;
339
339
  }
340
+ case MessageRole.Interrupt:
341
+ {
342
+ const result = _object_spread({}, baseMessage, data);
343
+ return result;
344
+ }
340
345
  }
341
346
  };
342
347
  /**
@@ -601,5 +606,10 @@ import { ActivityType, MessageRole, MessageType } from '../../message/type.ts.js
601
606
  });
602
607
  return result;
603
608
  }
609
+ case MessageRole.Interrupt:
610
+ {
611
+ const result = _object_spread({}, baseMessage, data);
612
+ return result;
613
+ }
604
614
  }
605
615
  };