Spaces:
Running
Running
Download test_check_nested.py from sisithefox/astrology-ziwei-api: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/sisithefox/astrology-ziwei-api/resolve/main/test_check_nested.py
- Command line
-
hf download hf://spaces/sisithefox/astrology-ziwei-api/test_check_nested.py
-
curl -L -o test_check_nested.py https://huggingface.co/spaces/sisithefox/astrology-ziwei-api/resolve/main/test_check_nested.py
1.11 kB
| import requests | |
| import json | |
| response = requests.post( | |
| "https://sisithefox-astrology-ziwei-api.hf.space/analyze-ziwei-knowledge-enhanced", | |
| json={ | |
| "birth_date": "2000-01-01", | |
| "birth_time": "14:30", | |
| "gender": "男" | |
| }, | |
| timeout=30 | |
| ) | |
| data = response.json() | |
| result = data.get('data', {}) | |
| print("=== Top-level keys ===") | |
| for key in sorted(result.keys()): | |
| print(f" {key}") | |
| print("\n=== knowledge_interpretation type ===") | |
| ki = result.get('knowledge_interpretation') | |
| print(f"Type: {type(ki)}") | |
| if isinstance(ki, dict): | |
| print("\n=== knowledge_interpretation keys ===") | |
| for key in sorted(ki.keys()): | |
| print(f" {key}") | |
| print("\n🎭 Pattern Recognition in knowledge_interpretation?", 'pattern_recognition' in ki) | |
| if 'pattern_recognition' in ki: | |
| pr = ki['pattern_recognition'] | |
| print(f"\n✅ Found pattern_recognition!") | |
| print(f" Matched patterns: {pr.get('pattern_count', 0)}") | |
| print(f" Highest score: {pr.get('highest_score', 0)}") | |
| print(f" Overall quality: {pr.get('overall_quality', 'N/A')}") | |