No invocation records available.
",
55 | initialSort: [
56 | {
57 | column: "timestamp",
58 | dir: "asc",
59 | },
60 | ],
61 | });
62 |
63 | // Set up row click event
64 | invocationTable.on("rowClick", function (e, row) {
65 | // Jump to the run detail page
66 | console.log(row.getData());
67 | invocationEditor.setValue(
68 | JSON.stringify(row.getData(), null, 2)
69 | );
70 | });
71 | })
72 | .catch((error) => {
73 | console.error(error);
74 | });
75 | }
76 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/web/workstation/examples/1_conversation.json:
--------------------------------------------------------------------------------
1 | {
2 | "2": {
3 | "name": "dashscope_chat",
4 | "data": {
5 | "args": {
6 | "config_name": "qwen",
7 | "model_name": "qwen-max",
8 | "api_key": "************",
9 | "temperature": 0.1,
10 | "seed": 1,
11 | "model_type": "dashscope_chat",
12 | "messages_key": "input"
13 | }
14 | },
15 | "inputs": {},
16 | "outputs": {}
17 | },
18 | "3": {
19 | "name": "ForLoopPipeline",
20 | "data": {
21 | "elements": [
22 | "4"
23 | ],
24 | "args": {
25 | "max_loop": 3,
26 | "break_func": ""
27 | }
28 | },
29 | "inputs": {
30 | "input_1": {
31 | "connections": [
32 | {
33 | "node": "7",
34 | "input": "output_1"
35 | }
36 | ]
37 | }
38 | },
39 | "outputs": {
40 | "output_1": {
41 | "connections": []
42 | }
43 | }
44 | },
45 | "4": {
46 | "name": "SequentialPipeline",
47 | "data": {
48 | "elements": [
49 | "5",
50 | "6"
51 | ]
52 | },
53 | "inputs": {
54 | "input_1": {
55 | "connections": []
56 | }
57 | },
58 | "outputs": {
59 | "output_1": {
60 | "connections": []
61 | }
62 | }
63 | },
64 | "5": {
65 | "name": "DialogAgent",
66 | "data": {
67 | "args": {
68 | "name": "Alice",
69 | "sys_prompt": "You are Alice.",
70 | "model_config_name": "qwen"
71 | }
72 | },
73 | "inputs": {
74 | "input_1": {
75 | "connections": []
76 | }
77 | },
78 | "outputs": {
79 | "output_1": {
80 | "connections": []
81 | }
82 | }
83 | },
84 | "6": {
85 | "name": "UserAgent",
86 | "data": {
87 | "args": {
88 | "name": "User"
89 | }
90 | },
91 | "inputs": {
92 | "input_1": {
93 | "connections": []
94 | }
95 | },
96 | "outputs": {
97 | "output_1": {
98 | "connections": []
99 | }
100 | }
101 | },
102 | "7": {
103 | "name": "Message",
104 | "data": {
105 | "args": {
106 | "name": "Host",
107 | "content": "Hello",
108 | "url": ""
109 | }
110 | },
111 | "inputs": {
112 | "input_1": {
113 | "connections": []
114 | }
115 | },
116 | "outputs": {
117 | "output_1": {
118 | "connections": [
119 | {
120 | "node": "3",
121 | "output": "input_1"
122 | }
123 | ]
124 | }
125 | }
126 | }
127 | }
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/_studio_utils.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """The utility functions for AgentScope Studio."""
3 | import os.path
4 | import sqlite3
5 |
6 |
7 | def _check_and_convert_id_type(db_path: str, table_name: str) -> None:
8 | """Check and convert the type of the 'id' column in the specified table
9 | from INTEGER to VARCHAR.
10 |
11 | Args:
12 | db_path (str): The path of the SQLite database file.
13 | table_name (str): The name of the table to be checked and converted.
14 | """
15 |
16 | if not os.path.exists(db_path):
17 | return
18 |
19 | # Connect to the SQLite database
20 | conn = sqlite3.connect(db_path)
21 | cursor = conn.cursor()
22 |
23 | try:
24 | # Obtain the table structure information
25 | cursor.execute(f"PRAGMA table_info({table_name});")
26 | columns = cursor.fetchall()
27 |
28 | # Look for the type of the 'id' column
29 | id_column = [col for col in columns if col[1] == "id"]
30 | if not id_column:
31 | return
32 |
33 | id_type = id_column[0][2].upper()
34 | if id_type in ["VARCHAR", "TEXT"]:
35 | return
36 |
37 | if id_type == "INTEGER":
38 | # Temporary table name
39 | temp_table_name = table_name + "_temp"
40 |
41 | # Create a new table and change the type of the 'id' column to
42 | # VARCHAR
43 | create_table_sql = f"CREATE TABLE {temp_table_name} ("
44 | for col in columns:
45 | col_type = "VARCHAR" if col[1] == "id" else col[2]
46 | create_table_sql += f"{col[1]} {col_type}, "
47 | create_table_sql = create_table_sql.rstrip(", ") + ");"
48 |
49 | cursor.execute(create_table_sql)
50 |
51 | # Copy data and convert the value of the 'id' column to a string
52 | column_names = ", ".join([col[1] for col in columns])
53 | column_values = ", ".join(
54 | [
55 | f"CAST({col[1]} AS VARCHAR)" if col[1] == "id" else col[1]
56 | for col in columns
57 | ],
58 | )
59 | cursor.execute(
60 | f"INSERT INTO {temp_table_name} ({column_names}) "
61 | f"SELECT {column_values} FROM {table_name};",
62 | )
63 |
64 | # Delete the old table
65 | cursor.execute(f"DROP TABLE {table_name};")
66 |
67 | # Rename the new table
68 | cursor.execute(
69 | f"ALTER TABLE {temp_table_name} RENAME TO {table_name};",
70 | )
71 |
72 | conn.commit()
73 |
74 | except sqlite3.Error as e:
75 | print(f"SQLite error: {e}")
76 | finally:
77 | conn.close()
78 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/web/workstation/examples/2_msghub.json:
--------------------------------------------------------------------------------
1 | {
2 | "2": {
3 | "name": "dashscope_chat",
4 | "data": {
5 | "args": {
6 | "config_name": "qwen",
7 | "model_name": "qwen-max",
8 | "api_key": "************",
9 | "temperature": 0.1,
10 | "seed": 1,
11 | "model_type": "dashscope_chat",
12 | "messages_key": "input"
13 | }
14 | },
15 | "inputs": {},
16 | "outputs": {}
17 | },
18 | "3": {
19 | "name": "MsgHub",
20 | "data": {
21 | "elements": [
22 | "4"
23 | ],
24 | "args": {
25 | "announcement": {
26 | "name": "Host",
27 | "content": "Welcome to group chat!"
28 | }
29 | }
30 | },
31 | "inputs": {
32 | "input_1": {
33 | "connections": [
34 | {
35 | "node": "7",
36 | "input": "output_1"
37 | }
38 | ]
39 | }
40 | },
41 | "outputs": {
42 | "output_1": {
43 | "connections": []
44 | }
45 | }
46 | },
47 | "4": {
48 | "name": "SequentialPipeline",
49 | "data": {
50 | "elements": [
51 | "5",
52 | "6"
53 | ]
54 | },
55 | "inputs": {
56 | "input_1": {
57 | "connections": []
58 | }
59 | },
60 | "outputs": {
61 | "output_1": {
62 | "connections": []
63 | }
64 | }
65 | },
66 | "5": {
67 | "name": "DialogAgent",
68 | "data": {
69 | "args": {
70 | "name": "Alice",
71 | "sys_prompt": "You are Alice.",
72 | "model_config_name": "qwen"
73 | }
74 | },
75 | "inputs": {
76 | "input_1": {
77 | "connections": []
78 | }
79 | },
80 | "outputs": {
81 | "output_1": {
82 | "connections": []
83 | }
84 | }
85 | },
86 | "6": {
87 | "name": "UserAgent",
88 | "data": {
89 | "args": {
90 | "name": "User"
91 | }
92 | },
93 | "inputs": {
94 | "input_1": {
95 | "connections": []
96 | }
97 | },
98 | "outputs": {
99 | "output_1": {
100 | "connections": []
101 | }
102 | }
103 | },
104 | "7": {
105 | "name": "Message",
106 | "data": {
107 | "args": {
108 | "name": "Host",
109 | "content": "Hello",
110 | "url": ""
111 | }
112 | },
113 | "inputs": {
114 | "input_1": {
115 | "connections": []
116 | }
117 | },
118 | "outputs": {
119 | "output_1": {
120 | "connections": [
121 | {
122 | "node": "3",
123 | "output": "input_1"
124 | }
125 | ]
126 | }
127 | }
128 | }
129 | }
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/js_third_party/marked-katex-extension.umd.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('katex')) :
3 | typeof define === 'function' && define.amd ? define(['katex'], factory) :
4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.markedKatex = factory(global.katex));
5 | })(this, (function (katex) { 'use strict';
6 |
7 | const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/;
8 | const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
9 |
10 | function index(options = {}) {
11 | return {
12 | extensions: [
13 | inlineKatex(options, createRenderer(options, false)),
14 | blockKatex(options, createRenderer(options, true))
15 | ]
16 | };
17 | }
18 |
19 | function createRenderer(options, newlineAfter) {
20 | return (token) => katex.renderToString(token.text, { ...options, displayMode: token.displayMode }) + (newlineAfter ? '\n' : '');
21 | }
22 |
23 | function inlineKatex(options, renderer) {
24 | return {
25 | name: 'inlineKatex',
26 | level: 'inline',
27 | start(src) {
28 | let index;
29 | let indexSrc = src;
30 |
31 | while (indexSrc) {
32 | index = indexSrc.indexOf('$');
33 | if (index === -1) {
34 | return;
35 | }
36 |
37 | if (index === 0 || indexSrc.charAt(index - 1) === ' ') {
38 | const possibleKatex = indexSrc.substring(index);
39 |
40 | if (possibleKatex.match(inlineRule)) {
41 | return index;
42 | }
43 | }
44 |
45 | indexSrc = indexSrc.substring(index + 1).replace(/^\$+/, '');
46 | }
47 | },
48 | tokenizer(src, tokens) {
49 | const match = src.match(inlineRule);
50 | if (match) {
51 | return {
52 | type: 'inlineKatex',
53 | raw: match[0],
54 | text: match[2].trim(),
55 | displayMode: match[1].length === 2
56 | };
57 | }
58 | },
59 | renderer
60 | };
61 | }
62 |
63 | function blockKatex(options, renderer) {
64 | return {
65 | name: 'blockKatex',
66 | level: 'block',
67 | tokenizer(src, tokens) {
68 | const match = src.match(blockRule);
69 | if (match) {
70 | return {
71 | type: 'blockKatex',
72 | raw: match[0],
73 | text: match[2].trim(),
74 | displayMode: match[1].length === 2
75 | };
76 | }
77 | },
78 | renderer
79 | };
80 | }
81 |
82 | return index;
83 |
84 | }));
85 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/css/login.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'Arial', sans-serif;
3 | background-color: #f0f0f0;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: center;
7 | align-items: center;
8 | height: 100vh;
9 | margin: 0;
10 | }
11 |
12 | .login-container {
13 | padding: 2rem;
14 | background: #fff;
15 | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
16 | border-radius: 8px;
17 | text-align: center;
18 | width: 100%;
19 | max-width: 80%;
20 | }
21 |
22 | #loginButton {
23 | background-color: #2ea44f;
24 | color: white;
25 | font-size: 18px;
26 | padding: 15px 24px;
27 | border: none;
28 | border-radius: 5px;
29 | cursor: pointer;
30 | box-shadow: 0px 4px 14px -3px rgba(0, 0, 0, 0.4);
31 | transition: background-color 0.3s, transform 0.2s;
32 | margin-top: 1rem;
33 | display: inline-block;
34 | width: 100%;
35 | }
36 |
37 | #loginButton:hover {
38 | background-color: #2c974b;
39 | transform: scale(1.05);
40 | }
41 |
42 | #loginButton:active {
43 | background-color: #258741;
44 | transform: scale(1);
45 | }
46 |
47 | #loginButton:disabled {
48 | background-color: #94d3a2;
49 | cursor: not-allowed;
50 | }
51 |
52 | .terms {
53 | background: #fff;
54 | padding: 20px;
55 | margin: 1rem auto;
56 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
57 | border-radius: 8px;
58 | max-width: 600px;
59 | }
60 |
61 | .terms ul {
62 | margin-left: 20px;
63 | }
64 |
65 | .terms li {
66 | margin-bottom: 10px;
67 | }
68 |
69 | .checkbox {
70 | margin-bottom: 1rem;
71 | }
72 |
73 | .brand-gif {
74 | background: #fff;
75 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
76 | width: 50%;
77 | height: auto;
78 | border-radius: 8px;
79 | }
80 |
81 | .link-like {
82 | color: #707070;
83 | text-decoration: underline;
84 | cursor: pointer;
85 | opacity: 0.15;
86 | }
87 |
88 | .link-like:hover {
89 | opacity: 1.0;
90 | }
91 |
92 | .waiting {
93 | position: fixed;
94 | top: 50%;
95 | left: 50%;
96 | transform: translate(-50%, -50%);
97 | display: flex;
98 | align-items: center;
99 | justify-content: center;
100 | z-index: 1000;
101 | background-color: rgba(255, 255, 255, 0.8);
102 | border-radius: 10px;
103 | padding: 20px 40px;
104 | box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
105 | flex-direction: column;
106 | }
107 |
108 | .css-spinner {
109 | border: 4px solid rgba(0, 0, 0, .1);
110 | border-radius: 50%;
111 | border-top: 4px solid #3498db;
112 | width: 40px;
113 | height: 40px;
114 | animation: spin 2s linear infinite;
115 | }
116 |
117 | @keyframes spin {
118 | 0% {
119 | transform: rotate(0deg);
120 | }
121 | 100% {
122 | transform: rotate(360deg);
123 | }
124 | }
125 |
126 | .waiting b {
127 | color: #555;
128 | font-weight: normal;
129 | font-size: 1.5em;
130 | }
131 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/service/execute_code/exec_shell.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Service to execute shell commands."""
3 | import subprocess
4 |
5 | from loguru import logger
6 |
7 | from agentscope.service.service_status import ServiceExecStatus
8 | from agentscope.service.service_response import ServiceResponse
9 |
10 |
11 | def execute_shell_command(command: str) -> ServiceResponse:
12 | """
13 | Executes a given shell command.
14 |
15 | Args:
16 | command (str): The shell command to execute.
17 |
18 | Returns:
19 | ServiceResponse: Contains either the output from the shell command as a
20 | string if sucessful, or an error message include the error type.
21 |
22 | Note:
23 | Use any bash/shell commands you want (e.g. find, grep, cat, ls),
24 | but note that :
25 | 1. interactive session commands (e.g. python, vim) or commands that
26 | change current state (e.g. cd that change the current directory)
27 | are NOT supported yet, so please do not invoke them.
28 | 2. be VERY CAREFUL when using commands that will
29 | change/edit the files current directory (e.g. rm, sed).
30 | ...
31 | """
32 |
33 | if any(_ in command for _ in execute_shell_command.insecure_commands):
34 | logger.warning(
35 | f"The command {command} is blocked for security reasons. "
36 | f"If you want to enable the command, try to reset the "
37 | f"insecure command list by executing "
38 | f'`execute_shell_command.insecure_commands = ["xxx", "xxx"]`',
39 | )
40 | return ServiceResponse(
41 | status=ServiceExecStatus.ERROR,
42 | content=f"The command {command} is blocked for security reasons.",
43 | )
44 |
45 | try:
46 | result = subprocess.run(
47 | command,
48 | shell=True,
49 | check=True,
50 | stdout=subprocess.PIPE,
51 | stderr=subprocess.PIPE,
52 | text=True,
53 | )
54 | return ServiceResponse(
55 | status=ServiceExecStatus.SUCCESS,
56 | content=result.stdout.strip() if result.stdout else "Success.",
57 | )
58 | except subprocess.CalledProcessError as e:
59 | error_message = (
60 | e.stderr.strip()
61 | if e.stderr
62 | else "An error occurred \
63 | while executing the command."
64 | )
65 | return ServiceResponse(
66 | status=ServiceExecStatus.ERROR,
67 | content=error_message,
68 | )
69 | except Exception as e:
70 | return ServiceResponse(
71 | status=ServiceExecStatus.ERROR,
72 | content=str(e),
73 | )
74 |
75 |
76 | # Security check: Block insecure commands
77 | execute_shell_command.insecure_commands = [
78 | # System management
79 | "shutdown",
80 | "kill",
81 | "reboot",
82 | "pkill",
83 | # User management
84 | "useradd",
85 | "userdel",
86 | "usermod",
87 | # File management
88 | "rm -rf",
89 | ]
90 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/prompt/_prompt_generator_zh.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Prompt generator class."""
3 | from typing import List, Literal, Optional
4 |
5 | from ._prompt_generator_base import SystemPromptGeneratorBase
6 | from ._prompt_utils import _DEFAULT_EXAMPLE_LIST_ZH
7 |
8 | _DEFAULT_META_PROMPT_ZH = """
9 | 你是一个擅长写和优化system prompt的专家。你的任务是优化用户提供的prompt, 使得优化后的system prompt包含对agent的角色或者性格描述,agent的技能点,和一些限制。
10 |
11 | ## 注意
12 | 1. 优化后的system prompt必须与用户原始prompt意图一致,可适当加入可调用的工具、具体关键词、时间框架、上下文或任何可以缩小范围并指导agent能够更好地理解完成任务的附加信息,对用户的prompt进行重构。
13 | 2. 请注意角色描述和技能点的描述不能缩小用户原始prompt定义的范围。例如用户原始prompt里描述的是文案大师,优化后的prompt描述不能缩小范围变成小红书文案大师。
14 | 3. 对技能点的描述应该尽量详细准确。用户原始的prompt会提到一些示例,技能点应该能覆盖这些案例,但注意不能只局限于用户prompt里给的示例。例如用户原始prompt里提到出题机器人可以出填空题的考题的示例,优化后的prompt里技能点不能只包括出填空题。
15 | 4. 技能范围不能超过大模型的能力,如果超过,请必须注明需要调用哪些工具,或者需要哪些知识库来帮助大模型拥有这个技能。比如大模型并没有搜索功能,如果需要搜索,则需要调用搜索工具来实现。
16 | 5. 请以markdown的格式输出优化后的prompt。
17 | 6. 优化后的prompt必须语言简练,字数不超过1000字。
18 | 7. 如果用户提供的prompt包含知识库或者Memory部分,优化后的system prompt也必须保留这些部分。
19 | 8. 如果prompt中含有如下标识符的变量:${{variable}}, 请确保改变量在优化后的prompt里只出现一次,在其他要使用该变量的地方直接使用该变量名。例如${{document}}再次出现的时候,请直接使用"检索内容"。
20 | 9. 优化后的prompt语言与用户提供的prompt一致,即用户提供的prompt使用中文写的,优化后的prompt也必须是中文, 如果用户提供的prompt使用英文写的,优化后的prompt也必须是英文。
21 | """ # noqa
22 |
23 | _DEFAULT_EXAMPLE_PROMPT_TEMPLATE_ZH = """## 样例{index}
24 | - 用户输入:
25 | ```
26 | {user_prompt}
27 | ```
28 |
29 | - 优化后的system prompt:
30 | ```
31 | {opt_prompt}
32 | ```
33 | """
34 |
35 | _DEFAULT_RESPONSE_PROMPT_TEMPLATE_ZH = """## 用户输入
36 | ```
37 | {user_prompt}
38 | ```
39 |
40 | ## 优化后的system prompt
41 | """
42 |
43 | # The name of the default local embedding model, which is used when
44 | # `embed_model_config_name` is not provided.
45 | _DEFAULT_LOCAL_EMBEDDING_MODEL = "sentence-transformers/all-mpnet-base-v2"
46 |
47 |
48 | class ChineseSystemPromptGenerator(SystemPromptGeneratorBase):
49 | """Optimize the users' system prompt with the given meta prompt and
50 | examples if provided."""
51 |
52 | def __init__(
53 | self,
54 | model_config_name: str,
55 | meta_prompt: str = _DEFAULT_META_PROMPT_ZH,
56 | response_prompt_template: str = _DEFAULT_RESPONSE_PROMPT_TEMPLATE_ZH,
57 | example_num: int = 0,
58 | example_list: List = _DEFAULT_EXAMPLE_LIST_ZH,
59 | example_selection_strategy: Literal["random", "similarity"] = "random",
60 | example_prompt_template: str = _DEFAULT_EXAMPLE_PROMPT_TEMPLATE_ZH,
61 | embed_model_config_name: Optional[str] = None,
62 | local_embedding_model: str = _DEFAULT_LOCAL_EMBEDDING_MODEL,
63 | ):
64 | super().__init__(
65 | model_config_name=model_config_name,
66 | meta_prompt=meta_prompt,
67 | response_prompt_template=response_prompt_template,
68 | example_num=example_num,
69 | example_list=example_list,
70 | example_selection_strategy=example_selection_strategy,
71 | example_prompt_template=example_prompt_template,
72 | embed_model_config_name=embed_model_config_name,
73 | local_embedding_model=local_embedding_model,
74 | )
75 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/css/server.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --server-content-padding-vertical: 20px;
3 | --server-content-padding-horizontal: 30px;
4 | --server-table-height: calc(100% - var(--runs-content-control-panel-height));
5 | }
6 |
7 |
8 | #server-panel {
9 | display: flex;
10 | height: 100%;
11 | width: 100%;
12 | flex-direction: column;
13 | }
14 |
15 | #server-content {
16 | display: flex;
17 | flex-direction: column;
18 | width: 100%;
19 | padding: var(--server-content-padding-vertical) var(--server-content-padding-horizontal);
20 | box-sizing: border-box;
21 | }
22 |
23 | .collapsed {
24 | display: none;
25 | }
26 |
27 | #server-table {
28 | flex-grow: 1;
29 | overflow-y: auto;
30 | max-height: 30vh;
31 | width: 100%;
32 | background-color: #ffffff;
33 | border: 1px solid var(--border-color);
34 | }
35 |
36 | #agent-memory-content {
37 | display: flex;
38 | flex-direction: row;
39 | height: 200px;
40 | width: 100%;
41 | border: 1px solid var(--border-color);
42 | }
43 |
44 | #agent-memory-table {
45 | display: flex;
46 | flex-direction: column;
47 | width: 350px;
48 | box-sizing: border-box;
49 | border: 0;
50 | background-color: #ffffff;
51 | }
52 |
53 | #agent-memory-raw {
54 | display: flex;
55 | flex-direction: column;
56 | width: calc(100% - 350px);
57 | height: 100%;
58 | box-sizing: border-box;
59 | border-left: 1px solid var(--border-color);
60 | }
61 |
62 | #agent-memory-raw .monaco-editor {
63 | display: flex;
64 | height: 100%;
65 | width: 100%;
66 | min-width: 100%;
67 | }
68 |
69 | .server-section-title-bar {
70 | display: flex;
71 | justify-content: flex-start;
72 | font-size: 20px;
73 | padding: 6px 0px;
74 | }
75 |
76 |
77 | .align-right-btn {
78 | margin-left: auto;
79 | }
80 |
81 | #server-content .icon {
82 | display: flex;
83 | height: 20px;
84 | padding: 4px 15px;
85 | cursor: pointer;
86 | }
87 |
88 | #agent-table {
89 | flex-grow: 1;
90 | overflow-y: auto;
91 | max-height: 30vh;
92 | width: 100%;
93 | background-color: #ffffff;
94 | border: 1px solid var(--border-color);
95 | }
96 |
97 | .status-tag {
98 | display: flex;
99 | flex-direction: row;
100 | align-items: center;
101 | height: 26px;
102 | width: fit-content;
103 | border-radius: 13px;
104 | color: var(--base-color);
105 | box-sizing: border-box;
106 | margin: 0 5px;
107 | padding: 0 14px;
108 | }
109 |
110 | .running.status-tag {
111 | background-color: #ccf4dd;
112 | color: #27ae60;
113 | fill: #27ae60;
114 | }
115 |
116 | .dead.status-tag {
117 | background-color: #f5d5d1;
118 | color: #c0392b;
119 | fill: #c0392b;
120 | }
121 |
122 | .loading.status-tag {
123 | background-color: #e1e1e1;
124 | color: #3d4047;
125 | fill: #3d4047;
126 | }
127 |
128 | .unknown.status-tag {
129 | background-color: #e1e1e1;
130 | color: #3d4047;
131 | fill: #3d4047;
132 | }
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/agents/dialog_agent.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """A general dialog agent."""
3 | from typing import Optional, Union, Sequence
4 |
5 | from ..message import Msg
6 | from .agent import AgentBase
7 |
8 |
9 | class DialogAgent(AgentBase):
10 | """A simple agent used to perform a dialogue. Your can set its role by
11 | `sys_prompt`."""
12 |
13 | def __init__(
14 | self,
15 | name: str,
16 | sys_prompt: str,
17 | model_config_name: str,
18 | use_memory: bool = True,
19 | memory_config: Optional[dict] = None,
20 | ) -> None:
21 | """Initialize the dialog agent.
22 |
23 | Arguments:
24 | name (`str`):
25 | The name of the agent.
26 | sys_prompt (`Optional[str]`):
27 | The system prompt of the agent, which can be passed by args
28 | or hard-coded in the agent.
29 | model_config_name (`str`):
30 | The name of the model config, which is used to load model from
31 | configuration.
32 | use_memory (`bool`, defaults to `True`):
33 | Whether the agent has memory.
34 | memory_config (`Optional[dict]`):
35 | The config of memory.
36 | """
37 | super().__init__(
38 | name=name,
39 | sys_prompt=sys_prompt,
40 | model_config_name=model_config_name,
41 | use_memory=use_memory,
42 | memory_config=memory_config,
43 | )
44 |
45 | def reply(self, x: Optional[Union[Msg, Sequence[Msg]]] = None) -> Msg:
46 | """Reply function of the agent. Processes the input data,
47 | generates a prompt using the current dialogue memory and system
48 | prompt, and invokes the language model to produce a response. The
49 | response is then formatted and added to the dialogue memory.
50 |
51 | Args:
52 | x (`Optional[Union[Msg, Sequence[Msg]]]`, defaults to `None`):
53 | The input message(s) to the agent, which also can be omitted if
54 | the agent doesn't need any input.
55 |
56 | Returns:
57 | `Msg`: The output message generated by the agent.
58 | """
59 | # record the input if needed
60 | if self.memory:
61 | self.memory.add(x)
62 |
63 | # prepare prompt
64 | prompt = self.model.format(
65 | Msg("system", self.sys_prompt, role="system"),
66 | self.memory
67 | and self.memory.get_memory()
68 | or x, # type: ignore[arg-type]
69 | )
70 |
71 | # call llm and generate response
72 | response = self.model(prompt)
73 |
74 | # Print/speak the message in this agent's voice
75 | # Support both streaming and non-streaming responses by "or"
76 | self.speak(response.stream or response.text)
77 |
78 | msg = Msg(self.name, response.text, role="assistant")
79 |
80 | # Record the message in memory
81 | if self.memory:
82 | self.memory.add(msg)
83 |
84 | return msg
85 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/service/retrieval/retrieval_from_list.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Retrieve service working with memory specially."""
3 | from typing import Callable, Optional, Any, Sequence
4 | from loguru import logger
5 |
6 | from agentscope.service.service_response import ServiceResponse
7 | from agentscope.service.service_status import ServiceExecStatus
8 | from agentscope.models import ModelWrapperBase
9 |
10 |
11 | def retrieve_from_list(
12 | query: Any,
13 | knowledge: Sequence, # TODO: rename
14 | score_func: Callable[[Any, Any], float],
15 | top_k: int = None,
16 | embedding_model: Optional[ModelWrapperBase] = None,
17 | preserve_order: bool = True,
18 | ) -> ServiceResponse:
19 | """
20 | Retrieve data in a list.
21 |
22 | Memory retrieval with user-defined score function. The score function is
23 | expected to take the `query` and one of the element in 'knowledge' (a
24 | list). This function retrieves top-k elements in 'knowledge' with
25 | HIGHEST scores. If the 'query' is a dict but has no embedding,
26 | we use the embedding model to embed the query.
27 |
28 | Args:
29 | query (`Any`):
30 | A message to be retrieved.
31 | knowledge (`Sequence`):
32 | Data/knowledge to be retrieved from.
33 | score_func (`Callable[[Any, Any], float]`):
34 | User-defined function for comparing two messages.
35 | top_k (`int`, defaults to `None`):
36 | Maximum number of messages returned.
37 | embedding_model (`Optional[ModelWrapperBase]`, defaults to `None`):
38 | A model to embed the query/message.
39 | preserve_order (`bool`, defaults to `True`):
40 | Whether to preserve the original order of the retrieved data.
41 | Defaults to True.
42 |
43 | Returns:
44 | `ServiceResponse`: The top-k retrieved messages with HIGHEST scores.
45 | """
46 | if isinstance(query, dict):
47 | if embedding_model is not None and "embedding" not in query:
48 | query["embedding"] = embedding_model(
49 | [query],
50 | return_embedding_only=True,
51 | )
52 | elif embedding_model is None and "embedding" not in query:
53 | logger.warning(
54 | "Since the input query has no embedding, embedding model is "
55 | "is not provided either.",
56 | )
57 |
58 | # (score, index, object)
59 | scores = [
60 | (score_func(query, msg), i, msg) for i, msg in enumerate(knowledge)
61 | ]
62 |
63 | # ordered by score, and extract the top-k items with highest scores
64 | top_k = len(scores) if top_k is None else top_k
65 | ordered_top_k_scores = sorted(scores, key=lambda x: x[0], reverse=True)[
66 | :top_k
67 | ]
68 |
69 | # if keep the original order
70 | if preserve_order:
71 | # ordered by index
72 | content = sorted(ordered_top_k_scores, key=lambda x: x[1])
73 | else:
74 | content = ordered_top_k_scores
75 |
76 | # The returned content includes a list of triples of (score, index, object)
77 | return ServiceResponse(
78 | status=ServiceExecStatus.SUCCESS,
79 | content=content,
80 | )
81 |
--------------------------------------------------------------------------------
/agentscope-main/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/pre-commit/pre-commit-hooks
3 | rev: v4.3.0
4 | hooks:
5 | - id: check-ast
6 | - id: sort-simple-yaml
7 | - id: check-yaml
8 | exclude: |
9 | (?x)^(
10 | meta.yaml
11 | )$
12 | - id: check-xml
13 | - id: check-toml
14 | - id: check-docstring-first
15 | - id: check-json
16 | - id: fix-encoding-pragma
17 | - id: detect-private-key
18 | - id: trailing-whitespace
19 | - repo: https://github.com/asottile/add-trailing-comma
20 | rev: v3.1.0
21 | hooks:
22 | - id: add-trailing-comma
23 | - repo: https://github.com/pre-commit/mirrors-mypy
24 | rev: v1.7.0
25 | hooks:
26 | - id: mypy
27 | exclude:
28 | (?x)(
29 | pb2\.py$
30 | | grpc\.py$
31 | | ^docs
32 | | \.html$
33 | )
34 | args: [ --disallow-untyped-defs,
35 | --disallow-incomplete-defs,
36 | --ignore-missing-imports,
37 | --disable-error-code=var-annotated,
38 | --disable-error-code=union-attr,
39 | --disable-error-code=assignment,
40 | --disable-error-code=attr-defined,
41 | --disable-error-code=import-untyped,
42 | --disable-error-code=truthy-function,
43 | --follow-imports=skip,
44 | --explicit-package-bases,
45 | ]
46 | # - repo: https://github.com/numpy/numpydoc
47 | # rev: v1.6.0
48 | # hooks:
49 | # - id: numpydoc-validation
50 | - repo: https://github.com/psf/black
51 | rev: 23.3.0
52 | hooks:
53 | - id: black
54 | args: [--line-length=79]
55 | - repo: https://github.com/PyCQA/flake8
56 | rev: 6.1.0
57 | hooks:
58 | - id: flake8
59 | args: ["--extend-ignore=E203"]
60 | - repo: https://github.com/pylint-dev/pylint
61 | rev: v3.0.2
62 | hooks:
63 | - id: pylint
64 | exclude:
65 | (?x)(
66 | ^docs
67 | | pb2\.py$
68 | | grpc\.py$
69 | | \.demo$
70 | | \.md$
71 | | \.html$
72 | )
73 | args: [
74 | --disable=W0511,
75 | --disable=W0718,
76 | --disable=W0122,
77 | --disable=C0103,
78 | --disable=R0913,
79 | --disable=E0401,
80 | --disable=E1101,
81 | --disable=C0415,
82 | --disable=W0603,
83 | --disable=R1705,
84 | --disable=R0914,
85 | --disable=E0601,
86 | --disable=W0602,
87 | --disable=W0604,
88 | --disable=R0801,
89 | --disable=R0902,
90 | --disable=R0903,
91 | --disable=C0123,
92 | --disable=W0231,
93 | --disable=W1113,
94 | --disable=W0221,
95 | --disable=R0401,
96 | --disable=W0632,
97 | --disable=W0123,
98 | --disable=C3001,
99 | ]
100 | - repo: https://github.com/regebro/pyroma
101 | rev: "4.0"
102 | hooks:
103 | - id: pyroma
104 | args: [--min=10, .]
105 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/html-drag-components/model-dashscope-chat.html:
--------------------------------------------------------------------------------
1 | \n 📖 This is an example of how to program a one-round conversation in AgentScope.
Modules Used: DashScope Chat: - Each application must contain a model configured.UserAgent: - Represents a user in a application.DialogAgent: - Agent for dialog in an application.\n ",
90 | "typenode": false,
91 | "inputs": {},
92 | "outputs": {},
93 | "pos_x": 68,
94 | "pos_y": 67
95 | }
96 | }
97 | }
98 | }
99 | }
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/html-drag-components/model-post-api-chat.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
Post API Chat
8 |
9 |
▲
10 |
11 |
12 |
Post API Chat Configuration
13 |
14 |
15 |
Config Name
16 |
18 |
19 |
20 |
Model Name
21 |
23 |
24 |
25 |
Temperature
26 |
28 |
29 |
30 |
Seed
31 |
32 |
33 |
34 |
API url
35 |
36 |
37 |
38 |
Content-Type
39 |
41 |
42 |
43 |
Authorization
44 |
45 |
46 |
47 |
Messages Key
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/service/sql_query/mysql.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """query in Mysql """
3 | from typing import Optional
4 | from typing import Any
5 |
6 | from ..service_response import ServiceResponse
7 | from ...utils.common import _if_change_database
8 | from ...service.service_status import ServiceExecStatus
9 |
10 | try:
11 | import pymysql
12 | except ImportError:
13 | pymysql = None
14 |
15 |
16 | def query_mysql(
17 | database: str,
18 | query: str,
19 | host: str,
20 | user: str,
21 | password: str,
22 | port: int,
23 | allow_change_data: bool = False,
24 | maxcount_results: Optional[int] = None,
25 | **kwargs: Any,
26 | ) -> ServiceResponse:
27 | """
28 | Execute query within MySQL database.
29 |
30 | Args:
31 | database (`str`):
32 | The name of the database to use.
33 | query (`str`):
34 | SQL query to execute.
35 | host (`str`):
36 | The host name or IP address of the MySQL server, e.g. "localhost".
37 | user (`str`):
38 | The username of the MySQL account to use.
39 | password (`str`):
40 | The password of the MySQL account to use.
41 | port (`str`):
42 | The port number of the MySQL server, e.g. 3306.
43 | allow_change_data (`bool`, defaults to `False`):
44 | Whether to allow changing data in the database. Defaults to
45 | `False` to avoid accidental changes to the database.
46 | maxcount_results (`int`, defaults to `None`):
47 | The maximum number of results to return. Defaults to `100` to
48 | avoid too many results.
49 |
50 | Returns:
51 | `ServiceResponse`: A `ServiceResponse` object that contains
52 | execution results or error message.
53 | """
54 |
55 | # Check if the query is safe
56 | if not allow_change_data and not _if_change_database(query):
57 | raise ValueError(
58 | "Unsafe SQL query detected. Only SELECT statements are allowed. "
59 | "If you want to allow changing data in the database, "
60 | "set `allow_change_data` to `True`.",
61 | )
62 |
63 | # Limit the number of results by adding LIMIT keywords if necessary
64 | if maxcount_results is not None:
65 | if "limit" not in query.lower():
66 | query += f" LIMIT {maxcount_results}"
67 |
68 | # Execute the query
69 | try:
70 | # Establish a connection to the database
71 | conn = pymysql.connect(
72 | host=host,
73 | port=port,
74 | user=user,
75 | password=password,
76 | database=database,
77 | **kwargs,
78 | )
79 |
80 | cursor = conn.cursor()
81 | cursor.execute(query)
82 |
83 | if _if_change_database(query):
84 | conn.commit()
85 |
86 | cursor.close()
87 | conn.close()
88 |
89 | # Fetch the results
90 | results = cursor.fetchall()
91 | return ServiceResponse(
92 | status=ServiceExecStatus.SUCCESS,
93 | content=results,
94 | )
95 | except Exception as e:
96 | return ServiceResponse(
97 | status=ServiceExecStatus.ERROR,
98 | # TODO: more specific error message
99 | content=str(e),
100 | )
101 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/service/text_processing/summarization.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Service for text processing
4 | """
5 | from loguru import logger
6 |
7 | from agentscope.models import ModelWrapperBase
8 | from agentscope.service.service_status import ServiceExecStatus
9 | from agentscope.service.service_response import ServiceResponse
10 | from agentscope.message import Msg
11 | from agentscope.constants import _DEFAULT_SYSTEM_PROMPT
12 | from agentscope.constants import _DEFAULT_TOKEN_LIMIT_PROMPT
13 |
14 |
15 | def summarization(
16 | model: ModelWrapperBase,
17 | text: str,
18 | system_prompt: str = _DEFAULT_SYSTEM_PROMPT,
19 | max_return_token: int = -1,
20 | token_limit_prompt: str = _DEFAULT_TOKEN_LIMIT_PROMPT,
21 | ) -> ServiceResponse:
22 | """Summarize the input text.
23 |
24 | Summarization function (Notice: current version of token limitation is
25 | built with Open AI API)
26 |
27 | Args:
28 | model (`ModelWrapperBase`):
29 | Model used to summarize provided text.
30 | text (`str`):
31 | Text to be summarized by the model.
32 | system_prompt (`str`, defaults to `_DEFAULT_SYSTEM_PROMPT`):
33 | Prompts as instruction for the system, will be as an instruction
34 | for the model.
35 | max_return_token (`int`, defaults to `-1`):
36 | Whether provide additional prompting instruction to limit the
37 | number of tokens in summarization returned by the model.
38 | token_limit_prompt (`str`, defaults to `_DEFAULT_TOKEN_LIMIT_PROMPT`):
39 | Prompt to instruct the model follow token limitation.
40 |
41 | Returns:
42 | `ServiceResponse`: If the model successfully summarized the text, and
43 | the summarization satisfies the provided token limitation, return
44 | `ServiceResponse` with `ServiceExecStatus.SUCCESS`; otherwise return
45 | `ServiceResponse` with `ServiceExecStatus.ERROR` (if the summary is
46 | return successfully but exceed the token limits, the content
47 | contains the summary as well).
48 |
49 | Example:
50 |
51 | The default message with `text` to be summarized:
52 |
53 | .. code-block:: python
54 |
55 | [
56 | {
57 | "role": "system",
58 | "name": "system",
59 | "content": "You are a helpful agent to summarize the text.\\
60 | You need to keep all the key information of the text in the\\
61 | summary."
62 | },
63 | {
64 | "role": "user",
65 | "name": "user",
66 | "content": text
67 | },
68 | ]
69 |
70 | Messages will be processed by model.format() before feeding to models.
71 | """
72 | if max_return_token > 0:
73 | system_prompt += token_limit_prompt.format(max_return_token)
74 | try:
75 | msgs = [
76 | Msg(name="system", role="system", content=system_prompt),
77 | Msg(name="user", role="user", content=text),
78 | ]
79 | msgs = model.format(msgs)
80 | model_output = model(msgs)
81 | summary = model_output.text
82 | return ServiceResponse(
83 | ServiceExecStatus.SUCCESS,
84 | content=summary,
85 | )
86 | except ValueError as e:
87 | logger.exception(e)
88 | return ServiceResponse(
89 | ServiceExecStatus.ERROR,
90 | content=f"Summarization by model {model.model} fail",
91 | )
92 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/css_third_party/drawflow.min.css:
--------------------------------------------------------------------------------
1 | .drawflow, .drawflow .parent-node {
2 | position: relative;
3 | }
4 |
5 | .parent-drawflow {
6 | display: flex;
7 | overflow: hidden;
8 | touch-action: none;
9 | outline: 0;
10 | }
11 |
12 | .drawflow {
13 | width: 100%;
14 | height: 100%;
15 | user-select: none;
16 | }
17 |
18 | .drawflow .drawflow-node {
19 | display: flex;
20 | align-items: center;
21 | position: absolute;
22 | background: #fff;
23 | width: 280px;
24 | min-width: 150px;
25 | height: fit-content;
26 | border-radius: 4px;
27 | border: 1px solid var(--border-color);
28 | color: #000;
29 | z-index: 2;
30 | padding: 15px;
31 | box-shadow: 0 2px 10px 2px var(--border-color);
32 | }
33 |
34 | .drawflow .drawflow-node.selected {
35 | background: var(--main-color-very-light);
36 | border: 1px solid var(--main-color-light);
37 | box-shadow: 0 2px 10px 2px var(--main-color-light);
38 | }
39 |
40 | .drawflow .drawflow-node:hover {
41 | cursor: move;
42 | }
43 |
44 | .drawflow .drawflow-node .inputs, .drawflow .drawflow-node .outputs {
45 | width: 0;
46 | }
47 |
48 | .drawflow .drawflow-node .drawflow_content_node {
49 | width: 100%;
50 | display: block;
51 | }
52 |
53 | .drawflow .drawflow-node .input, .drawflow .drawflow-node .output {
54 | position: relative;
55 | width: 15px;
56 | height: 15px;
57 | background: #fff;
58 | border-radius: 50%;
59 | border: 2px solid var(--border-color);
60 | cursor: crosshair;
61 | z-index: 1;
62 | margin-bottom: 5px;
63 | }
64 |
65 | .drawflow .drawflow-node .input {
66 | left: -27px;
67 | top: 2px;
68 | background: #ff0;
69 | }
70 |
71 | .drawflow .drawflow-node .output {
72 | right: -3px;
73 | top: 2px;
74 | }
75 |
76 | .drawflow svg {
77 | z-index: 0;
78 | }
79 |
80 | .drawflow .connection {
81 | position: absolute;
82 | pointer-events: none;
83 | overflow-x: visible;
84 | overflow-y: visible;
85 | }
86 |
87 | .drawflow .connection .main-path {
88 | fill: none;
89 | stroke-width: 3px;
90 | stroke: var(--main-color);
91 | pointer-events: all;
92 | }
93 |
94 | .drawflow .connection .main-path:hover {
95 | stroke: #1266ab;
96 | cursor: pointer;
97 | }
98 |
99 | .drawflow .connection .main-path.selected {
100 | stroke: #43b993;
101 | }
102 |
103 | .drawflow .connection .point {
104 | cursor: move;
105 | stroke: #000;
106 | stroke-width: 2;
107 | fill: #fff;
108 | pointer-events: all;
109 | }
110 |
111 | .drawflow .connection .point.selected, .drawflow .connection .point:hover {
112 | fill: #1266ab;
113 | }
114 |
115 | .drawflow .main-path {
116 | fill: none;
117 | stroke-width: 5px;
118 | stroke: #4682b4;
119 | }
120 |
121 | .drawflow-delete {
122 | position: absolute;
123 | display: block;
124 | width: 30px;
125 | height: 30px;
126 | background: #ffffff;
127 | color: var(--main-color-light);
128 | z-index: 4;
129 | border: 2px solid var(--main-color-light);
130 | box-shadow: 0 2px 20px 2px var(--main-color-light);
131 | line-height: 30px;
132 | font-weight: 700;
133 | text-align: center;
134 | border-radius: 50%;
135 | font-family: monospace;
136 | cursor: pointer;
137 | }
138 |
139 | .drawflow > .drawflow-delete {
140 | margin-left: -15px;
141 | margin-top: 15px;
142 | }
143 |
144 | .parent-node .drawflow-delete {
145 | right: -15px;
146 | top: -15px;
147 | }
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/css/dashboard-runs.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --runs-content-padding-vertical: 50px;
3 | --runs-content-padding-horizontal: 80px;
4 | --runs-content-control-panel-height: 55px;
5 | --runs-search-input-height: 35px;
6 | --runs-table-height: calc(100% - var(--runs-content-control-panel-height));
7 | }
8 |
9 | #runs-content {
10 | display: flex;
11 | flex-direction: column;
12 | height: 100%;
13 | width: 100%;
14 | padding: var(--runs-content-padding-vertical) var(--runs-content-padding-horizontal);
15 | box-sizing: border-box;
16 | }
17 |
18 | #runs-control-panel {
19 | display: flex;
20 | flex-direction: row;
21 | justify-content: space-between;
22 | align-items: center;
23 | height: var(--runs-content-control-panel-height);
24 | width: 100%;
25 | }
26 |
27 | #runs-table {
28 | flex-grow: 1;
29 | overflow-y: auto;
30 | width: 100%;
31 | height: var(--runs-table-height);
32 | max-height: var(--runs-table-height);
33 | background-color: #ffffff;
34 | border: 1px solid var(--border-color);
35 | }
36 |
37 | #runs-search-input {
38 | display: flex;
39 | height: var(--runs-search-input-height);
40 | flex-grow: 1;
41 | align-items: center;
42 | border: 1px solid var(--border-color);
43 | padding: 0 10px;
44 | }
45 |
46 | #runs-search-input:focus {
47 | border-color: var(--main-color);
48 | outline: none; /* 移除默认的焦点轮廓样式 */
49 | }
50 |
51 | /* Remove border from tabulator */
52 | .tabulator .tabulator-cell,
53 | .tabulator .tabulator-col,
54 | .tabulator .tabulator-header .tabulator-col {
55 | border: none !important;
56 | }
57 |
58 | .tabulator .tabulator-cell {
59 | height: 45px;
60 | }
61 |
62 | /* Remove the bottom border from table header */
63 | .tabulator .tabulator-header {
64 | border-bottom: none !important;
65 | }
66 |
67 | .tabulator-col-sorter-element.tabulator-sortable.tabulator-col {
68 | background-color: var(--main-color-light);
69 | color: var(--main-color-dark);
70 | }
71 |
72 | /* Set the same color for all rows */
73 | /*.tabulator .tabulator-row {*/
74 | /* background-color: #FFF !important; !* Replace by your color *!*/
75 | /*}*/
76 |
77 | /* or, you just want to remove the alternative background color and keep the basic background */
78 | /*.tabulator .tabulator-row:nth-child(even) {*/
79 | /* background-color: var(--main-color-light-light) !important; !* Causes even row background colors to inherit the default or specified row background colors *!*/
80 | /*}*/
81 |
82 | .runs-table-status-tag {
83 | display: flex;
84 | flex-direction: row;
85 | align-items: center;
86 | height: 26px;
87 | width: fit-content;
88 | border-radius: 13px;
89 | color: var(--base-color);
90 | box-sizing: border-box;
91 | margin: 0 5px;
92 | padding: 0 14px;
93 | }
94 |
95 | .running.runs-table-status-tag {
96 | background-color: #d1e7fa;
97 | color: #58c1ef;
98 | fill: #58c1ef;
99 | }
100 |
101 | .finished.runs-table-status-tag {
102 | background-color: var(--main-color-light);
103 | color: var(--main-color-dark);
104 | fill: var(--main-color-dark);
105 | }
106 |
107 | .waiting.runs-table-status-tag {
108 | background-color: #f8efba;
109 | color: #f6b93b;
110 | fill: #f6b93b;
111 | }
112 |
113 | .unknown.runs-table-status-tag {
114 | background-color: #e1e1e1;
115 | color: #3d4047;
116 | fill: #3d4047;
117 | }
118 |
119 | .runs-table-status-svg {
120 | display: flex;
121 | width: 15px;
122 | height: 15px;
123 | margin-right: 7px;
124 | }
125 |
--------------------------------------------------------------------------------
/agentscope-main/src/agentscope/studio/static/html-drag-components/model-openai-chat.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
OpenAI Chat
8 |
9 |
▲
10 |
11 |
12 |
OpenAI Chat Configurations (Your API key will NOT
13 | be stored and exposed to the website
14 | maintainer)
15 |
16 |
17 |
18 |
Config Name
19 |
21 |
22 |
23 |
Model Name
24 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
API key
36 |
37 |
38 |
39 |
Temperature
40 |
42 |
43 |
44 |
Seed
45 |
46 |
47 |
Advanced
48 | ▼
49 |
50 |
51 | Base URL
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------