mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 19:18:52 +01:00
🪙 feat: Update GPT-5.1 and GPT-5.2 Token Pricing (#11101)
This commit is contained in:
parent
7183223e59
commit
d7a765ac4c
3 changed files with 47 additions and 0 deletions
|
|
@ -36,6 +36,19 @@ describe('getValueKey', () => {
|
|||
expect(getValueKey('gpt-5-0130')).toBe('gpt-5');
|
||||
});
|
||||
|
||||
it('should return "gpt-5.1" for model name containing "gpt-5.1"', () => {
|
||||
expect(getValueKey('gpt-5.1')).toBe('gpt-5.1');
|
||||
expect(getValueKey('gpt-5.1-chat')).toBe('gpt-5.1');
|
||||
expect(getValueKey('gpt-5.1-codex')).toBe('gpt-5.1');
|
||||
expect(getValueKey('openai/gpt-5.1')).toBe('gpt-5.1');
|
||||
});
|
||||
|
||||
it('should return "gpt-5.2" for model name containing "gpt-5.2"', () => {
|
||||
expect(getValueKey('gpt-5.2')).toBe('gpt-5.2');
|
||||
expect(getValueKey('gpt-5.2-chat')).toBe('gpt-5.2');
|
||||
expect(getValueKey('openai/gpt-5.2')).toBe('gpt-5.2');
|
||||
});
|
||||
|
||||
it('should return "gpt-3.5-turbo-1106" for model name containing "gpt-3.5-turbo-1106"', () => {
|
||||
expect(getValueKey('gpt-3.5-turbo-1106-some-other-info')).toBe('gpt-3.5-turbo-1106');
|
||||
expect(getValueKey('openai/gpt-3.5-turbo-1106')).toBe('gpt-3.5-turbo-1106');
|
||||
|
|
@ -311,6 +324,34 @@ describe('getMultiplier', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should return the correct multiplier for gpt-5.1', () => {
|
||||
expect(getMultiplier({ model: 'gpt-5.1', tokenType: 'prompt' })).toBe(
|
||||
tokenValues['gpt-5.1'].prompt,
|
||||
);
|
||||
expect(getMultiplier({ model: 'gpt-5.1', tokenType: 'completion' })).toBe(
|
||||
tokenValues['gpt-5.1'].completion,
|
||||
);
|
||||
expect(getMultiplier({ model: 'openai/gpt-5.1', tokenType: 'prompt' })).toBe(
|
||||
tokenValues['gpt-5.1'].prompt,
|
||||
);
|
||||
expect(tokenValues['gpt-5.1'].prompt).toBe(1.25);
|
||||
expect(tokenValues['gpt-5.1'].completion).toBe(10);
|
||||
});
|
||||
|
||||
it('should return the correct multiplier for gpt-5.2', () => {
|
||||
expect(getMultiplier({ model: 'gpt-5.2', tokenType: 'prompt' })).toBe(
|
||||
tokenValues['gpt-5.2'].prompt,
|
||||
);
|
||||
expect(getMultiplier({ model: 'gpt-5.2', tokenType: 'completion' })).toBe(
|
||||
tokenValues['gpt-5.2'].completion,
|
||||
);
|
||||
expect(getMultiplier({ model: 'openai/gpt-5.2', tokenType: 'prompt' })).toBe(
|
||||
tokenValues['gpt-5.2'].prompt,
|
||||
);
|
||||
expect(tokenValues['gpt-5.2'].prompt).toBe(1.75);
|
||||
expect(tokenValues['gpt-5.2'].completion).toBe(14);
|
||||
});
|
||||
|
||||
it('should return the correct multiplier for gpt-4o', () => {
|
||||
const valueKey = getValueKey('gpt-4o-2024-08-06');
|
||||
expect(getMultiplier({ valueKey, tokenType: 'prompt' })).toBe(tokenValues['gpt-4o'].prompt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue