From a34cab13baef4d4801f203486d7d4e73b3fbe27b Mon Sep 17 00:00:00 2001 From: "fuqingxu.fqx" Date: Wed, 4 Sep 2024 11:41:52 +0800 Subject: [PATCH] revise documents --- README.md | 2 +- README_ZH.md | 1 + clear-vector-store.py | 2 -- examples/api/agentscope_example.md | 22 ++++++++++++++++++++++ examples/api/autogen_example.md | 22 ++++++++++++++++++++++ examples/api/autogen_example.py | 2 +- 6 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 examples/api/agentscope_example.md create mode 100644 examples/api/autogen_example.md diff --git a/README.md b/README.md index 30000355..5d34a7b9 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,10 @@ For installation, please refer to [Installation.md](docs/installation.md). ## Example Usages - [Simple Usages (Quick Start)](./examples/api/simple_usages_en.ipynb) +- [With AutoGen](./examples/api/autogen_example.md) - [CLI with a MemoryScope Chatbot](./examples/cli/README.md) - [Advanced Customization](./examples/advance/custom_operator.md) - ## 💡 Contribute Contributions are always encouraged! diff --git a/README_ZH.md b/README_ZH.md index 42373be2..aadc7737 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -99,6 +99,7 @@ MemoryScope可以用于个人助理、情感陪伴等记忆场景,通过长期 - [简易用法(快速开始)](./examples/api/simple_usages_cn.ipynb) - [在命令行与MemoryScope聊天机器人交互](./examples/cli/README_ZH.md) - [进阶自定义用法](./examples/advance/custom_operator.md) +- [结合AutoGen使用](./examples/api/autogen_example.md) ## 💡 代码贡献 diff --git a/clear-vector-store.py b/clear-vector-store.py index 7092d332..c575d34a 100644 --- a/clear-vector-store.py +++ b/clear-vector-store.py @@ -5,8 +5,6 @@ This script purges the entire vector store ! """ -import sys -sys.path.append(".") from memoryscope import MemoryScope, Arguments arguments = Arguments( diff --git a/examples/api/agentscope_example.md b/examples/api/agentscope_example.md new file mode 100644 index 00000000..28117a7b --- /dev/null +++ b/examples/api/agentscope_example.md @@ -0,0 +1,22 @@ +# Working with AgentScope + +1. First, make sure that you have installed AutoGen as well as memoryscope. + ``` + pip install agentscope memoryscope + ``` + + +2. Then, ensure that es is up and running. [elasticsearch documents](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html). +The docker method is recommended: + ``` + sudo docker run -p 9200:9200 \ + -e "discovery.type=single-node" \ + -e "xpack.security.enabled=false" \ + -e "xpack.license.self_generated.type=trial" \ + docker.elastic.co/elasticsearch/elasticsearch:8.13.2 + ``` + +3. Finally, we can start the autogen demo. + ``` + python examples/api/agentscope_example.py + ``` \ No newline at end of file diff --git a/examples/api/autogen_example.md b/examples/api/autogen_example.md new file mode 100644 index 00000000..b6cecb20 --- /dev/null +++ b/examples/api/autogen_example.md @@ -0,0 +1,22 @@ +# Working with AutoGen + +1. First, make sure that you have installed AutoGen as well as memoryscope. + ``` + pip install pyautogen memoryscope + ``` + + +2. Then, ensure that es is up and running. [elasticsearch documents](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html). +The docker method is recommended: + ``` + sudo docker run -p 9200:9200 \ + -e "discovery.type=single-node" \ + -e "xpack.security.enabled=false" \ + -e "xpack.license.self_generated.type=trial" \ + docker.elastic.co/elasticsearch/elasticsearch:8.13.2 + ``` + +3. Finally, we can start the autogen demo. + ``` + python examples/api/autogen_example.py + ``` \ No newline at end of file diff --git a/examples/api/autogen_example.py b/examples/api/autogen_example.py index b260678d..0d16e5de 100644 --- a/examples/api/autogen_example.py +++ b/examples/api/autogen_example.py @@ -27,7 +27,7 @@ class MemoryScopeAgent(ConversableAgent): self.memory_scope = MemoryScope(arguments=arguments) self.memory_chat = self.memory_scope.default_memory_chat - self.register_reply([Agent, None], MemoryScopeAgent.generate_reply_with_memory,remove_other_reply_funcs=True) + self.register_reply([Agent, None], MemoryScopeAgent.generate_reply_with_memory, remove_other_reply_funcs=True) def generate_reply_with_memory(