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:
@@ -55,6 +55,7 @@ func (p *PluginChatCompletion) OnEvent(
|
||||
resourceRefs := llmresource.NewRegistry()
|
||||
chatMessages = sourceRefs.EncodeMessages(chatMessages)
|
||||
chatMessages = resourceRefs.EncodeMessages(chatMessages)
|
||||
ctx = withPromptCacheMetadata(ctx, chatModel, chatMessages, opt, "knowledge_qa")
|
||||
|
||||
// Call the chat model to generate response
|
||||
pipelineInfo(ctx, "Completion", "model_call", map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user