2025-03-04 17:25:46 -08:00
|
|
|
import {
|
|
|
|
|
customProvider,
|
|
|
|
|
extractReasoningMiddleware,
|
|
|
|
|
wrapLanguageModel,
|
2025-03-17 16:54:40 -07:00
|
|
|
} from 'ai';
|
2025-09-01 11:07:07 +01:00
|
|
|
import { gateway } from '@ai-sdk/gateway';
|
2025-07-03 02:26:34 -07:00
|
|
|
import { isTestEnvironment } from '../constants';
|
2025-03-04 17:25:46 -08:00
|
|
|
|
|
|
|
|
export const myProvider = isTestEnvironment
|
2025-09-08 16:08:57 +01:00
|
|
|
? (() => {
|
|
|
|
|
const {
|
|
|
|
|
artifactModel,
|
|
|
|
|
chatModel,
|
|
|
|
|
reasoningModel,
|
|
|
|
|
titleModel,
|
2025-09-08 16:27:32 +01:00
|
|
|
} = require('./models.mock');
|
2025-09-08 16:08:57 +01:00
|
|
|
return customProvider({
|
|
|
|
|
languageModels: {
|
|
|
|
|
'chat-model': chatModel,
|
|
|
|
|
'chat-model-reasoning': reasoningModel,
|
|
|
|
|
'title-model': titleModel,
|
|
|
|
|
'artifact-model': artifactModel,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})()
|
2025-03-04 17:25:46 -08:00
|
|
|
: customProvider({
|
|
|
|
|
languageModels: {
|
2025-09-01 11:07:07 +01:00
|
|
|
'chat-model': gateway.languageModel('xai/grok-2-vision-1212'),
|
2025-03-17 16:54:40 -07:00
|
|
|
'chat-model-reasoning': wrapLanguageModel({
|
2025-09-08 16:56:10 +02:00
|
|
|
model: gateway.languageModel('xai/grok-3-mini'),
|
2025-03-17 16:54:40 -07:00
|
|
|
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
2025-03-04 17:25:46 -08:00
|
|
|
}),
|
2025-09-01 11:07:07 +01:00
|
|
|
'title-model': gateway.languageModel('xai/grok-2-1212'),
|
|
|
|
|
'artifact-model': gateway.languageModel('xai/grok-2-1212'),
|
2025-03-04 17:25:46 -08:00
|
|
|
},
|
|
|
|
|
});
|