Skip to content

Commit

Permalink
Merge branch 'main' into dev/as_copilot
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiTao-Li committed Apr 28, 2024
2 parents a55eaf0 + f2c51cc commit df7a79e
Show file tree
Hide file tree
Showing 123 changed files with 5,487 additions and 2,307 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ avoid-escape = no
ignore =
F401
F403
W503
W503
E731
4 changes: 2 additions & 2 deletions .github/workflows/sphinx_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
name: Build Documentation
run: |
cd docs/sphinx_doc
make clean all
./build_sphinx_doc.sh
- name: Upload Documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SphinxDoc
path: 'docs/sphinx_doc/build'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.9']
env:
OS: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ repos:
pb2\.py$
| grpc\.py$
| ^docs
| \.html$
)
args: [ --disallow-untyped-defs,
--disallow-incomplete-defs,
Expand Down Expand Up @@ -66,6 +67,7 @@ repos:
| grpc\.py$
| \.demo$
| \.md$
| \.html$
)
args: [
--disable=W0511,
Expand All @@ -91,6 +93,8 @@ repos:
--disable=W0221,
--disable=R0401,
--disable=W0632,
--disable=W0123,
--disable=C3001,
]
- repo: https://github.com/regebro/pyroma
rev: "4.0"
Expand Down
43 changes: 25 additions & 18 deletions README.md

Large diffs are not rendered by default.

43 changes: 25 additions & 18 deletions README_ZH.md

Large diffs are not rendered by default.

107 changes: 1 addition & 106 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,112 +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 all
./build_sphinx_doc.sh

# step 4: view sphinx_doc/build/html/index.html using your browser
```

## Update Documentation (for developer)

### Add doc for new packages

```
src
└── agentscope
├── ...
└── new_package
├── __init__.py
└── new_module.py
```

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/{language}/source/agentscope.new_package.rst`) of new packages.

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

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
===============================
Submodules
----------
agentscope.new\_package.new\_module module
-------------------------------------------
...
Module contents
---------------
...
```

to

```
NewPackage package
==================
new\_module module
------------------
...
```

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

```
.. toctree::
:maxdepth: 2
:hidden:
:glob:
:caption: AgentScope API Reference
agentscope.agents
...
agentscope.new_package
agentscope
```

4. rebuild the sphinx doc of AgentScope

```
make clean all
```

### Add doc for new modules

```
src
└── agentscope
├── ...
└── existing_package
├── __init__.py
├── existing_module.py
├── ...
└── new_module.py
```

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

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

```
new\_module module
------------------
.. automodule:: agentscope.existing_package.new_module
:members:
:undoc-members:
:show-inheritance:
```

2. rebuild the sphinx doc of AgentScope

```
make clean all
```
4 changes: 4 additions & 0 deletions docs/sphinx_doc/build_sphinx_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
sphinx-apidoc -f -o en/source ../../src/agentscope -t template -e
sphinx-apidoc -f -o zh_CN/source ../../src/agentscope -t template -e
make clean all
68 changes: 0 additions & 68 deletions docs/sphinx_doc/en/source/agentscope.agents.rst

This file was deleted.

20 changes: 0 additions & 20 deletions docs/sphinx_doc/en/source/agentscope.memory.rst

This file was deleted.

66 changes: 0 additions & 66 deletions docs/sphinx_doc/en/source/agentscope.models.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/sphinx_doc/en/source/agentscope.pipelines.rst

This file was deleted.

20 changes: 0 additions & 20 deletions docs/sphinx_doc/en/source/agentscope.rpc.rst

This file was deleted.

Loading

0 comments on commit df7a79e

Please sign in to comment.