Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the full list of supported models #11

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,34 @@ export interface AiWarpConfig {
aiProvider:
| {
openai: {
model: "gpt-3.5-turbo" | "gpt-4";
model:
| "gpt-4-0125-preview"
| "gpt-4-turbo-preview"
| "gpt-4-1106-preview"
| "gpt-4-vision-preview"
| "gpt-4-1106-vision-preview"
| "gpt-4"
| "gpt-4-0613"
| "gpt-4-32k"
| "gpt-4-32k-0613"
| "gpt-3.5-turbo-0125"
| "gpt-3.5-turbo"
| "gpt-3.5-turbo-1106"
| "gpt-3.5-turbo-instruct"
| "gpt-3.5-turbo-16k"
| "gpt-3.5-turbo-0613"
| "gpt-3.5-turbo-16k-0613";
apiKey: string;
};
}
| {
mistral: {
model: "mistral-tiny";
model:
| "open-mistral-7b"
| "open-mixtral-8x7b"
| "mistral-small-latest"
| "mistral-medium-latest"
| "mistral-large-latest";
apiKey: string;
};
};
Expand Down
24 changes: 20 additions & 4 deletions lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ const aiWarpSchema = {
model: {
type: 'string',
enum: [
'gpt-4-0125-preview',
'gpt-4-turbo-preview',
'gpt-4-1106-preview',
'gpt-4-vision-preview',
'gpt-4-1106-vision-preview',
'gpt-4',
'gpt-4-0613',
'gpt-4-32k',
'gpt-4-32k-0613',
'gpt-3.5-turbo-0125',
'gpt-3.5-turbo',
'gpt-4'
// TODO: fill
'gpt-3.5-turbo-1106',
'gpt-3.5-turbo-instruct',
'gpt-3.5-turbo-16k',
'gpt-3.5-turbo-0613',
'gpt-3.5-turbo-16k-0613'
]
},
apiKey: { type: 'string' }
Expand All @@ -40,8 +53,11 @@ const aiWarpSchema = {
model: {
type: 'string',
enum: [
'mistral-tiny'
// TODO: fill
'open-mistral-7b',
'open-mixtral-8x7b',
'mistral-small-latest',
'mistral-medium-latest',
'mistral-large-latest'
]
},
apiKey: { type: 'string' }
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const providers: Provider[] = [
name: 'Mistral',
config: {
mistral: {
model: 'mistral-tiny',
model: 'open-mistral-7b',
apiKey: ''
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/types/schema.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expectAssignable } from 'tsd'
import { AiWarpConfig } from '../../config'

// TODO: add more when more models are added
expectAssignable<AiWarpConfig['aiProvider']>({
openai: {
model: 'gpt-3.5-turbo',
Expand All @@ -18,7 +17,7 @@ expectAssignable<AiWarpConfig['aiProvider']>({

expectAssignable<AiWarpConfig['aiProvider']>({
mistral: {
model: 'mistral-tiny',
model: 'open-mistral-7b',
apiKey: ''
}
})
Expand All @@ -35,7 +34,7 @@ expectAssignable<AiWarpConfig>({
expectAssignable<AiWarpConfig>({
aiProvider: {
mistral: {
model: 'mistral-tiny',
model: 'open-mistral-7b',
apiKey: ''
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ai-providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const expectedStreamBody = buildExpectedStreamBodyString()

const providers: AiProvider[] = [
new OpenAiProvider('gpt-3.5-turbo', ''),
new MistralProvider('mistral-tiny', '')
new MistralProvider('open-mistral-7b', '')
]

for (const provider of providers) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ describe('AiWarpGenerator', () => {

generator.setConfig({
aiProvider: 'mistral',
aiModel: 'mistral-tiny'
aiModel: 'open-mistral-7b'
})
await generator.run()

configFile = JSON.parse(await readFile(join(dir, 'platformatic.json'), 'utf8'))
assert.deepStrictEqual(configFile.aiProvider, {
mistral: {
model: 'mistral-tiny',
model: 'open-mistral-7b',
apiKey: '{PLT_MISTRAL_API_KEY}'
}
})
Expand Down
Loading