2025-03-04 17:25:46 -08:00
|
|
|
import {
|
|
|
|
|
customProvider,
|
|
|
|
|
extractReasoningMiddleware,
|
|
|
|
|
wrapLanguageModel,
|
2025-03-17 16:54:40 -07:00
|
|
|
} from 'ai';
|
2025-03-20 14:10:45 -07:00
|
|
|
import { groq } from '@ai-sdk/groq';
|
2025-03-17 16:54:40 -07:00
|
|
|
import { xai } from '@ai-sdk/xai';
|
2025-03-20 14:10:45 -07:00
|
|
|
import { fal } from '@ai-sdk/fal';
|
2025-03-17 16:54:40 -07:00
|
|
|
import { isTestEnvironment } from '../constants';
|
2025-03-04 17:25:46 -08:00
|
|
|
import {
|
|
|
|
|
artifactModel,
|
|
|
|
|
chatModel,
|
|
|
|
|
reasoningModel,
|
|
|
|
|
titleModel,
|
2025-03-17 16:54:40 -07:00
|
|
|
} from './models.test';
|
2025-03-04 17:25:46 -08:00
|
|
|
|
|
|
|
|
export const myProvider = isTestEnvironment
|
|
|
|
|
? customProvider({
|
|
|
|
|
languageModels: {
|
2025-03-17 16:58:22 -07:00
|
|
|
'chat-model': chatModel,
|
2025-03-17 16:54:40 -07:00
|
|
|
'chat-model-reasoning': reasoningModel,
|
|
|
|
|
'title-model': titleModel,
|
|
|
|
|
'artifact-model': artifactModel,
|
2025-03-04 17:25:46 -08:00
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
: customProvider({
|
|
|
|
|
languageModels: {
|
2025-03-17 16:58:22 -07:00
|
|
|
'chat-model': xai('grok-2-1212'),
|
2025-03-17 16:54:40 -07:00
|
|
|
'chat-model-reasoning': wrapLanguageModel({
|
2025-03-20 14:10:45 -07:00
|
|
|
model: groq('deepseek-r1-distill-llama-70b'),
|
2025-03-17 16:54:40 -07:00
|
|
|
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
2025-03-04 17:25:46 -08:00
|
|
|
}),
|
2025-03-17 16:54:40 -07:00
|
|
|
'title-model': xai('grok-2-1212'),
|
|
|
|
|
'artifact-model': xai('grok-2-1212'),
|
2025-03-04 17:25:46 -08:00
|
|
|
},
|
|
|
|
|
imageModels: {
|
2025-03-20 14:10:45 -07:00
|
|
|
'small-model': fal.image('fal-ai/fast-sdxl'),
|
2025-03-04 17:25:46 -08:00
|
|
|
},
|
|
|
|
|
});
|