Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Studio supports allocation of agent server #351
Studio supports allocation of agent server #351
Changes from all commits
0ba7f32
beb7b71
eca9592
d82c4df
485537e
c993e85
a3330b6
34c09f5
1b40ee4
8f1a303
afa0a2f
7d592cc
eed97e6
f36f803
ad0a998
b8fa907
7fb3f3b
7dd1421
ca43187
f1a9835
a212a4f
b257af4
8850fc6
0c3c337
25b8416
80279a5
23b954b
351f195
2627baf
6dd5468
c9580d2
b85d30b
a7a8eaa
380fbd6
64186c6
11c1ff5
b5876a2
1616356
f289860
373024f
8b73ceb
96b74e1
12b945f
ee60f3b
4858165
1cfdd07
202a550
9bd9bad
06ed1dd
d3e41d1
490ac1a
e22e58a
4575889
e811315
c963c69
38c6e45
8cb07cd
1de6dc6
626545c
c1b56b3
09f0c0b
b99fc99
bf20616
b7b5041
d2a392d
b498c6a
4dd5249
8ff32bc
7801975
cce467a
b50f2ee
4fbc2ba
0c36ecc
57363b8
8ae467d
5a1ec2a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
(209-gui-en)= # AgentScope Studio AgentScope Studio is an open sourced Web UI toolkit for building and monitoring multi-agent applications. It provides the following features: - **Dashboard**: A user-friendly interface, where you can monitor your running applications, and look through the running histories. - **Workstation**: A powerful interface to build your multi-agent applications with **Dragging & Dropping**. - **Gallery**: Coming soon! - **Server Management**: Coming soon! ## Start AgentScope Studio To start a studio, first ensure you have installed the latest version of AgentScope. Then, you can simply run the following Python code: ```python import agentscope agentscope.studio.init() ``` Or you can run the following command in the terminal: ```bash as_studio ``` After that, you can visit AgentScope studio at `http://127.0.0.1:5000`. Of course, you can change the host and port, and link to your application running histories by providing the following arguments: ```python import agentscope agentscope.studio.init( host="127.0.0.1", # The IP address of AgentScope studio port=5000, # The port number of AgentScope studio run_dirs = [ # The directories of your running histories "xxx/xxx/runs", "xxx/xxx/runs" ] ) ``` ## About Dashboard Dashboard is a web interface to monitor your running applications and look through the running histories. ### Note Currently, Dashboard has the following limitations, and we are working on improving it. Any feedback, contribution, or suggestion are welcome! - The running application and AgentScope Studio must be running on the same machine for URL/path consistency. If you want to visit AgentScope in the other machine, you can try to forward the port to the remote machine by running the following command in the remote machine: ```bash # Supposing AgentScope is running on {as_host}:{as_port}, and the port # of the remote machine is {remote_machine_port} ssh -L {remote_machine_port}:{as_host}:{as_port} [{user_name}@]{as_host} ``` - For distributed applications, the single-machine & multi-process mode is supported, but the multi-machine multi-process mode is not supported yet. ### Register Running Application After starting the AgentScope Studio, you can register your running applications by specifying `studio_url` in `agentscope.init()`: ```python import agentscope agentscope.init( # ... project="xxx", name="xxx", studio_url="http://127.0.0.1:5000" # The URL of AgentScope Studio ) ``` After registering, you can view the running application in the Dashboard. To distinguish different applications, you can specify the `project` and `name` of the application. > Note: Once you register the running application, the input operation within the `agentscope.agents.UserAgent` class will be transferred to the Dashboard in AgentScope Studio, and you can enter the input in the Dashboard. ### Import Running Histories In AgentScope, the running histories are saved in the `./runs` directory by default. If you want to watch these running histories in the Dashboard, you can specify the `run_dirs` in `agentscope.studio.init()`: ```python import agentscope agentscope.studio.init( run_dirs = ["xxx/runs"] ) ``` ## About Workstation The workstation is designed to empower zero-code users. It facilitates the creation of complex applications through a user-friendly, drag-and-drop interface. > Note: We are actively developing the workstation, and the interface may continue to change. Any feedback, contribution, or suggestion are welcome! ### Quick Start In AgentScope Studio, click the workstation icon in the sidebar or welcome page to enter the workstation. The workstation is consisted of a sidebar, a central workspace and a top toolbox. Their functionalities are as follows: - **Sidebar**: Providing pre-built examples to help you become acquainted with the workstation, and draggable components for building applications. - **Central workspace**: The main area where you can drag and drop components to build your application. - **Top toolbox**: To import, export, check, and run your application.
#### Explore Built-in Examples For beginners, we highly recommend starting with the pre-built examples to get started. You have the option to directly click on an example to import it into your central workspace. Alternatively, for a more structured learning experience, you can opt to follow along with the tutorials linked to each example. These tutorials will walk you through how each multi-agent application is built on AgentScope Workstation step-by-step. #### Build Your Application To build an application, following these steps: - **Choose & drag component**: Click and drag your chosen component from sidebar into the central workspace area. - **Connect nodes**: Most nodes come with input and output points. Click on an output point of one component and drag it to an input point of another to create a message flow pipeline. This process allows different nodes to pass messages. - **Configure nodes**: After dropping your nodes into the workspace, click on any of them to fill in their configuration settings. You can customize the prompts, parameters, and other properties. #### Run Your Application Once the application is built, click on the "Run" button. Before running, the workstation will check your application for any errors. If there are any, you will be prompted to correct them before proceeding. After that, your application will be executed in the same Python environment as the AgentScope Studio, and you can find it in the Dashboard. #### Import or Export Your Application Workstation supports to import and export your application. Click the "Export HTML" or "Export Python" button to generate code that you can distribute to the community or save locally. If you want to convert the exported code to Python, you can compile the JSON configuration to Python code as follows: ```bash # Compile as_workflow config.json --compile ${YOUR_PYTHON_SCRIPT_NAME}.py ``` Want to edit your application further? Simply click the "Import HTML" button to upload your previously exported HTML code back into the AgentScope Workstation. #### Check Your Application After building your application, you can click the "Check" button to verify the correctness of your application structure. The following checking rules will be performed: - Presence of Model and Agent: Every application must include at least one model node and one agent node. - Single Connection Policy: A component should not have more than one connection for each input. - Mandatory Fields Validation: All required input fields must be populated to ensure that each node has the necessary args to operate correctly. - Consistent Configuration Naming: The ‘Model config name’ used by Agent nodes must correspond to a ‘Config Name’ defined in a Model node. - Proper Node Nesting: Nodes like ReActAgent should only contain the tool nodes. Similarly, Pipeline nodes like IfElsePipeline should contain the correct number of elements (no more than 2), and ForLoopPipeline, WhileLoopPipeline, and MsgHub should follow the one-element-only rule (must be a SequentialPipeline as a child node).(209-gui-en)=
AgentScope Studio
AgentScope Studio is an open sourced Web UI toolkit for building and monitoring multi-agent applications. It provides the following features:
Start AgentScope Studio
To start a studio, first ensure you have installed the latest version of AgentScope. Then, you can simply run the following Python code:
Or you can run the following command in the terminal:
After that, you can visit AgentScope studio at
http://127.0.0.1:5000
.Of course, you can change the host and port, and link to your application running histories by providing the following arguments:
About Dashboard
Dashboard is a web interface to monitor your running applications and look through the running histories.
Note
Currently, Dashboard has the following limitations, and we are working on improving it. Any feedback, contribution, or suggestion are welcome!
The running application and AgentScope Studio must be running on the same machine for URL/path consistency. If you want to visit AgentScope in the other machine, you can try to forward the port to the remote machine by running the following command in the remote machine:
For distributed applications, the single-machine & multi-process mode is supported, but the multi-machine multi-process mode is not supported yet.
Register Running Application
After starting the AgentScope Studio, you can register your running applications by specifying
studio_url
inagentscope.init()
:After registering, you can view the running application in the Dashboard. To distinguish different applications, you can specify the
project
andname
of the application.Import Running Histories
In AgentScope, the running histories are saved in the
./runs
directory by default. If you want to watch these running histories in the Dashboard, you can specify therun_dirs
inagentscope.studio.init()
:About Workstation
The workstation is designed to empower zero-code users. It facilitates the creation of complex applications through a user-friendly, drag-and-drop interface.
Quick Start
In AgentScope Studio, click the workstation icon in the sidebar or welcome page to enter the workstation. The workstation is consisted of a sidebar, a central workspace and a top toolbox. Their functionalities are as follows:
Explore Built-in Examples
For beginners, we highly recommend starting with the pre-built examples to get started. You have the option to directly click on an example to import it into your central workspace. Alternatively, for a more structured learning experience, you can opt to follow along with the tutorials linked to each example. These tutorials will walk you through how each multi-agent application is built on AgentScope Workstation step-by-step.
Build Your Application
To build an application, following these steps:
Run Your Application
Once the application is built, click on the "Run" button. Before running, the workstation will check your application for any errors. If there are any, you will be prompted to correct them before proceeding. After that, your application will be executed in the same Python environment as the AgentScope Studio, and you can find it in the Dashboard.
Import or Export Your Application
Workstation supports to import and export your application. Click the "Export HTML" or "Export Python" button to generate code that you can distribute to the community or save locally. If you want to convert the exported code to Python, you can compile the JSON configuration to Python code as follows:
Want to edit your application further? Simply click the "Import HTML" button to upload your previously exported HTML code back into the AgentScope Workstation.
Check Your Application
After building your application, you can click the "Check" button to verify the correctness of your application structure. The following checking rules will be performed:
About Server Manager
Server Manager is a web interface used to monitor and manage agent server processes (Servers) and large-scale distributed multi-agent applications.
Registering Server Process
The process can be registered by passing the
studio_url
parameter when initializingRpcAgentServerLauncher
.For more specific registration methods, please refer to the Connecting to AgentScope Studio section in Distribution.
Managing Server Process
You can enter the Server Manager page from the AgentScope Studio home page or via the Server Manager button on the sidebar. The current Server Manager page consists of three parts: Servers list, Agents list, and Memory list.
Servers List
The AgentScope agent server processes (Servers) registered with the Studio will be displayed on the Servers list in the Server Manager page. The list will display not only the
ID
,Hostname
,Port
, andCreated Time
of each Server but also the status and computational resource usage of each Server, includingStatus
,CPU Usage
,Memory Usage
.The
Status
includes the following types: -running
: Indicates that the Server is running. -dead
: Indicates that the Server has stopped running. -unknown
: Indicates that the Studio service cannot currently be accessed normally.Only Servers in
running
status will display CPU and memory usage. Users can refresh the Servers list by clicking the refresh button on the left of the Servers bar, and all Servers indead
status can be deleted at once by clicking the delete button on the right of the Servers bar.The last column of each row in the Servers list provides a delete button for closing and deleting the Server. Please note that this operation is irreversible and should be used with caution.
Agents List
By clicking on any Server row with
running
status, the Agents list will expand in the page, displaying all Agents under that Server. The list will display theID
,Name
,Class
,System Prompt
, andModel
of each Agent.The Agents list can also be refreshed by the user clicking the refresh button on the left of the Agents bar. Each Agent can be deleted by clicking the delete button on the rightmost side of its row, and all Agents within a Server can be deleted in bulk using the delete button on the right side of the Agents bar. As with the deletion of Servers, these operations are irreversible and should be used cautiously.
Memory List
By clicking on any Agent row, the Memory list will expand on the page, displaying all messages within the Agent's memory. Each message will display its
Name
andRole
attributes on the left, and clicking on a message will display its content on the right side of the list. Similarly, the current Memory list can be refreshed by clicking the refresh button on the left of the Memory bar.[Back to the top]