Skip to content

Repository files navigation

Story Book Multi-Agent Application

使用 Google ADK 建立的互動式故事書創作系統,整合 MCP 和 A2A 協議。

功能特色

  • 多代理協作: StoryMaster 協調 StoryWriter、StoryEditor、StoryIllustrator 完成故事創作
  • MCP 整合: 透過 Model Context Protocol 管理故事檔案
  • A2A 支援: 可透過 Agent-to-Agent 協議與其他系統互通
  • Gemini API: 使用 Google Gemini 2.0 Flash 模型

快速開始

1. 設置環境

# 建立虛擬環境
python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# .venv\Scripts\activate  # Windows

# 安裝依賴
pip install -r requirements.txt

2. 配置 API Key

編輯 .env 檔案,填入您的 Gemini API Key:

GOOGLE_API_KEY=your-actual-api-key

3. 啟動 Web UI

adk web story_book

然後在瀏覽器開啟 http://localhost:8000

專案結構

Agent-Story/
├── story_book/              # 主要代理套件
│   ├── agent.py            # StoryMaster 主控代理
│   ├── story_writer/       # 故事創作代理
│   ├── story_editor/       # 編輯潤色代理
│   ├── story_illustrator/  # 插圖描述代理
│   └── tools/              # 自定義工具
├── stories/                # 故事儲存目錄
├── .env                    # 環境變數
└── requirements.txt        # Python 依賴

使用範例

在 ADK Web UI 中,您可以輸入:

  • 「幫我創作一個關於勇敢小貓咪的童話故事」
  • 「創作一個太空冒險的科幻故事,適合 10 歲小朋友」
  • 「列出所有已儲存的故事」

授權

MIT License

About

use adk build a simple story gen framework

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages