后台管理功能开发,AI配置管理

This commit is contained in:
2025-10-30 14:50:44 +08:00
parent dc0413d084
commit 8b6e3d0815
23 changed files with 4463 additions and 4 deletions
+179
View File
@@ -0,0 +1,179 @@
// AI配置相关类型定义
export interface AiConfig {
id: string
configName: string
configKey: string
configType: string
provider: string
apiBaseUrl: string
apiToken: string
apiVersion?: string
modelName?: string
botId?: string
workflowId?: string
timeoutMs?: number
retryCount?: number
retryDelayMs?: number
maxTokens?: number
temperature?: number
topP?: number
supportStream?: number
supportFunctionCall?: number
supportVision?: number
supportFileUpload?: number
usageScenario: string
priority?: number
inputPricePer1k?: number
outputPricePer1k?: number
currency?: string
rateLimitPerMinute?: number
rateLimitPerHour?: number
rateLimitPerDay?: number
isEnabled?: number
isDefault?: number
environment?: string
customHeaders?: string
customParams?: string
webhookUrl?: string
healthCheckUrl?: string
healthCheckIntervalMinutes?: number
description?: string
usageNotes?: string
createTime?: string
updateTime?: string
}
export interface AiConfigPageRequest {
current: number
size: number
keyword?: string
configType?: string
provider?: string
usageScenario?: string
isEnabled?: number
isDefault?: number
environment?: string
orderBy?: string
orderDirection?: string
}
export interface AiConfigCreateRequest {
configName: string
configKey: string
configType: string
provider: string
apiBaseUrl: string
apiToken: string
apiVersion?: string
modelName?: string
botId?: string
workflowId?: string
timeoutMs?: number
retryCount?: number
retryDelayMs?: number
maxTokens?: number
temperature?: number
topP?: number
supportStream?: number
supportFunctionCall?: number
supportVision?: number
supportFileUpload?: number
usageScenario: string
priority?: number
inputPricePer1k?: number
outputPricePer1k?: number
currency?: string
rateLimitPerMinute?: number
rateLimitPerHour?: number
rateLimitPerDay?: number
isEnabled?: number
isDefault?: number
environment?: string
customHeaders?: string
customParams?: string
webhookUrl?: string
healthCheckUrl?: string
healthCheckIntervalMinutes?: number
description?: string
usageNotes?: string
}
export interface AiConfigUpdateRequest {
id: string
configName?: string
configKey?: string
configType?: string
provider?: string
apiBaseUrl?: string
apiToken?: string
apiVersion?: string
modelName?: string
botId?: string
workflowId?: string
timeoutMs?: number
retryCount?: number
retryDelayMs?: number
maxTokens?: number
temperature?: number
topP?: number
supportStream?: number
supportFunctionCall?: number
supportVision?: number
supportFileUpload?: number
usageScenario?: string
priority?: number
inputPricePer1k?: number
outputPricePer1k?: number
currency?: string
rateLimitPerMinute?: number
rateLimitPerHour?: number
rateLimitPerDay?: number
isEnabled?: number
isDefault?: number
environment?: string
customHeaders?: string
customParams?: string
webhookUrl?: string
healthCheckUrl?: string
healthCheckIntervalMinutes?: number
description?: string
usageNotes?: string
}
// 配置类型选项
export const CONFIG_TYPE_OPTIONS = [
{ label: 'Coze', value: 'coze' },
{ label: 'OpenAI', value: 'openai' },
{ label: 'Claude', value: 'claude' },
{ label: 'Gemini', value: 'gemini' }
]
// 服务提供商选项
export const PROVIDER_OPTIONS = [
{ label: 'Coze', value: 'coze' },
{ label: 'OpenAI', value: 'openai' },
{ label: 'Anthropic', value: 'anthropic' },
{ label: 'Google', value: 'google' }
]
// 使用场景选项
export const USAGE_SCENARIO_OPTIONS = [
{ label: '聊天', value: 'chat' },
{ label: '总结', value: 'summary' },
{ label: '情绪分析', value: 'emotion_analysis' },
{ label: '内容生成', value: 'content_generation' }
]
// 环境选项
export const ENVIRONMENT_OPTIONS = [
{ label: '开发环境', value: 'development' },
{ label: '测试环境', value: 'testing' },
{ label: '生产环境', value: 'production' }
]
// 货币选项
export const CURRENCY_OPTIONS = [
{ label: '美元', value: 'USD' },
{ label: '人民币', value: 'CNY' }
]