2025-02-03 20:33:15 +05:30
|
|
|
import { openai } from '@ai-sdk/openai';
|
|
|
|
|
import { fireworks } from '@ai-sdk/fireworks';
|
|
|
|
|
import {
|
|
|
|
|
customProvider,
|
|
|
|
|
extractReasoningMiddleware,
|
|
|
|
|
wrapLanguageModel,
|
|
|
|
|
} from 'ai';
|
2024-10-30 16:01:24 +05:30
|
|
|
|
2025-02-03 20:33:15 +05:30
|
|
|
export const DEFAULT_CHAT_MODEL: string = 'chat-model-small';
|
|
|
|
|
|
|
|
|
|
export const myProvider = customProvider({
|
|
|
|
|
languageModels: {
|
|
|
|
|
'chat-model-small': openai('gpt-4o-mini'),
|
|
|
|
|
'chat-model-large': openai('gpt-4o'),
|
|
|
|
|
'chat-model-reasoning': wrapLanguageModel({
|
|
|
|
|
model: fireworks('accounts/fireworks/models/deepseek-r1'),
|
|
|
|
|
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
|
|
|
|
}),
|
|
|
|
|
'title-model': openai('gpt-4-turbo'),
|
|
|
|
|
'block-model': openai('gpt-4o-mini'),
|
|
|
|
|
},
|
|
|
|
|
imageModels: {
|
2025-02-05 18:11:19 +03:00
|
|
|
'small-model': openai.image('dall-e-2'),
|
|
|
|
|
'large-model': openai.image('dall-e-3'),
|
2025-02-03 20:33:15 +05:30
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
interface ChatModel {
|
2024-10-30 16:01:24 +05:30
|
|
|
id: string;
|
2025-02-03 20:33:15 +05:30
|
|
|
name: string;
|
2024-10-30 16:01:24 +05:30
|
|
|
description: string;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-03 20:33:15 +05:30
|
|
|
export const chatModels: Array<ChatModel> = [
|
2024-10-30 16:01:24 +05:30
|
|
|
{
|
2025-02-03 20:33:15 +05:30
|
|
|
id: 'chat-model-small',
|
|
|
|
|
name: 'Small model',
|
2024-10-30 16:01:24 +05:30
|
|
|
description: 'Small model for fast, lightweight tasks',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-02-03 20:33:15 +05:30
|
|
|
id: 'chat-model-large',
|
|
|
|
|
name: 'Large model',
|
|
|
|
|
description: 'Large model for complex, multi-step tasks',
|
2024-10-30 16:01:24 +05:30
|
|
|
},
|
2025-02-03 20:33:15 +05:30
|
|
|
{
|
|
|
|
|
id: 'chat-model-reasoning',
|
|
|
|
|
name: 'Reasoning model',
|
|
|
|
|
description: 'Uses advanced reasoning',
|
|
|
|
|
},
|
|
|
|
|
];
|