mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 21:31:08 -05:00
Add Mistral API provider
This commit is contained in:
committed by
Matt Rubens
parent
4e57bfbcbe
commit
077fa84374
@@ -49,6 +49,7 @@ describe('checkExistKey', () => {
|
||||
geminiApiKey: undefined,
|
||||
openAiNativeApiKey: undefined,
|
||||
deepSeekApiKey: undefined,
|
||||
mistralApiKey: undefined,
|
||||
vsCodeLmModelSelector: undefined
|
||||
};
|
||||
expect(checkExistKey(config)).toBe(false);
|
||||
|
||||
@@ -13,6 +13,7 @@ export type ApiProvider =
|
||||
| "openai-native"
|
||||
| "deepseek"
|
||||
| "vscode-lm"
|
||||
| "mistral"
|
||||
|
||||
export interface ApiHandlerOptions {
|
||||
apiModelId?: string
|
||||
@@ -43,6 +44,7 @@ export interface ApiHandlerOptions {
|
||||
lmStudioBaseUrl?: string
|
||||
geminiApiKey?: string
|
||||
openAiNativeApiKey?: string
|
||||
mistralApiKey?: string
|
||||
azureApiVersion?: string
|
||||
openRouterUseMiddleOutTransform?: boolean
|
||||
openAiStreamingEnabled?: boolean
|
||||
@@ -549,3 +551,18 @@ export const deepSeekModels = {
|
||||
// https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
|
||||
export const azureOpenAiDefaultApiVersion = "2024-08-01-preview"
|
||||
|
||||
|
||||
// Mistral
|
||||
// https://docs.mistral.ai/getting-started/models/models_overview/
|
||||
export type MistralModelId = keyof typeof mistralModels
|
||||
export const mistralDefaultModelId: MistralModelId = "codestral-latest"
|
||||
export const mistralModels = {
|
||||
"codestral-latest": {
|
||||
maxTokens: 32_768,
|
||||
contextWindow: 256_000,
|
||||
supportsImages: false,
|
||||
supportsPromptCache: false,
|
||||
inputPrice: 0.3,
|
||||
outputPrice: 0.9,
|
||||
},
|
||||
} as const satisfies Record<string, ModelInfo>
|
||||
|
||||
@@ -14,6 +14,7 @@ export function checkExistKey(config: ApiConfiguration | undefined) {
|
||||
config.geminiApiKey,
|
||||
config.openAiNativeApiKey,
|
||||
config.deepSeekApiKey,
|
||||
config.mistralApiKey,
|
||||
config.vsCodeLmModelSelector,
|
||||
].some((key) => key !== undefined)
|
||||
: false;
|
||||
|
||||
Reference in New Issue
Block a user