Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial for the new version #278

Merged
merged 8 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ https://github.com/DavdGao/AgentScope/assets/102287034/d9acf581-20d2-4294-8d10-9

- **[2024-04-06]** We release **AgentScope** v0.0.3 now!

- **[2024-04-06]** New examples [Gomoku](https://github.com/modelscope/agentscope/blob/main/examples/game_gomoku), [Conversation with ReAct Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_react_agent), [Conversation with RAG Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_RAG_agents) and [Distributed Parallel Search](https://github.com/modelscope/agentscope/blob/main/examples/distributed_search) are available now!
- **[2024-04-06]** New examples [Gomoku](https://github.com/modelscope/agentscope/blob/main/examples/game_gomoku), [Conversation with ReAct Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_react_agent), [Conversation with RAG Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_RAG_agents) and [Distributed Parallel Search](https://github.com/modelscope/agentscope/blob/main/examples/distributed_parallel_optimization) are available now!
pan-x-c marked this conversation as resolved.
Show resolved Hide resolved

- **[2024-03-19]** We release **AgentScope** v0.0.2 now! In this new version,
AgentScope supports [ollama](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)(A local CPU inference engine), [DashScope](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) and Google [Gemini](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) APIs.
Expand Down Expand Up @@ -143,7 +143,7 @@ the following libraries.
- [Conversation in Natural Language to Query SQL](https://github.com/modelscope/agentscope/blob/main/examples/conversation_nl2sql/)
- [Conversation with RAG Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_RAG_agents)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[Conversation with gpt-4o](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_gpt-4o)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[Conversation with Software Engineering Agent](https://github.com/modelscope/agentscope/blob/main/examples/swe_agent/)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[Conversation with Software Engineering Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_swe-agent/)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[Conversation with Customized Services](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_customized_services/)

- Game
Expand All @@ -153,7 +153,7 @@ the following libraries.
- Distribution
- [Distributed Conversation](https://github.com/modelscope/agentscope/blob/main/examples/distributed_basic)
- [Distributed Debate](https://github.com/modelscope/agentscope/blob/main/examples/distributed_debate)
- [Distributed Parallel Search](https://github.com/modelscope/agentscope/blob/main/examples/distributed_search)
- [Distributed Parallel Optimization](https://github.com/modelscope/agentscope/blob/main/examples/distributed_parallel_optimization)
- [Distributed Large Scale Simulation](https://github.com/modelscope/agentscope/blob/main/examples/distributed_simulation)

More models, services and examples are coming soon!
Expand Down Expand Up @@ -192,7 +192,7 @@ pip install -e .\[distribute\]
- Install AgentScope from pip:

```bash
pip install agentscope
pip install agentscope --pre
```

## Quick Start
Expand Down
8 changes: 4 additions & 4 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

- **[2024-04-06]** 我们现在发布了**AgentScope** v0.0.3版本!

- **[2024-04-06]** 新的样例“[五子棋](./examples/game_gomoku)”,“[与ReAct智能体对话](./examples/conversation_with_react_agent)”,“[与RAG智能体对话](./examples/conversation_with_RAG_agents)”,“[分布式并行搜索](./examples/distributed_search)”上线了!
- **[2024-04-06]** 新的样例“[五子棋](./examples/game_gomoku)”,“[与ReAct智能体对话](./examples/conversation_with_react_agent)”,“[与RAG智能体对话](./examples/conversation_with_RAG_agents)”,“[分布式并行搜索](./examples/distributed_parallel_optimization)”上线了!
pan-x-c marked this conversation as resolved.
Show resolved Hide resolved

- **[2024-03-19]** 我们现在发布了**AgentScope** v0.0.2版本!在这个新版本中,AgentScope支持了[ollama](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)(本地CPU推理引擎),[DashScope](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)和[Gemini](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) APIs。

Expand Down Expand Up @@ -125,7 +125,7 @@ AgentScope支持使用以下库快速部署本地模型服务。
- [通过对话查询SQL信息](./examples/conversation_nl2sql/)
- [与RAG智能体对话](./examples/conversation_with_RAG_agents)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[与gpt-4o模型对话](./examples/conversation_with_gpt-4o)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[与SoftWare Engineering智能体对话](./examples/swe_agent/)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[与SoftWare Engineering智能体对话](./examples/conversation_with_swe-agent/)
- <img src="https://img.alicdn.com/imgextra/i3/O1CN01SFL0Gu26nrQBFKXFR_!!6000000007707-2-tps-500-500.png" alt="new" width="30" height="30"/>[与自定义服务对话](./examples/conversation_with_customized_services/)


Expand All @@ -136,7 +136,7 @@ AgentScope支持使用以下库快速部署本地模型服务。
- 分布式
- [分布式对话](./examples/distributed_basic)
- [分布式辩论](./examples/distributed_debate)
- [分布式并行搜索](./examples/distributed_search)
- [分布式并行搜索](./examples/distributed_parallel_optimization)
pan-x-c marked this conversation as resolved.
Show resolved Hide resolved
- [分布式大规模仿真](./examples/distributed_simulation)

更多模型API、服务和示例即将推出!
Expand Down Expand Up @@ -173,7 +173,7 @@ pip install -e .\[distribute\]
- 从pip安装的AgentScope

```bash
pip install agentscope
pip install agentscope --pre
```

## 快速开始
Expand Down
28 changes: 18 additions & 10 deletions docs/sphinx_doc/en/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ AgentScope Documentation
:hidden:
:caption: AgentScope Tutorial

tutorial/quick_start.rst
tutorial/advance.rst
tutorial/101-agentscope.md
tutorial/102-installation.md
tutorial/103-example.md

tutorial/203-model.md
tutorial/206-prompt.md
tutorial/201-agent.md
tutorial/205-memory.md
tutorial/203-parser.md
tutorial/204-service.md
tutorial/202-pipeline.md
tutorial/208-distribute.md
tutorial/209-gui.md
tutorial/105-logging.md
tutorial/207-monitor.md
tutorial/104-usecase.md

tutorial/contribute.rst


Expand All @@ -41,11 +56,4 @@ AgentScope Documentation
agentscope.server
agentscope.web
agentscope.prompt
agentscope.utils

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
agentscope.utils
4 changes: 2 additions & 2 deletions docs/sphinx_doc/en/source/tutorial/102-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ If you prefer to install AgentScope from Pypi, you can do so easily using `pip`:

```bash
# For centralized multi-agent applications
pip install agentscope
pip install agentscope --pre
# For distributed multi-agent applications
pip install agentscope[distribute] # On Mac use `pip install agentscope\[distribute\]`
pip install agentscope[distribute] --pre # On Mac use `pip install agentscope\[distribute\] --pre`
```

### Install from Source
Expand Down
4 changes: 1 addition & 3 deletions docs/sphinx_doc/en/source/tutorial/104-usecase.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
(104-usecase-en)=

# Crafting Your First Application
# Example: Werewolf Game

<img src="https://img.alicdn.com/imgextra/i3/O1CN01dFpOh82643mygUh2Z_!!6000000007607-2-tps-1024-1024.png" alt="img" style="zoom:25%;" />

Before diving into the advanced topics of AgentScope, in this tutorial, we will give you a glance at building a Werewolf application with out-of-the-box components of AgentScope.

**Werewolf** is a well-known social-deduction game, that involves an imaginary village where a few villagers are secretly werewolves, and the objective is to identify who they are before they eliminate all other players. It's a good use case to demonstrate the interaction between multiple autonomous agents, each with its own objectives and the need for communication.

Let the adventure begin to unlock the potential of multi-agent applications with AgentScope!
Expand Down
32 changes: 1 addition & 31 deletions docs/sphinx_doc/en/source/tutorial/105-logging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(105-logging-en)=

# Logging and WebUI
# Logging

Welcome to the tutorial on logging in multi-agent applications with AgentScope. We'll also touch on how you can visualize these logs using a simple web interface. This guide will help you track the agent's interactions and system information in a clearer and more organized way.

Expand Down Expand Up @@ -62,34 +62,4 @@ logger.warning("The agent is running slower than expected.")
logger.error("The agent encountered an unexpected error while processing a request.")
```

## Integrating logging with WebUI

To visualize these logs and running details, AgentScope provides a simple
web interface.

### Quick Running

You can run the WebUI in the following python code:

```python
import agentscope

agentscope.web.init(
path_save="YOUR_SAVE_PATH"
)
```

By this way, you can see all the running instances and projects in `http://127.0.0.1:5000` as follows:

![webui](https://img.alicdn.com/imgextra/i3/O1CN01kpHFkn1HpeYEkn60I_!!6000000000807-0-tps-3104-1849.jpg)

By clicking a running instance, we can observe more details.

![The running details](https://img.alicdn.com/imgextra/i2/O1CN01AZtsf31MIHm4FmjjO_!!6000000001411-0-tps-3104-1849.jpg)

### Note

The WebUI is still under development. We will provide more features and
better user experience in the future.

[[Return to the top]](#105-logging-en)
2 changes: 1 addition & 1 deletion docs/sphinx_doc/en/source/tutorial/201-agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(201-agent-en)=

# Customizing Your Own Agent
# Agent

This tutorial helps you to understand the `Agent` in more depth and navigate through the process of crafting your own custom agent with AgentScope. We start by introducing the fundamental abstraction called `AgentBase`, which serves as the base class to maintain the general behaviors of all agents. Then, we will go through the *AgentPool*, an ensemble of pre-built, specialized agents, each designed with a specific purpose in mind. Finally, we will demonstrate how to customize your own agent, ensuring it fits the needs of your project.

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/en/source/tutorial/203-parser.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(203-parser-en)=

# Model Response Parser
# Response Parser

## Table of Contents

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/en/source/tutorial/204-service.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(204-service-en)=

# Service
# Tool

Service function is a set of multi-functional utility tools that can be
used to enhance the capabilities of agents, such as executing Python code,
Expand Down
Binary file added docs/sphinx_doc/en/source/tutorial/209-gui.md
Binary file not shown.
15 changes: 0 additions & 15 deletions docs/sphinx_doc/en/source/tutorial/advance.rst

This file was deleted.

39 changes: 18 additions & 21 deletions docs/sphinx_doc/en/source/tutorial/main.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Welcome to AgentScope Tutorial Hub
# Welcome to AgentScope Tutorial

AgentScope is an innovative multi-agent platform designed to empower developers to build multi-agent applications with ease, reliability, and high performance. It features three high-level capabilities:

Expand All @@ -10,26 +10,23 @@ AgentScope is an innovative multi-agent platform designed to empower developers

## Tutorial Navigator

### Getting Started

- [About AgentScope](101-agentscope-en)
- [Installation](102-installation-en)
- [Quick Start](103-start-en)
- [Crafting Your First Application](104-usecase-en)
- [Logging and WebUI](105-logging-en)

### Advanced Exploration

- [Customizing Your Own Agent](201-agent-en)
- [Pipeline and MsgHub](202-pipeline-en)
- [Model](203-model-en)
- [Service](204-service-en)
- [Memory](205-memory-en)
- [Prompt Engineering](206-prompt-en)
- [Monitor](207-monitor-en)
- [Distribution](208-distribute-en)
- [About AgentScope](101-agentscope.md)
- [Installation](102-installation.md)
- [Quick Start](103-example.md)
- [Model](203-model.md)
- [Prompt Engineering](206-prompt.md)
- [Agent](201-agent.md)
- [Memory](205-memory.md)
- [Response Parser](203-parser.md)
- [Tool](204-service.md)
- [Pipeline and MsgHub](202-pipeline.md)
- [Distribution](208-distribute.md)
- [AgentScope Studio](209-gui.md)
- [Logging](105-logging.md)
- [Monitor](207-monitor.md)
- [Example: Werewolf Game](104-usecase.md)

### Getting Involved

- [Joining AgentScope Community](301-community-en)
- [Contribute to AgentScope](302-contribute-en)
- [Joining AgentScope Community](301-community.md)
- [Contribute to AgentScope](302-contribute.md)
11 changes: 0 additions & 11 deletions docs/sphinx_doc/en/source/tutorial/quick_start.rst

This file was deleted.

28 changes: 18 additions & 10 deletions docs/sphinx_doc/zh_CN/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ AgentScope 文档
:hidden:
:caption: AgentScope 教程

tutorial/quick_start.rst
tutorial/advance.rst
tutorial/101-agentscope.md
tutorial/102-installation.md
tutorial/103-example.md

tutorial/203-model.md
tutorial/206-prompt.md
tutorial/201-agent.md
tutorial/205-memory.md
tutorial/203-parser.md
tutorial/204-service.md
tutorial/202-pipeline.md
tutorial/208-distribute.md
tutorial/209-gui.md
tutorial/105-logging.md
tutorial/207-monitor.md
tutorial/104-usecase.md

tutorial/contribute.rst


Expand All @@ -41,11 +56,4 @@ AgentScope 文档
agentscope.server
agentscope.web
agentscope.prompt
agentscope.utils

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
agentscope.utils
4 changes: 2 additions & 2 deletions docs/sphinx_doc/zh_CN/source/tutorial/102-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ pip install -e .[distribute] # 在Mac上使用`pip install -e .\[distribute\]`

```bash
# 针对本地化的multi-agent应用
pip install agentscope
pip install agentscope --pre

# 为分布式multi-agent应用
pip install agentscope[distribute] # 在Mac上使用`pip install agentscope\[distribute\]`
pip install agentscope[distribute] --pre # 在Mac上使用`pip install agentscope\[distribute\] --pre`
```

[[返回顶端]](#102-installation-zh)
9 changes: 4 additions & 5 deletions docs/sphinx_doc/zh_CN/source/tutorial/104-usecase.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
(104-usecase-zh)=

# 创造您的第一个应用
# 样例:狼人杀游戏

<img src="https://img.alicdn.com/imgextra/i3/O1CN01dFpOh82643mygUh2Z_!!6000000007607-2-tps-1024-1024.png" alt="img" style="zoom:25%;" />

在介绍更多AgentScope的高阶内容前,我们先会给您展示如何利用AgentScope内置的功能,快速搭建一个狼人杀游戏模拟应用。
**狼人杀**是非常具有代表性的,具有复杂SOP流程的游戏。游戏中,玩家分别扮演狼人和村民的角色进行对抗,其中一些村民(例如预言家和女巫)还有特殊的技能。当狼人被全部杀死后村民取得胜利;而当狼人的数量等于村民的数量时即狼人获得胜利。
我们将利用 AgentScope 构建一个狼人杀游戏,用 Agent 来扮演不同的角色进行互动,并推动游戏的进行。

**狼人杀**是一个广为人知的桌面游戏。游戏设定在一个虚拟世界的村庄里。村庄里有真正的村民、也有伪装成村民的狼人;每个参与者都在游戏中都有自己的角色。对于村民方而言,他们的胜利条件是在全灭之前找出并杀死所有的狼人;对于狼人方而言,胜利条件就是杀死所有的村民。狼人杀这样的游戏是一个很好的可以自动展示多个有不同目标的智能体之间如何互动。

话不多说,让我们开始通过狼人杀这个游戏,解锁AgentScope多智体的应用吧!
完整的样例代码可以在GitHub仓库的[examples/game_werewolf](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf)找到,这里我们将介绍构建狼人杀游戏中的几个关键步骤。

## 开始

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial/105-logging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(105-logging-zh)=

# 日志和WebUI
# 日志

本节教程主要是关于AgentScope的日志记录(logging)功能。我们会介绍如何能美观地将这些日志可视化。这个模块会帮助您更方便、清晰、有组织地跟踪智能体之间的互动和各种系统消息。

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial/201-agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(201-agent-zh)=

# 定制你自己的Agent
# Agent

本教程帮助你更深入地理解Agent,并引导你通过使用AgentScope定制自己的自定义agent。
我们首先介绍一个称为AgentBase的基本抽象概念,它作为基类维护所有agent的通用行为。然后,我们将探讨AgentPool,这是一个由预构建的、专门化的agent组成的集合,每个agent都设计有特定的目的。最后,我们将演示如何定制你自己的agent,确保它符合你项目的需求。
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial/202-pipeline.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(202-pipeline-zh)=

# Pipeline 和 MsgHub
# Pipeline和MsgHub

**Pipeline**和**Message Hub**主要用于描绘应用中信息的交换和传播过程,它们极大简化了Multi-Agent应用流程的编排工作。
在本教程中,我们将详细的介绍Pipeline和Message Hub的原理和使用方式。
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial/203-parser.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(203-parser-zh)=

# 模型结果解析
# 结果解析

## 目录

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial/204-service.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(204-service-zh)=

# 服务函数
# 工具

服务函数(Service function)是可以增强智能体能力工具,例如执行Python代码、网络搜索、
文件操作等。本教程概述了AgentScope中可用的服务功能,同时介绍如何使用它们来增强智能体的能力。
Expand Down
Loading