fix(openai): strip unsupported ChatGPT prompt cache retention options while preserving prompt cache keys
This commit is contained in:
@@ -203,6 +203,12 @@ tap.test('getModel uses ChatGPT Codex backend for OpenAI ChatGPT auth', async ()
|
||||
model,
|
||||
system: 'system prompt',
|
||||
prompt: 'hello',
|
||||
providerOptions: {
|
||||
openai: {
|
||||
promptCacheKey: 'session-1',
|
||||
promptCacheRetention: 'in_memory',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(capturedRequest?.url).toEqual('https://chatgpt.com/backend-api/codex/responses');
|
||||
@@ -214,6 +220,8 @@ tap.test('getModel uses ChatGPT Codex backend for OpenAI ChatGPT auth', async ()
|
||||
expect(capturedBody.input).toEqual([
|
||||
{ role: 'user', content: [{ type: 'input_text', text: 'hello' }] },
|
||||
]);
|
||||
expect(capturedBody.prompt_cache_key).toEqual('session-1');
|
||||
expect(capturedBody.prompt_cache_retention).toEqual(undefined);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user