MCPcopy Create free account
hub / github.com/diillson/chatcli / ProcessExtractionResult

Method ProcessExtractionResult

cli/workspace/memory/store.go:478–517  ·  view source on GitHub ↗

ProcessExtractionResult is ProcessExtraction with a summary of what changed.

(response string)

Source from the content-addressed store, hash-verified

476
477// ProcessExtractionResult is ProcessExtraction with a summary of what changed.
478func (m *Manager) ProcessExtractionResult(response string) ExtractionSummary {
479 daily, longTerm, profileUpdates, topics, projects := parseEnhancedResponse(response)
480
481 var sum ExtractionSummary
482
483 if daily != "" {
484 if err := m.Daily.WriteDailyNote(daily); err != nil {
485 m.logger.Warn("failed to write daily note", zap.Error(err))
486 } else {
487 sum.DailyWritten = true
488 }
489 }
490
491 if longTerm != "" {
492 if n, _ := m.appendLongTermCounted(longTerm); n > 0 {
493 sum.FactsAdded = n
494 }
495 }
496
497 if len(profileUpdates) > 0 {
498 // Background extraction is an inference, not the user's own words —
499 // recorded as such so freshness/trust can tell them apart.
500 if m.Profile.UpdateWithSource(profileUpdates, FieldSourceExtraction) {
501 sum.ProfileUpdated = true
502 }
503 }
504
505 if len(topics) > 0 {
506 m.Topics.RecordWithSummary(topics)
507 sum.TopicsRecorded = len(topics)
508 }
509
510 if len(projects) > 0 {
511 if m.Projects.Upsert(projects) {
512 sum.ProjectsUpserted = 1
513 }
514 }
515
516 return sum
517}
518
519// RecordInteraction records a usage event.
520func (m *Manager) RecordInteraction(event InteractionEvent) {

Callers 3

ProcessExtractionMethod · 0.95

Implementers 2

MockTokenManagerllm/token/mock_token_manager.go
TokenManagerllm/token/token_manager.go

Calls 8

appendLongTermCountedMethod · 0.95
parseEnhancedResponseFunction · 0.85
WarnMethod · 0.80
UpdateWithSourceMethod · 0.80
RecordWithSummaryMethod · 0.80
ErrorMethod · 0.65
WriteDailyNoteMethod · 0.45
UpsertMethod · 0.45

Tested by 2