fix: improve xai cache hit rate (#35970)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user