阶段4(下):LangChain 1.x、提示词与注入防护、模型侧(路由/vLLM/LoRA)、AI 编程工具与验证、Dify/Coze 专题
This commit is contained in:
1 parent
caaec830b3
commit
7a32d2c9a6
38 files changed
+3059
-67
No files matched your search
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: add-api-endpoint
|
||||
description: 需要新增一个后端 HTTP 接口(含模型、服务、测试)时使用。
|
||||
---
|
||||
|
||||
# 新增接口的步骤
|
||||
|
||||
1. 在 `app/schemas/` 定义请求和响应模型(pydantic),字段写清楚约束。
|
||||
2. 在 `app/services/` 写业务逻辑,不依赖 FastAPI 对象,方便单测。
|
||||
3. 在 `app/api/` 注册路由,使用依赖注入获取当前用户和数据库会话。
|
||||
4. 在 `tests/` 写测试:正常、参数错误、无权限三类用例。
|
||||
5. 运行 `uv run pytest -q`,全部通过后再报告完成,并列出验证结果。
|
||||
Reference in new issue
Block a user