MCPcopy Create free account
hub / github.com/53AI/53AIHub / SendEndStep

Method SendEndStep

api/controller/relay/relay_process_step.go:353–375  ·  view source on GitHub ↗
(StepCode string, Message string, Data map[string]interface{})

Source from the content-addressed store, hash-verified

351}
352
353func (ps *ProcessSender) SendEndStep(StepCode string, Message string, Data map[string]interface{}) error {
354 // ⭐ 在发送前处理 data,截取 content
355 processedData := ps.truncateSourcesContent(Data)
356
357 step := ProcessStep{
358 StepCode: StepCode,
359 Status: STEP_STATUS_COMPLETED,
360 Message: Message,
361 Timestamp: time.Now().Unix(),
362 Data: processedData, // 使用处理后的数据
363 }
364 if ps != nil && ps.chatRequest != nil && ps.chatRequest.EnableProcessSteps {
365 ps.recordProcessStep(step)
366 }
367 if !ps.CheckNeedSend() {
368 return nil
369 }
370 if err := sendProcessStep(ps.c, ps.requestId, step); err != nil {
371 logger.SysErrorf("发送处理步骤失败: %s", err.Error())
372 return err
373 }
374 return nil
375}
376
377// truncateSourcesContent 截取 data 中 sources 的 content
378func (ps *ProcessSender) truncateSourcesContent(data map[string]interface{}) map[string]interface{} {

Callers 6

runAgentLoopFunction · 0.80
HandleRAGFunction · 0.80
HandleKnowledgeSearchRagFunction · 0.80
handleChatRequestFunction · 0.80
RelayTextHelperFunction · 0.80

Calls 5

recordProcessStepMethod · 0.95
CheckNeedSendMethod · 0.95
sendProcessStepFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected