Skip to content

bodhi-realtime-agent / applyOpenAICacheConfig

Function: applyOpenAICacheConfig() ​

applyOpenAICacheConfig(payload, cfg, probeState): void

Defined in: src/transport/openai-realtime-transport.ts:236

Mutate a session.update payload in-place to add truncation and (P6) prompt_cache_key. Single insertion point used by buildSessionConfig(), updateSession(), and transferSession() so the field never gets dropped on agent handoff. Validation must have run separately (validateOpenAICacheConfig).

Parameters ​

payload ​

Record<string, unknown>

cfg ​

OpenAIRealtimeCacheConfig | undefined

probeState ​

CacheKeyProbeState

When cfg.experimental?.promptCacheKey is present: 'rejected' → omit the field; 'unknown' or 'accepted' → include.

Returns ​

void

Built with VitePress