mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor: 将模型别名(alias)统一重命名为模型映射(mapping)
- 重命名 API: alias-mapping-preview -> mapping-preview - 重命名类型: AliasMatchedModel -> MappingMatchedModel 等 - 重命名字段: model_aliases -> model_mappings, alias_matched_model -> mapping_matched_model - 重命名前端组件: ModelAliasesTab -> ModelMappingsTab - 重命名验证函数: validate_model_aliases -> validate_model_mappings - 同步更新相关测试用例 - 补充 ModelService 中新增/批量创建模型时的缓存失效逻辑
This commit is contained in:
@@ -97,34 +97,34 @@ export async function testModel(data: TestModelRequest): Promise<TestModelRespon
|
||||
}
|
||||
|
||||
/**
|
||||
* 别名映射预览相关类型
|
||||
* 映射预览相关类型
|
||||
*/
|
||||
export interface AliasMatchedModel {
|
||||
export interface MappingMatchedModel {
|
||||
allowed_model: string
|
||||
alias_pattern: string
|
||||
mapping_pattern: string
|
||||
}
|
||||
|
||||
export interface AliasMatchingGlobalModel {
|
||||
export interface MappingMatchingGlobalModel {
|
||||
global_model_id: string
|
||||
global_model_name: string
|
||||
display_name: string
|
||||
is_active: boolean
|
||||
matched_models: AliasMatchedModel[]
|
||||
matched_models: MappingMatchedModel[]
|
||||
}
|
||||
|
||||
export interface AliasMatchingKey {
|
||||
export interface MappingMatchingKey {
|
||||
key_id: string
|
||||
key_name: string
|
||||
masked_key: string
|
||||
is_active: boolean
|
||||
allowed_models: string[]
|
||||
matching_global_models: AliasMatchingGlobalModel[]
|
||||
matching_global_models: MappingMatchingGlobalModel[]
|
||||
}
|
||||
|
||||
export interface ProviderAliasMappingPreviewResponse {
|
||||
export interface ProviderMappingPreviewResponse {
|
||||
provider_id: string
|
||||
provider_name: string
|
||||
keys: AliasMatchingKey[]
|
||||
keys: MappingMatchingKey[]
|
||||
total_keys: number
|
||||
total_matches: number
|
||||
// 截断提示
|
||||
@@ -134,11 +134,11 @@ export interface ProviderAliasMappingPreviewResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Provider 别名映射预览
|
||||
* 获取 Provider 映射预览
|
||||
*/
|
||||
export async function getProviderAliasMappingPreview(
|
||||
export async function getProviderMappingPreview(
|
||||
providerId: string
|
||||
): Promise<ProviderAliasMappingPreviewResponse> {
|
||||
const response = await client.get(`/api/admin/providers/${providerId}/alias-mapping-preview`)
|
||||
): Promise<ProviderMappingPreviewResponse> {
|
||||
const response = await client.get(`/api/admin/providers/${providerId}/mapping-preview`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user