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:
@@ -146,6 +146,10 @@ func (lkeapProvider) Thinking() ThinkingStrategy { return thinkingTypeField{} }
|
||||
type deepseekProvider struct{ baseProvider }
|
||||
|
||||
func (deepseekProvider) Name() provider.ProviderName { return provider.ProviderDeepSeek }
|
||||
|
||||
// Native DeepSeek cache counters are not represented by go-openai v1.41.2;
|
||||
// use the raw path so prompt_cache_hit_tokens/miss_tokens remain observable.
|
||||
func (deepseekProvider) ForceRawHTTP() bool { return true }
|
||||
func (deepseekProvider) ShapeRequest(req *openai.ChatCompletionRequest, opts *ChatOptions, _ bool) {
|
||||
if opts != nil && opts.ToolChoice != "" {
|
||||
req.ToolChoice = nil
|
||||
|
||||
Reference in New Issue
Block a user