Skip to content

Commit

Permalink
update agent
Browse files Browse the repository at this point in the history
  • Loading branch information
qingzhong1 committed Jan 2, 2024
1 parent ec5433b commit 6754db4
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 58 deletions.
5 changes: 0 additions & 5 deletions docs/modules/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ Function agent是一种由大语言模型的函数调用能力驱动的agent。
print(response.steps[0].input_files)
# 打印结果可能如下:
# [<LocalFile id: 'file-local-74aaf9e4-a4c2-11ee-b0a2-fa2020087eb4', filename: 'example.png', byte_size: 17663, created_at: '2023-12-27 22:15:58', purpose: 'assistants', metadata: {}, path: PosixPath('example.png')>]
<<<<<<< Updated upstream

=======

>>>>>>> Stashed changes
# 尝试调用语音合成工具,该工具的输出中包含文件
response = await agent.run("请使用将刚才识别出的文字转换为语音。")

Expand Down
4 changes: 0 additions & 4 deletions docs/modules/chat_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,4 @@ async def demo():
messages.append(AIMessage(result))

asyncio.run(demo())
<<<<<<< Updated upstream
```
=======
```
>>>>>>> Stashed changes
8 changes: 0 additions & 8 deletions docs/modules/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@
from erniebot_agent.file import GlobalFileManagerHandler

async def demo_function():
<<<<<<< Updated upstream
file_manager = await GlobalFileManagerHandler().get()
=======
file_manager = await GlobalFileManagerHandler().get()
>>>>>>> Stashed changes
```
2. 通过 `GlobalFileManagerHandler`创建 `File`

Expand Down Expand Up @@ -150,8 +146,4 @@ async def demo_function():
response = await agent.async_run('请帮我画一张北京市的图')
# 您可以通过AgentResponse.steps[-1]获取agent的最后一个步骤,然后最后一步的输出文件;或者在save_dir中找到所有文件
files = response.steps[-1].output_files
<<<<<<< Updated upstream
```
=======
```
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/modules/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ os.environ["EB_AGENT_ACCESS_TOKEN"] = "your access token"

## 智能体Agent

<<<<<<< Updated upstream
TODO
=======
TODO
>>>>>>> Stashed changes
12 changes: 0 additions & 12 deletions docs/modules/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ print(memory.get_messages())
>>> []
```

<<<<<<< Updated upstream
### 4.2 LimitTokensMemory
=======
### 4.2 LimitTokensMemory
>>>>>>> Stashed changes
`LimitTokensMemory(max_token_limit)`是token数量限制截断记忆,在memory中存储固定数量的token。其中`max_token_limit`表示memory中最多存储的消息的token数量,超过这个限制后,从头开始对消息进行删除。

```python
Expand All @@ -115,11 +111,7 @@ print("裁剪后的消息为:", memory.get_messages())
裁剪后的消息为: [<AIMessage role: 'assistant', content: '单词中目前有单词:meticulous', token_count: 9>, <HumanMessage role: 'user', content: '我想对单词本中的单词全部打印出对应的中文含义用于记忆', token_count: 26>, <AIMessage role: 'assistant', content: '好的,单词本中包括:meticulous的意思是挑剔的,关注细节的', token_count: 21>]
```

<<<<<<< Updated upstream
### 4.3 SlidingWindowMemory
=======
### 4.3 SlidingWindowMemory
>>>>>>> Stashed changes
`SlidingWindowMemory(max_round, retained_round)`是滑动窗口截断记忆,在memory中存储固定轮数的消息。其中`max_round`表示memory中消息最多存储的轮数,`retained_round`表示在memory中会保留的初始消息的轮数,用于初始消息比较重要的场景。下面两个例子我们分别展示SlidingWindowMemory保留一轮消息,和同时保留首轮消息的效果。

```python
Expand Down Expand Up @@ -167,8 +159,4 @@ print("裁剪后的消息为:", memory.get_messages())
## 5. 总结
综上,我们展示了Memory的设计出发点,并展示了三种Memory的使用方法和裁剪效果。

<<<<<<< Updated upstream
可以看到,我们讲到了两种memory的设计出发点,但是并未考虑第二点语义信息,因此后续我们还会持续补充更多的memory满足不同应用和效果的需求。
=======
可以看到,我们讲到了两种memory的设计出发点,但是并未考虑第二点语义信息,因此后续我们还会持续补充更多的memory满足不同应用和效果的需求。
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/modules/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,4 @@ async def demo():
print(ai_message.content)

asyncio.run(demo())
<<<<<<< Updated upstream
```
=======
```
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/package/erniebot_agent/chat_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@
options:
summary: true
members:
<<<<<<< Updated upstream
- ERNIEBot
=======
- ERNIEBot
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/package/erniebot_agent/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@
show_signature_annotations: true
line_length: 60
members:
<<<<<<< Updated upstream
- AIStudioFileClient
=======
- AIStudioFileClient
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/package/erniebot_agent/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
- Memory
- WholeMemory
- LimitTokensMemory
<<<<<<< Updated upstream
- SlidingWindowMemory
=======
- SlidingWindowMemory
>>>>>>> Stashed changes
4 changes: 0 additions & 4 deletions docs/package/erniebot_agent/retrieval.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@
options:
summary: true
members:
<<<<<<< Updated upstream
- BaizhongSearch
=======
- BaizhongSearch
>>>>>>> Stashed changes
6 changes: 1 addition & 5 deletions erniebot-agent/cookbook/remote-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ demo文件结构如下所示:


* 第三步:上传插件配置文件
<<<<<<< Updated upstream
![开发.png](https://bce.bdstatic.com/doc/eb118-guidbook/EB118-developer/%E5%BC%80%E5%8F%91_2519f45.png)
=======
![开发.png](https://bce.bdstatic.com/doc/eb118-guidbook/EB118-developer/%E5%BC%80%E5%8F%91_2519f45.png)
>>>>>>> Stashed changes
![开发.png](https://bce.bdstatic.com/doc/eb118-guidbook/EB118-developer/%E5%BC%80%E5%8F%91_2519f45.png)

0 comments on commit 6754db4

Please sign in to comment.