摘要:
API文件可以先把它们分成五层: 层次文件主要职责 入口层 main.py 创建 FastAPI 应用,注册生命周期和路由 HTTP 层 query_router.py 定义 /api/query,接收请求,返回流式响应 业务层 query_service.py 创建 State / Context 阅读全文
posted @ 2026-06-11 11:32
幻影之舞
阅读(12)
评论(0)
推荐(0)
摘要:
先搭建一个最小的FaastAPI接口 from fastapi import FastAPI # 创建 FastAPI 应用实例 app = FastAPI() # 声明一个 GET 接口 @app.get("/health") async def health_check(): # 返回普通 di 阅读全文
posted @ 2026-06-11 09:55
幻影之舞
阅读(10)
评论(0)
推荐(0)

浙公网安备 33010602011771号