feat: add tests (#843)
This commit is contained in:
parent
95a2af2535
commit
9dd9a9898c
35 changed files with 1063 additions and 191 deletions
41
lib/ai/providers.ts
Normal file
41
lib/ai/providers.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import {
|
||||
customProvider,
|
||||
extractReasoningMiddleware,
|
||||
wrapLanguageModel,
|
||||
} from 'ai';
|
||||
import { openai } from '@ai-sdk/openai';
|
||||
import { fireworks } from '@ai-sdk/fireworks';
|
||||
import { isTestEnvironment } from '../constants';
|
||||
import {
|
||||
artifactModel,
|
||||
chatModel,
|
||||
reasoningModel,
|
||||
titleModel,
|
||||
} from './models.test';
|
||||
|
||||
export const myProvider = isTestEnvironment
|
||||
? customProvider({
|
||||
languageModels: {
|
||||
'chat-model-small': chatModel,
|
||||
'chat-model-large': chatModel,
|
||||
'chat-model-reasoning': reasoningModel,
|
||||
'title-model': titleModel,
|
||||
'artifact-model': artifactModel,
|
||||
},
|
||||
})
|
||||
: 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'),
|
||||
'artifact-model': openai('gpt-4o-mini'),
|
||||
},
|
||||
imageModels: {
|
||||
'small-model': openai.image('dall-e-2'),
|
||||
'large-model': openai.image('dall-e-3'),
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue