config: add setCacheKey in provider options (#4738)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
Shantur Rathore
2025-11-25 23:53:56 +00:00
committed by GitHub
parent 14a910bd64
commit 69c2dd53ad
4 changed files with 32 additions and 6 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> {
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
}