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 README.md #75

Merged
merged 29 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
afd3096
update English README.md ad search.py doc-string
ZiTao-Li Mar 15, 2024
d344568
update model tutorial
ZiTao-Li Mar 15, 2024
5c77879
rename directories of examples
DavdGao Mar 17, 2024
6772c88
finish chinese readme.md
DavdGao Mar 17, 2024
09df544
add ollama related scripts
DavdGao Mar 18, 2024
3226f28
reformat
DavdGao Mar 18, 2024
bb44b72
reformat
DavdGao Mar 18, 2024
be90d6d
modified accordingly
DavdGao Mar 18, 2024
f9a44b8
update sphinx docs
pan-x-c Mar 18, 2024
0e617ad
Merge branch 'update_README' of github.com:ZiTao-Li/agentscope into z…
pan-x-c Mar 18, 2024
28bd79f
Merge branch 'main' into zt/update_readme
pan-x-c Mar 18, 2024
137bb36
improve accordingly
DavdGao Mar 18, 2024
8315608
Merge branch 'update_README_merge' into update_README
DavdGao Mar 18, 2024
697f424
reformat
DavdGao Mar 18, 2024
2b1c9f1
modified accordingly
DavdGao Mar 18, 2024
23e4481
update notebook example
pan-x-c Mar 18, 2024
b1b86af
update notebook example
pan-x-c Mar 18, 2024
34e7364
Merge branch 'modelscope:main' into update_README
ZiTao-Li Mar 18, 2024
6e13296
fix auto-discussion example
pan-x-c Mar 18, 2024
eee06fe
Merge branch 'update_README' of github.com:ZiTao-Li/agentscope into z…
pan-x-c Mar 18, 2024
228d26e
Adjust the order of tutorial
DavdGao Mar 18, 2024
4f69108
Merge branch 'update_README_merge' into update_README
DavdGao Mar 18, 2024
40129f1
update version
pan-x-c Mar 18, 2024
8655ac9
Merge branch 'update_README' of github.com:ZiTao-Li/agentscope into z…
pan-x-c Mar 18, 2024
3a5b136
improvement
DavdGao Mar 18, 2024
ab6d367
Merge branch 'backup' into update_README
DavdGao Mar 18, 2024
fda248d
reformat
DavdGao Mar 18, 2024
e1d7aa3
improve accordingly
DavdGao Mar 18, 2024
52bb077
improve accordingly
DavdGao Mar 18, 2024
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
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. You code
2. How to execute
3. See error
Expand All @@ -23,9 +24,10 @@ A clear and concise description of what you expected to happen.
Detailed error messages.

**Environment (please complete the following information):**
- AgentScope Version: [e.g. 0.0.1 via `print(agentscope.__version__)`]
- Python Version: [e.g. 3.9]
- OS: [e.g. macos, windows]

- AgentScope Version: [e.g. 0.0.2 via `print(agentscope.__version__)`]
- Python Version: [e.g. 3.9]
- OS: [e.g. macos, windows]

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
389 changes: 161 additions & 228 deletions README.md

Large diffs are not rendered by default.

361 changes: 138 additions & 223 deletions README_ZH.md

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pip install sphinx sphinx-autobuild sphinx_rtd_theme myst-parser sphinxcontrib-m
cd sphinx_doc

# step 3: build the sphinx doc
make clean html
make clean all

# step 4: view sphinx_doc/build/html/index.html using your browser
```
Expand All @@ -32,14 +32,14 @@ src

If a new package (`agentscope/new_package`) is added , please add the corresponding documents as follows:

1. use the following script to generate template script (`sphinx_doc/source/agentscope.new_package.rst`) of new packages.
1. use the following script to generate template script (`sphinx_doc/{language}/source/agentscope.new_package.rst`) of new packages.

```shell
cd sphinx_doc
sphinx-apidoc -o source ../../src/agentscope
sphinx-apidoc -o {language}/source ../../src/agentscope
```

2. edit `sphinx_doc/source/agentscope.new_package.rst`, modify the content of the generated template script. For example, modify
2. edit `sphinx_doc/{language}/source/agentscope.new_package.rst`, modify the content of the generated template script. For example, modify

```
agentscope.new\_package package
Expand Down Expand Up @@ -68,7 +68,7 @@ new\_module module
...
```

1. modify the `sphinx_doc/source/index.rst`, add the new package into the table of contents.
3. modify the `sphinx_doc/{language}/source/index.rst`, add the new package into the table of contents.

```
.. toctree::
Expand All @@ -86,8 +86,7 @@ new\_module module
4. rebuild the sphinx doc of AgentScope

```
make clean
make html
make clean all
```

### Add doc for new modules
Expand All @@ -105,7 +104,7 @@ src

If a new module (agentscope/existing_package/new_module.py) is added , please add the corresponding documents as follows:

1. edit `sphinx_doc/source/agentscope.existing_package.rst` and add the following content.
1. edit `sphinx_doc/{language}/source/agentscope.existing_package.rst` and add the following content.

```
new\_module module
Expand All @@ -120,6 +119,5 @@ new\_module module
2. rebuild the sphinx doc of AgentScope

```
make clean
make html
make clean all
```
4 changes: 2 additions & 2 deletions docs/sphinx_doc/en/source/_templates/language_selector.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- language_selector.html -->
<div class="language-selector">
<a href="{{ pathto('../en/index') }}">English</a></li> |
<a href="{{ pathto('../zh_CN/index') }}">中文</a></li>
<a href="{{ pathto('../en/' + pagename) }}">English</a></li> |
<a href="{{ pathto('../zh_CN/' + pagename) }}">中文</a></li>
</div>
41 changes: 16 additions & 25 deletions docs/sphinx_doc/en/source/tutorial/103-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,37 @@ agents).
AgentScope decouples the deployment and invocation of models to better build multi-agent applications.

In terms of model deployment, users can use third-party model services such
as OpenAI API, HuggingFace/ModelScope Inference API, and can also quickly
deploy local open-source model services through the [scripts]
(<https://github.com/modelscope/agentscope/blob/main/scripts/README.md>) in
the repository. Currently, we support building basic model services quickly
using Flask with Transformers (or ModelScope), and also support deploying
local model services through FastChat and vllm inference engines.

While in terms of model invocation, AgentScope provides a `ModelWrapper` class to encapsulate OpenAI API and RESTful Post Request calls.
Currently, the supported OpenAI APIs include Chat, Image generation, and Embedding.
Users can specify the model service by setting different model configs.

| Model Usage | Supported APIs |
| --------------------------- |-----------------------------------------------------------------------------|
| Text generation | Standard *OpenAI* chat API, FastChat and vllm |
| Image generation | *DALL-E* API for generating images |
| Embedding | API for text embeddings |
| General usages in POST | *Huggingface* and *ModelScope* Inference API, and other customized post API |

Each API has its specific configuration requirements. For example, to configure an OpenAI API, you would need to fill out the following fields in the model config in a dict, a yaml file or a json file:
as OpenAI API, Google Gemini API, HuggingFace/ModelScope Inference API, or
quickly deploy local open-source model services through the [scripts](https://github.com/modelscope/agentscope/blob/main/scripts/README.md) in
the repository.

While for model invocation, users should prepare a model configuration to specify the model service. Taking OpenAI Chat API as an example, the model configuration is like this:

```python
model_config = {
"config_name": "{config_name}", # A unique name for the model config.
"model_type": "openai", # Choose from "openai", "openai_dall_e", or "openai_embedding".

"model_name": "{model_name}", # The model identifier used in the OpenAI API, such as "gpt-3.5-turbo", "gpt-4", or "text-embedding-ada-002".
"api_key": "xxx", # Your OpenAI API key. If unset, the environment variable OPENAI_API_KEY is used.
"organization": "xxx", # Your OpenAI organization ID. If unset, the environment variable OPENAI_ORGANIZATION is used.
}
```

For open-source models, we support integration with various model interfaces such as HuggingFace, ModelScope, FastChat, and vllm. You can find scripts on deploying these services in the `scripts` directory, and we defer the detailed instructions to [[Using Different Model Sources with Model API]](#203-model).
More details about model invocation, deployment and open-source models please refer to [Model](203-model-en) section.

You can register your configuration by calling AgentScope's initialization method as follow. Besides, you can also load more than one config by calling init multiple times.
After preparing the model configuration, you can register your configuration by calling the `init` method of AgentScope. Additionally, you can load multiple model configurations at once.

```python
import agentscope

# init once by passing a list of config dict
openai_cfg_dict = {...dict_filling...}
modelscope_cfg_dict = {...dict_filling...}
openai_cfg_dict = {
# ...
}
modelscope_cfg_dict = {
# ...
}
agentscope.init(model_configs=[openai_cfg_dict, modelscope_cfg_dict])
```

Expand All @@ -71,7 +62,7 @@ dialogAgent = DialogAgent(name="assistant", model_config_name="gpt-4", sys_promp
userAgent = UserAgent()
```

**NOTE**: Please refer to [[Customizing Your Custom Agent with Agent Pool]](201-agent) for all available agents.
**NOTE**: Please refer to [Customizing Your Own Agent](201-agent-en) for all available agents.

## Step3: Agent Conversation

Expand Down Expand Up @@ -112,6 +103,6 @@ while x is None or x.content != "exit":
x = sequentialpipeline([dialog_agent, user_agent])
```

For more details about how to utilize pipelines for complex agent interactions, please refer to [[Agent Interactions: Dive deeper into Pipelines and Message Hub]](202-pipeline).
For more details about how to utilize pipelines for complex agent interactions, please refer to [Pipeline and MsgHub](202-pipeline-en).

[[Return to the top]](#103-start-en)
6 changes: 0 additions & 6 deletions docs/sphinx_doc/en/source/tutorial/104-usecase.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,5 @@ Moderator: The day is coming, all the players open your eyes. Last night is peac

Now you've grasped how to conveniently set up a multi-agent application with AgentScope. Feel free to tailor the game to include additional roles and introduce more sophisticated strategies. For more advanced tutorials that delve deeper into more capabilities of AgentScope, such as *memory management* and *service functions* utilized by agents, please refer to the tutorials in the **Advanced Exploration** section and look up the API references.

## Other Example Applications

- Example of Simple Group Conversation: [examples/Simple Conversation](https://github.com/modelscope/agentscope/tree/main/examples/simple_chat/README.md)
- Example of Werewolves: [examples/Werewolves](https://github.com/modelscope/agentscope/tree/main/examples/werewolves/README.md)
- Example of Distributed Agents: [examples/Distributed Agents](https://github.com/modelscope/agentscope/tree/main/examples/distributed_agents/README.md)
- ...

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

# Agent Interactions: Dive deeper into Pipelines and Message Hub
# Pipeline and MsgHub

**Pipeline & MsgHub** (message hub) are one or a sequence of steps describing how the structured `Msg` passes between multi-agents, which streamlines the process of collaboration across agents.

Expand Down
Loading
Loading