Skip to content

Latest commit

 

History

History

conversation_in_stream_mode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Conversation in Stream Mode

In this example, we will show

  • How to set up the stream mode in AgentScope
  • How to print in stream mode in both terminal and AgentScope Studio

Refer to our tutorial for more information: Streaming.

Tested Models

These models are tested in this example. For other models, some modifications may be needed.

  • qwen-max in DashScope
  • llama2 in ollama
  • gpt-4
  • gemini-pro
  • gpt-4 in litellm

Prerequisites

  • Install the lastest version of AgentScope by
git clone https://github.com/modelscope/agentscope
cd agentscope
pip install -e .
  • Fill your api_key in main.py to use your own model API. Then run the example by
python main.py

What We do in this Example

We create a new StreamingAgent in main.py and print the text in stream mode. The text will be printed in both terminal and AgentScope Studio.

Please refer to main.py for more details.