feat(Application): Application can configure specified model

This commit is contained in:
ulleo
2026-06-03 17:29:09 +08:00
committed by ulleo
parent c0802dbadc
commit f691b3e03a
5 changed files with 20 additions and 8 deletions
+5
View File
@@ -92,6 +92,11 @@
"system_model_create": "Save Model",
"system_model_update": "Update Model",
"system_model_del": "Delete Model",
"enable_custom_model": "Enable Custom Model",
"custom_model": "Custom Model",
"system_model_ws_mapping": "Query Model-Workspace Authorization Relationships",
"system_model_ws_mapping_update": "Update Model-Workspace Authorization Relationships",
"system_model_list_by_ws": "Get Model List by Workspace",
"model_name": "Name",
"model_type": "Type",
"base_model": "Base Model",
+5
View File
@@ -92,6 +92,11 @@
"system_model_create": "保存模型",
"system_model_update": "更新模型",
"system_model_del": "删除模型",
"enable_custom_model": "启用自定义模型",
"custom_model": "自定义模型",
"system_model_ws_mapping": "查询模型授权工作空间的关联关系",
"system_model_ws_mapping_update": "更新模型授权工作空间的关联关系",
"system_model_list_by_ws": "根据工作空间获取模型列表",
"model_name": "名称",
"model_type": "类型",
"base_model": "基础模型",
+6 -6
View File
@@ -192,8 +192,8 @@ async def delete_model(
session.commit()
@router.get("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_query",
description=f"{PLACEHOLDER_PREFIX}system_model_query")
@router.get("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping",
description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping")
@require_permissions(permission=SqlbotPermission(role=['admin']))
async def get_model_ws_mapping_by_id(
session: SessionDep,
@@ -214,8 +214,8 @@ async def get_model_ws_mapping_by_id(
return [str(ws_id) for ws_id in ws_ids]
@router.put("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_query",
description=f"{PLACEHOLDER_PREFIX}system_model_query")
@router.put("/{id}/ws_mapping", response_model=List[str], summary=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_update",
description=f"{PLACEHOLDER_PREFIX}system_model_ws_mapping_update")
@require_permissions(permission=SqlbotPermission(role=['admin']))
async def update_model_ws_mapping_by_id(
session: SessionDep,
@@ -249,8 +249,8 @@ async def update_model_ws_mapping_by_id(
return [str(ws_id) for ws_id in ws_ids]
@router.get("/list/by_ws", response_model=List[AiModelBrief], summary=f"{PLACEHOLDER_PREFIX}system_model_query",
description=f"{PLACEHOLDER_PREFIX}system_model_query")
@router.get("/list/by_ws", response_model=List[AiModelBrief], summary=f"{PLACEHOLDER_PREFIX}system_model_list_by_ws",
description=f"{PLACEHOLDER_PREFIX}system_model_list_by_ws")
@require_permissions(permission=SqlbotPermission(role=['ws_admin']))
async def get_model_by_ws(
session: SessionDep,
+2 -2
View File
@@ -111,8 +111,8 @@ class AssistantBase(BaseModel):
configuration: Optional[str] = Field(default=None, description=f"{PLACEHOLDER_PREFIX}assistant_configuration")
description: Optional[str] = Field(default=None, description=f"{PLACEHOLDER_PREFIX}assistant_description")
oid: Optional[int] = Field(default=1, description=f"{PLACEHOLDER_PREFIX}oid")
enable_custom_model: Optional[bool] = Field(default=False, description=f"{PLACEHOLDER_PREFIX}oid")
custom_model: Optional[str] = Field(description=f"{PLACEHOLDER_PREFIX}oid")
enable_custom_model: Optional[bool] = Field(default=False, description=f"{PLACEHOLDER_PREFIX}enable_custom_model")
custom_model: Optional[str] = Field(description=f"{PLACEHOLDER_PREFIX}custom_model")
class AssistantDTO(AssistantBase, BaseCreatorDTO):
@@ -65,6 +65,8 @@ const defaultForm = {
type: 4,
configuration: null,
description: null,
enable_custom_model: false,
custom_model: null,
}
const pageForm = ref<Form>(cloneDeep(defaultForm))