diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..f9c2e95 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,44 @@ +--- +name: Bug Report +about: Share your findings to help us squash those bugs +title: '' +labels: '' +assignees: '' + +--- + +**What kind of bug is it?** +- [ ] Xircuits Component Library Code +- [ ] Workflow Example +- [ ] Documentation +- [ ] Not Sure + +**Xircuits Version** +Run `pip show xircuits` to get the version, or mention you've used a specific .whl from a branch. + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Tested on?** + +- [ ] Windows +- [ ] Linux Ubuntu +- [ ] Centos +- [ ] Mac +- [ ] Others (State here -> xxx ) + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..7e83d77 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,31 @@ +--- +name: Feature Request +about: Suggest an idea for this component library +title: '' +labels: '' +assignees: '' + +--- + +**Xircuits Version** +Run `pip show xircuits` to get the version, or mention you've used a specific .whl from a branch. + +**What kind of feature is it?** +- [ ] Xircuits Component Library Code +- [ ] Workflow Example +- [ ] Documentation +- [ ] Not Sure + +**Is your feature request related to a problem? Please describe.** + +A clear and concise description of what the problem is. Ex. When I use X feature / when I do Y it does Z. + +**Describe the solution you'd like** + +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6d53741 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,46 @@ +Welcome to Xircuits! Thank you for making a pull request. Please ensure that your pull request follows the template. + +# Description + +Please include a summary which includes relevant motivation and context. You may also describe the code changes. List any dependencies that are required for this change. + +## References + +If applicable, note issue numbers this pull request addresses. You can also note any other pull requests that address this issue and how this pull request is different. + +## Pull Request Type + +- [ ] Xircuits Component Library Code +- [ ] Workflow Example +- [ ] Documentation +- [ ] Others (Please Specify) + +## Type of Change + +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +# Tests + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. + +**1. Test A** + + 1. First step + 2. Second step + 3. ... + + +## Tested on? + +- [ ] Windows +- [ ] Linux Ubuntu +- [ ] Centos +- [ ] Mac +- [ ] Others (State here -> xxx ) + +# Notes + +Add if any. diff --git a/.github/workflows/run-workflow-tests.yml b/.github/workflows/run-workflow-tests.yml new file mode 100644 index 0000000..db111e0 --- /dev/null +++ b/.github/workflows/run-workflow-tests.yml @@ -0,0 +1,134 @@ +name: Run Xircuits Workflows Test + +on: + push: + branches: [ main ] + pull_request: + branches: "*" + workflow_dispatch: + +jobs: + build-and-run: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + env: + TEST_XIRCUITS: | + examples/multion_example.xircuits + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Create virtual environment + run: | + python -m venv venv + echo "${{ github.workspace }}/venv/bin" >> $GITHUB_PATH + + - name: Install xircuits in virtual environment + run: pip install xircuits + + - name: Set Environment Variables + run: | + LIBRARY_NAME=$(echo "${GITHUB_REPOSITORY##*/}" | sed 's/-/_/g') + echo "LIBRARY_NAME=$LIBRARY_NAME" >> $GITHUB_ENV + COMPONENT_LIBRARY_PATH="xai_components/${LIBRARY_NAME}" + echo "COMPONENT_LIBRARY_PATH=$COMPONENT_LIBRARY_PATH" >> $GITHUB_ENV + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + fi + + - name: List Xircuits + run: xircuits list + + - name: Clone Repository + run: | + rm -rf ${{ env.COMPONENT_LIBRARY_PATH }} + if [ "${{ github.event_name }}" == "pull_request" ]; then + REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}" + else + REPO_URL="https://github.com/${{ github.repository }}" + fi + git clone -b ${{ env.BRANCH_NAME }} $REPO_URL ${{ env.COMPONENT_LIBRARY_PATH }} + + - name: Install Component Library + run: | + if [ -f "${{ env.COMPONENT_LIBRARY_PATH }}/requirements.txt" ]; then + echo "requirements.txt found, installing dependencies..." + pip install -r ${{ env.COMPONENT_LIBRARY_PATH }}/requirements.txt + else + echo "requirements.txt not found." + fi + + - name: Install Selenium and other dependencies + run: | + python -m pip install --upgrade pip + pip install selenium + + - name: Verify Chrome and ChromeDriver + run: | + echo "Chrome version:" + google-chrome --version + echo "ChromeDriver version:" + chromedriver --version + + - name: Test .xircuits Workflows + run: | + export PYTHONPATH="${GITHUB_WORKSPACE}:${PYTHONPATH}" + LOG_FILE="${GITHUB_WORKSPACE}/workflow_logs.txt" + TEST_FILES=$(echo "$TEST_XIRCUITS" | tr '\n' ' ') + echo "Repository: $LIBRARY_NAME" > $LOG_FILE + echo "Branch: $BRANCH_NAME" >> $LOG_FILE + + # Get the server token for GitHub secret if any + API_KEY="${{ secrets.API_KEY }}" + + echo -e "Testing Files:\n$TEST_FILES" >> $LOG_FILE + IFS=' ' read -r -a FILE_ARRAY <<< "$TEST_FILES" + FAIL=0 + if [ ${#FILE_ARRAY[@]} -eq 0 ]; then + echo "No .xircuits files specified for testing." | tee -a $LOG_FILE + else + for file in "${FILE_ARRAY[@]}"; do + FULL_PATH="${COMPONENT_LIBRARY_PATH}/${file}" + if [ -f "$FULL_PATH" ]; then + WORKFLOW_LOG_FILE="${FULL_PATH%.*}_workflow_log.txt" + echo -e "\n\nProcessing $FULL_PATH..." | tee -a $LOG_FILE + xircuits compile $FULL_PATH "${FULL_PATH%.*}.py" 2>&1 | tee -a $LOG_FILE + python "${FULL_PATH%.*}.py" --api_key "$API_KEY" 2>&1 | tee -a $WORKFLOW_LOG_FILE + LAST_LINE=$(tail -n 1 "$WORKFLOW_LOG_FILE") + if [[ "$LAST_LINE" != "Finished Executing" ]]; then + echo "Error: Workflow $FULL_PATH did not finish as expected" | tee -a $LOG_FILE + FAIL=1 + else + echo "$FULL_PATH processed successfully" | tee -a $LOG_FILE + fi + cat "$WORKFLOW_LOG_FILE" | tee -a $LOG_FILE + else + echo "Specified file $FULL_PATH does not exist" | tee -a $LOG_FILE + FAIL=1 + fi + done + fi + if [ $FAIL -ne 0 ]; then + echo "One or more workflows failed or did not finish as expected." | tee -a $LOG_FILE + exit 1 + else + echo "Workflow processing completed" | tee -a $LOG_FILE + fi + + - name: Upload log file + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ env.LIBRARY_NAME }}-validation-workflow-${{ matrix.python-version }} + path: ${{ github.workspace }}/workflow_logs.txt diff --git a/multion_example.xircuits b/examples/multion_example.xircuits similarity index 58% rename from multion_example.xircuits rename to examples/multion_example.xircuits index 16d6a01..b878789 100644 --- a/multion_example.xircuits +++ b/examples/multion_example.xircuits @@ -1,12 +1,12 @@ { "id": "b17c7037-3be5-48ad-8b38-964a81efe48d", - "offsetX": 15.145277207981962, - "offsetY": 41.15406673332858, + "offsetX": 150.14527720798196, + "offsetY": 69.15406673332859, "zoom": 99.88333333333334, "gridSize": 0, "layers": [ { - "id": "b7137a35-ca93-44a1-8945-002cfd31eef9", + "id": "a600e145-80e2-4b2e-8d64-5ec3bcfd1945", "type": "diagram-links", "isSvg": true, "transformed": true, @@ -17,20 +17,20 @@ "selected": false, "source": "f51921a7-b4d8-438f-b085-cdc92cb4c681", "sourcePort": "0acb1c89-a296-4a4c-b47c-b3776da716c1", - "target": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", - "targetPort": "04b52f66-844f-4d86-8196-c26cbc8693a9", + "target": "8b44a279-d493-4384-b938-999f5633c8f3", + "targetPort": "5519f03f-425f-44c5-afa4-c1ccae4aca64", "points": [ { "id": "fe9cccb3-2220-4582-b632-68c4a90d09a0", "type": "point", - "x": 131.5, - "y": 135 + "x": 167.74997982312516, + "y": 137.10001188924582 }, { "id": "882bcb43-666d-4aa1-be83-81a64940d4db", "type": "point", - "x": 215.312, - "y": 137.25 + "x": 214.91248565675397, + "y": 139.35002479034446 } ], "labels": [], @@ -43,22 +43,22 @@ "id": "db48baa1-7606-4705-ad52-faf803debdd9", "type": "triangle-link", "selected": false, - "source": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", - "sourcePort": "dcdea7f9-c53a-401b-aa2e-9f3c04ed008e", - "target": "8dc60790-07b3-49a3-86fa-f609665cd279", - "targetPort": "db324868-215f-4427-9051-bdb2940143b0", + "source": "8b44a279-d493-4384-b938-999f5633c8f3", + "sourcePort": "8ef36919-e239-4f0b-ae2c-e6fbd84db3d0", + "target": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "targetPort": "983b3c4b-6efe-4db8-acea-34bd381ab3f1", "points": [ { "id": "bb3ecb45-62ce-49c5-8666-a6030bbf7de5", "type": "point", - "x": 304.234, - "y": 137.25 + "x": 332.9375469027275, + "y": 139.35002479034446 }, { "id": "32f54883-a3b0-4f01-8453-ff0d824433c6", "type": "point", - "x": 478.828, - "y": 179.172 + "x": 478.42499504270427, + "y": 181.27500538293685 } ], "labels": [], @@ -67,26 +67,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "831b42ad-bdd9-4556-9191-8c51fff47cf7": { - "id": "831b42ad-bdd9-4556-9191-8c51fff47cf7", + "e9f6ea77-0a82-40a7-9c19-925ee24bbd66": { + "id": "e9f6ea77-0a82-40a7-9c19-925ee24bbd66", "type": "parameter-link", "selected": false, - "source": "e297ff59-f5df-417f-b637-8493659a4713", - "sourcePort": "45fb4a8d-240a-4bdd-b628-e58cc2956c23", - "target": "8dc60790-07b3-49a3-86fa-f609665cd279", - "targetPort": "cae6c93e-6588-4b15-b325-2c283b8f895d", + "source": "381c92c7-e5da-42d4-af6b-66933b12c23a", + "sourcePort": "fafa65b5-719c-4574-ade9-a02772056e50", + "target": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "targetPort": "46aaabe5-ce01-47d4-a0fa-d0b4d1cdc62b", "points": [ { - "id": "599a5edf-54d6-4921-91f5-75d5e299855b", + "id": "cf980cfd-246f-4a21-ae6b-e6cbcad6bc63", "type": "point", - "x": 370.219, - "y": 329.898 + "x": 366.04999439090216, + "y": 407.8500175645071 }, { - "id": "3eff5786-9744-49ce-b111-8b9feae3ca33", + "id": "e688b890-df26-4cac-abeb-b6b6aca0c7f2", "type": "point", - "x": 478.828, - "y": 201.172 + "x": 478.42499504270427, + "y": 224.4750025475977 } ], "labels": [], @@ -95,26 +95,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "e9f6ea77-0a82-40a7-9c19-925ee24bbd66": { - "id": "e9f6ea77-0a82-40a7-9c19-925ee24bbd66", - "type": "parameter-link", + "375805db-f0f2-4b63-a4c1-dc83658783f9": { + "id": "375805db-f0f2-4b63-a4c1-dc83658783f9", + "type": "triangle-link", "selected": false, - "source": "77d86a6a-0d88-4f33-af9a-3ae8071b56e9", - "sourcePort": "7bd117a7-9128-4df9-b597-9511b5babfe9", - "target": "8dc60790-07b3-49a3-86fa-f609665cd279", - "targetPort": "499895ea-f90b-44a3-bd83-398f56e1a18c", + "source": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "sourcePort": "812a84dd-6f18-469f-86d0-c34387ff5f2c", + "target": "db078a85-e228-4d4d-8a0c-94f592d9957b", + "targetPort": "6e47fa89-3a49-4c59-ab95-dfa400e0af1c", "points": [ { - "id": "cf980cfd-246f-4a21-ae6b-e6cbcad6bc63", + "id": "05fbcb51-8203-4c2c-8454-d5f1473a2f31", "type": "point", - "x": 366.453, - "y": 408.75 + "x": 682.1376353756968, + "y": 181.27500538293685 }, { - "id": "e688b890-df26-4cac-abeb-b6b6aca0c7f2", + "id": "c3fa34e6-9839-4771-92d5-3139c6cfdf9b", "type": "point", - "x": 478.828, - "y": 223.172 + "x": 806.8250962675706, + "y": 159.22501892412552 } ], "labels": [], @@ -123,26 +123,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "09cfcac8-0b58-4e33-b32a-77469c97c631": { - "id": "09cfcac8-0b58-4e33-b32a-77469c97c631", + "d632fdb4-4969-4202-9c84-7ed462a4d634": { + "id": "d632fdb4-4969-4202-9c84-7ed462a4d634", "type": "parameter-link", "selected": false, - "source": "e89c37db-f79f-47ce-a629-0a694c4df807", - "sourcePort": "e364ab78-b5c7-413c-806b-43808c51dd1b", - "target": "8dc60790-07b3-49a3-86fa-f609665cd279", - "targetPort": "863914a1-f39f-4027-b467-e1b1ee26f5b4", + "source": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "sourcePort": "3ff9aca7-7004-4462-ae12-c04870461d2a", + "target": "db078a85-e228-4d4d-8a0c-94f592d9957b", + "targetPort": "9a4c7be6-ce2d-4d95-82e6-eb0402da35e1", "points": [ { - "id": "e53032ef-0e74-4357-8e92-fbf5c0e441c7", + "id": "ed6c018a-5d2d-4139-bd6b-a0c48e0e276d", "type": "point", - "x": 354.562, - "y": 490.602 + "x": 682.1376353756968, + "y": 224.4750025475977 }, { - "id": "e52af7a8-7502-4571-aaed-ba9bebd0c202", + "id": "abb15260-1072-440a-892b-8f940795506c", "type": "point", - "x": 478.828, - "y": 245.172 + "x": 806.8250962675706, + "y": 180.82501750645596 } ], "labels": [], @@ -151,26 +151,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "375805db-f0f2-4b63-a4c1-dc83658783f9": { - "id": "375805db-f0f2-4b63-a4c1-dc83658783f9", + "bc0740a1-7649-4dae-9512-dabb043af033": { + "id": "bc0740a1-7649-4dae-9512-dabb043af033", "type": "triangle-link", "selected": false, - "source": "8dc60790-07b3-49a3-86fa-f609665cd279", - "sourcePort": "a475f3a5-c391-4165-85c8-0989befca445", - "target": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", - "targetPort": "a927f1ab-9d71-4a7e-ac16-26f886542152", + "source": "db078a85-e228-4d4d-8a0c-94f592d9957b", + "sourcePort": "88dedac5-0b09-464f-9f75-b62475eaee70", + "target": "51236373-134c-4ad7-846a-3d77d8090877", + "targetPort": "e372b049-879a-41df-b9f5-535d98f8face", "points": [ { - "id": "05fbcb51-8203-4c2c-8454-d5f1473a2f31", + "id": "d1530f93-dc68-4b45-a3ef-0e90ad3702cc", "type": "point", - "x": 685.133, - "y": 179.172 + "x": 879.8625771697691, + "y": 159.22501892412552 }, { - "id": "c3fa34e6-9839-4771-92d5-3139c6cfdf9b", + "id": "892eea34-501d-43cb-b15f-97258466cfb1", "type": "point", - "x": 807.227, - "y": 157.125 + "x": 977.0750641943243, + "y": 181.11252334008478 } ], "labels": [], @@ -179,26 +179,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "d632fdb4-4969-4202-9c84-7ed462a4d634": { - "id": "d632fdb4-4969-4202-9c84-7ed462a4d634", + "aa5c7033-3286-4692-a170-9a0981c7ea15": { + "id": "aa5c7033-3286-4692-a170-9a0981c7ea15", "type": "parameter-link", "selected": false, - "source": "8dc60790-07b3-49a3-86fa-f609665cd279", - "sourcePort": "e87b54f7-64a5-4933-8c67-9f770975c025", - "target": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", - "targetPort": "1b14f5bc-f160-44eb-8ee0-3163d59d0587", + "source": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "sourcePort": "ce3b4d03-aa0d-43a8-98e1-e8e479e23d2b", + "target": "51236373-134c-4ad7-846a-3d77d8090877", + "targetPort": "a3b548d7-60c1-4b81-9c21-dd6a1c8693b0", "points": [ { - "id": "ed6c018a-5d2d-4139-bd6b-a0c48e0e276d", + "id": "74617a53-9647-40a7-bb2e-dfc73b496db2", "type": "point", - "x": 685.133, - "y": 223.172 + "x": 682.1376353756968, + "y": 289.27502884781256 }, { - "id": "abb15260-1072-440a-892b-8f940795506c", + "id": "a450653c-9e61-44f7-84b6-4d1bb358bdec", "type": "point", - "x": 807.227, - "y": 179.125 + "x": 977.0750641943243, + "y": 202.7125219224152 } ], "labels": [], @@ -207,26 +207,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "bc0740a1-7649-4dae-9512-dabb043af033": { - "id": "bc0740a1-7649-4dae-9512-dabb043af033", + "1763ff04-e411-42ae-829d-dd548c0443b7": { + "id": "1763ff04-e411-42ae-829d-dd548c0443b7", "type": "triangle-link", "selected": false, - "source": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", - "sourcePort": "57f45113-ad33-44ed-be2d-b5988abdcf47", - "target": "8420c721-202c-4eea-b852-aecfc4adaf22", - "targetPort": "d57d2168-73f9-405f-8cfc-c4ec9af2b6a7", + "source": "51236373-134c-4ad7-846a-3d77d8090877", + "sourcePort": "977749b9-bd9c-422c-a1b1-1d527331957a", + "target": "1ac1afa9-1dc1-4021-be19-f072f178dfbe", + "targetPort": "0e9c84be-5680-4b2e-8e36-7439e779bddb", "points": [ { - "id": "d1530f93-dc68-4b45-a3ef-0e90ad3702cc", + "id": "a27fc6b3-a71c-4c27-9253-c66a14597fab", "type": "point", - "x": 879.008, - "y": 157.125 + "x": 1050.1125937907227, + "y": 181.11252334008478 }, { - "id": "892eea34-501d-43cb-b15f-97258466cfb1", + "id": "2116af47-e624-46bb-b578-1d6efd91c80c", "type": "point", - "x": 977.477, - "y": 179.008 + "x": 1187.4751692739892, + "y": 166.0500285545016 } ], "labels": [], @@ -235,26 +235,26 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "aa5c7033-3286-4692-a170-9a0981c7ea15": { - "id": "aa5c7033-3286-4692-a170-9a0981c7ea15", + "4e565226-c965-4ff2-ac39-9faac2d35bf0": { + "id": "4e565226-c965-4ff2-ac39-9faac2d35bf0", "type": "parameter-link", "selected": false, - "source": "8dc60790-07b3-49a3-86fa-f609665cd279", - "sourcePort": "f9413bf6-606c-4b95-af0c-20e675ddebd5", - "target": "8420c721-202c-4eea-b852-aecfc4adaf22", - "targetPort": "106f8aea-6ae4-4bba-91f2-26058e1b549d", + "source": "9a9e6736-ecc0-4426-bca0-4917d72fd081", + "sourcePort": "f5c3532c-602c-4f20-9cab-f8af53953103", + "target": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "targetPort": "bfd7ffd8-5f36-46d4-872f-78049d5da43b", "points": [ { - "id": "74617a53-9647-40a7-bb2e-dfc73b496db2", + "id": "3b712bd2-f84a-4de4-98f8-3acd313ca865", "type": "point", - "x": 685.133, - "y": 289.172 + "x": 360.5625132279829, + "y": 489.70005066688793 }, { - "id": "a450653c-9e61-44f7-84b6-4d1bb358bdec", + "id": "4464c0ba-e9be-4de6-8627-351ad7e5bec7", "type": "point", - "x": 977.477, - "y": 201.008 + "x": 478.42499504270427, + "y": 246.07503168315168 } ], "labels": [], @@ -263,26 +263,54 @@ "curvyness": 50, "selectedColor": "rgb(0,192,255)" }, - "1763ff04-e411-42ae-829d-dd548c0443b7": { - "id": "1763ff04-e411-42ae-829d-dd548c0443b7", - "type": "triangle-link", + "b63b7140-80b4-41a9-9b58-c04123b14e96": { + "id": "b63b7140-80b4-41a9-9b58-c04123b14e96", + "type": "parameter-link", "selected": false, - "source": "8420c721-202c-4eea-b852-aecfc4adaf22", - "sourcePort": "8cc1b9ce-dcfe-4794-805d-68774edd6426", - "target": "7cd6a658-ed83-4e69-8ad7-852721a981fd", - "targetPort": "4fdd0734-a9db-4cb7-b738-69d2dcf474e9", + "source": "108e64c7-1e4c-4845-adcc-d8c223d2ff4b", + "sourcePort": "310ac508-e96a-4a4f-aa20-ac3541353ada", + "target": "8218d13f-46bb-4239-b465-f6eab32e4e89", + "targetPort": "518a93e2-ad13-4bd2-ade8-04c23e4dc778", "points": [ { - "id": "a27fc6b3-a71c-4c27-9253-c66a14597fab", + "id": "8a90e9f1-1d16-4a80-84dc-0d0173a41317", "type": "point", - "x": 1049.258, - "y": 179.008 + "x": 383.2625195178732, + "y": 328.99999975401465 }, { - "id": "2116af47-e624-46bb-b578-1d6efd91c80c", + "id": "a0c5358e-0250-442c-933b-dfec01c10b48", "type": "point", - "x": 1187.875, - "y": 163.945 + "x": 478.42499504270427, + "y": 202.87500396526727 + } + ], + "labels": [], + "width": 3, + "color": "gray", + "curvyness": 50, + "selectedColor": "rgb(0,192,255)" + }, + "50db25b0-d099-4aac-bfba-cec73f29c775": { + "id": "50db25b0-d099-4aac-bfba-cec73f29c775", + "type": "triangle-link", + "selected": true, + "source": "65330cb2-ae25-4b0e-8d81-46d0e6fb92c1", + "sourcePort": "ee367b32-6e89-48a9-9ec9-cf01df36ab5f", + "target": "8b44a279-d493-4384-b938-999f5633c8f3", + "targetPort": "3bb823d7-c226-46b4-9f39-0298ce05cef7", + "points": [ + { + "id": "92a08aab-e459-4c5e-a125-7822a25e5168", + "type": "point", + "x": 111.72502264652329, + "y": 207.13751473629702 + }, + { + "id": "be7dd8f3-341c-4e7d-bd69-cd8594940fbd", + "type": "point", + "x": 214.91248565675397, + "y": 160.9500109604278 } ], "labels": [], @@ -294,7 +322,7 @@ } }, { - "id": "4b1ec0bd-6e85-4d87-8120-b44796b0fd28", + "id": "1c4c5243-bc56-4fe4-abd2-8c97f7d48ce4", "type": "diagram-nodes", "isSvg": false, "transformed": true, @@ -314,8 +342,8 @@ "id": "0acb1c89-a296-4a4c-b47c-b3776da716c1", "type": "default", "extras": {}, - "x": 121, - "y": 124.5, + "x": 157.44997448751388, + "y": 126.8000189658816, "name": "out-0", "alignment": "right", "parentNode": "f51921a7-b4d8-438f-b085-cdc92cb4c681", @@ -336,26 +364,25 @@ "0acb1c89-a296-4a4c-b47c-b3776da716c1" ] }, - "7cd6a658-ed83-4e69-8ad7-852721a981fd": { - "id": "7cd6a658-ed83-4e69-8ad7-852721a981fd", + "1ac1afa9-1dc1-4021-be19-f072f178dfbe": { + "id": "1ac1afa9-1dc1-4021-be19-f072f178dfbe", "type": "custom-node", "selected": false, "extras": { - "type": "Finish", - "borderColor": "rgb(0,192,255)" + "type": "Finish" }, "x": 1176.379, "y": 128.951, "ports": [ { - "id": "4fdd0734-a9db-4cb7-b738-69d2dcf474e9", + "id": "0e9c84be-5680-4b2e-8e36-7439e779bddb", "type": "default", "extras": {}, - "x": 1177.375, - "y": 153.445, + "x": 1177.175115244178, + "y": 155.75002321889033, "name": "in-0", "alignment": "left", - "parentNode": "7cd6a658-ed83-4e69-8ad7-852721a981fd", + "parentNode": "1ac1afa9-1dc1-4021-be19-f072f178dfbe", "links": [ "1763ff04-e411-42ae-829d-dd548c0443b7" ], @@ -366,14 +393,14 @@ "dataType": "" }, { - "id": "445048a6-b18f-4ed2-be06-681c10dbbbdf", + "id": "9702d4b0-d323-4486-a77f-086b9a5d04c4", "type": "default", "extras": {}, - "x": 1177.375, - "y": 175.445, + "x": 1177.175115244178, + "y": 177.35002180122075, "name": "parameter-dynalist-outputs", "alignment": "left", - "parentNode": "7cd6a658-ed83-4e69-8ad7-852721a981fd", + "parentNode": "1ac1afa9-1dc1-4021-be19-f072f178dfbe", "links": [], "in": true, "label": "outputs", @@ -390,23 +417,23 @@ "name": "Finish", "color": "rgb(255,102,102)", "portsInOrder": [ - "4fdd0734-a9db-4cb7-b738-69d2dcf474e9", - "445048a6-b18f-4ed2-be06-681c10dbbbdf" + "0e9c84be-5680-4b2e-8e36-7439e779bddb", + "9702d4b0-d323-4486-a77f-086b9a5d04c4" ], "portsOutOrder": [] }, - "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3": { - "id": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", + "8b44a279-d493-4384-b938-999f5633c8f3": { + "id": "8b44a279-d493-4384-b938-999f5633c8f3", "type": "custom-node", "selected": false, "extras": { - "type": "debug", + "type": "library_component", "path": "xai_components/xai_multion/multion_components.py", "description": null, "lineNo": [ { - "lineno": 12, - "end_lineno": 17 + "lineno": 10, + "end_lineno": 16 } ], "borderColor": "rgb(0,192,255)" @@ -415,14 +442,14 @@ "y": 102.252, "ports": [ { - "id": "04b52f66-844f-4d86-8196-c26cbc8693a9", + "id": "5519f03f-425f-44c5-afa4-c1ccae4aca64", "type": "default", "extras": {}, - "x": 204.812, - "y": 126.75, + "x": 204.6124803211427, + "y": 129.0500194547332, "name": "in-0", "alignment": "left", - "parentNode": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", + "parentNode": "8b44a279-d493-4384-b938-999f5633c8f3", "links": [ "4cdb620f-d9e5-4482-9459-e486839206ce" ], @@ -433,15 +460,17 @@ "dataType": "" }, { - "id": "a5bae7f2-ed09-44e4-ad02-11f2dda0fc73", + "id": "3bb823d7-c226-46b4-9f39-0298ce05cef7", "type": "default", "extras": {}, - "x": 204.812, - "y": 148.75, + "x": 204.6124803211427, + "y": 150.6500180370636, "name": "parameter-secret-api_key", "alignment": "left", - "parentNode": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", - "links": [], + "parentNode": "8b44a279-d493-4384-b938-999f5633c8f3", + "links": [ + "50db25b0-d099-4aac-bfba-cec73f29c775" + ], "in": true, "label": "api_key", "varName": "api_key", @@ -449,14 +478,14 @@ "dataType": "secret" }, { - "id": "dcdea7f9-c53a-401b-aa2e-9f3c04ed008e", + "id": "8ef36919-e239-4f0b-ae2c-e6fbd84db3d0", "type": "default", "extras": {}, - "x": 293.734, - "y": 126.75, + "x": 322.63756639161033, + "y": 129.0500194547332, "name": "out-0", "alignment": "right", - "parentNode": "4eace8f5-0d5c-4fd9-9cc5-cd504d77d4c3", + "parentNode": "8b44a279-d493-4384-b938-999f5633c8f3", "links": [ "db48baa1-7606-4705-ad52-faf803debdd9" ], @@ -468,70 +497,35 @@ } ], "name": "MultiOnLogin", - "color": "rgb(153,51,204)", + "color": "rgb(0,102,204)", "portsInOrder": [ - "04b52f66-844f-4d86-8196-c26cbc8693a9", - "a5bae7f2-ed09-44e4-ad02-11f2dda0fc73" + "5519f03f-425f-44c5-afa4-c1ccae4aca64", + "3bb823d7-c226-46b4-9f39-0298ce05cef7" ], "portsOutOrder": [ - "dcdea7f9-c53a-401b-aa2e-9f3c04ed008e" + "8ef36919-e239-4f0b-ae2c-e6fbd84db3d0" ] }, - "e297ff59-f5df-417f-b637-8493659a4713": { - "id": "e297ff59-f5df-417f-b637-8493659a4713", + "381c92c7-e5da-42d4-af6b-66933b12c23a": { + "id": "381c92c7-e5da-42d4-af6b-66933b12c23a", "type": "custom-node", "selected": false, "extras": { - "type": "string" - }, - "x": 125.958, - "y": 294.9, - "ports": [ - { - "id": "45fb4a8d-240a-4bdd-b628-e58cc2956c23", - "type": "default", - "extras": {}, - "x": 359.719, - "y": 319.398, - "name": "out-0", - "alignment": "right", - "parentNode": "e297ff59-f5df-417f-b637-8493659a4713", - "links": [ - "831b42ad-bdd9-4556-9191-8c51fff47cf7" - ], - "in": false, - "label": "How many followers does Elon Musk have?", - "varName": "How many followers does Elon Musk have?", - "portType": "", - "dataType": "" - } - ], - "name": "Literal String", - "color": "lightpink", - "portsInOrder": [], - "portsOutOrder": [ - "45fb4a8d-240a-4bdd-b628-e58cc2956c23" - ] - }, - "77d86a6a-0d88-4f33-af9a-3ae8071b56e9": { - "id": "77d86a6a-0d88-4f33-af9a-3ae8071b56e9", - "type": "custom-node", - "selected": false, - "extras": { - "type": "string" + "type": "string", + "attached": false }, "x": 218.787, "y": 373.755, "ports": [ { - "id": "7bd117a7-9128-4df9-b597-9511b5babfe9", + "id": "fafa65b5-719c-4574-ade9-a02772056e50", "type": "default", "extras": {}, - "x": 355.953, - "y": 398.25, + "x": 355.7499890552909, + "y": 397.55003705338993, "name": "out-0", "alignment": "right", - "parentNode": "77d86a6a-0d88-4f33-af9a-3ae8071b56e9", + "parentNode": "381c92c7-e5da-42d4-af6b-66933b12c23a", "links": [ "e9f6ea77-0a82-40a7-9c19-925ee24bbd66" ], @@ -539,80 +533,43 @@ "label": "https://www.google.com", "varName": "https://www.google.com", "portType": "", - "dataType": "" + "dataType": "string" } ], "name": "Literal String", "color": "lightpink", "portsInOrder": [], "portsOutOrder": [ - "7bd117a7-9128-4df9-b597-9511b5babfe9" - ] - }, - "e89c37db-f79f-47ce-a629-0a694c4df807": { - "id": "e89c37db-f79f-47ce-a629-0a694c4df807", - "type": "custom-node", - "selected": false, - "extras": { - "type": "boolean" - }, - "x": 280.674, - "y": 455.605, - "ports": [ - { - "id": "e364ab78-b5c7-413c-806b-43808c51dd1b", - "type": "default", - "extras": {}, - "x": 344.062, - "y": 480.102, - "name": "out-0", - "alignment": "right", - "parentNode": "e89c37db-f79f-47ce-a629-0a694c4df807", - "links": [ - "09cfcac8-0b58-4e33-b32a-77469c97c631" - ], - "in": false, - "label": "True", - "varName": "True", - "portType": "", - "dataType": "" - } - ], - "name": "Literal Boolean", - "color": "red", - "portsInOrder": [], - "portsOutOrder": [ - "e364ab78-b5c7-413c-806b-43808c51dd1b" + "fafa65b5-719c-4574-ade9-a02772056e50" ] }, - "8dc60790-07b3-49a3-86fa-f609665cd279": { - "id": "8dc60790-07b3-49a3-86fa-f609665cd279", + "8218d13f-46bb-4239-b465-f6eab32e4e89": { + "id": "8218d13f-46bb-4239-b465-f6eab32e4e89", "type": "custom-node", "selected": false, "extras": { - "type": "debug", + "type": "library_component", "path": "xai_components/xai_multion/multion_components.py", "description": null, "lineNo": [ { - "lineno": 19, - "end_lineno": 50 + "lineno": 20, + "end_lineno": 51 } - ], - "borderColor": "rgb(0,192,255)" + ] }, "x": 467.332, "y": 144.176, "ports": [ { - "id": "db324868-215f-4427-9051-bdb2940143b0", + "id": "983b3c4b-6efe-4db8-acea-34bd381ab3f1", "type": "default", "extras": {}, - "x": 468.328, - "y": 168.672, + "x": 468.124989707093, + "y": 170.97500004732558, "name": "in-0", "alignment": "left", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ "db48baa1-7606-4705-ad52-faf803debdd9" ], @@ -623,16 +580,16 @@ "dataType": "" }, { - "id": "cae6c93e-6588-4b15-b325-2c283b8f895d", + "id": "518a93e2-ad13-4bd2-ade8-04c23e4dc778", "type": "default", "extras": {}, - "x": 468.328, - "y": 190.672, + "x": 468.124989707093, + "y": 192.574998629656, "name": "parameter-string-input_prompt", "alignment": "left", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ - "831b42ad-bdd9-4556-9191-8c51fff47cf7" + "b63b7140-80b4-41a9-9b58-c04123b14e96" ], "in": true, "label": "★input_prompt", @@ -641,14 +598,14 @@ "dataType": "string" }, { - "id": "499895ea-f90b-44a3-bd83-398f56e1a18c", + "id": "46aaabe5-ce01-47d4-a0fa-d0b4d1cdc62b", "type": "default", "extras": {}, - "x": 468.328, - "y": 212.672, + "x": 468.124989707093, + "y": 214.17499721198644, "name": "parameter-string-url", "alignment": "left", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ "e9f6ea77-0a82-40a7-9c19-925ee24bbd66" ], @@ -659,16 +616,16 @@ "dataType": "string" }, { - "id": "863914a1-f39f-4027-b467-e1b1ee26f5b4", + "id": "bfd7ffd8-5f36-46d4-872f-78049d5da43b", "type": "default", "extras": {}, - "x": 468.328, - "y": 234.672, + "x": 468.124989707093, + "y": 235.7750263475404, "name": "parameter-boolean-local", "alignment": "left", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ - "09cfcac8-0b58-4e33-b32a-77469c97c631" + "4e565226-c965-4ff2-ac39-9faac2d35bf0" ], "in": true, "label": "★local", @@ -677,14 +634,14 @@ "dataType": "boolean" }, { - "id": "7a73a255-c79e-469b-b7fc-15530eee38c1", + "id": "3f89b08b-01cd-4e20-8409-41a95430ff50", "type": "default", "extras": {}, - "x": 468.328, - "y": 256.672, + "x": 468.124989707093, + "y": 257.37502492987085, "name": "parameter-int-max_steps", "alignment": "left", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": true, "label": "max_steps", @@ -693,14 +650,14 @@ "dataType": "int" }, { - "id": "a475f3a5-c391-4165-85c8-0989befca445", + "id": "812a84dd-6f18-469f-86d0-c34387ff5f2c", "type": "default", "extras": {}, - "x": 674.633, - "y": 168.672, + "x": 671.8376300400856, + "y": 170.97500004732558, "name": "out-0", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ "375805db-f0f2-4b63-a4c1-dc83658783f9" ], @@ -711,30 +668,30 @@ "dataType": "" }, { - "id": "f213e3a5-989e-462d-9323-5baa60f83505", + "id": "4d3df0e9-e669-4b5d-a807-b84436645857", "type": "default", "extras": {}, - "x": 674.633, - "y": 190.672, + "x": 671.8376300400856, + "y": 192.574998629656, "name": "parameter-out-string-session_id", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": false, "label": "session_id", "varName": "session_id", "portType": "", - "dataType": "" + "dataType": "string" }, { - "id": "e87b54f7-64a5-4933-8c67-9f770975c025", + "id": "3ff9aca7-7004-4462-ae12-c04870461d2a", "type": "default", "extras": {}, - "x": 674.633, - "y": 212.672, + "x": 671.8376300400856, + "y": 214.17499721198644, "name": "parameter-out-string-out_message", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ "d632fdb4-4969-4202-9c84-7ed462a4d634" ], @@ -742,49 +699,49 @@ "label": "out_message", "varName": "out_message", "portType": "", - "dataType": "" + "dataType": "string" }, { - "id": "00ef45f0-bc3f-49c2-9061-7d768e7dab28", + "id": "82c60269-7481-47b7-a20a-d620550791c8", "type": "default", "extras": {}, - "x": 674.633, - "y": 234.672, + "x": 671.8376300400856, + "y": 235.7750263475404, "name": "parameter-out-string-status", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": false, "label": "status", "varName": "status", "portType": "", - "dataType": "" + "dataType": "string" }, { - "id": "6ff80e05-0c84-4e9f-8ee4-6fd716f96378", + "id": "7cee7a8e-10b1-4ba5-bbda-0f9955b1c6a7", "type": "default", "extras": {}, - "x": 674.633, - "y": 256.672, + "x": 671.8376300400856, + "y": 257.37502492987085, "name": "parameter-out-string-final_url", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": false, "label": "final_url", "varName": "final_url", "portType": "", - "dataType": "" + "dataType": "string" }, { - "id": "f9413bf6-606c-4b95-af0c-20e675ddebd5", + "id": "ce3b4d03-aa0d-43a8-98e1-e8e479e23d2b", "type": "default", "extras": {}, - "x": 674.633, - "y": 278.672, + "x": 671.8376300400856, + "y": 278.9750235122013, "name": "parameter-out-string-screenshot_url", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [ "aa5c7033-3286-4692-a170-9a0981c7ea15" ], @@ -792,89 +749,88 @@ "label": "screenshot_url", "varName": "screenshot_url", "portType": "", - "dataType": "" + "dataType": "string" }, { - "id": "23b136b2-a52c-4131-b1f4-43c087441335", + "id": "bf6060c5-393d-4c04-9c43-14c28a14796c", "type": "default", "extras": {}, - "x": 674.633, - "y": 300.672, + "x": 671.8376300400856, + "y": 300.5750220945317, "name": "parameter-out-int-step_count", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": false, "label": "step_count", "varName": "step_count", "portType": "", - "dataType": "" + "dataType": "int" }, { - "id": "1337815a-cca3-4138-90c6-f21101947bd0", + "id": "e48bda6c-a5dc-4d84-a8e9-1771d3bc0d9f", "type": "default", "extras": {}, - "x": 674.633, - "y": 322.672, + "x": 671.8376300400856, + "y": 322.1750206768621, "name": "parameter-out-int-processing_time", "alignment": "right", - "parentNode": "8dc60790-07b3-49a3-86fa-f609665cd279", + "parentNode": "8218d13f-46bb-4239-b465-f6eab32e4e89", "links": [], "in": false, "label": "processing_time", "varName": "processing_time", "portType": "", - "dataType": "" + "dataType": "int" } ], "name": "MultiOnNewSession", - "color": "rgb(102,102,102)", + "color": "rgb(255,153,102)", "portsInOrder": [ - "db324868-215f-4427-9051-bdb2940143b0", - "cae6c93e-6588-4b15-b325-2c283b8f895d", - "499895ea-f90b-44a3-bd83-398f56e1a18c", - "863914a1-f39f-4027-b467-e1b1ee26f5b4", - "7a73a255-c79e-469b-b7fc-15530eee38c1" + "983b3c4b-6efe-4db8-acea-34bd381ab3f1", + "518a93e2-ad13-4bd2-ade8-04c23e4dc778", + "46aaabe5-ce01-47d4-a0fa-d0b4d1cdc62b", + "bfd7ffd8-5f36-46d4-872f-78049d5da43b", + "3f89b08b-01cd-4e20-8409-41a95430ff50" ], "portsOutOrder": [ - "a475f3a5-c391-4165-85c8-0989befca445", - "f213e3a5-989e-462d-9323-5baa60f83505", - "e87b54f7-64a5-4933-8c67-9f770975c025", - "00ef45f0-bc3f-49c2-9061-7d768e7dab28", - "6ff80e05-0c84-4e9f-8ee4-6fd716f96378", - "f9413bf6-606c-4b95-af0c-20e675ddebd5", - "23b136b2-a52c-4131-b1f4-43c087441335", - "1337815a-cca3-4138-90c6-f21101947bd0" + "812a84dd-6f18-469f-86d0-c34387ff5f2c", + "4d3df0e9-e669-4b5d-a807-b84436645857", + "3ff9aca7-7004-4462-ae12-c04870461d2a", + "82c60269-7481-47b7-a20a-d620550791c8", + "7cee7a8e-10b1-4ba5-bbda-0f9955b1c6a7", + "ce3b4d03-aa0d-43a8-98e1-e8e479e23d2b", + "bf6060c5-393d-4c04-9c43-14c28a14796c", + "e48bda6c-a5dc-4d84-a8e9-1771d3bc0d9f" ] }, - "9549868d-5eeb-4bdf-97b5-6f2ee1110aff": { - "id": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", + "db078a85-e228-4d4d-8a0c-94f592d9957b": { + "id": "db078a85-e228-4d4d-8a0c-94f592d9957b", "type": "custom-node", "selected": false, "extras": { - "type": "debug", + "type": "library_component", "path": "xai_components/xai_utils/utils.py", - "description": "Prints a message to the console.\n\n##### inPorts:\n- msg: The message to be printed.", + "description": "Prints a message to the console.\n\n##### inPorts:\n- msg (any): The message to be printed.", "lineNo": [ { - "lineno": 80, - "end_lineno": 89 + "lineno": 52, + "end_lineno": 61 } - ], - "borderColor": "rgb(0,192,255)" + ] }, "x": 795.73, "y": 122.129, "ports": [ { - "id": "a927f1ab-9d71-4a7e-ac16-26f886542152", + "id": "6e47fa89-3a49-4c59-ab95-dfa400e0af1c", "type": "default", "extras": {}, - "x": 796.727, - "y": 146.625, + "x": 796.5250909319594, + "y": 148.92501358851425, "name": "in-0", "alignment": "left", - "parentNode": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", + "parentNode": "db078a85-e228-4d4d-8a0c-94f592d9957b", "links": [ "375805db-f0f2-4b63-a4c1-dc83658783f9" ], @@ -885,14 +841,14 @@ "dataType": "" }, { - "id": "1b14f5bc-f160-44eb-8ee0-3163d59d0587", + "id": "9a4c7be6-ce2d-4d95-82e6-eb0402da35e1", "type": "default", "extras": {}, - "x": 796.727, - "y": 168.625, + "x": 796.5250909319594, + "y": 170.5250121708447, "name": "parameter-any-msg", "alignment": "left", - "parentNode": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", + "parentNode": "db078a85-e228-4d4d-8a0c-94f592d9957b", "links": [ "d632fdb4-4969-4202-9c84-7ed462a4d634" ], @@ -903,14 +859,14 @@ "dataType": "any" }, { - "id": "57f45113-ad33-44ed-be2d-b5988abdcf47", + "id": "88dedac5-0b09-464f-9f75-b62475eaee70", "type": "default", "extras": {}, - "x": 868.508, - "y": 146.625, + "x": 869.5625718341579, + "y": 148.92501358851425, "name": "out-0", "alignment": "right", - "parentNode": "9549868d-5eeb-4bdf-97b5-6f2ee1110aff", + "parentNode": "db078a85-e228-4d4d-8a0c-94f592d9957b", "links": [ "bc0740a1-7649-4dae-9512-dabb043af033" ], @@ -922,44 +878,43 @@ } ], "name": "Print", - "color": "rgb(192,255,0)", + "color": "rgb(153,204,51)", "portsInOrder": [ - "a927f1ab-9d71-4a7e-ac16-26f886542152", - "1b14f5bc-f160-44eb-8ee0-3163d59d0587" + "6e47fa89-3a49-4c59-ab95-dfa400e0af1c", + "9a4c7be6-ce2d-4d95-82e6-eb0402da35e1" ], "portsOutOrder": [ - "57f45113-ad33-44ed-be2d-b5988abdcf47" + "88dedac5-0b09-464f-9f75-b62475eaee70" ] }, - "8420c721-202c-4eea-b852-aecfc4adaf22": { - "id": "8420c721-202c-4eea-b852-aecfc4adaf22", + "51236373-134c-4ad7-846a-3d77d8090877": { + "id": "51236373-134c-4ad7-846a-3d77d8090877", "type": "custom-node", "selected": false, "extras": { - "type": "debug", + "type": "library_component", "path": "xai_components/xai_utils/utils.py", - "description": "Prints a message to the console.\n\n##### inPorts:\n- msg: The message to be printed.", + "description": "Prints a message to the console.\n\n##### inPorts:\n- msg (any): The message to be printed.", "lineNo": [ { - "lineno": 80, - "end_lineno": 89 + "lineno": 52, + "end_lineno": 61 } ], - "borderColor": "rgb(0,192,255)", "nextNode": "None" }, "x": 965.982, "y": 144.014, "ports": [ { - "id": "d57d2168-73f9-405f-8cfc-c4ec9af2b6a7", + "id": "e372b049-879a-41df-b9f5-535d98f8face", "type": "default", "extras": {}, - "x": 966.977, - "y": 168.508, + "x": 966.7751075529131, + "y": 170.8125180044735, "name": "in-0", "alignment": "left", - "parentNode": "8420c721-202c-4eea-b852-aecfc4adaf22", + "parentNode": "51236373-134c-4ad7-846a-3d77d8090877", "links": [ "bc0740a1-7649-4dae-9512-dabb043af033" ], @@ -970,14 +925,14 @@ "dataType": "" }, { - "id": "106f8aea-6ae4-4bba-91f2-26058e1b549d", + "id": "a3b548d7-60c1-4b81-9c21-dd6a1c8693b0", "type": "default", "extras": {}, - "x": 966.977, - "y": 190.508, + "x": 966.7751075529131, + "y": 192.41251658680392, "name": "parameter-any-msg", "alignment": "left", - "parentNode": "8420c721-202c-4eea-b852-aecfc4adaf22", + "parentNode": "51236373-134c-4ad7-846a-3d77d8090877", "links": [ "aa5c7033-3286-4692-a170-9a0981c7ea15" ], @@ -988,14 +943,14 @@ "dataType": "any" }, { - "id": "8cc1b9ce-dcfe-4794-805d-68774edd6426", + "id": "977749b9-bd9c-422c-a1b1-1d527331957a", "type": "default", "extras": {}, - "x": 1038.758, - "y": 168.508, + "x": 1039.8125884551114, + "y": 170.8125180044735, "name": "out-0", "alignment": "right", - "parentNode": "8420c721-202c-4eea-b852-aecfc4adaf22", + "parentNode": "51236373-134c-4ad7-846a-3d77d8090877", "links": [ "1763ff04-e411-42ae-829d-dd548c0443b7" ], @@ -1007,13 +962,124 @@ } ], "name": "Print", - "color": "rgb(192,255,0)", + "color": "rgb(153,204,51)", "portsInOrder": [ - "d57d2168-73f9-405f-8cfc-c4ec9af2b6a7", - "106f8aea-6ae4-4bba-91f2-26058e1b549d" + "e372b049-879a-41df-b9f5-535d98f8face", + "a3b548d7-60c1-4b81-9c21-dd6a1c8693b0" ], "portsOutOrder": [ - "8cc1b9ce-dcfe-4794-805d-68774edd6426" + "977749b9-bd9c-422c-a1b1-1d527331957a" + ] + }, + "9a9e6736-ecc0-4426-bca0-4917d72fd081": { + "id": "9a9e6736-ecc0-4426-bca0-4917d72fd081", + "type": "custom-node", + "selected": false, + "extras": { + "type": "boolean", + "attached": false + }, + "x": 280.674, + "y": 455.605, + "ports": [ + { + "id": "f5c3532c-602c-4f20-9cab-f8af53953103", + "type": "default", + "extras": {}, + "x": 350.2625078923716, + "y": 479.40004533127666, + "name": "out-0", + "alignment": "right", + "parentNode": "9a9e6736-ecc0-4426-bca0-4917d72fd081", + "links": [ + "4e565226-c965-4ff2-ac39-9faac2d35bf0" + ], + "in": false, + "label": "False", + "varName": "False", + "portType": "", + "dataType": "boolean" + } + ], + "name": "Literal Boolean", + "color": "red", + "portsInOrder": [], + "portsOutOrder": [ + "f5c3532c-602c-4f20-9cab-f8af53953103" + ] + }, + "108e64c7-1e4c-4845-adcc-d8c223d2ff4b": { + "id": "108e64c7-1e4c-4845-adcc-d8c223d2ff4b", + "type": "custom-node", + "selected": false, + "extras": { + "type": "string", + "attached": false + }, + "x": 125.958, + "y": 294.9, + "ports": [ + { + "id": "310ac508-e96a-4a4f-aa20-ac3541353ada", + "type": "default", + "extras": {}, + "x": 372.96251418226194, + "y": 318.7000192428975, + "name": "out-0", + "alignment": "right", + "parentNode": "108e64c7-1e4c-4845-adcc-d8c223d2ff4b", + "links": [ + "b63b7140-80b4-41a9-9b58-c04123b14e96" + ], + "in": false, + "label": "How many electric cars are there in the world?", + "varName": "How many electric cars are there in the world?", + "portType": "", + "dataType": "string" + } + ], + "name": "Literal String", + "color": "lightpink", + "portsInOrder": [], + "portsOutOrder": [ + "310ac508-e96a-4a4f-aa20-ac3541353ada" + ] + }, + "65330cb2-ae25-4b0e-8d81-46d0e6fb92c1": { + "id": "65330cb2-ae25-4b0e-8d81-46d0e6fb92c1", + "type": "custom-node", + "selected": true, + "extras": { + "type": "string", + "borderColor": "rgb(0,192,255)" + }, + "x": -28.178151718320002, + "y": 173.04782239279635, + "ports": [ + { + "id": "ee367b32-6e89-48a9-9ec9-cf01df36ab5f", + "type": "default", + "extras": {}, + "x": 101.42501731091201, + "y": 196.83750940068575, + "name": "parameter-out-0", + "alignment": "right", + "parentNode": "65330cb2-ae25-4b0e-8d81-46d0e6fb92c1", + "links": [ + "50db25b0-d099-4aac-bfba-cec73f29c775" + ], + "in": false, + "label": "▶", + "varName": "▶", + "portType": "", + "dataType": "string" + } + ], + "name": "Argument (string): api_key", + "color": "lightpink", + "portsInOrder": [], + "portsOutOrder": [ + "ee367b32-6e89-48a9-9ec9-cf01df36ab5f" ] } } diff --git a/log_in.py b/log_in.py new file mode 100644 index 0000000..456da73 --- /dev/null +++ b/log_in.py @@ -0,0 +1,42 @@ +from selenium import webdriver +from selenium.webdriver.chrome.options import Options +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +import os + +base_path = os.path.abspath(os.path.dirname(__file__)) # Gets the absolute path of the current script +crx_path = os.path.join(base_path, 'test', 'MultiOnExtension.crx') +# Get environment variables +email = os.getenv('MULTION_EMAIL') +password = os.getenv('MULTION_PASSWORD') + +# Setup Chrome options +options = Options() +options.add_argument('--headless') # Enable headless mode +options.add_argument('--no-sandbox') # Bypass OS security model +options.add_argument('--disable-dev-shm-usage') # Overcome limited resource problems +options.add_extension(crx_path) + +# Initialize WebDriver +driver = webdriver.Chrome(options=options) + +try: + driver.get('https://platform.multion.ai/login?callbackUrl=https://platform.multion.ai/beta') + + email_input = WebDriverWait(driver, 10).until( + EC.visibility_of_element_located((By.CSS_SELECTOR, 'input[type="email"]')) + ) + password_input = driver.find_element(By.CSS_SELECTOR, 'input[type="password"]') + + email_input.send_keys(email) + password_input.send_keys(password) + + login_button = driver.find_element(By.CSS_SELECTOR, 'button[type="submit"]') + login_button.click() + + # Handle post-login steps or verifications here + +finally: + # Ensure the browser closes cleanly even if the test fails + driver.quit() diff --git a/multion_components.py b/multion_components.py index ecff5a9..564c89a 100644 --- a/multion_components.py +++ b/multion_components.py @@ -8,6 +8,13 @@ @xai_component class MultiOnLogin(Component): + """ + A component that initializes a MultiOn client using the provided API key. + + ## Inputs + - `api_key`: The API key used to authenticate with the MultiOn service. + + """ api_key: InArg[secret] def execute(self, ctx): @@ -18,6 +25,24 @@ def execute(self, ctx): @xai_component class MultiOnNewSession(Component): + """ + A component that starts a new browsing session with MultiOn. + + ## Inputs + - `input_prompt`: The command or prompt for browsing. + - `url`: The URL to browse. + - `local`: A boolean flag indicating if the browsing should be local. + - `max_steps`: The maximum number of steps for browsing. + + ## Outputs + - `session_id`: The ID of the newly created session. + - `out_message`: The message returned from the browsing session. + - `status`: The status of the browsing session. + - `final_url`: The final URL after browsing. + - `screenshot_url`: The URL of the screenshot taken during the session. + - `step_count`: The number of steps completed during browsing. + - `processing_time`: The time taken for processing the session. + """ input_prompt: InCompArg[str] url: InCompArg[str] local: InCompArg[bool] @@ -53,6 +78,24 @@ def execute(self, ctx) -> None: @xai_component class MultiOnStepSession(Component): + """ + A component that continues a browsing session in MultiOn. + + ## Inputs + - `input_prompt`: The command or prompt for browsing. + - `session_id`: The ID of the existing session to continue. + - `max_steps`: The maximum number of steps for browsing. + + ## Outputs + - `session_id`: The ID of the session being continued. + - `out_message`: The message returned from the browsing session. + - `status`: The status of the browsing session. + - `final_url`: The final URL after browsing. + - `screenshot_url`: The URL of the screenshot taken during the session. + - `step_count`: The number of steps completed during browsing. + - `processing_time`: The time taken for processing the session. + """ + input_prompt: InCompArg[str] session_id: InCompArg[str] max_steps: InArg[int] diff --git a/pyproject.toml b/pyproject.toml index c7c0e4f..28a8a42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,11 @@ readme = "README.md" repository = "https://github.com/XpressAI/xai-multion" keywords = ["xircuits", "multion"] +dependencies = [ + "multion==1.3.8", + "requests" +] + # Xircuits-specific configurations [tool.xircuits] default_example_path = "multion_example.xircuits" diff --git a/requirements.txt b/requirements.txt index 5143590..3ce7c38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -multion==1.1.0 -requests==2.28.2 +multion==1.3.8 +requests