Skip to content

Latest commit

 

History

History
127 lines (89 loc) · 4.46 KB

README.md

File metadata and controls

127 lines (89 loc) · 4.46 KB

Web UI

AgentScope Web UI

A user interface for AgentScope, which is a tool for monitoring and analyzing the communication of agents in a multi-agent application.

Quick Start

To start a web UI, you can run the following python code:

import agentscope

agentscope.web.init(
    path_save="YOUR_SAVE_PATH",
    host="YOUR_WEB_IP",         # defaults to 127.0.0.1
    port=5000                   # defaults to 5000
)

The argument path_save refers to the saving directory of your application, which defaults to ./runs in AgentScope.

Note when running AgentScope applications, the argument save_log of agentscope.init function should be True to enable saving the logging files.

import agentscope

agentscope.init(
    # ...
    save_log=True,      # defaults to True
    # ...
)

A Running Example

The home page of web UI, which lists all available projects and runs in the given saving path.

The web UI

By clicking a running instance, we can observe more details.

The running details

AgentScope Studio

A running-time interface for AgentScope, which is a tool for monitoring the communication of agents in a multi-agent application, powered by gradio and modelscope_studio.

How to Use

To start a studio, you can run the following python code:

as_studio path/to/your/script.py

Remark: in path/to/your/script.py, there should be a main function.

An Example (Text)

Run the following code in the root directory of this project after you setup the configs in examples/conversation/conversation.py:

as_studio examples/conversation_basic/conversation.py

The following interface will be launched at localhost:xxxx.

Principle: When calling agent's self.speak(msg) method, it will output msg.content to the frontend.

Multimodal cases

as_studio also support multimodal cases, such as image, audio and video.

Image case

If you implement a text-to-image agent, as_studio will display the image as follows.

Principle: When calling agent's self.speak(msg) method, it will output msg.url to the frontend. Here msg.url is a list of urls of images.

Audio case

If you implement an audio agent, as_studio will display the audio as follows.

Principle: When calling agent's self.speak(msg) method, it will output msg.audio_path to the frontend. Here msg.audio_path is a list of paths of audios.

Video case

If you implement a video agent, as_studio will display the video as follows.

Principle: When calling agent's self.speak(msg) method, it will output msg.video_path to the frontend. Here msg.video_path is a list of paths of videos.

AgentScope Workstation

A draggable interface for building AgentScope workflow, which is a tool for generating config for running with AgentScope.

How to Use

Go to the AgentScope Workstation website and log in with GitHub. Drag modules to the canvas and fill in the blanks. Link each module to build a workflow. Click the EXPORT button to get the final configurations. Then save the configurations as config.json. Then run with the following commands:

# Run in command line
as_workflow config.json

# Run in as_studio (gradio ui)
as_studio config.json

Or you can run your workflow on ModelScope Studio. Click the RUN button. Then, fill in the API_KEY environment variable in ModelScope Studio. After a few minutes, enjoy your journey on AgentScope!

You can also compile JSON configuration to Python code and run:

# Compile
as_workflow config.json --compile ${YOUR_PYTHON_SCRIPT_NAME}.py

# Run python workflow
python ${YOUR_PYTHON_SCRIPT_NAME}.py

# Run workflow in as_studio (gradio ui)
as_studio ${YOUR_PYTHON_SCRIPT_NAME}.py

More examples about AgentScope Workstation are coming soon!