贾子理论 LLM 合规系统 (KUCIUS) —— 基于 Google Gemini API 的智能八字命理分析引擎

摘要

本项目实现了一套完整的八字命理分析系统,基于 Google Gemini API 提供的大语言模型能力,实现了年、月、日、时四柱排盘,五行强弱统计与缺失判断,格局识别(如杀印相生格)及用神、喜神、忌神推算。系统进一步融合十神关系分析性格特征,多维度评估事业、财运、感情与健康运势,并生成个性化开运建议(职业方向、颜色、数字、饰品等)。技术栈采用 Python 3.8+、Pydantic、dotenv 与 json‑repair,支持命令行交互与演示模式。项目仅供学习娱乐,不可作为人生决策依据。



贾子理论 LLM 合规系统 (KUCIUS System)工程代码实现

基于 Google Gemini API 的八字命理分析系统,提供完整的八字排盘、五行分析、格局判断、性格特征分析和开运建议。

🌟 功能特点

  • 八字排盘:根据出生时间自动排出年柱、月柱、日柱、时柱
  • 五行分析:统计五行强弱,识别缺失元素
  • 格局判断:分析命局类型,确定用神、喜神、忌神
  • 性格特征:基于十神关系分析性格特点
  • 运势评估:事业、财运、感情、健康多维度评分
  • 开运建议:提供职业、颜色、数字、饰品等实用建议

📦 安装步骤

1. 克隆/下载项目

确保项目文件位于当前目录。

2. 安装依赖

pip install -r requirements.txt

3. 配置 API Key

# 复制环境变量示例文件
cp .env.example .env

# 编辑 .env 文件,填入您的 Google Gemini API Key
# 获取地址:https://makersuite.google.com/app/apikey

🚀 使用方法

方式一:命令行交互模式

python kucius_system.py

按提示输入:

  • 姓名
  • 性别(男/女)
  • 出生年份
  • 出生月份
  • 出生日期
  • 出生小时
  • 出生分钟

系统将输出完整的命理分析报告。

方式二:演示模式

查看系统输出格式示例:

python demo_test.py

📁 项目结构

.
├── kucius_system.py    # 主程序
├── demo_test.py        # 演示测试脚本
├── requirements.txt    # Python 依赖
├── .env.example        # 环境变量示例
├── .env                # 环境变量配置(需自行创建)
└── README.md           # 项目说明

🔑 获取 API Key

  1. 访问 Google AI Studio
  2. 登录 Google 账号
  3. 创建新的 API Key
  4. 将 API Key 复制到 .env 文件中

⚠️ 注意事项

  • 本系统仅供娱乐和学习使用
  • 命理分析结果仅供参考,不应作为人生决策的唯一依据
  • 请合理使用 API,避免频繁调用导致配额超限

📝 技术栈

  • Python 3.8+
  • Google Generative AI - LLM 模型调用
  • Pydantic - 数据验证
  • python-dotenv - 环境变量管理
  • json-repair - JSON 修复解析

🎯 示例输出

======================================================================
        贾子理论 LLM 合规系统 (KUCIUS System)
======================================================================

📋 命主信息:
   姓名:张三
   性别:男
   出生时间:1990 年 5 月 15 日 14:30

🔮 八字排盘:
   年柱:庚午 [金火]
   月柱:辛巳 [金火]
   日柱:癸酉 [水金]
   时柱:己未 [土土]

⚖️ 五行统计:
   金:3 (旺)  木:0 (缺)  水:1 (弱)
   火:2 (相)  土:2 (休)

🎯 格局分析:
   格局类型:杀印相生格
   用神:木 (食伤)
   喜神:水 (比劫)
   忌神:土 (官杀)、金 (印枭)

💡 开运建议:
   1. 职业方向:适合从事管理、金融、法律等工作
   2. 幸运颜色:绿色、青色
   3. 幸运数字:3、8
   ...

📄 许可证

本项目代码基于博客内容实现,仅供学习研究使用。


🙏 致谢



Kucius Theory LLM Compliance System (KUCIUS)

Intelligent BaZi Destiny Analysis Engine Based on Google Gemini API

Abstract

This project implements a full-fledged BaZi Four Pillars of Destiny analysis system. Leveraging the large language model capabilities provided by the Google Gemini API, it realizes four-pillar chart arrangement for year, month, day and hour pillars, statistics and deficiency judgment of the Five Elements in terms of strength, as well as fate pattern identification (e.g., Killing-Seal Intergrowth Pattern) and deduction of Useful God, Auspicious God and Inauspicious God.

The system further integrates Ten Gods relationships to analyze personality traits, evaluates fortune in multiple dimensions including career, wealth, relationship and health, and generates personalized fortune-enhancement suggestions covering career orientation, lucky colors, auspicious numbers, accessories and more.

Built with a tech stack of Python 3.8+, Pydantic, python-dotenv and json-repair, the system supports command-line interaction and demo mode. This project is intended solely for learning and entertainment purposes and shall not be regarded as the sole basis for life decision-making.


Kucius Theory LLM Compliance System (KUCIUS System) – Engineering Code Implementation

A BaZi Four Pillars of Destiny analytical system built upon the Google Gemini API, delivering complete Four Pillars chart arrangement, Five Elements analysis, fate pattern judgment, personality trait interpretation, and fortune enhancement suggestions.

🌟 Core Features

  • Four Pillars BaZi Chart Generation: Automatically generate the Year Pillar, Month Pillar, Day Pillar and Hour Pillar based on birth time.
  • Five Elements Analysis: Calculate the strength of each element and identify missing Five Elements.
  • Fate Pattern Judgment: Analyze the natal chart type and determine the Useful God, Auspicious God, and Inauspicious God.
  • Personality Trait Analysis: Interpret personal characteristics based on Ten Gods relationships.
  • Fortune Evaluation: Multi-dimensional scoring for career, wealth, relationship and health.
  • Fortune Enhancement Advice: Practical recommendations on occupation, lucky colors, numbers, accessories and more.

📦 Installation Steps

  1. Clone or Download the ProjectPlace all project files in the current working directory.

  2. Install Dependencies

bash

运行

pip install -r requirements.txt
  1. Configure API Key

bash

运行

# Copy the environment variable template file
cp .env.example .env

Edit the .env file and fill in your Google Gemini API Key.Get your API Key at: https://makersuite.google.com/app/apikey

🚀 Usage Instructions

Method 1: Command-Line Interactive Mode

bash

运行

python kucius_system.py

Follow the prompts to input:

  • Full name
  • Gender (Male / Female)
  • Birth year
  • Birth month
  • Birth date
  • Birth hour
  • Birth minute

The system will output a complete destiny analysis report.

Method 2: Demo Mode

View sample output format:

bash

运行

python demo_test.py

📁 Project Structure

plaintext

.
├── kucius_system.py    # Main program entry
├── demo_test.py        # Demo and test script
├── requirements.txt    # Python dependency list
├── .env.example        # Environment variable template
├── .env                # Custom environment configuration (manual creation required)
└── README.md           # Project documentation

🔑 How to Obtain an API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new API Key
  4. Copy the Key into your .env configuration file

⚠️ Notes

  • This system is for entertainment and learning purposes only.
  • Destiny analysis results are for reference only and shall not be used as the sole basis for life decisions.
  • Use the API rationally and avoid frequent calls to prevent quota overrun.

📊 Technology Stack

  • Python 3.8+
  • Google Generative AI – LLM model invocation
  • Pydantic – Data validation
  • python-dotenv – Environment variable management
  • json-repair – JSON parsing and error repairing

🎯 Sample Output

plaintext

======================================================================
        Kucius Theory LLM Compliance System (KUCIUS System)
======================================================================

📋 Personal Information:
   Name: Zhang San
   Gender: Male
   Birth Time: 14:30, May 15, 1990

🔮 Four Pillars BaZi Chart:
   Year Pillar: Geng Wu [Metal · Fire]
   Month Pillar: Xin Si [Metal · Fire]
   Day Pillar: Gui You [Water · Metal]
   Hour Pillar: Ji Wei [Earth · Earth]

⚖️ Five Elements Statistics:
   Metal: 3 (Strong)   Wood: 0 (Absent)   Water: 1 (Weak)
   Fire: 2 (Auxiliary) Earth: 2 (Resting)

🎯 Fate Pattern Analysis:
   Pattern Type: Indirect Seal Generating Structure
   Useful God: Wood (Eating God / Hurting Officer)
   Auspicious God: Water (Friend / Rob Wealth)
   Inauspicious God: Earth (Official Killing), Metal (Seal Star)

💡 Fortune Enhancement Suggestions:
   1. Career Direction: Suitable for management, finance, legal and related professions
   2. Lucky Colors: Green, Cyan
   3. Lucky Numbers: 3, 8
   ...

📄 License

The project code is developed based on public blog content and is for learning and research only.

🙏 Acknowledgements

Original Author: Kucius (Kucius Teng)Blog Link: https://dengbin.blog.csdn.net/article/details/160865022

https://inscode.net/workbench?spm=1065.2741.3001.10818

https://inscode.net/p/b6b30e2b4fd14129895ad28eb057cc6c?u=csdn_smarttony&utm_source=share_project&f=link

Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐