Files
slide/decks/gen2D/pages/lessons.md
T
wonder f0245e926d
Deploy Slides / build-and-deploy (push) Successful in 1m13s
feat: add 3 creative slides — tech decisions, request tracing, lessons learned
- why-not-x.md: Engineering decision rationale (Go vs Python, SQLite vs PG, etc.)
- request-journey.md: Full HTTP-to-pixel request tracing with timing breakdown
- lessons.md: 4 real engineering pitfalls and how they were solved
- Wire all 3 new pages into slides.md in logical positions
2026-05-30 22:46:23 +08:00

32 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 踩坑与收获
真实的工程教训
<v-clicks>
<Item title="🕳️ 坑 1:AI 输出不可控">
最初没有质检节点,生成的精灵表经常缺帧、错位。**解法**:引入 QualitySupervisor + 重试机制,用视觉模型自动校验。
</Item>
<Item title="🕳️ 坑 2:LLM 调用成本高">
每次生成都调 LLM 优化提示词,API 成本飙升。**解法**:无 Key 自动回退模板生成,开发环境零成本。模板也能生成三段式结构化提示词。
</Item>
<Item title="🕳️ 坑 3:并发请求重复生成">
用户连续点两次"生成",同一个素材生成了两遍。**解法**:`hash(prompt+type+params)` 去重,相同参数直接返回已有 taskId。
</Item>
<Item title="🕳️ 坑 4:Redis 挂了限流也挂了">
一开始限流依赖 Redis,Redis 宕机时整个生成接口不可用。**解法**:fail-open 策略,Redis 不可用时自动放行,保障核心业务。
</Item>
</v-clicks>
<div v-click class="mt-4 text-center text-gray-400 text-sm">
<b>最大的收获</b>:AI 应用的核心不是调 API,而是工程化 — 可靠性、一致性、成本控制
</div>
<!--
这些都是我们实际遇到的问题。做 AI 应用和做传统 Web 应用最大的区别就是:AI 的输出是不确定的,你需要用工程手段去兜底。
-->