feat(llm): add prompt-cache observability and wiki cache-friendly prompts
Normalize provider-specific cache counters into TokenUsage, propagate call purpose and prefix fingerprints through context for logging and Langfuse, and restructure wiki page-modify prompts with warmup/singleflight to improve prefix cache hit rates during reduce batches.
This commit is contained in:
@@ -395,7 +395,7 @@ func (s *knowledgeService) scrubWikiPendingIngest(ctx context.Context, kbID, kno
|
||||
// actual swap happens asynchronously inside mapOneDocument (see its
|
||||
// oldPageSlugs handling) — that's where we have both the old page set and
|
||||
// the freshly extracted candidate slugs, which is exactly the information
|
||||
// the WikiPageModifyPrompt needs to do a correct replace-not-append.
|
||||
// the WikiPageModifyUserPrompt needs to do a correct replace-not-append.
|
||||
//
|
||||
// So the only thing worth doing synchronously at reparse time is keeping
|
||||
// the Redis pending list clean so the re-ingest enqueued by
|
||||
|
||||
Reference in New Issue
Block a user