🌵 chore: Remove deprecated 'prompt-caching' Anthropic header (#11313)

This commit is contained in:
Danny Avila 2026-01-12 19:12:36 -05:00 committed by GitHub
parent 90521bfb4e
commit 28270bec58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 68 deletions

View file

@ -44,7 +44,7 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
configOptions: {
baseURL: 'http://host.docker.internal:4000/v1',
defaultHeaders: {
'anthropic-beta': 'prompt-caching-2024-07-31,context-1m-2025-08-07',
'anthropic-beta': 'context-1m-2025-08-07',
},
},
tools: [],
@ -92,8 +92,7 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
configOptions: {
baseURL: 'http://localhost:4000/v1',
defaultHeaders: {
'anthropic-beta':
'token-efficient-tools-2025-02-19,output-128k-2025-02-19,prompt-caching-2024-07-31',
'anthropic-beta': 'token-efficient-tools-2025-02-19,output-128k-2025-02-19',
},
},
tools: [],
@ -140,8 +139,7 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
configOptions: {
baseURL: 'http://localhost:4000/v1',
defaultHeaders: {
'anthropic-beta':
'token-efficient-tools-2025-02-19,output-128k-2025-02-19,prompt-caching-2024-07-31',
'anthropic-beta': 'token-efficient-tools-2025-02-19,output-128k-2025-02-19',
},
},
tools: [],
@ -182,14 +180,14 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
configOptions: {
baseURL: 'https://api.anthropic.proxy.com/v1',
defaultHeaders: {
'anthropic-beta': 'max-tokens-3-5-sonnet-2024-07-15,prompt-caching-2024-07-31',
'anthropic-beta': 'max-tokens-3-5-sonnet-2024-07-15',
},
},
tools: [],
});
});
it('should apply anthropic-beta headers based on model pattern', () => {
it('should apply custom headers without anthropic-beta for models that dont need it', () => {
const apiKey = 'sk-custom';
const endpoint = 'Anthropic (via LiteLLM)';
const options = {
@ -227,7 +225,6 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
defaultHeaders: {
'Custom-Header': 'custom-value',
Authorization: 'Bearer custom-token',
'anthropic-beta': 'prompt-caching-2024-07-31',
},
},
tools: [],
@ -309,9 +306,6 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
},
configOptions: {
baseURL: 'http://proxy.litellm/v1',
defaultHeaders: {
'anthropic-beta': 'prompt-caching-2024-07-31',
},
},
tools: [],
});
@ -389,9 +383,6 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
},
configOptions: {
baseURL: 'http://litellm/v1',
defaultHeaders: {
'anthropic-beta': 'prompt-caching-2024-07-31',
},
},
tools: [
{
@ -438,9 +429,6 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
},
configOptions: {
baseURL: 'http://litellm/v1',
defaultHeaders: {
'anthropic-beta': 'prompt-caching-2024-07-31',
},
},
tools: [],
});
@ -488,9 +476,6 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
},
configOptions: {
baseURL: 'http://litellm/v1',
defaultHeaders: {
'anthropic-beta': 'prompt-caching-2024-07-31',
},
},
tools: [],
});
@ -541,7 +526,7 @@ describe('getOpenAIConfig - Anthropic Compatibility', () => {
configOptions: {
baseURL: 'http://litellm/v1',
defaultHeaders: {
'anthropic-beta': 'max-tokens-3-5-sonnet-2024-07-15,prompt-caching-2024-07-31',
'anthropic-beta': 'max-tokens-3-5-sonnet-2024-07-15',
},
},
tools: [],