File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,11 +221,12 @@ export function resolveTranscriptPolicy(params: {
221221 model ?: ProviderRuntimeModel ;
222222} ) : TranscriptPolicy {
223223 const provider = normalizeProviderId ( params . provider ?? "" ) ;
224- const cacheKey = canCacheTranscriptPolicy ( params )
225- ? resolveTranscriptPolicyCacheKey ( { ...params , provider, config : params . config } )
224+ const cacheConfig = canCacheTranscriptPolicy ( params ) ? params . config : undefined ;
225+ const cacheKey = cacheConfig
226+ ? resolveTranscriptPolicyCacheKey ( { ...params , provider, config : cacheConfig } )
226227 : undefined ;
227- if ( cacheKey ) {
228- const cached = transcriptPolicyCache . get ( params . config ) ?. get ( cacheKey ) ;
228+ if ( cacheConfig && cacheKey ) {
229+ const cached = transcriptPolicyCache . get ( cacheConfig ) ?. get ( cacheKey ) ;
229230 if ( cached ) {
230231 return cached ;
231232 }
@@ -259,11 +260,11 @@ export function resolveTranscriptPolicy(params: {
259260 modelId : params . modelId ,
260261 } ) ,
261262 ) ;
262- if ( cacheKey ) {
263- let configCache = transcriptPolicyCache . get ( params . config ) ;
263+ if ( cacheConfig && cacheKey ) {
264+ let configCache = transcriptPolicyCache . get ( cacheConfig ) ;
264265 if ( ! configCache ) {
265266 configCache = new Map ( ) ;
266- transcriptPolicyCache . set ( params . config , configCache ) ;
267+ transcriptPolicyCache . set ( cacheConfig , configCache ) ;
267268 }
268269 configCache . set ( cacheKey , policy ) ;
269270 }
You can’t perform that action at this time.
0 commit comments