mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🚀 feat: Support for GPT-4 Turbo/0125 Models (#1643)
This commit is contained in:
parent
d0730d2515
commit
fcbaa74e4a
7 changed files with 44 additions and 5 deletions
|
|
@ -80,6 +80,20 @@ describe('getModelMaxTokens', () => {
|
|||
);
|
||||
});
|
||||
|
||||
// 01/25 Update
|
||||
test('should return correct tokens for gpt-4-turbo/0125 matches', () => {
|
||||
expect(getModelMaxTokens('gpt-4-turbo')).toBe(
|
||||
maxTokensMap[EModelEndpoint.openAI]['gpt-4-turbo'],
|
||||
);
|
||||
expect(getModelMaxTokens('gpt-4-turbo-preview')).toBe(
|
||||
maxTokensMap[EModelEndpoint.openAI]['gpt-4-turbo'],
|
||||
);
|
||||
expect(getModelMaxTokens('gpt-4-0125')).toBe(maxTokensMap[EModelEndpoint.openAI]['gpt-4-0125']);
|
||||
expect(getModelMaxTokens('gpt-4-0125-preview')).toBe(
|
||||
maxTokensMap[EModelEndpoint.openAI]['gpt-4-0125'],
|
||||
);
|
||||
});
|
||||
|
||||
test('should return correct tokens for Anthropic models', () => {
|
||||
const models = [
|
||||
'claude-2.1',
|
||||
|
|
@ -166,6 +180,16 @@ describe('matchModelName', () => {
|
|||
expect(matchModelName('gpt-4-1106-vision-preview')).toBe('gpt-4-1106');
|
||||
});
|
||||
|
||||
// 01/25 Update
|
||||
it('should return the closest matching key for gpt-4-turbo/0125 matches', () => {
|
||||
expect(matchModelName('openai/gpt-4-0125')).toBe('gpt-4-0125');
|
||||
expect(matchModelName('gpt-4-turbo-preview')).toBe('gpt-4-turbo');
|
||||
expect(matchModelName('gpt-4-turbo-vision-preview')).toBe('gpt-4-turbo');
|
||||
expect(matchModelName('gpt-4-0125')).toBe('gpt-4-0125');
|
||||
expect(matchModelName('gpt-4-0125-preview')).toBe('gpt-4-0125');
|
||||
expect(matchModelName('gpt-4-0125-vision-preview')).toBe('gpt-4-0125');
|
||||
});
|
||||
|
||||
// Tests for Google models
|
||||
it('should return the exact model name if it exists in maxTokensMap - Google models', () => {
|
||||
expect(matchModelName('text-bison-32k', EModelEndpoint.google)).toBe('text-bison-32k');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue