config: add setCacheKey in provider options (#4654)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Shantur Rathore
2025-11-25 04:20:52 +00:00
committed by GitHub
parent d3ea044619
commit 9b6d03c497
3 changed files with 26 additions and 5 deletions

View File

@@ -128,7 +128,13 @@ export namespace ProviderTransform {
return undefined
}
export function options(providerID: string, modelID: string, npm: string, sessionID: string): Record<string, any> {
export function options(
providerID: string,
modelID: string,
npm: string,
sessionID: string,
providerOptions?: Record<string, any>,
): Record<string, any> | undefined {
const result: Record<string, any> = {}
// switch to providerID later, for now use this
@@ -138,7 +144,7 @@ export namespace ProviderTransform {
}
}
if (providerID === "openai") {
if (providerID === "openai" || providerOptions?.setCacheKey) {
result["promptCacheKey"] = sessionID
}