Skip the prompt_cache_key parameter for GroqAPI's to allow Groq API's to work

This commit is contained in:
gautamrajur 2026-03-06 09:51:21 -05:00
parent 41bb78f593
commit 005611f997

View file

@ -157,7 +157,8 @@ func (p *Provider) Chat(
// Prompt caching is only supported by OpenAI-native endpoints. // Prompt caching is only supported by OpenAI-native endpoints.
// Gemini and other providers reject unknown fields, so skip for non-OpenAI APIs. // Gemini and other providers reject unknown fields, so skip for non-OpenAI APIs.
if cacheKey, ok := options["prompt_cache_key"].(string); ok && cacheKey != "" { if cacheKey, ok := options["prompt_cache_key"].(string); ok && cacheKey != "" {
if !strings.Contains(p.apiBase, "generativelanguage.googleapis.com") { if !strings.Contains(p.apiBase, "generativelanguage.googleapis.com") &&
!strings.Contains(p.apiBase, "api.groq.com") {
requestBody["prompt_cache_key"] = cacheKey requestBody["prompt_cache_key"] = cacheKey
} }
} }