feat(dingtalk): add reasoning mode and support evidence

This commit is contained in:
姚章浩
2026-09-10 16:24:56 +08:00
parent 0798a2dac7
commit bfa1b1b25f
45 changed files with 2713 additions and 102 deletions
@@ -49,7 +49,7 @@ func (s *Store) Claim(ctx context.Context, limit int, maxAttempts int, staleBefo
FROM candidates c
WHERE sc.id = c.id
RETURNING sc.id, sc.tenant_key, sc.channel, sc.turn_id,
sc.notification_attempts, sc.created_at, sc.faq_record_id
sc.notification_attempts, sc.created_at, sc.faq_record_id, sc.trigger_type
)
SELECT
cl.id,
@@ -62,7 +62,8 @@ func (s *Store) Claim(ctx context.Context, limit int, maxAttempts int, staleBefo
COALESCE(c.conversation_type, 'direct') AS conversation_type,
m.created_at AS asked_at,
COALESCE(history.previous_questions, ARRAY[]::TEXT[]) AS previous_questions,
cl.faq_record_id
cl.faq_record_id,
cl.trigger_type
FROM claimed cl
JOIN turns t ON t.id = cl.turn_id
AND t.tenant_key = cl.tenant_key
@@ -110,16 +111,18 @@ func (s *Store) Claim(ctx context.Context, limit int, maxAttempts int, staleBefo
askedAt time.Time
previousQuestions []string
faqRecordID string
triggerType string
)
if err := rows.Scan(&id, &tenantKey, &channel, &turnID, &attempts,
&question, &senderName, &conversationType, &askedAt,
&previousQuestions, &faqRecordID); err != nil {
&previousQuestions, &faqRecordID, &triggerType); err != nil {
rows.Close()
return nil, fmt.Errorf("claim scan: %w", err)
}
cases = append(cases, coverage.PendingSupportCase{
SupportNotification: coverage.SupportNotification{
CaseID: id,
TriggerType: triggerType,
Question: question,
SenderName: senderName,
Channel: channel,