2025-03-04 17:25:46 -08:00
|
|
|
import {
|
|
|
|
|
customProvider,
|
|
|
|
|
extractReasoningMiddleware,
|
|
|
|
|
wrapLanguageModel,
|
2025-03-17 16:54:40 -07:00
|
|
|
} from 'ai';
|
|
|
|
|
import { xai } from '@ai-sdk/xai';
|
|
|
|
|
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-04-26 01:09:01 -07:00
|
|
|
'chat-model': xai('grok-2-vision-1212'),
|
2025-03-17 16:54:40 -07:00
|
|
|
'chat-model-reasoning': wrapLanguageModel({
|
2025-04-09 17:46:27 -07:00
|
|
|
model: xai('grok-3-mini-beta'),
|
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-21 21:18:56 -07:00
|
|
|
'small-model': xai.image('grok-2-image'),
|
2025-03-04 17:25:46 -08:00
|
|
|
},
|
|
|
|
|
});
|