Skip to content
Closed
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
4 changes: 3 additions & 1 deletion packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const globalSettingsSchema = z.object({
allowedMaxRequests: z.number().nullish(),
autoCondenseContext: z.boolean().optional(),
autoCondenseContextPercent: z.number().optional(),
maxConcurrentFileReads: z.number().optional(),
maxConcurrentFileReads: z.number().optional(),

browserToolEnabled: z.boolean().optional(),
browserViewportSize: z.string().optional(),
Expand Down Expand Up @@ -221,6 +221,7 @@ export type SecretState = Pick<
| "groqApiKey"
| "chutesApiKey"
| "litellmApiKey"
| "modelharborApiKey"
| "codeIndexOpenAiKey"
| "codeIndexQdrantApiKey"
>
Expand All @@ -243,6 +244,7 @@ export const SECRET_STATE_KEYS = keysOf<SecretState>()([
"groqApiKey",
"chutesApiKey",
"litellmApiKey",
"modelharborApiKey",
"codeIndexOpenAiKey",
"codeIndexQdrantApiKey",
])
Expand Down
11 changes: 11 additions & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const providerNames = [
"groq",
"chutes",
"litellm",
"modelharbor",
] as const

export const providerNamesSchema = z.enum(providerNames)
Expand Down Expand Up @@ -203,6 +204,11 @@ const litellmSchema = baseProviderSettingsSchema.extend({
litellmModelId: z.string().optional(),
})

const modelharborSchema = baseProviderSettingsSchema.extend({
modelharborApiKey: z.string().optional(),
modelharborModelId: z.string().optional(),
})

const defaultSchema = z.object({
apiProvider: z.undefined(),
})
Expand All @@ -229,6 +235,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
groqSchema.merge(z.object({ apiProvider: z.literal("groq") })),
chutesSchema.merge(z.object({ apiProvider: z.literal("chutes") })),
litellmSchema.merge(z.object({ apiProvider: z.literal("litellm") })),
modelharborSchema.merge(z.object({ apiProvider: z.literal("modelharbor") })),
defaultSchema,
])

Expand All @@ -255,6 +262,7 @@ export const providerSettingsSchema = z.object({
...groqSchema.shape,
...chutesSchema.shape,
...litellmSchema.shape,
...modelharborSchema.shape,
...codebaseIndexProviderSchema.shape,
})

Expand Down Expand Up @@ -359,4 +367,7 @@ export const PROVIDER_SETTINGS_KEYS = keysOf<ProviderSettings>()([
"litellmBaseUrl",
"litellmApiKey",
"litellmModelId",
// ModelHarbor
"modelharborApiKey",
"modelharborModelId",
])
1 change: 1 addition & 0 deletions packages/types/src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from "./groq.js"
export * from "./lite-llm.js"
export * from "./lm-studio.js"
export * from "./mistral.js"
export * from "./modelharbor.js"
export * from "./openai.js"
export * from "./openrouter.js"
export * from "./requesty.js"
Expand Down
Loading