+ User Prompt
+ {chatbotInteraction.userPrompt}
+ BPMN Process Element
+ {chatbotInteraction.bpmnProcess}
+ Response Content
+
+ {JSON.stringify(chatbotInteraction.chatbotResponse)}
+
+
+ );
+};
+
+export default ChatbotResponseModal;
diff --git a/src/management-system-v2/components/bpmn-chatbot-tools.json b/src/management-system-v2/components/bpmn-chatbot-tools.json
new file mode 100644
index 000000000..808722357
--- /dev/null
+++ b/src/management-system-v2/components/bpmn-chatbot-tools.json
@@ -0,0 +1,67 @@
+[
+ {
+ "name": "append_element",
+ "description": "Create a BPMN element and connect it to an already existing element. The element can either be a task, event or gateway. This automatically places the element and creates a connection from the given source element.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "bpmn_type": {
+ "type": "string",
+ "description": "The BPMN type of the element. Possible types are: 'Task','StartEvent','EndEvent','ExclusiveGateway','InclusiveGateway','ParallelGateway'."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the new element."
+ },
+ "source_element_id_or_name": {
+ "type": "string",
+ "description": "The id or name of the source element which to append to. Use the id if the element already exists in the process, otherwise the name."
+ },
+ "label": {
+ "type": "string",
+ "description": "The label of the connection which is automatically created."
+ }
+ },
+ "required": ["bpmn_type", "name", "source_element_id_or_name"]
+ }
+ },
+ {
+ "name": "create_connection",
+ "description": "Create a connection between two elements. Only needed if the connection has not been created yet.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "source_element_id_or_name": {
+ "type": "string",
+ "description": "The id or name of the source element of the connection. User the id if the element already exists in the process, otherwise the name."
+ },
+ "target_element_id_or_name": {
+ "type": "string",
+ "description": "The id or name of the target element of the connection. User the id if the element already exists in the process, otherwise the name."
+ },
+ "label": {
+ "type": "string",
+ "description": "The optional label of the connection."
+ }
+ },
+ "required": ["source_element_id_or_name", "target_element_id_or_name"]
+ }
+ },
+ {
+ "name": "remove_elements",
+ "description": "Remove BPMN elements. Removing an element with exactly one incomming and one outgoing connection merges the two connections into one. If the deleted element has more than one incomming or outgoing connection all associated connections will be removed. Connections are also considered elements and can be seperately removed too by including their id here.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "element_ids": {
+ "type": "array",
+ "description": "The ids of the elements to be removed.",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": ["element_ids"]
+ }
+ }
+]
diff --git a/src/management-system-v2/components/bpmn-chatbot.tsx b/src/management-system-v2/components/bpmn-chatbot.tsx
new file mode 100644
index 000000000..39d3faab9
--- /dev/null
+++ b/src/management-system-v2/components/bpmn-chatbot.tsx
@@ -0,0 +1,206 @@
+import { BPMNCanvasRef } from '@/components/bpmn-canvas';
+import { Button, Card, Form, Input, List, Space, Tooltip } from 'antd';
+import React, { useState } from 'react';
+import { getNewShapePosition } from 'bpmn-js/lib/features/auto-place/BpmnAutoPlaceUtil';
+import { Element, Shape } from 'bpmn-js/lib/model/Types';
+import { MessageOutlined } from '@ant-design/icons';
+import ChatbotResponseModal, { ChatbotInteraction } from './bpmn-chatbot-response';
+import { sendToAPI } from '@/lib/bpmn-chatbot/bpmnChatbotAPIcommunication';
+
+type ChatbotDialogProps = {
+ show: boolean;
+ modeler: BPMNCanvasRef | null;
+};
+
+type FieldType = {
+ prompt: string;
+};
+
+const ChatbotDialog: React.FC