mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 11:24:43 +00:00
feat(provider): optimize provider and model configuration management (#377)
* feat(provider): optimize provider and model configuration management * style(provider): use default tabs variant in provider settings dialog * style(provider): make tabs list full width * feat(provider): make model card row clickable and remove pencil edit icon * feat(settings): persist active settings tab in url hash * feat(agent): add search box and alphabetical sorting for provider and model selectors * refactor(providers): remove frontend pagination and display all models in scrollable list * fix(providers): address code review findings for model editing, i18n, and api protocol propagation
This commit is contained in:
@@ -49,14 +49,35 @@ export type ProviderConfigSerializable = z.infer<typeof providerConfigSchema>
|
||||
export const createProviderRequestSchema = z.object({
|
||||
name: z.string().min(1, 'Provider name is required'),
|
||||
config: providerConfigSchema,
|
||||
models: z.array(providerModelSchema).min(1, 'At least one model is required'),
|
||||
models: z.array(providerModelSchema).default([]),
|
||||
})
|
||||
|
||||
export type CreateProviderRequest = z.infer<typeof createProviderRequestSchema>
|
||||
|
||||
export const updateProviderRequestSchema = z.object({
|
||||
name: z.string().min(1, 'Provider name is required').optional(),
|
||||
config: providerConfigSchema,
|
||||
models: z.array(providerModelSchema).min(1, 'At least one model is required'),
|
||||
models: z.array(providerModelSchema).optional(),
|
||||
})
|
||||
|
||||
export type UpdateProviderRequest = z.infer<typeof updateProviderRequestSchema>
|
||||
|
||||
export const createModelRequestSchema = z.object({
|
||||
modelId: z.string().min(1, 'Model ID is required'),
|
||||
name: z.string().min(0).default(''),
|
||||
config: providerModelConfigSchema,
|
||||
})
|
||||
|
||||
export type CreateModelRequest = z.infer<typeof createModelRequestSchema>
|
||||
|
||||
export const updateModelRequestSchema = z.object({
|
||||
modelId: z.string().min(1, 'Model ID is required').optional(),
|
||||
name: z.string().min(0).optional(),
|
||||
config: providerModelConfigSchema.optional(),
|
||||
})
|
||||
|
||||
export type UpdateModelRequest = z.infer<typeof updateModelRequestSchema>
|
||||
|
||||
export const providerResponseSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user