refactor: enhance event consumption logic and add graph tool completion test
This commit is contained in:
@@ -79,7 +79,8 @@ func (g *HandoffGraph) Run(ctx context.Context, argumentsInJSON string) (string,
|
||||
if err := services.ConversationService.HandoffByAI(g.conversation.ID, g.aiAgent, state.Reason); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return g.buildSuccessReply(), nil
|
||||
// ConversationService sends the customer-visible handoff notice according to the dispatch decision.
|
||||
return "", nil
|
||||
case ConfirmationDecisionCancel:
|
||||
return CancelHandoffReply, nil
|
||||
default:
|
||||
@@ -109,10 +110,6 @@ func (g *HandoffGraph) buildConfirmationPrompt(reason string) string {
|
||||
return fmt.Sprintf("我准备为你转接人工客服。\n原因:%s\n请直接回复“确认”或“取消”。", strings.TrimSpace(reason))
|
||||
}
|
||||
|
||||
func (g *HandoffGraph) buildSuccessReply() string {
|
||||
return "已为你转接人工客服,请稍候。,请稍候。"
|
||||
}
|
||||
|
||||
func parseHandoffDecision(value string) ConfirmationDecision {
|
||||
return ParseConfirmationDecision(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user