fix: improve xai cache hit rate (#35970)

This commit is contained in:
Aiden Cline
2026-07-08 17:29:36 -05:00
committed by GitHub
parent f95f877e5f
commit ccb6b7c3ea
9 changed files with 281 additions and 109 deletions
+6 -1
View File
@@ -1127,7 +1127,12 @@ export function options(input: {
}
}
if (input.model.providerID === "openai" || input.providerOptions?.setCacheKey) {
if (
input.providerOptions?.setCacheKey !== false &&
(input.model.providerID === "openai" ||
input.model.api.npm === "@ai-sdk/xai" ||
input.providerOptions?.setCacheKey)
) {
result["promptCacheKey"] = input.sessionID
}