mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 05:02:57 +00:00
- 删除原有的示例模块(module_example)和AI模块(module_ai) - 在应用模块(module_application)下新增AI子模块和示例子模块 - 更新相关路由配置,移除不再使用的模块路由 - 调整定时任务模块从监控模块迁移至应用模块 - 更新前端API路径和组件文件结构 - 修正数据库表名前缀,统一使用'app_'作为应用模块表前缀
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional, List
|
|
from fastapi import Query
|
|
from pydantic import Field
|
|
|
|
from app.core.base_schema import BaseSchema
|
|
from app.common.enums import McpLLMProvider
|
|
|
|
|
|
class McpQueryParam:
|
|
"""MCP 服务器查询参数"""
|
|
|
|
def __init__(
|
|
self,
|
|
name: Optional[str] = Query(None, description="MCP 名称"),
|
|
type: Optional[int] = Query(None, description="MCP 类型"),
|
|
) -> None:
|
|
|
|
# 模糊查询字段
|
|
self.name = ("like", name) if name else None
|
|
|
|
# 精确查询字段
|
|
self.type = type
|
|
|
|
|
|
class McpChatParam(BaseSchema):
|
|
"""MCP 聊天参数"""
|
|
pk: List[int] = Field(..., description='MCP ID 列表')
|
|
provider: McpLLMProvider = Field(McpLLMProvider.openai, description='LLM 供应商')
|
|
model: str = Field(..., description='LLM 名称')
|
|
key: str = Field(..., description='LLM API Key')
|
|
base_url: Optional[str] = Field(None, description='自定义 LLM API 地址,必须兼容 openai 供应商')
|
|
prompt: str = Field(..., description='用户提示词') |