34 lines
1,003 B
TypeScript
34 lines
1,003 B
TypeScript
import {
|
|
customProvider,
|
|
extractReasoningMiddleware,
|
|
wrapLanguageModel,
|
|
} from 'ai';
|
|
import { gateway } from '@ai-sdk/gateway';
|
|
import {
|
|
artifactModel,
|
|
chatModel,
|
|
reasoningModel,
|
|
titleModel,
|
|
} from './models.test';
|
|
import { isTestEnvironment } from '../constants';
|
|
|
|
export const myProvider = isTestEnvironment
|
|
? customProvider({
|
|
languageModels: {
|
|
'chat-model': chatModel,
|
|
'chat-model-reasoning': reasoningModel,
|
|
'title-model': titleModel,
|
|
'artifact-model': artifactModel,
|
|
},
|
|
})
|
|
: customProvider({
|
|
languageModels: {
|
|
'chat-model': gateway.languageModel('xai/grok-2-vision-1212'),
|
|
'chat-model-reasoning': wrapLanguageModel({
|
|
model: gateway.languageModel('xai/grok-3-mini'),
|
|
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
|
}),
|
|
'title-model': gateway.languageModel('xai/grok-2-1212'),
|
|
'artifact-model': gateway.languageModel('xai/grok-2-1212'),
|
|
},
|
|
});
|