From aaf60ad4cddf885ce5d3123a0762b288a105882a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E8=BD=A9?= Date: Wed, 17 Jul 2024 17:00:38 +0800 Subject: [PATCH 1/2] update sphinx generator --- .gitignore | 8 +- LICENSE | 14 +-- docs/README.md | 4 +- docs/sphinx_doc/Makefile | 32 +++++++ docs/sphinx_doc/assets/redirect.html | 12 +++ docs/sphinx_doc/build_sphinx_doc.sh | 9 ++ docs/sphinx_doc/en/source/_static/custom.css | 4 + .../source/_templates/language_selector.html | 5 + .../en/source/_templates/layout.html | 3 + docs/sphinx_doc/en/source/conf.py | 93 +++++++++++++++++++ docs/sphinx_doc/en/source/index.rst | 26 ++++++ docs/sphinx_doc/en/source/modules.rst | 7 ++ .../en/source/tutorial/contribute.rst | 8 ++ docs/sphinx_doc/en/source/tutorial/main.md | 34 +++++++ docs/sphinx_doc/requirements.txt | 11 +++ docs/sphinx_doc/template/module.rst_t | 5 + docs/sphinx_doc/template/package.rst_t | 10 ++ .../zh_CN/source/_static/custom.css | 4 + .../source/_templates/language_selector.html | 5 + .../zh_CN/source/_templates/layout.html | 3 + docs/sphinx_doc/zh_CN/source/conf.py | 93 +++++++++++++++++++ docs/sphinx_doc/zh_CN/source/index.rst | 26 ++++++ docs/sphinx_doc/zh_CN/source/modules.rst | 7 ++ .../zh_CN/source/tutorial/contribute.rst | 8 ++ docs/sphinx_doc/zh_CN/source/tutorial/main.md | 34 +++++++ memory_scope/chat/__init__.py | 1 + memory_scope/utils/__init__.py | 14 +++ 27 files changed, 468 insertions(+), 12 deletions(-) create mode 100644 docs/sphinx_doc/Makefile create mode 100644 docs/sphinx_doc/assets/redirect.html create mode 100755 docs/sphinx_doc/build_sphinx_doc.sh create mode 100644 docs/sphinx_doc/en/source/_static/custom.css create mode 100644 docs/sphinx_doc/en/source/_templates/language_selector.html create mode 100644 docs/sphinx_doc/en/source/_templates/layout.html create mode 100644 docs/sphinx_doc/en/source/conf.py create mode 100644 docs/sphinx_doc/en/source/index.rst create mode 100644 docs/sphinx_doc/en/source/modules.rst create mode 100644 docs/sphinx_doc/en/source/tutorial/contribute.rst create mode 100644 docs/sphinx_doc/en/source/tutorial/main.md create mode 100644 docs/sphinx_doc/requirements.txt create mode 100644 docs/sphinx_doc/template/module.rst_t create mode 100644 docs/sphinx_doc/template/package.rst_t create mode 100644 docs/sphinx_doc/zh_CN/source/_static/custom.css create mode 100644 docs/sphinx_doc/zh_CN/source/_templates/language_selector.html create mode 100644 docs/sphinx_doc/zh_CN/source/_templates/layout.html create mode 100644 docs/sphinx_doc/zh_CN/source/conf.py create mode 100644 docs/sphinx_doc/zh_CN/source/index.rst create mode 100644 docs/sphinx_doc/zh_CN/source/modules.rst create mode 100644 docs/sphinx_doc/zh_CN/source/tutorial/contribute.rst create mode 100644 docs/sphinx_doc/zh_CN/source/tutorial/main.md diff --git a/.gitignore b/.gitignore index 41cce170..cbb24eb3 100644 --- a/.gitignore +++ b/.gitignore @@ -141,6 +141,10 @@ docs/sphinx_doc/build/ # Used to save loggings and files *runs/ -agentscope.db +memoryscope.db tmp*.json -cradle* \ No newline at end of file +cradle* + +# sphinx docs + +memory_scope*.rst \ No newline at end of file diff --git a/LICENSE b/LICENSE index 2f2f2f25..7609ced3 100644 --- a/LICENSE +++ b/LICENSE @@ -213,7 +213,7 @@ also licensed under the terms of the Apache 2.0. -------------------------------------------------------------------------------- -Code in src/agentscope/web/static/js/socket.io.js is adapted from +Code in src/memoryscope/web/static/js/socket.io.js is adapted from https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.3/socket.io.js (MIT License) Copyright (c) 2014-2021 Guillermo Rauch @@ -238,7 +238,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -Code in src/agentscope/web/static/js/jquery-3.3.1.min.js is adapted from +Code in src/memoryscope/web/static/js/jquery-3.3.1.min.js is adapted from https://code.jquery.com/jquery-3.3.1.min.js (MIT License) Copyright (c) JS Foundation and other contributors @@ -263,7 +263,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -Code in src/agentscope/web/static/js/bootstrap.bundle.min.js is adapted from +Code in src/memoryscope/web/static/js/bootstrap.bundle.min.js is adapted from https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.bundle.min.js (MIT License) @@ -290,7 +290,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -Code in src/agentscope/web/static/js/bootstrap-table.min.js is adapted from +Code in src/memoryscope/web/static/js/bootstrap-table.min.js is adapted from https://unpkg.com/bootstrap-table@1.18.0/dist/bootstrap-table.min.js (MIT License) @@ -316,7 +316,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -Code in src/agentscope/web/static/css/bootstrap.min.css is adapted from +Code in src/memoryscope/web/static/css/bootstrap.min.css is adapted from https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css (MIT License) @@ -344,7 +344,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -Fonts in src/agentscope/web/static/fonts/KRYPTON.ttf is adapted from +Fonts in src/memoryscope/web/static/fonts/KRYPTON.ttf is adapted from https://github.com/githubnext/monaspace (SIL Open Font License 1.1). These fonts are distributed with their original license. See https://github .com/githubnext/monaspace/blob/main/LICENSE for the full text of the license. @@ -369,7 +369,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- -Fonts in src/agentscope/web/static/fonts/OSWALD.ttf is adapted from +Fonts in src/memoryscope/web/static/fonts/OSWALD.ttf is adapted from https://fonts.google.com/specimen/Oswald (SIL Open Font License 1.1). These fonts are distributed with their original license. See https://github .com/googlefonts/OswaldFont/blob/main/OFL.txt for the full text of the license. diff --git a/docs/README.md b/docs/README.md index 77f713f4..d20e0cf3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,8 +4,6 @@ Please use the following commands to build sphinx doc of MemoryScope. -参考:https://github.com/modelscope/agentscope/blob/main/docs/README.md - ```shell # step 1: Install dependencies pip install sphinx sphinx-autobuild sphinx_rtd_theme myst-parser sphinxcontrib-mermaid @@ -17,4 +15,4 @@ cd sphinx_doc ./build_sphinx_doc.sh # step 4: view sphinx_doc/build/html/index.html using your browser -``` \ No newline at end of file +``` diff --git a/docs/sphinx_doc/Makefile b/docs/sphinx_doc/Makefile new file mode 100644 index 00000000..bc8097ab --- /dev/null +++ b/docs/sphinx_doc/Makefile @@ -0,0 +1,32 @@ +# Makefile + +SPHINXBUILD = sphinx-build +SPHINXPROJ = MemoryScope-Doc +ASSETSDIR = assets +BUILDDIR = build/html +SOURCEDIR_EN = en/source +BUILDDIR_EN = build/html/en +SOURCEDIR_ZH = zh_CN/source +BUILDDIR_ZH = build/html/zh_CN + +# English document +en: + @$(SPHINXBUILD) -b html "$(SOURCEDIR_EN)" "$(BUILDDIR_EN)" + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR_EN)" + +# Chinese document +zh_CN: + @$(SPHINXBUILD) -b html "$(SOURCEDIR_ZH)" "$(BUILDDIR_ZH)" + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR_ZH)" + +index: + @cp "$(ASSETSDIR)/redirect.html" "$(BUILDDIR)/index.html" + +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR_EN)" "$(BUILDDIR_EN)" $(O) + +all: en zh_CN index + +.PHONY: all en zh_CN index \ No newline at end of file diff --git a/docs/sphinx_doc/assets/redirect.html b/docs/sphinx_doc/assets/redirect.html new file mode 100644 index 00000000..81065c59 --- /dev/null +++ b/docs/sphinx_doc/assets/redirect.html @@ -0,0 +1,12 @@ + + + + + + MemoryScope Documentation + + +

Redirecting to English documentation...

+

If you are not redirected, click here.

+ + diff --git a/docs/sphinx_doc/build_sphinx_doc.sh b/docs/sphinx_doc/build_sphinx_doc.sh new file mode 100755 index 00000000..de8754c2 --- /dev/null +++ b/docs/sphinx_doc/build_sphinx_doc.sh @@ -0,0 +1,9 @@ +#!/bin/bash +rm -rf build/html/* +rm en/source/agentscope*.rst +rm zh_CN/source/agentscope*.rst +rm en/source/memory_scope*.rst +rm zh_CN/source/memory_scope*.rst +sphinx-apidoc -f -o en/source ../../memory_scope -t template -e +sphinx-apidoc -f -o zh_CN/source ../../memory_scope -t template -e +make clean all \ No newline at end of file diff --git a/docs/sphinx_doc/en/source/_static/custom.css b/docs/sphinx_doc/en/source/_static/custom.css new file mode 100644 index 00000000..68f11cee --- /dev/null +++ b/docs/sphinx_doc/en/source/_static/custom.css @@ -0,0 +1,4 @@ +.language-selector a { + color: white; + width: 20px; +} \ No newline at end of file diff --git a/docs/sphinx_doc/en/source/_templates/language_selector.html b/docs/sphinx_doc/en/source/_templates/language_selector.html new file mode 100644 index 00000000..a8aca93e --- /dev/null +++ b/docs/sphinx_doc/en/source/_templates/language_selector.html @@ -0,0 +1,5 @@ + +
+ English | + 中文 +
diff --git a/docs/sphinx_doc/en/source/_templates/layout.html b/docs/sphinx_doc/en/source/_templates/layout.html new file mode 100644 index 00000000..1d182d30 --- /dev/null +++ b/docs/sphinx_doc/en/source/_templates/layout.html @@ -0,0 +1,3 @@ + +{% extends "!layout.html" %} {% block sidebartitle %} {{ super() }} {% include +"language_selector.html" %} {% endblock %} diff --git a/docs/sphinx_doc/en/source/conf.py b/docs/sphinx_doc/en/source/conf.py new file mode 100644 index 00000000..e36bb088 --- /dev/null +++ b/docs/sphinx_doc/en/source/conf.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +sys.path.insert(0, os.path.abspath("/home/hmp/memoryscope")) + + +# -- Project information ----------------------------------------------------- + +language = "en" + +project = "MemoryScope" +copyright = "2024, Alibaba Tongyi Lab" +author = "EcoML team of Alibaba Tongyi Lab" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinxcontrib.mermaid", + "myst_parser", + "sphinx.ext.autosectionlabel", +] + +# Prefix document path to section labels, otherwise autogenerated labels would +# look like 'heading' rather than 'path/to/file:heading' +autosectionlabel_prefix_document = True +autosummary_generate = True +autosummary_ignore_module_all = False + +autodoc_member_order = "bysource" + +autodoc_default_options = { + "members": True, + "special-members": "__init__", +} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +autodoc_default_options = { + "members": True, + "special-members": "__init__", +} + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +html_theme_options = { + "navigation_depth": 2, +} + +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} + +html_css_files = [ + "custom.css", +] diff --git a/docs/sphinx_doc/en/source/index.rst b/docs/sphinx_doc/en/source/index.rst new file mode 100644 index 00000000..b05070d1 --- /dev/null +++ b/docs/sphinx_doc/en/source/index.rst @@ -0,0 +1,26 @@ +.. MemoryScope documentation master file, created by + sphinx-quickstart on Fri Jan 5 17:53:54 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +:github_url: https://github.com/modelscope/memoryscope + +MemoryScope Documentation +====================================== + + + +.. toctree:: + :maxdepth: 1 + :glob: + :caption: MemoryScope API Reference + + memory_scope + memory_scope.chat + memory_scope.constants + memory_scope.enumeration + memory_scope.memory + memory_scope.models + memory_scope.scheme + memory_scope.storage + memory_scope.utils \ No newline at end of file diff --git a/docs/sphinx_doc/en/source/modules.rst b/docs/sphinx_doc/en/source/modules.rst new file mode 100644 index 00000000..b90b32ff --- /dev/null +++ b/docs/sphinx_doc/en/source/modules.rst @@ -0,0 +1,7 @@ +memory_scope +============ + +.. toctree:: + :maxdepth: 4 + + memory_scope diff --git a/docs/sphinx_doc/en/source/tutorial/contribute.rst b/docs/sphinx_doc/en/source/tutorial/contribute.rst new file mode 100644 index 00000000..20a9bdfa --- /dev/null +++ b/docs/sphinx_doc/en/source/tutorial/contribute.rst @@ -0,0 +1,8 @@ +Get Involved +=============== + +.. toctree:: + :maxdepth: 2 + + 301-community.md + 302-contribute.md \ No newline at end of file diff --git a/docs/sphinx_doc/en/source/tutorial/main.md b/docs/sphinx_doc/en/source/tutorial/main.md new file mode 100644 index 00000000..fa12f01c --- /dev/null +++ b/docs/sphinx_doc/en/source/tutorial/main.md @@ -0,0 +1,34 @@ +# Welcome to MemoryScope Tutorial + +MemoryScope 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: + +- **Easy-to-Use**: Programming in pure Python with various prebuilt components for immediate use, suitable for developers or users with different levels of customization requirements. + +- **High Robustness**: Supporting customized fault-tolerance controls and retry mechanisms to enhance application stability. + +- **Actor-Based Distribution**: Enabling developers to build distributed multi-agent applications in a centralized programming manner for streamlined development. + +## Tutorial Navigator + +- [About MemoryScope](101-memoryscope.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) +- [System Prompt Optimization](209-prompt_opt.md) +- [Tool](204-service.md) +- [Pipeline and MsgHub](202-pipeline.md) +- [Distribution](208-distribute.md) +- [MemoryScope Studio](209-gui.md) +- [Retrieval Augmented Generation (RAG)](210-rag.md) +- [Logging](105-logging.md) +- [Monitor](207-monitor.md) +- [Example: Werewolf Game](104-usecase.md) + +### Getting Involved + +- [Joining MemoryScope Community](301-community.md) +- [Contribute to MemoryScope](302-contribute.md) diff --git a/docs/sphinx_doc/requirements.txt b/docs/sphinx_doc/requirements.txt new file mode 100644 index 00000000..6992bd9b --- /dev/null +++ b/docs/sphinx_doc/requirements.txt @@ -0,0 +1,11 @@ +loguru +tiktoken +pillow +requests +openai +numpy +sphinx +sphinx-autobuild +sphinx_rtd_theme +sphinxcontrib-mermaid +myst-parser \ No newline at end of file diff --git a/docs/sphinx_doc/template/module.rst_t b/docs/sphinx_doc/template/module.rst_t new file mode 100644 index 00000000..74d73a4c --- /dev/null +++ b/docs/sphinx_doc/template/module.rst_t @@ -0,0 +1,5 @@ +{{ basename | heading }} +.. automodule:: {{ qualname }} +{%- for option in automodule_options %} + :{{ option }}: +{%- endfor %} \ No newline at end of file diff --git a/docs/sphinx_doc/template/package.rst_t b/docs/sphinx_doc/template/package.rst_t new file mode 100644 index 00000000..3d9163fa --- /dev/null +++ b/docs/sphinx_doc/template/package.rst_t @@ -0,0 +1,10 @@ +{%- macro automodule(modname, options) -%} +.. automodule:: {{ modname }} +{%- for option in options %} + :{{ option }}: +{%- endfor %} +{%- endmacro %} + +{{- pkgname | heading }} + +{{ automodule(pkgname, automodule_options) }} diff --git a/docs/sphinx_doc/zh_CN/source/_static/custom.css b/docs/sphinx_doc/zh_CN/source/_static/custom.css new file mode 100644 index 00000000..68f11cee --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/_static/custom.css @@ -0,0 +1,4 @@ +.language-selector a { + color: white; + width: 20px; +} \ No newline at end of file diff --git a/docs/sphinx_doc/zh_CN/source/_templates/language_selector.html b/docs/sphinx_doc/zh_CN/source/_templates/language_selector.html new file mode 100644 index 00000000..a8aca93e --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/_templates/language_selector.html @@ -0,0 +1,5 @@ + +
+ English | + 中文 +
diff --git a/docs/sphinx_doc/zh_CN/source/_templates/layout.html b/docs/sphinx_doc/zh_CN/source/_templates/layout.html new file mode 100644 index 00000000..1d182d30 --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/_templates/layout.html @@ -0,0 +1,3 @@ + +{% extends "!layout.html" %} {% block sidebartitle %} {{ super() }} {% include +"language_selector.html" %} {% endblock %} diff --git a/docs/sphinx_doc/zh_CN/source/conf.py b/docs/sphinx_doc/zh_CN/source/conf.py new file mode 100644 index 00000000..cef534ef --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/conf.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +sys.path.insert(0, os.path.abspath("/home/hmp/memoryscope")) + + +# -- Project information ----------------------------------------------------- + +language = "zh_CN" + +project = "MemoryScope" +copyright = "2024, Alibaba Tongyi Lab" +author = "EcoML team of Alibaba Tongyi Lab" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinxcontrib.mermaid", + "myst_parser", + "sphinx.ext.autosectionlabel", +] + +# Prefix document path to section labels, otherwise autogenerated labels would +# look like 'heading' rather than 'path/to/file:heading' +autosectionlabel_prefix_document = True +autosummary_generate = True +autosummary_ignore_module_all = False + +autodoc_member_order = "bysource" + +autodoc_default_options = { + "members": True, + "special-members": "__init__", +} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +autodoc_default_options = { + "members": True, + "special-members": "__init__", +} + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +html_theme_options = { + "navigation_depth": 4, +} + +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} + +html_css_files = [ + "custom.css", +] diff --git a/docs/sphinx_doc/zh_CN/source/index.rst b/docs/sphinx_doc/zh_CN/source/index.rst new file mode 100644 index 00000000..e9f423cb --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/index.rst @@ -0,0 +1,26 @@ +.. MemoryScope documentation master file, created by + sphinx-quickstart on Fri Jan 5 17:53:54 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +:github_url: https://github.com/modelscope/memoryscope + +MemoryScope 文档 +====================================== + + +.. toctree:: + :maxdepth: 1 + :glob: + :caption: MemoryScope API 文档 + + memory_scope + memory_scope.agent + memory_scope.chat + memory_scope.constants + memory_scope.enumeration + memory_scope.memory + memory_scope.models + memory_scope.scheme + memory_scope.storage + memory_scope.utils \ No newline at end of file diff --git a/docs/sphinx_doc/zh_CN/source/modules.rst b/docs/sphinx_doc/zh_CN/source/modules.rst new file mode 100644 index 00000000..b90b32ff --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/modules.rst @@ -0,0 +1,7 @@ +memory_scope +============ + +.. toctree:: + :maxdepth: 4 + + memory_scope diff --git a/docs/sphinx_doc/zh_CN/source/tutorial/contribute.rst b/docs/sphinx_doc/zh_CN/source/tutorial/contribute.rst new file mode 100644 index 00000000..d17f827f --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/tutorial/contribute.rst @@ -0,0 +1,8 @@ +参与贡献 +=============== + +.. toctree:: + :maxdepth: 2 + + 301-community.md + 302-contribute.md \ No newline at end of file diff --git a/docs/sphinx_doc/zh_CN/source/tutorial/main.md b/docs/sphinx_doc/zh_CN/source/tutorial/main.md new file mode 100644 index 00000000..d7603570 --- /dev/null +++ b/docs/sphinx_doc/zh_CN/source/tutorial/main.md @@ -0,0 +1,34 @@ +# 欢迎来到 MemoryScope 教程 + +AgentScope是一款全新的Multi-Agent框架,专为应用开发者打造,旨在提供高易用、高可靠的编程体验! + +- **高易用**:AgentScope支持纯Python编程,提供多种语法工具实现灵活的应用流程编排,内置丰富的API服务(Service)以及应用样例,供开发者直接使用。 + +- **高鲁棒**:确保开发便捷性和编程效率的同时,针对不同能力的大模型,AgentScope提供了全面的重试机制、定制化的容错控制和面向Agent的异常处理,以确保应用的稳定、高效运行; + +- **基于Actor的分布式机制**:AgentScope设计了一种新的基于Actor的分布式机制,实现了复杂分布式工作流的集中式编程和自动并行优化,即用户可以使用中心化编程的方式完成分布式应用的流程编排,同时能够零代价将本地应用迁移到分布式的运行环境中。 + +## 教程大纲 + +- [关于AgentScope](101-memoryscope.md) +- [安装](102-installation.md) +- [快速开始](103-example.md) +- [模型](203-model.md) +- [提示工程](206-prompt.md) +- [Agent](201-agent.md) +- [记忆](205-memory.md) +- [结果解析](203-parser.md) +- [系统提示优化](209-prompt_opt.md) +- [工具](204-service.md) +- [Pipeline和MsgHub](202-pipeline.md) +- [分布式](208-distribute.md) +- [MemoryScope Studio](209-gui.md) +- [检索增强生成(RAG)](210-rag.md) +- [日志](105-logging.md) +- [监控器](207-monitor.md) +- [样例:狼人杀游戏](104-usecase.md) + +### 参与贡献 + +- [加入AgentScope社区](301-community.md) +- [贡献到AgentScope](302-contribute.md) \ No newline at end of file diff --git a/memory_scope/chat/__init__.py b/memory_scope/chat/__init__.py index e69de29b..bf69662e 100644 --- a/memory_scope/chat/__init__.py +++ b/memory_scope/chat/__init__.py @@ -0,0 +1 @@ +""" Chat.""" \ No newline at end of file diff --git a/memory_scope/utils/__init__.py b/memory_scope/utils/__init__.py index e69de29b..b78e9562 100644 --- a/memory_scope/utils/__init__.py +++ b/memory_scope/utils/__init__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +""" Import modules in utils package.""" +from .datetime_handler import DatetimeHandler +from .global_context import GlobalContext +from .logger import Logger +from .memory_handler import MemoryHandler + + +__all__ = [ + "DatetimeHandler", + "GlobalContext", + "Logger", + "MemoryHandler", +] From 8b378a05660283ee08d5ada9ff8252ba0e2461ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E8=BD=A9?= Date: Wed, 17 Jul 2024 17:05:38 +0800 Subject: [PATCH 2/2] update readme --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index d20e0cf3..409593a3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,4 +15,5 @@ cd sphinx_doc ./build_sphinx_doc.sh # step 4: view sphinx_doc/build/html/index.html using your browser +cd docs/sphinx_doc/build/html && python -m http.server 8899 ```