diff --git a/src/agentscope/studio/static/html-drag-components/model-wanx.html b/src/agentscope/studio/static/html-drag-components/model-wanx.html new file mode 100644 index 000000000..28e8c6d46 --- /dev/null +++ b/src/agentscope/studio/static/html-drag-components/model-wanx.html @@ -0,0 +1,40 @@ +
+
+ + + + Wanx +
+ +
+
+
Wanx Configurations
+
+ +
+ +
+ +
+ +
+ +
+ + + +
+ + + +
+
\ No newline at end of file diff --git a/src/agentscope/studio/static/js/workstation.js b/src/agentscope/studio/static/js/workstation.js index ca5eefd83..dfff2e39d 100644 --- a/src/agentscope/studio/static/js/workstation.js +++ b/src/agentscope/studio/static/js/workstation.js @@ -17,6 +17,7 @@ let nameToHtmlFile = { 'openai_chat': 'model-openai-chat.html', 'post_api_chat': 'model-post-api-chat.html', 'post_api_dall_e': 'model-post-api-dall-e.html', + 'dashscope_image_synthesis': 'model-wanx.html', 'Message': 'message-msg.html', 'DialogAgent': 'agent-dialogagent.html', 'UserAgent': 'agent-useragent.html', @@ -565,6 +566,28 @@ async function addNodeToDrawFlow(name, pos_x, pos_y) { addEventListenersToNumberInputs(post_api_dall_eId); break; + case 'dashscope_image_synthesis': + const dashscope_image_synthesisId = editor.addNode('dashscope_image_synthesis', 0, + 0, + pos_x, pos_y, + 'dashscope_image_synthesis', { + "args": + { + "config_name": '', + "model_name": '', + "generate_args": { + "n": 1, + "size": "", + "temperature": 0.0, + "seed": 0, + }, + "model_type": 'dashscope_image_synthesis', + "messages_key": 'prompt' + } + }, htmlSourceCode); + addEventListenersToNumberInputs(dashscope_image_synthesisId); + break; + // Message case 'Message': editor.addNode('Message', 1, 1, pos_x, diff --git a/src/agentscope/studio/templates/workstation.html b/src/agentscope/studio/templates/workstation.html index 1978aba1f..e9987d127 100644 --- a/src/agentscope/studio/templates/workstation.html +++ b/src/agentscope/studio/templates/workstation.html @@ -161,6 +161,10 @@ data-node="post_api_dall_e" draggable="true" ondragstart="drag(event)">Post API Dall-E +
  • Wanx +
  • @@ -254,7 +258,7 @@
  • - Tool + Service
  • +
  • +
    + Tool +
    + +
  • diff --git a/src/agentscope/web/workstation/workflow_node.py b/src/agentscope/web/workstation/workflow_node.py index b66f48952..5b0d22a94 100644 --- a/src/agentscope/web/workstation/workflow_node.py +++ b/src/agentscope/web/workstation/workflow_node.py @@ -873,6 +873,7 @@ def compile(self) -> dict: "openai_chat": ModelNode, "post_api_chat": ModelNode, "post_api_dall_e": ModelNode, + 'dashscope_image_synthesis': ModelNode, "Message": MsgNode, "DialogAgent": DialogAgentNode, "UserAgent": UserAgentNode,