mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-22 18:34:08 +01:00
🌵 chore: Remove deprecated 'prompt-caching' Anthropic header (#11313)
This commit is contained in:
parent
90521bfb4e
commit
28270bec58
5 changed files with 27 additions and 68 deletions
|
|
@ -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: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue