阶段3(上):Python/asyncio/FastAPI 专题的课程、企业场景、面试题和可运行示例
This commit is contained in:
1 parent
b8010a74f3
commit
7f52513ffc
24 files changed
+2817
-33
No files matched your search
@@ -4,12 +4,39 @@ title: FastAPI
|
||||
type: index
|
||||
domain: python
|
||||
stack: [fastapi]
|
||||
tags: []
|
||||
tags: [FastAPI, Web 框架, pydantic, SSE]
|
||||
week: [4, 5, 12]
|
||||
---
|
||||
|
||||
# FastAPI
|
||||
|
||||
路由与校验、依赖注入、中间件与鉴权、流式输出、测试。
|
||||
Python AI 服务最常用的 Web 框架:基于类型标注自动做参数校验和生成 OpenAPI 文档,原生支持 async 和流式响应。你熟悉的 Express / Koa、以及本计划里的 Gin,概念都能对应上:路由 ↔ 路由,中间件 ↔ 中间件,`Depends` ↔ 依赖注入(Gin 里通常手动传)。
|
||||
|
||||
> 本专题建设中:课程、企业场景、面试题和示例代码会陆续补充。
|
||||
## 学习路线
|
||||
|
||||
| 顺序 | 课程 | 级别 | 预计 |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | [路由和参数校验:路径 / 查询 / 请求体、pydantic 模型、响应模型](01-routing-validation.md) | 基础 | 2 小时 |
|
||||
| 2 | [依赖注入、鉴权、中间件和统一错误处理](02-deps-auth-errors.md) | 进阶 | 3 小时 |
|
||||
| 3 | [流式输出(SSE)、生命周期、测试和部署](03-streaming-testing.md) | 进阶 | 3 小时 |
|
||||
|
||||
## 企业场景
|
||||
|
||||
- [大模型对话 API:鉴权、统一错误、SSE 流式、客户端断开即停止](scenarios/streaming-chat-api.md)
|
||||
|
||||
## 面试题
|
||||
|
||||
- [FastAPI 面试题](interview.md)
|
||||
|
||||
## 示例代码
|
||||
|
||||
- [examples/chat-api](examples/chat-api/):完整的流式对话 API(API Key 鉴权、请求 ID、统一错误格式、SSE、依赖替换)+ 6 个测试;模型客户端是假实现,不需要 API Key
|
||||
|
||||
## 在 16 周计划中
|
||||
|
||||
- [第 4 周:FastAPI 基础](../../../plan/week04-python.md)、[第 5 周:RAG 服务](../../../plan/week05-rag-1.md)、[第 12 周:Agent 服务化](../../../plan/week12-agent-m3-persistence.md)
|
||||
|
||||
## 官方资料
|
||||
|
||||
- FastAPI 文档(有中文版):https://fastapi.tiangolo.com/zh/
|
||||
- pydantic v2:https://docs.pydantic.dev/latest/
|
||||
Reference in new issue
Block a user