Skip to content

Commit 06eef25

Browse files
committed
Add missing config to address #3434
1 parent 28a12c5 commit 06eef25

File tree

3 files changed

+73
-49
lines changed

3 files changed

+73
-49
lines changed

src/exports/roo-code.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ type ProviderSettings = {
196196
| "litellm"
197197
)
198198
| undefined
199-
apiModelId?: string | undefined
200199
apiKey?: string | undefined
201200
anthropicBaseUrl?: string | undefined
202201
anthropicUseAuthToken?: boolean | undefined
202+
apiModelId?: string | undefined
203203
glamaModelId?: string | undefined
204204
glamaApiKey?: string | undefined
205205
openRouterApiKey?: string | undefined

src/exports/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ type ProviderSettings = {
199199
| "litellm"
200200
)
201201
| undefined
202-
apiModelId?: string | undefined
203202
apiKey?: string | undefined
204203
anthropicBaseUrl?: string | undefined
205204
anthropicUseAuthToken?: boolean | undefined
205+
apiModelId?: string | undefined
206206
glamaModelId?: string | undefined
207207
glamaApiKey?: string | undefined
208208
openRouterApiKey?: string | undefined

src/schemas/index.ts

Lines changed: 71 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,19 @@ const genericProviderSettingsSchema = z.object({
358358
modelMaxThinkingTokens: z.number().optional(),
359359
})
360360

361-
const anthropicSchema = z.object({
362-
apiModelId: z.string().optional(),
363-
apiKey: z.string().optional(),
364-
anthropicBaseUrl: z.string().optional(),
365-
anthropicUseAuthToken: z.boolean().optional(),
361+
// Several of the providers share common model config properties.
362+
const commonProviderModelSchema = z.object({
363+
apiModelId: z.string().optional(), // Actually, the router providers don't use this
366364
})
367365

366+
const anthropicSchema = z
367+
.object({
368+
apiKey: z.string().optional(),
369+
anthropicBaseUrl: z.string().optional(),
370+
anthropicUseAuthToken: z.boolean().optional(),
371+
})
372+
.merge(commonProviderModelSchema)
373+
368374
const glamaSchema = z.object({
369375
glamaModelId: z.string().optional(),
370376
glamaApiKey: z.string().optional(),
@@ -378,24 +384,28 @@ const openRouterSchema = z.object({
378384
openRouterUseMiddleOutTransform: z.boolean().optional(),
379385
})
380386

381-
const bedrockSchema = z.object({
382-
awsAccessKey: z.string().optional(),
383-
awsSecretKey: z.string().optional(),
384-
awsSessionToken: z.string().optional(),
385-
awsRegion: z.string().optional(),
386-
awsUseCrossRegionInference: z.boolean().optional(),
387-
awsUsePromptCache: z.boolean().optional(),
388-
awsProfile: z.string().optional(),
389-
awsUseProfile: z.boolean().optional(),
390-
awsCustomArn: z.string().optional(),
391-
})
387+
const bedrockSchema = z
388+
.object({
389+
awsAccessKey: z.string().optional(),
390+
awsSecretKey: z.string().optional(),
391+
awsSessionToken: z.string().optional(),
392+
awsRegion: z.string().optional(),
393+
awsUseCrossRegionInference: z.boolean().optional(),
394+
awsUsePromptCache: z.boolean().optional(),
395+
awsProfile: z.string().optional(),
396+
awsUseProfile: z.boolean().optional(),
397+
awsCustomArn: z.string().optional(),
398+
})
399+
.merge(commonProviderModelSchema)
392400

393-
const vertexSchema = z.object({
394-
vertexKeyFile: z.string().optional(),
395-
vertexJsonCredentials: z.string().optional(),
396-
vertexProjectId: z.string().optional(),
397-
vertexRegion: z.string().optional(),
398-
})
401+
const vertexSchema = z
402+
.object({
403+
vertexKeyFile: z.string().optional(),
404+
vertexJsonCredentials: z.string().optional(),
405+
vertexProjectId: z.string().optional(),
406+
vertexRegion: z.string().optional(),
407+
})
408+
.merge(commonProviderModelSchema)
399409

400410
const openAiSchema = z.object({
401411
openAiBaseUrl: z.string().optional(),
@@ -435,25 +445,33 @@ const lmStudioSchema = z.object({
435445
lmStudioSpeculativeDecodingEnabled: z.boolean().optional(),
436446
})
437447

438-
const geminiSchema = z.object({
439-
geminiApiKey: z.string().optional(),
440-
googleGeminiBaseUrl: z.string().optional(),
441-
})
448+
const geminiSchema = z
449+
.object({
450+
geminiApiKey: z.string().optional(),
451+
googleGeminiBaseUrl: z.string().optional(),
452+
})
453+
.merge(commonProviderModelSchema)
442454

443-
const openAiNativeSchema = z.object({
444-
openAiNativeApiKey: z.string().optional(),
445-
openAiNativeBaseUrl: z.string().optional(),
446-
})
455+
const openAiNativeSchema = z
456+
.object({
457+
openAiNativeApiKey: z.string().optional(),
458+
openAiNativeBaseUrl: z.string().optional(),
459+
})
460+
.merge(commonProviderModelSchema)
447461

448-
const mistralSchema = z.object({
449-
mistralApiKey: z.string().optional(),
450-
mistralCodestralUrl: z.string().optional(),
451-
})
462+
const mistralSchema = z
463+
.object({
464+
mistralApiKey: z.string().optional(),
465+
mistralCodestralUrl: z.string().optional(),
466+
})
467+
.merge(commonProviderModelSchema)
452468

453-
const deepSeekSchema = z.object({
454-
deepSeekBaseUrl: z.string().optional(),
455-
deepSeekApiKey: z.string().optional(),
456-
})
469+
const deepSeekSchema = z
470+
.object({
471+
deepSeekBaseUrl: z.string().optional(),
472+
deepSeekApiKey: z.string().optional(),
473+
})
474+
.merge(commonProviderModelSchema)
457475

458476
const unboundSchema = z.object({
459477
unboundApiKey: z.string().optional(),
@@ -471,17 +489,23 @@ const fakeAiSchema = z.object({
471489
fakeAi: z.unknown().optional(),
472490
})
473491

474-
const xaiSchema = z.object({
475-
xaiApiKey: z.string().optional(),
476-
})
492+
const xaiSchema = z
493+
.object({
494+
xaiApiKey: z.string().optional(),
495+
})
496+
.merge(commonProviderModelSchema)
477497

478-
const groqSchema = z.object({
479-
groqApiKey: z.string().optional(),
480-
})
498+
const groqSchema = z
499+
.object({
500+
groqApiKey: z.string().optional(),
501+
})
502+
.merge(commonProviderModelSchema)
481503

482-
const chutesSchema = z.object({
483-
chutesApiKey: z.string().optional(),
484-
})
504+
const chutesSchema = z
505+
.object({
506+
chutesApiKey: z.string().optional(),
507+
})
508+
.merge(commonProviderModelSchema)
485509

486510
const litellmSchema = z.object({
487511
litellmBaseUrl: z.string().optional(),

0 commit comments

Comments
 (0)