feat(settings): add model provider management with full CRUD support
Add a new settings page for managing API model providers (name, API URL, API key, applicable agent types). Includes database migration, SeaORM entity, backend CRUD commands/handlers, frontend settings UI with agent type filter, add/edit/delete dialogs, and i18n support for all 10 locales. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ import type {
|
||||
ChatChannelInfo,
|
||||
ChannelStatusInfo,
|
||||
ChatChannelMessageLog,
|
||||
ModelProviderInfo,
|
||||
} from "./types"
|
||||
|
||||
export async function listConversations(params?: {
|
||||
@@ -1468,3 +1469,40 @@ export async function weixinCheckQrcode(
|
||||
}> {
|
||||
return getTransport().call("weixin_check_qrcode", { channelId, qrcode })
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Model Providers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export async function listModelProviders(): Promise<ModelProviderInfo[]> {
|
||||
return getTransport().call("list_model_providers")
|
||||
}
|
||||
|
||||
export async function createModelProvider(params: {
|
||||
name: string
|
||||
apiUrl: string
|
||||
apiKey: string
|
||||
agentTypes: string[]
|
||||
}): Promise<ModelProviderInfo> {
|
||||
return getTransport().call("create_model_provider", params)
|
||||
}
|
||||
|
||||
export async function updateModelProvider(params: {
|
||||
id: number
|
||||
name?: string | null
|
||||
apiUrl?: string | null
|
||||
apiKey?: string | null
|
||||
agentTypes?: string[] | null
|
||||
}): Promise<ModelProviderInfo> {
|
||||
return getTransport().call("update_model_provider", {
|
||||
id: params.id,
|
||||
name: params.name ?? null,
|
||||
apiUrl: params.apiUrl ?? null,
|
||||
apiKey: params.apiKey ?? null,
|
||||
agentTypes: params.agentTypes ?? null,
|
||||
})
|
||||
}
|
||||
|
||||
export async function deleteModelProvider(id: number): Promise<void> {
|
||||
return getTransport().call("delete_model_provider", { id })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user