-
Notifications
You must be signed in to change notification settings - Fork 161
feat: Add xAI provider, upgrade Gemini SDK #494
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fe9ac76
feat: Add GPT-5.1 model and implement migration from v12 to v13
kevin-on 6046d48
Merge branch 'main' into feat/add-gpt-5.1-model
kevin-on bd2ec3b
feat: Remove GPT-4.1 models from defaults
kevin-on cd0e099
feat: Add support for predicted outputs in specific chat models
kevin-on b2f2eb6
chore: Update default apply model ID to gpt-4.1-mini with explanatory…
kevin-on 83ff1a4
Merge branch 'main' into feat/add-gpt-5.1-model
kevin-on 1d74d35
feat: Update recommended models and schema version
kevin-on 7ade3c7
feat: Update chat models and migration logic for version 14
kevin-on c855cf2
feat: Update default chat model to claude-opus-4.5 and enhance migrat…
kevin-on 11e5512
feat: Introduce new default models for migration from v13 to v14
kevin-on 061ea95
feat: Update Google AI integration and enhance chat message handling
kevin-on 6e66c34
feat: Enhance Gemini model settings and thinking capabilities
kevin-on 349b628
feat: Add xAI provider and associated models
kevin-on f532a2b
feat: Enhance DeepSeekMessageAdapter to support reasoning content
kevin-on 5237d82
feat: Refactor provider types and remove legacy models
kevin-on 327a17e
fix: fix lint errors
kevin-on 3cc9b86
fix: Handle null content in GeminiProvider responses
kevin-on File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| import { DEFAULT_CHAT_MODELS_V13, migrateFrom12To13 } from './12_to_13' | ||
|
|
||
| describe('Migration from v12 to v13', () => { | ||
| it('should increment version to 13', () => { | ||
| const oldSettings = { | ||
| version: 12, | ||
| } | ||
| const result = migrateFrom12To13(oldSettings) | ||
| expect(result.version).toBe(13) | ||
| }) | ||
|
|
||
| it('should merge existing chat models with new default models', () => { | ||
| const oldSettings = { | ||
| version: 12, | ||
| chatModels: [ | ||
| { | ||
| id: 'gpt-4o', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4o', | ||
| enable: false, | ||
| }, | ||
| { | ||
| id: 'custom-model', | ||
| providerType: 'custom', | ||
| providerId: 'custom', | ||
| model: 'custom-model', | ||
| }, | ||
| ], | ||
| } | ||
| const result = migrateFrom12To13(oldSettings) | ||
|
|
||
| expect(result.chatModels).toEqual([ | ||
| ...DEFAULT_CHAT_MODELS_V13.map((model) => | ||
| model.id === 'gpt-4o' | ||
| ? { | ||
| ...model, | ||
| enable: false, | ||
| } | ||
| : model, | ||
| ), | ||
| { | ||
| id: 'custom-model', | ||
| providerType: 'custom', | ||
| providerId: 'custom', | ||
| model: 'custom-model', | ||
| }, | ||
| ]) | ||
| }) | ||
|
|
||
| it('should add new GPT-5.1 model', () => { | ||
| const oldSettings = { | ||
| version: 12, | ||
| chatModels: [ | ||
| { | ||
| id: 'gpt-4o', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4o', | ||
| }, | ||
| ], | ||
| } | ||
| const result = migrateFrom12To13(oldSettings) | ||
|
|
||
| const chatModels = result.chatModels as { id: string }[] | ||
| const gpt51 = chatModels.find((m) => m.id === 'gpt-5.1') | ||
|
|
||
| expect(gpt51).toBeDefined() | ||
| expect(gpt51).toEqual({ | ||
| id: 'gpt-5.1', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-5.1', | ||
| }) | ||
| }) | ||
|
|
||
| it('should preserve gpt-5 as custom model when migrating', () => { | ||
| const oldSettings = { | ||
| version: 12, | ||
| chatModels: [ | ||
| { | ||
| id: 'gpt-5', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-5', | ||
| enable: true, | ||
| }, | ||
| { | ||
| id: 'gpt-4o', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4o', | ||
| }, | ||
| ], | ||
| } | ||
| const result = migrateFrom12To13(oldSettings) | ||
|
|
||
| const chatModels = result.chatModels as { id: string }[] | ||
| const gpt5 = chatModels.find((m) => m.id === 'gpt-5') | ||
| const gpt51 = chatModels.find((m) => m.id === 'gpt-5.1') | ||
|
|
||
| // gpt-5 should be preserved as custom model | ||
| expect(gpt5).toBeDefined() | ||
| expect(gpt5).toEqual({ | ||
| id: 'gpt-5', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-5', | ||
| enable: true, | ||
| }) | ||
|
|
||
| // gpt-5.1 should be added as new default | ||
| expect(gpt51).toBeDefined() | ||
| expect(gpt51).toEqual({ | ||
| id: 'gpt-5.1', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-5.1', | ||
| }) | ||
| }) | ||
|
|
||
| it('should preserve gpt-4.1 models as custom models when migrating', () => { | ||
| const oldSettings = { | ||
| version: 12, | ||
| chatModels: [ | ||
| { | ||
| id: 'gpt-4.1', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1', | ||
| enable: true, | ||
| }, | ||
| { | ||
| id: 'gpt-4.1-mini', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1-mini', | ||
| }, | ||
| { | ||
| id: 'gpt-4.1-nano', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1-nano', | ||
| }, | ||
| { | ||
| id: 'gpt-4o', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4o', | ||
| }, | ||
| ], | ||
| } | ||
| const result = migrateFrom12To13(oldSettings) | ||
|
|
||
| const chatModels = result.chatModels as { id: string }[] | ||
| const gpt41 = chatModels.find((m) => m.id === 'gpt-4.1') | ||
| const gpt41Mini = chatModels.find((m) => m.id === 'gpt-4.1-mini') | ||
| const gpt41Nano = chatModels.find((m) => m.id === 'gpt-4.1-nano') | ||
| const gpt51 = chatModels.find((m) => m.id === 'gpt-5.1') | ||
|
|
||
| // gpt-4.1 models should be preserved as custom models | ||
| expect(gpt41).toBeDefined() | ||
| expect(gpt41).toEqual({ | ||
| id: 'gpt-4.1', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1', | ||
| enable: true, | ||
| }) | ||
|
|
||
| expect(gpt41Mini).toBeDefined() | ||
| expect(gpt41Mini).toEqual({ | ||
| id: 'gpt-4.1-mini', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1-mini', | ||
| }) | ||
|
|
||
| expect(gpt41Nano).toBeDefined() | ||
| expect(gpt41Nano).toEqual({ | ||
| id: 'gpt-4.1-nano', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-4.1-nano', | ||
| }) | ||
|
|
||
| // gpt-5.1 should be added as new default | ||
| expect(gpt51).toBeDefined() | ||
| expect(gpt51).toEqual({ | ||
| id: 'gpt-5.1', | ||
| providerType: 'openai', | ||
| providerId: 'openai', | ||
| model: 'gpt-5.1', | ||
| }) | ||
| }) | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.