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:
@@ -119,7 +119,8 @@ If NO, leave the sql field empty.
|
||||
|
||||
Return your response in the specified JSON format.`, chatManage.Query, knowledge.ID, schema.Description())
|
||||
|
||||
response, err := chatModel.Chat(ctx, []chat.Message{
|
||||
modelCtx := types.WithLLMCallMetadata(ctx, "data_analysis_plan", "")
|
||||
response, err := chatModel.Chat(modelCtx, []chat.Message{
|
||||
{Role: "user", Content: analysisPrompt},
|
||||
}, &chat.ChatOptions{
|
||||
Temperature: 0.1,
|
||||
|
||||
Reference in New Issue
Block a user