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:
@@ -147,9 +147,10 @@ func TestBuildOutbound_ShapeRequest(t *testing.T) {
|
||||
c := newOutboundChat(t, string(provider.ProviderDeepSeek), "deepseek-chat", nil)
|
||||
body, _, useRaw, err := c.buildOutbound(msgs, &ChatOptions{ToolChoice: "auto"}, false)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, useRaw)
|
||||
req := body.(*openai.ChatCompletionRequest)
|
||||
assert.Nil(t, req.ToolChoice)
|
||||
assert.True(t, useRaw)
|
||||
request, ok := body.(map[string]any)
|
||||
require.True(t, ok)
|
||||
assert.NotContains(t, request, "tool_choice")
|
||||
})
|
||||
|
||||
t.Run("moonshot pins temperature to 1", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user