Skip to content

Commit

Permalink
Modify tutorial accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Jul 19, 2024
1 parent f652fca commit 23c1f24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/sphinx_doc/en/source/tutorial/203-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ After printing the streaming response, the full text of the response will be ava
```python
def reply(self, x: Optional[Msg, Sequence[Msg]] = None) -> Msg:
# ...
# Use stream=True if you want to set up streaming mode in model calling
response = self.model(prompt)

# For now, the response.text is None
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx_doc/zh_CN/source/tutorial/203-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class MyAgent(AgentBase):
```python
def reply(self, x: Optional[Msg, Sequence[Msg]] = None) -> Msg:
# ...
# 如果想在调用时使用流式打印,在这里调用时使用 stream=True
response = self.model(prompt)

# 程序运行到这里时,response.text 为 None
Expand Down

0 comments on commit 23c1f24

Please sign in to comment.