Spaces:
Running
Running
th commited on
Commit ·
e193de8
1
Parent(s): 98fa8d0
chore: 标记/analyze-ziwei-enhanced为deprecated + 修复Dockerfile漏COPY evidence.py/terms.py
Browse files- 二代endpoint(/analyze-ziwei-enhanced)确认零前端调用(hf-api-config.ts只声明
路径字符串未实际import),标deprecated不删代码
- ⚠️关键修复:本项目Dockerfile是逐文件显式COPY(不是*.py通配符),Phase 3新增的
evidence.py/terms.py没被列进去——如果真的推到HF Space重建,会在容器里
`from evidence import ...` ImportError。现在补上COPY,避免以后push时才发现。
🦊 Generated with Sisi
- Dockerfile +5 -0
- app.py +5 -0
Dockerfile
CHANGED
|
@@ -41,6 +41,11 @@ COPY sihua_analyzer.py ./
|
|
| 41 |
COPY sihua_data.py ./
|
| 42 |
COPY ai_interpreter.py ./
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
# Copy v3.5+ knowledge-enhanced modules
|
| 45 |
COPY knowledge_enhanced_interpreter.py ./
|
| 46 |
COPY palace_strength.py ./
|
|
|
|
| 41 |
COPY sihua_data.py ./
|
| 42 |
COPY ai_interpreter.py ./
|
| 43 |
|
| 44 |
+
# 2026-07-12 Phase 3: 四层schema(meta/strength/timing/evidence) — 漏COPY会导致
|
| 45 |
+
# HF Space构建后 `from evidence import ...` ImportError,务必跟app.py一起加
|
| 46 |
+
COPY evidence.py ./
|
| 47 |
+
COPY terms.py ./
|
| 48 |
+
|
| 49 |
# Copy v3.5+ knowledge-enhanced modules
|
| 50 |
COPY knowledge_enhanced_interpreter.py ./
|
| 51 |
COPY palace_strength.py ./
|
app.py
CHANGED
|
@@ -274,11 +274,16 @@ def calculate_ziwei(request: ZiweiRequest, api_key: str = Depends(verify_api_key
|
|
| 274 |
raise HTTPException(status_code=500, detail=f"Calculation error: {str(e)}")
|
| 275 |
|
| 276 |
|
|
|
|
|
|
|
|
|
|
| 277 |
@app.post("/analyze-ziwei-enhanced", response_model=ZiweiResponse)
|
| 278 |
def analyze_ziwei_enhanced(request: ZiweiRequest, api_key: str = Depends(verify_api_key)):
|
| 279 |
"""
|
| 280 |
增强版紫微斗数分析 - 包含四化飞星和AI解读
|
| 281 |
|
|
|
|
|
|
|
| 282 |
Enhanced Ziwei Doushu Analysis with Four Transformations and AI Interpretation
|
| 283 |
完整的紫微斗数排盘 + 四化飞星分析 + AI智能解读
|
| 284 |
"""
|
|
|
|
| 274 |
raise HTTPException(status_code=500, detail=f"Calculation error: {str(e)}")
|
| 275 |
|
| 276 |
|
| 277 |
+
# ⚠️ DEPRECATED (2026-07): 2026-07-12全仓库排查确认astrologybazi前端零调用此endpoint
|
| 278 |
+
# (app/lib/hf/hf-api-config.ts里声明了这个路径字符串,但从没被实际import/调用)。
|
| 279 |
+
# 保留仅为兼容,不删除代码——见 API_UNIFICATION_PLAN.md §1.2/§6。三代/四代(v4)才是活的。
|
| 280 |
@app.post("/analyze-ziwei-enhanced", response_model=ZiweiResponse)
|
| 281 |
def analyze_ziwei_enhanced(request: ZiweiRequest, api_key: str = Depends(verify_api_key)):
|
| 282 |
"""
|
| 283 |
增强版紫微斗数分析 - 包含四化飞星和AI解读
|
| 284 |
|
| 285 |
+
⚠️ DEPRECATED: 零前端调用,详见函数上方模块级注释。
|
| 286 |
+
|
| 287 |
Enhanced Ziwei Doushu Analysis with Four Transformations and AI Interpretation
|
| 288 |
完整的紫微斗数排盘 + 四化飞星分析 + AI智能解读
|
| 289 |
"""
|