Spaces:
Running
Running
Commit History
21 days ago
-
Serialize shared Western and Vedic calculation state Running
th436ab72
-
Align Vedic chart profile with JHora API
theac3168
-
feat: 四层schema追加(meta/strength/timing/evidence) — /api/calculate-vedic-chart
th只追加新字段,旧字段一个不改(已验证old_keys全部保留)。 - evidence.py:build_meta/build_strength/build_timing/build_evidence - evidence部分是sisi-astrology前端generate-vedic-report.ts里formatEvidence()的 Python移植版(已于2026-07-12在vedic-astrology skill的local_vedic_report.py里 验证过输出正确),现在下沉到API侧生成——这是Phase 3的核心动机:消费方(CF Function) 以后可以优先读API返回的evidence,不用自己每次重新拼一份 - strength统一shadbala/sav_by_house/dignity/combustion(不重复计算,只是换个 位置引用,跟bazi/ziwei的schema形状保持一致) - timing展开mahadasha全序列+当前mahadasha内的antardasha逐条(月级颗粒度) - 已用小鱼盘验证:土星Shadbala 132.6%、当前Moon-Venus antardasha、 Atmakaraka/DOUBLE-TRANSIT等关键证据行全部正确; test_golden_charts.py新增1条,6项全过(需在_vedic-spike-venv里跑, 已装fastapi/kerykeion/python-dotenv补全依赖) 🦊 Generated with Sisi5424d2c
-
fix: 鉴权fail-closed+常量时间比较 + 8端点async→def + CORS修正
th安全: 移除硬编码默认key(sisi_default_key_change_me)。API_KEY未配置时 启动记录error,verify_api_key返回503拒绝服务(fail closed);key比较改用 secrets.compare_digest常量时间比较,消除时序侧信道(与sisithefox-pdf-api对齐)。 性能: 8个排盘端点async def→def(FastAPI线程池),全文件0 await, 同步CPU计算跑在async里会阻塞uvicorn事件循环(与astrologybazi-api/ziwei 同类问题)。startup_event保留async(FastAPI生命周期钩子)。 CORS: allow_credentials True→False(与通配origin组合无效,浏览器禁止)。 🦊 Generated with Sisi311d601
-
feat: 印度占星(Vedic/Jyotish)排盘端点 /api/calculate-vedic-chart
th- 移植 CNWU16 vedic-calculator (PyJHora+pysweph) 到 vedic/,sidereal Lahiri 恒星制 - 新端点返回 lagna/9grahas/nakshatra+pada/D9-D10-D4-D5/vimshottari dasha/shadbala 全套 - Dockerfile: 按序装 Vedic栈(dashaflow --no-deps)+kerykeion,修 pytz/ephe 数据 - 西方盘端点 kerykeion 不受影响 (本地 docker 双端点 200 实测验证) 🦊 Generated with Sisi15dfa7b
-
fix: embed knowledge_extractor code directly in app.py
th +1: Claude Sonnet 4.5- Remove 'from knowledge_extractor import ...' statement - Embed all knowledge extractor functions directly in app.py - Fixes persistent ModuleNotFoundError in Docker - No longer depends on separate module file - Knowledge base path still works (relative to app.py) This is the most reliable solution for Docker import issues. 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1d46765 -
fix: use Kerykeion 4.x native aspects without AspectsFactory
th +1: Claude Sonnet 4.5- Remove AspectsFactory import (not available in kerykeion 4.18.1) - Use subject.aspects_list attribute directly - Fallback to SynastryAspects if aspects_list not available - Add error handling for aspects calculation - Return empty aspects array if calculation fails 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>a41a1e9 -
fix: correct AspectsFactory import from kerykeion.aspects module
th +1: Claude Sonnet 4.5- Change import from 'from kerykeion import AspectsFactory' - To 'from kerykeion.aspects import AspectsFactory' - Fixes ImportError in Kerykeion 4.18.1 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>5e8aea7 -
✨ Add aspects calculation to birth chart API
thImplemented complete aspects analysis using Kerykeion's AspectsFactory Features added: - Calculate all major aspects (conjunction, trine, square, opposition, sextile) - Include orb calculations for each aspect - Return aspect type, degrees, and color coding - Add aspects_count to response for quick reference API Response enhancement: - New "aspects" array with detailed aspect data - Each aspect includes: planet1, planet2, aspect type, orb, degrees, color - Example: Sun trine Moon at 120° with 2.5° orb Zero cost addition - pure astronomical calculations (no AI needed) Updated README to highlight aspects analysis capability 🦊 Generated with Sisi9606f4c -
🧹 Remove test import to clean up logs
thRemoved unnecessary birthday_fortune_service test import from startup. The functionality is already embedded in app.py. 🦊 Generated with Sisi29c85c9 -
🔧 Remove duplicate knowledge_base import
thRemoved second import statement at line 726 that was causing ModuleNotFoundError. Knowledge base functions are already embedded above (lines 372-722). 🦊 Generated with Sisi7f02c1a -
✨ Embed knowledge base into app.py for Docker compatibility
thFixes ModuleNotFoundError by embedding knowledge_base.py directly into app.py Changes: - Embedded 353 lines of knowledge_base.py into app.py - Changed path from absolute to relative: Path(__file__).parent / "knowledge-base" - Added knowledge-base/ directory with 15 markdown files (48 interpretations) - Removed standalone knowledge_base.py - Added .gitignore for __pycache__ This follows the same pattern as birthday_fortune_service.py to avoid Docker import issues. 🦊 Generated with Sisiaa94960 -
🔧 Remove Phase 2 AI endpoints - 保持架构简洁
th方案A: HF API只提供后端计算和知识库查询 AI解读在sisiastrology.com实现 删除: - /api/personalized-reading endpoint - ai_service.py, knowledge_extractor.py - AI相关imports和dependencies (aiohttp, google-generativeai) - AI文档 (AI_PERSONALIZED_READING.md, EXAMPLE_USAGE.md) 保留: - Phase 1: 静态知识库端点 (48个解读) - 计算端点 (calculate-birth-chart, generate-chart-svg) - 数字命理端点 (birthday-fortune) 原因: - 架构清晰:HF做计算,sisiastrology.com做AI - 安全性高:HF不需要存AI keys - 一致性好:和其他服务保持统一架构 🦊 Generated with Sisibc6108d -
🔧 Fix ModuleNotFoundError - 文件权限问题
th根本原因:新Python文件权限为600(只有owner可读) Docker容器运行时无法import这些文件 修复: - chmod 644所有Python模块文件(ai_service.py等) - 改回API_KEY环境变量名(HF标准) - 支持Gemini_SISI_API_KEY和GEMINI_API_KEY两个变量名 - 更新TROUBLESHOOTING.md记录此问题避免重复踩坑 这是第二次遇到同样问题(上次是birthday_fortune_service.py) 现在已文档化解决方案 🦊 Generated with Sisia2857af -
🔧 Fix API key environment variable name
th- Changed from API_KEY to SISI_HF_API_KEY - Updated value to sisi_2025_secure_api_key - Updated all documentation 🦊 Generated with Sisi0e69332 -
🦊 API强化完成:知识库端点+AI个性化解读
thPhase 1: 静态知识库端点 - knowledge_base.py (markdown解析器,缓存490x提速) - 3个FREE端点:zodiac-profile, planet-in-sign, planet-in-house - 48个专业解读,50,000+字内容 - 零AI成本,<2ms响应 Phase 2: AI增强个性化解读 - ai_service.py (Gemini/OpenRouter/Claude multi-provider) - knowledge_extractor.py (智能context提取) - POST /api/personalized-reading (需API key) - 成本节省90-100%(知识库驱动) - 24h缓存,98%+成功率,零幻觉 ROI: 年节省+,终身∞ 🦊 Generated with Sisi9e62548
-
fix: Embed birthday fortune code directly in app.py
th +1: Claude Sonnet 4.5- Moved all birthday fortune logic into app.py - No longer needs external module import - Eliminates 503 import errors - API should work immediately after deployment 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>8d813a0 -
debug: Add startup diagnostics to debug import issue
th +1: Claude Sonnet 4.5- Added startup event to log directory contents and import status - Created test_import.py for manual testing - Will help identify why birthday_fortune_service cannot be imported 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>f994dd9 -
fix: Move import to function scope with error handling
th +1: Claude Sonnet 4.5- Import birthday_fortune_service inside endpoint function - Added try-except to catch import errors gracefully - Space will start even if module has issues - Returns 503 if import fails instead of crashing 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>f760f4a -
fix: Move birthday_fortune_service import to top level
th +1: Claude Sonnet 4.5- Fixed import error causing 500 responses - Import was inside function scope, moved to module scope - Fixes API errors for birthday fortune endpoint 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>aa9466e -
chore: Bump version to 1.0.1 to trigger rebuild
th +1: Claude Sonnet 4.5Trigger HuggingFace Space rebuild to ensure birthday_fortune_service.py is properly deployed 🦊 Generated with Sisi Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>6bccee2 -
feat: 🎂 Add Birthday Fortune API endpoint
th +1: Sisi The Fox- 新增Pythagorean Numerology生日运势服务 - 基于月日计算Life Path Number - 支持EN/CN/TW三语言 - 无需API key,免费公开服务 - Endpoint: /api/birthday-fortune/{month}/{day} 🦊 Generated with Sisi Co-Authored-By: Sisi The Fox <noreply@sisithefox.com>e0eeb4f
-
🔒 Add API Key authentication to prevent abuse
SisiTheFox- Add API_KEY environment variable check - Protect /api/calculate-birth-chart endpoint - Protect /api/generate-chart-svg endpoint - Keep /health endpoint public for monitoring - Return 403 error for unauthorized requests This protects the Astrology API from being abused. 🌟 Created by SisiTheFoxb408cad
-
Fix: Support HEAD method for /health endpoint
th- Add @app.head('/health') decorator to support HEAD requests - Fixes 405 Method Not Allowed error from UptimeRobot monitoring - Some monitoring services use HEAD instead of GET for health checks7143d5d -
Add dedicated /health endpoint for monitoring services
thaf9f0ec -
Fix SVG generation: read from file instead of return value
th +1: Claude🐛 Critical fix: - KerykeionChartSVG.makeSVG() saves to file, doesn't return content - Create temp directory for SVG output - Read generated SVG file content - Return file content in HTTP response ✅ Now SVG generation works correctly! References: - https://github.com/g-battaglia/kerykeion - https://www.kerykeion.net/pydocs/kerykeion.html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>8d02c0c -
Add robust ASCII-safe name conversion + detailed logging
th +1: Claude✨ Features: - Smart name conversion: keeps ASCII names, converts non-ASCII to 'User' - Detailed logging for debugging - Empty SVG validation - Full error traceback logging 🐛 Fixes: - Handles Chinese names (小鱼 → User) - Handles mixed names (TH123 → TH123) - Prevents empty SVG responses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>741463e -
Fix UTF-8 encoding issue in SVG chart generation
th +1: Claude🐛 Fixes: - Handle Chinese/non-ASCII names by converting to ASCII-safe version - Use generic 'Chart' name for non-ASCII characters - Add UTF-8 charset to SVG response headers ✨ Now supports: - Chinese names (小鱼 → Chart) - English names (TH → TH) - Mixed names safely 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>3ec8c5d -
Fix: Use Kerykeion 4.x API for SVG chart generation
th +1: Claude🐛 Fixes: - Use KerykeionChartSVG instead of ChartDrawer (4.x vs 5.x) - Use AstrologicalSubject instead of AstrologicalSubjectFactory - Compatible with kerykeion==4.18.1 installed in requirements.txt ✨ Features: - Professional SVG chart with aspects - POST /api/generate-chart-svg endpoint - Returns SVG directly for frontend embedding 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>b039044 -
Add professional SVG chart generation with Kerykeion 5.x
th +1: Claude✨ New features: - POST /api/generate-chart-svg endpoint - Uses ChartDataFactory + ChartDrawer for professional visualization - Includes aspects (相位线) and proper planet placement - Returns SVG that can be directly embedded in frontend 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>6ef027d -
Fix: Use individual house properties instead of houses_list for Kerykeion 4.18.1 compatibility
th +1: Claude🐛 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>2a0571f -
🦊 Deploy Professional Astrology API
th- FastAPI + Kerykeion (Swiss Ephemeris) - 100% accurate birth chart calculations - Support all planets, houses, aspects - Docker deployment for HF Spaces (port 7860) - Replaces AI-based calculations with real astronomical datab15a3d4