Skip to content

Commit

Permalink
modify set.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Sep 6, 2024
1 parent b76b7c1 commit 196477a
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 137 deletions.
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,38 @@ cd agentscope
pip install -e .
```

- To build distributed multi-agent applications:
### Using pip

- Install AgentScope from pip:

```bash
# On windows
pip install -e .[distribute]
# On mac
pip install -e .\[distribute\]
pip install agentscope
```

### Using pip
### Extra Dependencies

- Install AgentScope from pip:
To support different deployment scenarios, AgentScope provides several
optional dependencies. Full list of optional dependencies refers to
[tutorial](https://doc.agentscope.io/en/tutorial/102-installation.html)

#### On Windows

```bash
# From source
pip install -e .[distribute] # For windows
# From pypi
pip install agentscope[distribute]
```

#### On Mac
```bash
pip install agentscope --pre
# From source
pip install -e .\[distribute\]
# From pypi
pip install agentscope\[distribute\]
```


## Quick Start

### Configuration
Expand Down
16 changes: 6 additions & 10 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,19 @@ cd agentscope
pip install -e .
```

- 构建分布式多智能体应用需要按照以下方式安装:

```bash
# 在windows上
pip install -e .[distribute]
# 在mac上
pip install -e .\[distribute\]
```

### 使用pip

- 从pip安装的AgentScope

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

### 额外依赖

为了支持不同的部署场景,AgentScope提供了若干个可选的依赖项。
完整的可选依赖项列表请参考[tutorial](https://doc.agentscope.io/en/tutorial/102-installation.html)

## 快速开始

### 配置
Expand Down
33 changes: 27 additions & 6 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,7 @@ If you prefer to install AgentScope from Pypi, you can do so easily using `pip`:

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

### Install from Source
Expand All @@ -59,10 +57,33 @@ cd agentscope

# For centralized multi-agent applications
pip install -e .
# For distributed multi-agent applications
pip install -e .[distribute] # On Mac use `pip install -e .\[distribute\]`
```

**Note**: The `[distribute]` option installs additional dependencies required for distributed applications. Remember to activate your virtual environment before running these commands.
### Extra Dependencies

The supported optional dependencies for AgentScope are list as follows:

- ollama: Ollama API
- litellm: Litellm API
- zhipuai: Zhipuai API
- gemini: Gemini API
- service: The dependencies for different service functions
- distribute: The dependencies for distribution mode
- full: All the dependencies

You can install one or more of these dependencies by adding them to the installation command.

#### Windows
```bash
pip install agentscope[gemini]
# or
pip install agentscope[ollama,distribute]
```
#### Mac & Linux
```bash
pip install agentscope\[gemini\]
# or
pip install agentscope\[ollama,distribute\]
```

[[Return to the top]](#102-installation-en)
37 changes: 30 additions & 7 deletions docs/sphinx_doc/zh_CN/source/tutorial/102-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,45 @@ cd agentscope

# 针对本地化的multi-agent应用
pip install -e .
# 为分布式multi-agent应用
pip install -e .[distribute] # 在Mac上使用`pip install -e .\[distribute\]`
```

**注意**`[distribute]`选项安装了分布式应用程序所需的额外依赖项。在运行这些命令之前,请激活您的虚拟环境。

### 使用Pip安装

如果您选择从Pypi安装AgentScope,可以使用`pip`轻松地完成:

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

### 额外依赖

AgentScope 支持可选依赖如下,用户可以根据自己的需求选择安装:

- ollama: Ollama API
- litellm: Litellm API
- zhipuai: Zhipuai API
- gemini: Gemini API
- service: 不同工具函数的依赖
- distribute: 分布式模式的依赖
- full: 一次性安装上述所有的依赖,可能耗时较长

可以通过将它们添加到安装命令中来安装这些依赖。

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

```bash
pip install agentscope[gemini]
# or
pip install agentscope[ollama,distribute]
```

#### Mac & Linux

```bash
pip install agentscope\[gemini\]
# or
pip install agentscope\[ollama,distribute\]
```

[[返回顶端]](#102-installation-zh)
149 changes: 77 additions & 72 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,6 @@
NAME = "agentscope"
URL = "https://github.com/modelscope/agentscope"

rpc_requires = [
"grpcio==1.60.0",
"grpcio-tools==1.60.0",
"protobuf==4.25.0",
"expiringdict",
"dill",
"psutil",
]

service_requires = [
"docker",
"pymongo",
"pymysql",
"bs4",
"beautifulsoup4",
"feedparser",
]

doc_requires = [
"sphinx",
"sphinx-autobuild",
"sphinx_rtd_theme",
"myst-parser",
"sphinxcontrib-mermaid",
]

test_requires = ["pytest", "pytest-cov", "pre-commit"]

gradio_requires = [
"gradio==4.19.1",
"modelscope_studio==0.0.5",
]

rag_requires = [
"llama-index==0.10.30",
]

studio_requires = []

web_requires = [
"playwright",
"markdownify",
]

# released requires
minimal_requires = [
"networkx",
Expand All @@ -71,47 +27,85 @@
"tiktoken",
"Pillow",
"requests",
"chardet",
"inputimeout",
"openai>=1.3.0",
"numpy",
"Flask==3.0.0",
"Flask-Cors==4.0.0",
"Flask-SocketIO==5.3.6",
"flask_sqlalchemy",
"flake8",
# TODO: move into other requires
"dashscope==1.14.1",
"psutil",
"scipy",
# Leaving openai and dashscope here as default supports
"openai>=1.3.0",
"ollama>=0.1.7",
"google-generativeai>=0.4.0",
"zhipuai",
"litellm",
"dashscope==1.14.1",
]

extra_service_requires = [
"docker",
"pymongo",
"pymysql",
"bs4",
"beautifulsoup4",
"feedparser",
"notebook",
"nbclient",
"nbformat",
"psutil",
"scipy",
"pillow",
"playwright",
"markdownify",
]

extra_distribute_requires = [
"grpcio==1.60.0",
"grpcio-tools==1.60.0",
"protobuf==4.25.0",
"expiringdict",
"dill",
]

extra_dev_requires = [
# unit test
"pytest",
"pytest-cov",
"pre-commit"
# doc
"sphinx",
"sphinx-autobuild",
"sphinx_rtd_theme",
"myst-parser",
"sphinxcontrib-mermaid",
]

distribute_requires = minimal_requires + rpc_requires
extra_gradio_requires = [
"gradio==4.19.1",
"modelscope_studio==0.0.5",
]

dev_requires = minimal_requires + test_requires
extra_rag_requires = [
"llama-index==0.10.30",
]

full_requires = (
minimal_requires
+ rpc_requires
+ service_requires
+ doc_requires
+ test_requires
+ gradio_requires
+ rag_requires
+ studio_requires
+ web_requires
# API requires
extra_gemini_requires = ["google-generativeai>=0.4.0"]
extra_litellm_requires = ["litellm"]
extra_zhipuai_requires = ["zhipuai"]
extra_ollama_requires = ["ollama>=0.1.7"]

# Full requires
extra_full_requires = (
extra_distribute_requires
+ extra_service_requires
+ extra_dev_requires
+ extra_gradio_requires
+ extra_rag_requires
+ extra_gemini_requires
+ extra_litellm_requires
+ extra_zhipuai_requires
+ extra_ollama_requires
)

online_requires = full_requires + [
# For online workstation
extra_online_requires = extra_full_requires + [
"oss2",
"flask_babel",
"babel==2.15.0",
Expand Down Expand Up @@ -141,10 +135,21 @@
},
install_requires=minimal_requires,
extras_require={
"distribute": distribute_requires,
"dev": dev_requires,
"full": full_requires,
"online": online_requires,
# For specific LLM API
"ollama": extra_ollama_requires,
"litellm": extra_litellm_requires,
"zhipuai": extra_zhipuai_requires,
"gemini": extra_gemini_requires,
# For service functions
"service": extra_service_requires,
# For distribution mode
"distribute": extra_distribute_requires,
# With unit test requires
"dev": extra_dev_requires,
# With full requires
"full": extra_full_requires,
# With online workstation requires
"online": extra_online_requires,
},
license="Apache License 2.0",
classifiers=[
Expand Down
Loading

0 comments on commit 196477a

Please sign in to comment.