Skip to content

atop0914/skypulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌪️ SkyPulse

智能天气机器人 - 基于 AI Agent 的天气查询应用

技术栈

  • 后端: Python + FastAPI + LangChain + 和风天气 API
  • 前端: React + TypeScript + Vite + Zustand
  • 部署: Docker + GitHub Actions

项目结构

skypulse/
├── backend/                    # Python 后端
│   ├── src/
│   │   └── skypulse/        # 主包
│   │       ├── __init__.py   # 包初始化
│   │       ├── main.py       # FastAPI 应用入口
│   │       ├── cli.py        # CLI 终端测试界面
│   │       ├── core/         # 配置和提示词
│   │       │   ├── config.py # 应用配置
│   │       │   └── prompts.py # 提示词模板
│   │       ├── models/       # 数据模型
│   │       │   └── schemas.py # Pydantic 模型
│   │       ├── services/     # API 服务
│   │       │   └── qweather_service.py # 和风天气 API
│   │       ├── agent/        # AI Agent
│   │       │   └── agent.py  # LangChain Agent
│   │       ├── api/         # REST API 路由
│   │       │   └── routes/   # FastAPI 路由
│   │       └── utils/       # 工具函数
│   │           ├── location_cache.py # 城市缓存
│   │           └── helpers.py        # 辅助函数
│   ├── README.md            # 后端详细文档
│   ├── pyproject.toml
│   └── uv.lock
│
└── frontend/                  # React 前端
    └── src/
        ├── components/      # UI 组件
        ├── contexts/        # Context 状态
        ├── store/          # Zustand 状态
        ├── pages/          # 页面
        ├── services/       # API 服务
        ├── types/          # TypeScript 类型
        └── utils/          # 工具函数

快速开始

后端

启动 FastAPI 服务:

cd backend
uv sync
uv run python -m skypulse.main

或使用 CLI 终端测试界面:

uv run python -m skypulse.cli

或命令行工具:

skypulse

前端

cd frontend
npm install
npm run dev

Docker Compose(推荐用于生产部署)

使用 Docker Compose 一键启动前后端服务:

# 复制环境变量配置文件
cp .env.example .env
[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?logo=go)](https://go.dev/)

# 构建并启动所有服务
docker compose up -d --build

# 查看日志
docker compose logs -f

# 停止服务
docker compose down

启动后访问:

文档

About

🌪️ SkyPulse - 智能天气机器人,基于 AI Agent 的天气查询应用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors