Skip to content

Commit

Permalink
fix typos in tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed May 15, 2024
1 parent 1728e54 commit 1b14ffb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/sphinx_doc/en/source/tutorial/203-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ In AgentScope, we achieve post-processing by calling the `to_content`, `to_memor
return msg
```

> **Note**: `keys_to_content`, `keys_to_memory`, and `keys_to_metadata` parameters can be a list, a string, or the default `None` value.
> - For the default `None`, the `to_content`, `to_memory`, and `to_metadata` methods will directly return `None`.
> **Note**: `keys_to_content`, `keys_to_memory`, and `keys_to_metadata` parameters can be a string, a list of strings, or a bool value.
> - For `True`, the `to_content`, `to_memory`, and `to_metadata` methods will directly return the whole dictionary.
> - For `False`, the `to_content`, `to_memory`, and `to_metadata` methods will directly return `None`.
> - For a string, the `to_content`, `to_memory`, and `to_metadata` methods will directly extract the corresponding value. For example, if `keys_to_content="speak"`, the `to_content` method will put `res.parsed["speak"]` into the `content` field of the `Msg` object, and the `content` field will be a string rather than a dictionary.
> - For a list, the `to_content`, `to_memory`, and `to_metadata` methods will filter the dictionary according to the list of keys.
> - For a list of string, the `to_content`, `to_memory`, and `to_metadata` methods will filter the dictionary according to the list of keys.
> ```python
> parser = MarkdownJsonDictParser(
> content_hint={
Expand Down
5 changes: 3 additions & 2 deletions docs/sphinx_doc/zh_CN/source/tutorial/203-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ AgentScope中,我们通过调用`to_content`,`to_memory`和`to_metadata`方



> **Note**: `keys_to_content``keys_to_memory``keys_to_metadata`参数可以是列表,字符串,也可以是默认的`None`值。
> - 如果是默认的`None`,则会直接返回`None`
> **Note**: `keys_to_content``keys_to_memory``keys_to_metadata`参数可以是列表,字符串,也可以是布尔值。
> - 如果是`True`,则会直接返回整个字典,即不进行过滤
> - 如果是`False`,则会直接返回`None`
> - 如果是字符串类型,则`to_content``to_memory``to_metadata`方法将会把字符串对应的键值直接放入到对应的位置,例如`keys_to_content="speak"`,则`to_content`方法将会把`res.parsed["speak"]`放入到`Msg`对象的`content`字段中,`content`字段会是字符串而不是字典。
> - 如果是列表类型,则`to_content``to_memory``to_metadata`方法实现的将是过滤功能,对应过滤后的结果是字典
> ```python
Expand Down

0 comments on commit 1b14ffb

Please sign in to comment.