diff --git a/dummy-sse-app.cjs b/dummy-sse-app.cjs
index a2b4eba..37dba9b 100644
--- a/dummy-sse-app.cjs
+++ b/dummy-sse-app.cjs
@@ -28,6 +28,19 @@ const responseText = `${responseTextBase}
}
When I tried to access the website, I got a 404 Not Found error.
+
+\`sudo apt-get update && sudo apt-get install -y net-tools\`
+
+\`\`\`bash
+#!/bin/bash
+
+echo "Script start."
+echo "Stderr start" >&2
+
+sudo apt update && sudo apt install -y curl
+
+curl -X GET https://www.google.com/?s=puppies
+\`\`\`
`;
app.use(bodyParser.json());
diff --git a/node-red.sh b/node-red.sh
index 037e51f..87b0dd7 100755
--- a/node-red.sh
+++ b/node-red.sh
@@ -1,3 +1,10 @@
#!/bin/bash
-docker run --rm -it --add-host host.docker.internal.local=$(hostname -I | awk '{print $1}') -p 1880:1880 -v $(pwd)/packages/node-red-data:/data --name mynodered nodered/node-red:3.1.3-18
+
+docker run --rm -it \
+--name node-red-server \
+-p 1880:1880 \
+--add-host host.docker.internal.local=$(hostname -I | awk '{print $1}') \
+-v $(pwd)/packages/node-red-data:/data \
+ nodered/node-red:3.1.3-18
+
read -n 1 -s -r -p "Press any key to continue"
diff --git a/packages/docker-engine-api/Dockerfile b/packages/docker-engine-api/Dockerfile
new file mode 100644
index 0000000..f3da436
--- /dev/null
+++ b/packages/docker-engine-api/Dockerfile
@@ -0,0 +1,9 @@
+FROM alpine:3.19
+
+RUN apk --update add socat
+
+EXPOSE 2375
+
+ENTRYPOINT ["socat"]
+
+CMD ["TCP-LISTEN:2375,fork", "UNIX-CONNECT:/var/run/docker.sock"]
diff --git a/packages/docker-engine-api/docker-engine-api.sh b/packages/docker-engine-api/docker-engine-api.sh
new file mode 100755
index 0000000..110b122
--- /dev/null
+++ b/packages/docker-engine-api/docker-engine-api.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+docker network disconnect docker-engine-api node-red-server || true
+docker network rm docker-engine-api || true
+
+docker network create docker-engine-api
+docker network connect docker-engine-api node-red-server
+
+docker run --rm \
+--name docker-engine-api \
+--network docker-engine-api \
+-v /var/run/docker.sock:/var/run/docker.sock \
+ $1
diff --git a/packages/docker-engine-api/package.json b/packages/docker-engine-api/package.json
new file mode 100644
index 0000000..2e50470
--- /dev/null
+++ b/packages/docker-engine-api/package.json
@@ -0,0 +1,5 @@
+{
+ "name": "docker-engine-api",
+ "version": "0.0.9",
+ "private": true
+}
diff --git a/packages/docker-engine-api/project.json b/packages/docker-engine-api/project.json
new file mode 100644
index 0000000..8774429
--- /dev/null
+++ b/packages/docker-engine-api/project.json
@@ -0,0 +1,39 @@
+{
+ "name": "docker-engine-api",
+ "sourceRoot": "packages/docker-engine-api",
+ "projectType": "application",
+ "tags": [],
+ "targets": {
+ "build": {
+ "executor": "nx:run-commands",
+ "options": {
+ "commands": [
+ "docker build -t docker-engine-api:local packages/docker-engine-api"
+ ]
+ }
+ },
+ "publish": {
+ "executor": "nx:run-commands",
+ "options": {
+ "parallel": false,
+ "commands": ["/bin/bash packages/docker-engine-api/publish.sh"]
+ }
+ },
+ "serve": {
+ "executor": "nx:run-commands",
+ "options": {
+ "commands": [
+ "/bin/bash packages/docker-engine-api/docker-engine-api.sh joshuacarter603/docker-engine-api:0.0.9"
+ ]
+ }
+ },
+ "serve-local": {
+ "executor": "nx:run-commands",
+ "options": {
+ "commands": [
+ "/bin/bash packages/docker-engine-api/docker-engine-api.sh docker-engine-api:local"
+ ]
+ }
+ }
+ }
+}
diff --git a/packages/docker-engine-api/publish.sh b/packages/docker-engine-api/publish.sh
new file mode 100644
index 0000000..50a6f55
--- /dev/null
+++ b/packages/docker-engine-api/publish.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+PREFIX="$(dirname "$0")"
+SEMVER=$1
+
+if [[ "$SEMVER" != "major" && "$SEMVER" != "minor" && "$SEMVER" != "patch" ]]; then
+ echo "Error: SEMVER must be 'major', 'minor', or 'patch'."
+ exit 1
+fi
+
+docker login
+
+npm --prefix $PREFIX version $SEMVER
+
+VERSION=$(node -p "require('./$PREFIX/package.json').version")
+echo "Publishing docker-engine-api:$VERSION"
+
+docker tag docker-engine-api:local joshuacarter603/docker-engine-api:latest
+docker tag docker-engine-api:local joshuacarter603/docker-engine-api:$VERSION
+
+docker push joshuacarter603/docker-engine-api:latest
+docker push joshuacarter603/docker-engine-api:$VERSION
diff --git a/packages/history-archives/admin-operator-01/programatic-history-680.json b/packages/history-archives/admin-operator-01/programatic-history-680.json
new file mode 100644
index 0000000..56ecb4e
--- /dev/null
+++ b/packages/history-archives/admin-operator-01/programatic-history-680.json
@@ -0,0 +1 @@
+{"entries":[{"id":"fe003161-dcb7-4cc3-9b03-7d7135f40c97","role":"user","content":"Sign up for a Twitter account with the username @freakythursdays."},{"id":"83174ff5-ffa5-4122-9617-a263a96bf78f","role":"assistant","content":"Sure thing! I'll sign up for a Twitter account with the username @freakythursdays."},{"id":"c72e45f8-c98c-4132-b948-687f7ea763f7","role":"user","content":"Follow @freakythursdays on Twitter."},{"id":"a41efd70-360c-46db-b0c6-05fef2c0141a","role":"assistant","content":"I'm following @freakythursdays on Twitter."},{"id":"fc2b23cd-3ada-43e6-b219-04608526fbd6","role":"user","content":"Follow @freakythursdays on Twitter."},{"id":"4e3a61f8-2784-447d-9c5c-5ea61e1f5bc6","role":"assistant","content":"I'm sorry, I am already following @freakythursdays on Twitter."}],"streaming":null}
\ No newline at end of file
diff --git a/packages/history-archives/bash-executor-01/history-1711926907124.json b/packages/history-archives/bash-executor-01/history-1711926907124.json
new file mode 100644
index 0000000..b80209e
--- /dev/null
+++ b/packages/history-archives/bash-executor-01/history-1711926907124.json
@@ -0,0 +1 @@
+{"entries":[{"id":"006d62a2-d590-4192-866d-aa16d5910405","role":"user","content":"Write a single bash script that will return an output that accomplishes the following task. Remember to install all needed dependencies at the beginning of the script.\n\nSearch Google for puppies."},{"id":"68f3d5f7-2f24-43fe-8d0d-0b57436d69e2","role":"assistant","content":"Certainly! Here is a bash script that will search for puppies on Google and return the search results in a text format:\n```bash\n#!/bin/bash\n\n# Install necessary dependencies\napt-get update\napt-get install -y google-chrome google-chrome-stable\n\n# Search for puppies on Google\ngoogle-search \"puppies\" > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance."},{"id":"3967a160-a158-411c-9c16-d4c3486734ed","role":"user","content":"Chrome is not available, please use a different method."},{"id":"aa0eae7b-d773-4989-afc7-6502fcc8b195","role":"assistant","content":"Certainly! Here is an updated version of the script that uses the `curl` command to search for puppies on Google:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl\ncurl -s \"https://www.google.com/search?q=puppies\" | grep -oP 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/' > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance"},{"id":"8264cb8b-16fa-4ee5-963a-f5f973d9dbdd","role":"user","content":"The script made no output."},{"id":"3a5ecf73-34dd-4691-b135-dce7525d7060","role":"assistant","content":"I apologize for the oversight. Here is an updated version of the script that should work as intended:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl and output the search results\ncurl -s \"https://www.google.com/search?q=puppies\" | grep -oP 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/'\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance."},{"id":"79f1458b-3464-4deb-a9e5-468256e3fcb1","role":"user","content":"The script made no output."},{"id":"52391f70-ffa6-474f-b341-bafbd5559878","role":"assistant","content":"I apologize for the oversight. Here is an updated version of the script that should work as intended:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl and output the search results\ncurl -s \"https://www.google.com/search?q=puppies\" | grep -oP 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/'\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance"},{"id":"dda74f1b-dff1-47ef-a2ac-2a6ccf2fde8f","role":"user","content":"That is the same script as before."},{"id":"12daaebc-8a6a-4f98-a9ab-d90eaaa136e5","role":"assistant","content":"I apologize for the confusion. Here is an updated version of the script that should work as intended:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl and output the search results\ncurl -s \"https://www.google.com/search?q=puppies\" | grep -oP 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/' > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance"},{"id":"dcdf7792-c56e-47d4-8310-fd0f1ab1398e","role":"user","content":"That is the same script as before."},{"id":"acef04cf-fbea-4578-a407-6fadec8ba62c","role":"assistant","content":"I apologize for the oversight. Here is an updated version of the script that should work as intended:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl and output the search results\ncurl -s \"https://www.google.com/search?q=puppies\" | grep -oP 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/' > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI apologize for any confusion caused by my previous responses. I hope this updated version of the script works as intended. Let me know if you have any questions or need further assistance"},{"id":"b2e67d9b-d4b9-498c-a588-12ae63d6d112","role":"user","content":"We've already tried that script."},{"id":"712806c0-84d6-4c91-858f-086bdf08391b","role":"assistant","content":"I apologize for the misunderstanding. Here is an alternative script that uses the `wget` command to search Google for puppies and output the search results:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using wget and output the search results\nwget -qO - https://www.google.com/search?q=puppies | grep -Po 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/' > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance"},{"id":"8e7cbb2c-f9f0-436d-836d-8c7a99a3b95f","role":"user","content":"The script made no output."},{"id":"2bac05db-e99c-4fc0-80d4-611cadee3fc3","role":"assistant","content":"I apologize for the oversight. Here is an updated version of the script that should work as intended:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using wget and output the search results\nwget -qO - https://www.google.com/search?q=puppies | grep -Po 'alt=\"(<[^>]*>)' | sed 's/.*\\(([^)]*\\)>.*/\\1/' > /dev/null\n```\nTo use this script, copy and paste the code into a new file and save it as `puppy_search.sh`. Then, make the script executable by running the command `chmod +x puppy_search.sh`. Finally, run the script by typing `./puppy_search.sh` in your terminal.\n\nI hope this helps! Let me know if you have any questions or need further assistance"}],"streaming":null}
\ No newline at end of file
diff --git a/packages/history-archives/bash-executor-01/history-1719288112213.json b/packages/history-archives/bash-executor-01/history-1719288112213.json
new file mode 100644
index 0000000..7b1ab20
--- /dev/null
+++ b/packages/history-archives/bash-executor-01/history-1719288112213.json
@@ -0,0 +1 @@
+{"entries":[{"id":"d27af1bb-fe29-4e93-98e0-7f49e05345ad","role":"user","content":"Search Google for puppies."}],"streaming":null}
\ No newline at end of file
diff --git a/packages/history-archives/bash-executor-01/programatic-history-1719287971416.json b/packages/history-archives/bash-executor-01/programatic-history-1719287971416.json
new file mode 100644
index 0000000..ea0087c
--- /dev/null
+++ b/packages/history-archives/bash-executor-01/programatic-history-1719287971416.json
@@ -0,0 +1 @@
+{"entries":[{"id":"f64dd0df-5d65-4dae-b8f1-8b8dcfe44edf","role":"user","content":"Write a single bash script that will return an output that accomplishes the following task. Remember to install all needed dependencies at the beginning of the script.\n \nSearch Google for puppies."},{"id":"66eb64d7-c69a-4f92-b58f-82960d94025b","role":"assistant","content":"Here is a bash script that searches for puppies on Google and returns the search results:\n```bash\n#!/bin/bash\n\n# Install necessary dependencies\napt-get update && apt-get install -y google-chrome\n\n# Start Google Chrome in incognito mode and navigate to Google's homepage\ngoogle-chrome --incognito\nchromium --disable-extensions --disable-infobars --no-sandbox --check-for-update-interval=1 --disable-pinch --enable-logging --vizier-service=0\n\n# Wait for the page to load\nsleep 5\n\n# Search for puppies on Google\necho \"puppies\" | google-search\n\n# Wait for the search results to appear on the page\nsleep 10\n\n# Scrape the search results and save them to a file\nwget -r -l 3 --no-clobber --page-requisites --restrict-file-names=windows --domains puppies.googlepages.com --recursive --no-parent http://puppies.googlepages.com/\n```\nNote: This that you have an internet connection and Google Chrome is already installed on your system."},{"id":"ac817531-baa7-4945-831a-54785f13e987","role":"user","content":"Chrome is not available, please use a different method."},{"id":"e8352351-425e-49a6-9dd7-ebebb36e1eed","role":"assistant","content":"Here is a bash script that uses the `wget` command to search for puppies on Google and returns the search results:\n```bin/bash\n\n# Install necessary dependencies\napt-get update && apt-get install -y wget\n\n# Search for puppies on Google\necho \"puppies\" | wget --recursive --no-clobber --page-requisites --restrict-file-names=windows --domains google.com --no-parent https://www.google.com?q=puppies\n```\nThis script uses the `wget` command to recursively download the search results and save them to a file"}],"streaming":null}
\ No newline at end of file
diff --git a/packages/history-archives/bash-executor-01/programatic-history-1719288121273.json b/packages/history-archives/bash-executor-01/programatic-history-1719288121273.json
new file mode 100644
index 0000000..3d88207
--- /dev/null
+++ b/packages/history-archives/bash-executor-01/programatic-history-1719288121273.json
@@ -0,0 +1 @@
+{"entries":[{"id":"1f57acf6-7ab0-4c6f-b0ea-ab0b56ef7127","role":"user","content":"Write a single bash script that will return an output that accomplishes the following task. Remember to install all needed dependencies at the beginning of the script.\n \nSearch Google for puppies."},{"id":"5902eca5-aa62-4510-9b6c-96fbaa5090c5","role":"assistant","content":"Sure, I can help you with that. Here's a bash script that will search for puppies on Google:\n```bash\n#!/bin/bash\n\n# Install the 'google-search' package if not already installed\nif ! command -v google-search &> /dev/null; then\n echo \"Installing the 'google-search' package\"\n sudo apt-get update\n sudo apt-get install google-search-engine\nfi\n\n# Search for puppies on Google\ngoogle-search \"puppies\"\n```\nThis script first checks if the 'google-search' package is installed. If it's not, it will install it using the APT package manager. Then, it runs the 'google-search' command with the query \"puppies\", which will search for puppies on Google and display the results in your default web browser."},{"id":"eb244b30-7165-4417-b805-a4a4d44179e5","role":"user","content":"\nammy/multiverse amd64 Packages [266 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000OGet:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000[Get:8 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2474 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000[Get:9 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.7 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000VGet:10 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1922 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000QGet:11 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000LGet:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000TGet:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2189 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000ZGet:14 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2556 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000XGet:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1392 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000ZGet:16 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [51.8 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000ZGet:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [31.8 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000VGet:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [81.0 kB]\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000#Fetched 32.2 MB in 32s (1004 kB/s)\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001cBuilding dependency tree...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001dReading state information...\n\n\n\n\n\u0002\u0000\u0000\u0000\u0000\u0000\u00001E: Unable to locate package google-search-engine\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000S/root/scripts/script-1719288132048-0.sh: line 11: google-search: command not found\n\n\n\n"},{"id":"7ad018ca-10bd-4b88-be2d-5055dd1b55ea","role":"assistant","content":"Oh, it seems like the 'google-search' package is not available in your system. That's okay, we can use a different approach to search for puppies on Google.\n\nHere's an updated version of the script that uses the 'curl' command to fetch the search results directly from Google:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl\ncurl -sSf \"https://www.google.com/search?q=puppies\" | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000I/root/scripts/script-1719288190451-0.sh: line 4: curl: command not found\n\n\n\n"},{"id":"76b86e5a-2fa6-4172-9ffe-3d557e6a1074","role":"assistant","content":"Oh, it seems like the 'curl' command is not available in your system either. In that case, we can use the 'wget' command instead to fetch the search results directly from Google:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using wget\nwget -qO- https://www.google.com/search?q=puppies | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000I/root/scripts/script-1719288215718-0.sh: line 4: wget: command not found\n\n\n\n"},{"id":"86f9f128-669b-4082-9cd4-964e4d909ad9","role":"assistant","content":"I apologize for the confusion earlier. It looks like neither 'curl' nor 'wget' are installed on your system either. In that case, we can use the 'google-search' command with the 'grep' command to extract the relevant text content from the search results page:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using google-search and grep\ngoogle-search \"puppies\" | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000R/root/scripts/script-1719288246082-0.sh: line 4: google-search: command not found\n\n\n\n"},{"id":"72b7f957-76f2-4edf-b44c-636c33778f42","role":"assistant","content":"I apologize for the inconvenience. It seems like none of the methods I've suggested earlier work in your system. In that case, let's try a different approach using the 'inquirer' package to prompt you for your search query and display the results in real-time:\n```bash\n#!/bin/bash\n\n# Install the 'inquirer' package if not already installed\nif ! command -v inquirer &> /dev/null; then\n echo \"Installing the 'inquirer' package\"\n sudo apt-get update\n sudo apt-get install inquirer\nfi\n\n# Prompt for search query and display results in real-time using inquirer\ninquirer -N -I \"Search:\" -i \"Puppies\" --list /usr/bin/google-search > output.txt\necho \"=====================\"\ncat output.txt\n```\nThis script checks if the 'inquirer' package is installed, and if not, it installs it using the APT package manager. Then, it uses the 'inquirer' command with the '-N', '-I', and '--list' options to prompt the user for a search query and run the 'google-search' command with that query as input. The results are saved to a file called 'output.txt'. Finally, the script displays the output by concatenating the string \"=====================\" and the 'cat' command to print the contents of 'output.txt'"},{"id":"39a72722-1066-4496-b3e8-d2fec46837f0","role":"user","content":"\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000%E: Unable to locate package inquirer\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000N/root/scripts/script-1719288288000-0.sh: line 11: inquirer: command not found\n\n\n\n\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\"Installing the 'inquirer' package\n\u0001\u0000\u0000\u0000\u0000\u0000\u00007Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000?Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000AHit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000AHit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001cBuilding dependency tree...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001dReading state information...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0016=====================\n\n\n\n"},{"id":"feaa7e0c-9282-41f2-ad55-1128411f0762","role":"assistant","content":"It seems like the 'inquirer' package is not available in your system. In that case, we can use a simple while loop to prompt you for your search query and display the results one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using google-search and print each result\nwhile read line; do\n echo \"Searching for '$line'\"\n google-search \"$line\" | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000�/root/scripts/script-1719288326681-0.sh: line 7: syntax error near unexpected token `<(inquirer -N -I \"Enter search query (press Enter to finish):\" -i \"\")'\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000~/root/scripts/script-1719288326681-0.sh: line 7: `done <(inquirer -N -I \"Enter search query (press Enter to finish):\" -i \"\")'\n\n\n\n"},{"id":"cb160b4d-350b-4ee5-b201-b9b95415ee22","role":"assistant","content":"I apologize for the confusion earlier. It seems like there was a syntax error in the script I provided. Here's the corrected version:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using google-search and print each result\nwhile read line; do\n echo \"Searching for '$line'\"\n google-search \"$line\" | grep -Po '(?<=
/dev/null; then\n echo \"Installing the 'readline' package\"\n sudo apt-get update\n sudo apt-get install readline\nfi\n\n# Search for puppies on Google using google-search and print each result\ngoogle-search \"puppies\" | while read -r line; do\n echo \"Searching for '$line'\"\n echo \"$line\" | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000%E: Unable to locate package readline\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000S/root/scripts/script-1719288388291-0.sh: line 11: google-search: command not found\n\n\n\n\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\"Installing the 'readline' package\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000AHit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u00007Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000?Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000AHit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0019Reading package lists...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001cBuilding dependency tree...\n\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u001dReading state information...\n\n\n\n"},{"id":"c0dfbb43-22f8-4e46-b984-690d932f7b27","role":"assistant","content":"I apologize for the confusion earlier. It seems like neither 'readline' nor 'google-search' are installed on your system. In that case, let's try a different approach using the 'nc' command to fetch the search results directly from Google and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using nc and print each result\necho \"Puppies\" | nc google.com 80 | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000G/root/scripts/script-1719288429889-0.sh: line 4: nc: command not found\n\n\n\n"},{"id":"c625282e-363e-4611-9372-bc7fe9c7366b","role":"assistant","content":"It seems like the 'nc' command is not available in your system. In that case, you can use a simple while loop with wget to fetch the search results and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using wget and print each result\necho \"Puppies\" | wget -qO- http://www.google.com/search?q= | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000I/root/scripts/script-1719288456801-0.sh: line 4: wget: command not found\n\n\n\n"},{"id":"3138d55e-76bf-4c83-bc98-b7a86bd9e290","role":"assistant","content":"It seems like the 'wget' command is not available in your system. In that case, we can use a simple while loop with curl to fetch the search results and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using curl and print each result\necho \"Puppies\" | curl -s http://www.google.com/search?q= | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000I/root/scripts/script-1719288482832-0.sh: line 4: curl: command not found\n\n\n\n"},{"id":"edde3c99-e9d6-4191-902b-bcc039ff0bd6","role":"assistant","content":"It seems like the 'curl' command is not available in your system. In that case, we can use a simple while loop with the 'httpie' command to fetch the search results and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using httpie and print each result\necho \"Puppies\" | http -c 10 http://www.google.com/search?q= | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000I/root/scripts/script-1719288513388-0.sh: line 4: http: command not found\n\n\n\n"},{"id":"914a02ea-40f1-4afa-a4b2-03aeae8d7abd","role":"assistant","content":"It seems like the 'http' command is not available in your system. In that case, let's use a simple while loop with the 'timeout' command to fetch the search results and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using timeout and print each result\necho \"Puppies\" | timeout 10s -w 30s -f http://www.google.com/search?q= | grep -Po '(?<=
\n\u0002\u0000\u0000\u0000\u0000\u0000\u0000?timeout: failed to run command '-w': No such file or directory\n\n\n\n"},{"id":"dadf7530-55c5-4c06-946f-c23731db3956","role":"assistant","content":"I apologize for the confusion earlier. It seems like the 'timeout' command is not available in your system. In that case, let's use a simple while loop with the 'sleep' command to fetch the search results and print them one by one:\n```bash\n#!/bin/bash\n\n# Search for puppies on Google using sleep and print each result\necho \"Puppies\" | sleep 10; curl -s http://www.google.com/search?q= | grep -Po '(?<=
{
- class ProvideImportFn {
+ class ProvideGlobal {
constructor(config) {
RED.nodes.createNode(this, config);
this.on('input', (msg) => {
try {
- // Custom function wrapper logic
- const sendFunction = async (module) => {
- return await import(module);
- }
- // Attach the function to the message object
- msg.import = sendFunction;
+ // Attach global to the message object
+ msg.global = global;
+ // attach keywords
+ msg.global.require = require;
+ msg.global.module = module;
+ msg.global.exports = exports;
+ msg.global.__dirname = __dirname;
+ msg.global.__filename = __filename;
+
// Send the updated message object
this.send(msg);
} catch (err) {
- this.error(`Error in ProvideImportFn: ${err.message}`, msg);
+ this.error(`Error in ProvideGlobal: ${err.message}`, msg);
}
});
}
}
- RED.nodes.registerType("provide-import-fn", ProvideImportFn);
+ RED.nodes.registerType("provide-global", ProvideGlobal);
};
diff --git a/packages/llm-nodes/provide-import-fn/provide-import-fn.js b/packages/llm-nodes/provide-import-fn/provide-import-fn.js
index e4cf521..c80466b 100644
--- a/packages/llm-nodes/provide-import-fn/provide-import-fn.js
+++ b/packages/llm-nodes/provide-import-fn/provide-import-fn.js
@@ -1,18 +1,22 @@
module.exports = (RED) => {
- class ProvideGlobal {
+ class ProvideImportFn {
constructor(config) {
RED.nodes.createNode(this, config);
this.on('input', (msg) => {
try {
- // Attach global the message object
- msg.global = global;
+ // Custom function wrapper logic
+ const sendFunction = async (module) => {
+ return await import(module);
+ }
+ // Attach the function to the message object
+ msg.import = sendFunction;
// Send the updated message object
this.send(msg);
} catch (err) {
- this.error(`Error in ProvideGlobal: ${err.message}`, msg);
+ this.error(`Error in ProvideImportFn: ${err.message}`, msg);
}
});
}
}
- RED.nodes.registerType("provide-global", ProvideGlobal);
+ RED.nodes.registerType("provide-import-fn", ProvideImportFn);
};
diff --git a/packages/node-red-data/.config.modules.json b/packages/node-red-data/.config.modules.json
index 4e6917b..47aba44 100644
--- a/packages/node-red-data/.config.modules.json
+++ b/packages/node-red-data/.config.modules.json
@@ -119,5 +119,12 @@
"subpath": "",
"builtin": false,
"known": false
+ },
+ "yargs": {
+ "spec": "yargs",
+ "module": "yargs",
+ "subpath": "",
+ "builtin": false,
+ "known": false
}
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.modules.json.backup b/packages/node-red-data/.config.modules.json.backup
index 2218dcc..4e6917b 100644
--- a/packages/node-red-data/.config.modules.json.backup
+++ b/packages/node-red-data/.config.modules.json.backup
@@ -112,5 +112,12 @@
"subpath": "/document_loaders",
"builtin": false,
"known": false
+ },
+ "mammoth": {
+ "spec": "mammoth",
+ "module": "mammoth",
+ "subpath": "",
+ "builtin": false,
+ "known": false
}
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.nodes.json b/packages/node-red-data/.config.nodes.json
index 9daa9cd..d27100a 100644
--- a/packages/node-red-data/.config.nodes.json
+++ b/packages/node-red-data/.config.nodes.json
@@ -427,28 +427,9 @@
}
}
},
- "node-red-contrib-jsonpath": {
- "name": "node-red-contrib-jsonpath",
- "version": "0.1.1",
- "local": true,
- "user": true,
- "nodes": {
- "jsonpath": {
- "name": "jsonpath",
- "types": [
- "jsonpath"
- ],
- "enabled": true,
- "local": true,
- "user": false,
- "module": "node-red-contrib-jsonpath",
- "file": "/data/node_modules/node-red-contrib-jsonpath/jsonpath/node-red-contrib-jsonpath.js"
- }
- }
- },
"node-red-contrib-llm-nodes": {
"name": "node-red-contrib-llm-nodes",
- "version": "0.2.11",
+ "version": "0.2.12",
"local": true,
"user": true,
"nodes": {
@@ -477,7 +458,7 @@
"provide-import-fn": {
"name": "provide-import-fn",
"types": [
- "provide-global"
+ "provide-import-fn"
],
"enabled": true,
"local": true,
@@ -488,7 +469,7 @@
"provide-global": {
"name": "provide-global",
"types": [
- "provide-import-fn"
+ "provide-global"
],
"enabled": true,
"local": true,
diff --git a/packages/node-red-data/.config.nodes.json.backup b/packages/node-red-data/.config.nodes.json.backup
index 5227c7c..a7c247d 100644
--- a/packages/node-red-data/.config.nodes.json.backup
+++ b/packages/node-red-data/.config.nodes.json.backup
@@ -427,28 +427,9 @@
}
}
},
- "node-red-contrib-jsonpath": {
- "name": "node-red-contrib-jsonpath",
- "version": "0.1.1",
- "local": true,
- "user": true,
- "nodes": {
- "jsonpath": {
- "name": "jsonpath",
- "types": [
- "jsonpath"
- ],
- "enabled": true,
- "local": true,
- "user": false,
- "module": "node-red-contrib-jsonpath",
- "file": "/data/node_modules/node-red-contrib-jsonpath/jsonpath/node-red-contrib-jsonpath.js"
- }
- }
- },
"node-red-contrib-llm-nodes": {
"name": "node-red-contrib-llm-nodes",
- "version": "0.2.9",
+ "version": "0.2.11",
"local": true,
"user": true,
"nodes": {
@@ -507,6 +488,7 @@
"module": "node-red-contrib-llm-nodes",
"file": "/data/node_modules/node-red-contrib-llm-nodes/ui-builder/ui-builder.js"
}
- }
+ },
+ "pending_version": "0.2.12"
}
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.runtime.json b/packages/node-red-data/.config.runtime.json
index d2351f2..4a5af3d 100644
--- a/packages/node-red-data/.config.runtime.json
+++ b/packages/node-red-data/.config.runtime.json
@@ -1,4 +1,4 @@
{
"_credentialSecret": "11d9476d46ab9488b12589613b0fa2a548159f32a8aa5b67b2daa47ec7be8d8a",
- "runtimeFlowState": "start"
+ "runtimeFlowState": "stop"
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.runtime.json.backup b/packages/node-red-data/.config.runtime.json.backup
index 4a5af3d..d2351f2 100644
--- a/packages/node-red-data/.config.runtime.json.backup
+++ b/packages/node-red-data/.config.runtime.json.backup
@@ -1,4 +1,4 @@
{
"_credentialSecret": "11d9476d46ab9488b12589613b0fa2a548159f32a8aa5b67b2daa47ec7be8d8a",
- "runtimeFlowState": "stop"
+ "runtimeFlowState": "start"
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.users.json b/packages/node-red-data/.config.users.json
index fa95f19..98dec08 100644
--- a/packages/node-red-data/.config.users.json
+++ b/packages/node-red-data/.config.users.json
@@ -9,7 +9,7 @@
"view-grid-size": "20",
"view-node-status": true,
"view-node-show-label": true,
- "view-show-tips": true,
+ "view-show-tips": false,
"view-show-welcome-tours": true
},
"tours": {
@@ -24,7 +24,7 @@
}
}
},
- "menu-menu-item-palette": true,
+ "menu-menu-item-palette": false,
"debug": {
"filter": "filterAll",
"filteredNodes": [
@@ -92,6 +92,7 @@
},
"menu-deploymenu-item-node": true,
"menu-deploymenu-item-full": false,
- "menu-deploymenu-item-flow": false
+ "menu-deploymenu-item-flow": false,
+ "menu-menu-item-sidebar": false
}
}
\ No newline at end of file
diff --git a/packages/node-red-data/.config.users.json.backup b/packages/node-red-data/.config.users.json.backup
index 720eced..b0c3e1c 100644
--- a/packages/node-red-data/.config.users.json.backup
+++ b/packages/node-red-data/.config.users.json.backup
@@ -9,7 +9,7 @@
"view-grid-size": "20",
"view-node-status": true,
"view-node-show-label": true,
- "view-show-tips": true,
+ "view-show-tips": false,
"view-show-welcome-tours": true
},
"tours": {
@@ -26,7 +26,7 @@
},
"menu-menu-item-palette": true,
"debug": {
- "filter": "filterSelected",
+ "filter": "filterAll",
"filteredNodes": [
"15aec0fd7f870fd5",
"4dbabd6e04735026",
@@ -92,6 +92,7 @@
},
"menu-deploymenu-item-node": true,
"menu-deploymenu-item-full": false,
- "menu-deploymenu-item-flow": false
+ "menu-deploymenu-item-flow": false,
+ "menu-menu-item-sidebar": false
}
}
\ No newline at end of file
diff --git a/packages/node-red-data/.flows.json.backup b/packages/node-red-data/.flows.json.backup
index c9c90a0..0803fb2 100644
--- a/packages/node-red-data/.flows.json.backup
+++ b/packages/node-red-data/.flows.json.backup
@@ -8,9 +8,9 @@
"env": []
},
{
- "id": "191694dad2850f37",
+ "id": "ec55121054ad7072",
"type": "tab",
- "label": "Iterative Eval 01",
+ "label": "Admin-Operator",
"disabled": false,
"info": "",
"env": []
@@ -23,6 +23,22 @@
"info": "",
"env": []
},
+ {
+ "id": "3b5c9ca1fb9ebf48",
+ "type": "tab",
+ "label": "Bash Executor",
+ "disabled": false,
+ "info": "",
+ "env": []
+ },
+ {
+ "id": "191694dad2850f37",
+ "type": "tab",
+ "label": "Iterative Eval 01",
+ "disabled": false,
+ "info": "",
+ "env": []
+ },
{
"id": "8518392b3e041cfe",
"type": "tab",
@@ -40,12 +56,11 @@
"env": []
},
{
- "id": "ec55121054ad7072",
+ "id": "f6f2187d.f17ca8",
"type": "tab",
- "label": "Admin-Operator",
- "disabled": false,
- "info": "",
- "env": []
+ "label": "Portainer Flow",
+ "disabled": true,
+ "info": "https://flows.nodered.org/flow/648cb2a8aeb19d1f665d1c0db1e4541b"
},
{
"id": "9941dd1769d8bb1b",
@@ -146,7 +161,7 @@
{
"id": "6d317c39edd7ba27",
"type": "subflow",
- "name": "Send Streaming Request",
+ "name": "SSE Request",
"info": "",
"category": "llm request",
"in": [
@@ -605,7 +620,7 @@
"type": "subflow",
"name": "provide - parseMarkdown",
"info": "",
- "category": "llm:util",
+ "category": "llm parsers",
"in": [
{
"x": 50,
@@ -976,24 +991,24 @@
{
"id": "f0aa5f2ed7dab3b8",
"type": "subflow",
- "name": "http request",
+ "name": "HTTP Request",
"info": "",
- "category": "llm:util",
+ "category": "llm request",
"in": [
{
"x": 80,
"y": 60,
"wires": [
{
- "id": "a94bb02058f6c758"
+ "id": "1c4e6c80d9868fa0"
}
]
}
],
"out": [
{
- "x": 880,
- "y": 380,
+ "x": 1120,
+ "y": 300,
"wires": [
{
"id": "3d6d82698400006b",
@@ -1004,7 +1019,7 @@
],
"env": [],
"meta": {},
- "color": "#E2D96E",
+ "color": "#3FADB5",
"icon": "node-red/white-globe.svg"
},
{
@@ -1156,22 +1171,22 @@
"type": "subflow",
"name": "provide - exractHtmlTags",
"info": "",
- "category": "llm:util",
+ "category": "llm parsers",
"in": [
{
"x": 50,
"y": 30.90909093618393,
"wires": [
{
- "id": "0a432a478665f6a9"
+ "id": "3d458d6f47d14634"
}
]
}
],
"out": [
{
- "x": 500,
- "y": 160,
+ "x": 620,
+ "y": 260,
"wires": [
{
"id": "0a432a478665f6a9",
@@ -1218,147 +1233,402 @@
"color": "#DDAA99"
},
{
- "id": "573a66c74ad47252",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "24d6b22fbb3331ef",
- "fa93074c3844e72a",
- "e64c01c3ce72e42c",
- "fd30589c82c22c62",
- "f99c0d4e42875ff9"
+ "id": "b9a9b43a3594c357",
+ "type": "subflow",
+ "name": "Docker Run",
+ "info": "",
+ "category": "Docker",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "1540fd3640a5c2da"
+ },
+ {
+ "id": "9ead6c09c1634875"
+ }
+ ]
+ }
],
- "x": 314,
- "y": 459,
- "w": 452,
- "h": 222
- },
- {
- "id": "ffdcd8798ee03933",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "d0bc8cbbd38f96d0",
- "ed0c2d4f1d21f64c",
- "b7a0d2554c54f30c"
+ "out": [
+ {
+ "x": 1240,
+ "y": 960,
+ "wires": [
+ {
+ "id": "b136a36f1f060bab",
+ "port": 0
+ }
+ ]
+ }
],
- "x": 854,
- "y": 779,
- "w": 452,
- "h": 142
+ "env": [
+ {
+ "name": "Container Name",
+ "type": "str",
+ "value": ""
+ },
+ {
+ "name": "Image",
+ "type": "str",
+ "value": "ubuntu"
+ },
+ {
+ "name": "Command",
+ "type": "json",
+ "value": "[\"sleep\", \"Infinity\"]"
+ },
+ {
+ "name": "Docker Run Args",
+ "type": "json",
+ "value": "[\"--rm\"]"
+ },
+ {
+ "name": "Output Mode",
+ "type": "str",
+ "value": "stream"
+ },
+ {
+ "name": "Commit",
+ "type": "bool",
+ "value": "false"
+ }
+ ],
+ "meta": {},
+ "color": "#D8BFD8",
+ "icon": "font-awesome/fa-inbox"
},
{
- "id": "0e803c0423a03bad",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "ec546330d29baba3",
- "96d1b37cfc101abc"
+ "id": "5982620408722375",
+ "type": "subflow",
+ "name": "Docker Logs",
+ "info": "",
+ "category": "",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": []
+ }
],
- "x": 854,
- "y": 959,
- "w": 272,
- "h": 142
+ "out": [
+ {
+ "x": 820,
+ "y": 200,
+ "wires": []
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#DDAA99"
},
{
- "id": "1309c3c5cd6f1b74",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "2f187dab7a1ae2ad",
- "2c75870eb28bb7c5",
- "07a96f21f7eb4899",
- "e9e910c0b95eb6fc"
+ "id": "d5c30c295cb6b7bc",
+ "type": "subflow",
+ "name": "Run Command",
+ "info": "",
+ "category": "llm:util",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "1c249f69debb918b"
+ }
+ ]
+ }
],
- "x": 514,
- "y": 759,
- "w": 252,
- "h": 242
+ "out": [
+ {
+ "x": 1240,
+ "y": 280,
+ "wires": [
+ {
+ "id": "5be0298a22eb5f2a",
+ "port": 0
+ },
+ {
+ "id": "bee02be8135363fa",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#A6BBCF",
+ "icon": "font-awesome/fa-terminal"
},
{
- "id": "3cdc7422abfbe82e",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "3b2ca8934fb0ccd7",
- "05af6ff6db82adba"
+ "id": "72ced27310c541f6",
+ "type": "subflow",
+ "name": "cURL Request",
+ "info": "",
+ "category": "llm request",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "03f57deed86e37c5"
+ }
+ ]
+ }
],
- "x": 854,
- "y": 239,
- "w": 372,
- "h": 142
+ "out": [
+ {
+ "x": 1020,
+ "y": 120,
+ "wires": [
+ {
+ "id": "c7494ed5f552a21e",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#3FADB5",
+ "icon": "node-red/bridge-dash.svg"
},
{
- "id": "2ec09f072ab0b146",
- "type": "group",
- "z": "2b3efcc977e88d91",
- "style": {
- "stroke": "#999999",
- "stroke-opacity": "1",
- "fill": "none",
- "fill-opacity": "1",
- "label": true,
- "label-position": "nw",
- "color": "#a4a4a4"
- },
- "nodes": [
- "b07e294259fdd664",
- "c5dcd2bf8b994fb8"
+ "id": "30eb5320bb41dc49",
+ "type": "subflow",
+ "name": "Build HTTP Request",
+ "info": "",
+ "category": "llm request",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "3762dbf4e0957cfa"
+ }
+ ]
+ }
],
- "x": 854,
- "y": 39,
- "w": 352,
- "h": 122
+ "out": [
+ {
+ "x": 360,
+ "y": 40,
+ "wires": [
+ {
+ "id": "3762dbf4e0957cfa",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#FFFFFF"
},
{
- "id": "0e1cb402b61eb646",
+ "id": "3f4aa860a3b350bc",
+ "type": "subflow",
+ "name": "Docker Commit",
+ "info": "",
+ "category": "Docker",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "f3d99166630391d1"
+ }
+ ]
+ }
+ ],
+ "out": [
+ {
+ "x": 580,
+ "y": 260,
+ "wires": [
+ {
+ "id": "9fe7448838c509e5",
+ "port": 0
+ },
+ {
+ "id": "cea8afeae263e378",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [
+ {
+ "name": "Container",
+ "type": "str",
+ "value": ""
+ },
+ {
+ "name": "Repository",
+ "type": "str",
+ "value": ""
+ },
+ {
+ "name": "Tag",
+ "type": "str",
+ "value": ""
+ }
+ ],
+ "meta": {},
+ "color": "#D8BFD8",
+ "icon": "font-awesome/fa-inbox"
+ },
+ {
+ "id": "126e4a373d8bcb36",
+ "type": "subflow",
+ "name": "Extract HTML Tags",
+ "info": "",
+ "category": "llm parsers",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "af3d5caec2de488c"
+ }
+ ]
+ }
+ ],
+ "out": [
+ {
+ "x": 440,
+ "y": 260,
+ "wires": [
+ {
+ "id": "6d6f8c6f67a318de",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#DEBD5C",
+ "icon": "node-red/parser-html.svg"
+ },
+ {
+ "id": "828f5a08b0bcf89d",
+ "type": "subflow",
+ "name": "Parse Markdown",
+ "info": "",
+ "category": "llm parsers",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "e82cac62a6dcc5e2"
+ }
+ ]
+ }
+ ],
+ "out": [
+ {
+ "x": 420,
+ "y": 200,
+ "wires": [
+ {
+ "id": "e935f75b3e48ad5e",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#DEBD5C",
+ "icon": "node-red/hash.svg"
+ },
+ {
+ "id": "87f7528a5c81b545",
+ "type": "subflow",
+ "name": "Import JS Modules",
+ "info": "
Imports given modules for use in subsequent nodes.
\r\n\r\nProperties
\r\n\r\n\r\n - Modulesarray<object | string>
\r\n - Overrides
msg.modules. \r\n
\r\n\r\nInputs
\r\n\r\n\r\n - modulesarray<object | string>
\r\n - A list of modules to import. Modules may be either a string specifying the module name or an\r\n object with the following properties (see:\r\n \r\n import - JavaScript | MDN\r\n \r\n ):\r\n
\r\n moduleName - The module to import \r\n key? (moduleName) - The key to store the module imports under in importedModules.\r\n defaultExport? (true) - Whether to import the default export. If true, will be\r\n imported as default in the imported module. \r\n namedExports? (*) - An array of named exports to import. A named export may be\r\n either a string specifying an export name, or an object with the following properties:\r\n \r\n name - The name of the export.\r\n alias? (name) - The alias to import as.\r\n
\r\n \r\n
\r\n \r\n
\r\n\r\nOutputs
\r\n\r\n\r\n - importedModulesobject
\r\n - A filtered module namespace object (see:\r\n \r\n import() - JavaScript | MDN #Module namespace object\r\n ) containing only the
namedExports and default export (if specified).\r\n \r\n
\r\n\r\nExamples
\r\n\r\nWhen given the following `msg` as input:\r\n\r\n```js\r\n{\r\n ...msg,\r\n modules: [\r\n \"colors/safe\",\r\n {\r\n moduleName: \"change-case\",\r\n key: \"changeCase\",\r\n defaultExport: false,\r\n namedExports: [\r\n \"camelCase\",\r\n {\r\n name: \"split\",\r\n alias: \"splitWords\"\r\n }\r\n ]\r\n }\r\n ]\r\n}\r\n```\r\nThe following msg will be output:\r\n```js\r\n{\r\n ...msg,\r\n importedModules: {\r\n \"colors/safe\": {\r\n \"default\": {\r\n themes,\r\n styles,\r\n ...\r\n },\r\n green,\r\n gray,\r\n white,\r\n ...\r\n },\r\n changeCase: {\r\n camelCase,\r\n splitWords\r\n }\r\n }\r\n}\r\n```\r\n",
+ "category": "llm:util",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "e98dae970d7540c6"
+ }
+ ]
+ }
+ ],
+ "out": [
+ {
+ "x": 1060,
+ "y": 400,
+ "wires": [
+ {
+ "id": "457ddbfd4780ea1d",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [
+ {
+ "name": "Modules",
+ "type": "json",
+ "value": "[]"
+ }
+ ],
+ "meta": {},
+ "color": "#A6BBCF",
+ "icon": "font-awesome/fa-sign-in"
+ },
+ {
+ "id": "d5c98b48f9d2d77f",
+ "type": "subflow",
+ "name": "Decode HTML Entities",
+ "info": "",
+ "category": "llm parsers",
+ "in": [
+ {
+ "x": 50,
+ "y": 30,
+ "wires": [
+ {
+ "id": "4432567301785438"
+ }
+ ]
+ }
+ ],
+ "out": [
+ {
+ "x": 500,
+ "y": 140,
+ "wires": [
+ {
+ "id": "e5c508b6228990f4",
+ "port": 0
+ }
+ ]
+ }
+ ],
+ "env": [],
+ "meta": {},
+ "color": "#DEBD5C",
+ "icon": "font-awesome/fa-file-code-o"
+ },
+ {
+ "id": "573a66c74ad47252",
"type": "group",
- "z": "9e23ccbf2e0608ed",
+ "z": "2b3efcc977e88d91",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
@@ -1369,21 +1639,19 @@
"color": "#a4a4a4"
},
"nodes": [
- "c0c36621780669a4",
- "977f9402195729c4",
- "8ec4c35df45a28c5",
- "aaf9af66d3e39da8",
- "378e8541feaf87ec",
- "45671622e142be7e",
- "33ca3631b9af0d55"
+ "24d6b22fbb3331ef",
+ "fa93074c3844e72a",
+ "e64c01c3ce72e42c",
+ "fd30589c82c22c62",
+ "f99c0d4e42875ff9"
],
- "x": 248,
- "y": 379,
- "w": 438,
- "h": 408
+ "x": 314,
+ "y": 459,
+ "w": 452,
+ "h": 222
},
{
- "id": "8a3c592536de3111",
+ "id": "ffdcd8798ee03933",
"type": "group",
"z": "2b3efcc977e88d91",
"style": {
@@ -1396,18 +1664,19 @@
"color": "#a4a4a4"
},
"nodes": [
- "e71f5a20f7b7837e",
- "c8c9a2cca8781c5f"
+ "d0bc8cbbd38f96d0",
+ "ed0c2d4f1d21f64c",
+ "b7a0d2554c54f30c"
],
"x": 854,
- "y": 419,
- "w": 332,
+ "y": 779,
+ "w": 452,
"h": 142
},
{
- "id": "83fd8826b0ec3bf4",
+ "id": "0e803c0423a03bad",
"type": "group",
- "z": "191694dad2850f37",
+ "z": "2b3efcc977e88d91",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
@@ -1418,23 +1687,18 @@
"color": "#a4a4a4"
},
"nodes": [
- "c85c2df7d79465a0",
- "73516493eccdfd9d",
- "f762ec936046e78f",
- "ce1b28a464e3b3b3",
- "81b98c3380c57334",
- "d48b052e253b43c3",
- "93859b35073996c8"
+ "ec546330d29baba3",
+ "96d1b37cfc101abc"
],
- "x": 74,
- "y": 579,
- "w": 592,
- "h": 368
+ "x": 854,
+ "y": 959,
+ "w": 272,
+ "h": 142
},
{
- "id": "0e31504694a6eb0c",
+ "id": "1309c3c5cd6f1b74",
"type": "group",
- "z": "191694dad2850f37",
+ "z": "2b3efcc977e88d91",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
@@ -1445,13 +1709,157 @@
"color": "#a4a4a4"
},
"nodes": [
- "9d0d59cbd0342094",
- "b67aacc8e54e5106",
- "c533acab9a1bba89",
- "8565c4a9a8c13312"
+ "2f187dab7a1ae2ad",
+ "2c75870eb28bb7c5",
+ "07a96f21f7eb4899",
+ "e9e910c0b95eb6fc"
],
- "x": 74,
- "y": 39,
+ "x": 514,
+ "y": 759,
+ "w": 252,
+ "h": 242
+ },
+ {
+ "id": "3cdc7422abfbe82e",
+ "type": "group",
+ "z": "2b3efcc977e88d91",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "3b2ca8934fb0ccd7",
+ "05af6ff6db82adba"
+ ],
+ "x": 854,
+ "y": 239,
+ "w": 372,
+ "h": 142
+ },
+ {
+ "id": "2ec09f072ab0b146",
+ "type": "group",
+ "z": "2b3efcc977e88d91",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "b07e294259fdd664",
+ "c5dcd2bf8b994fb8"
+ ],
+ "x": 854,
+ "y": 39,
+ "w": 352,
+ "h": 122
+ },
+ {
+ "id": "0e1cb402b61eb646",
+ "type": "group",
+ "z": "9e23ccbf2e0608ed",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "c0c36621780669a4",
+ "977f9402195729c4",
+ "8ec4c35df45a28c5",
+ "aaf9af66d3e39da8",
+ "378e8541feaf87ec",
+ "45671622e142be7e",
+ "33ca3631b9af0d55"
+ ],
+ "x": 248,
+ "y": 379,
+ "w": 438,
+ "h": 408
+ },
+ {
+ "id": "8a3c592536de3111",
+ "type": "group",
+ "z": "2b3efcc977e88d91",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "e71f5a20f7b7837e",
+ "c8c9a2cca8781c5f"
+ ],
+ "x": 854,
+ "y": 419,
+ "w": 332,
+ "h": 142
+ },
+ {
+ "id": "83fd8826b0ec3bf4",
+ "type": "group",
+ "z": "191694dad2850f37",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "c85c2df7d79465a0",
+ "73516493eccdfd9d",
+ "f762ec936046e78f",
+ "ce1b28a464e3b3b3",
+ "81b98c3380c57334",
+ "d48b052e253b43c3",
+ "93859b35073996c8"
+ ],
+ "x": 74,
+ "y": 579,
+ "w": 592,
+ "h": 368
+ },
+ {
+ "id": "0e31504694a6eb0c",
+ "type": "group",
+ "z": "191694dad2850f37",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "9d0d59cbd0342094",
+ "b67aacc8e54e5106",
+ "c533acab9a1bba89",
+ "8565c4a9a8c13312"
+ ],
+ "x": 74,
+ "y": 39,
"w": 512,
"h": 162
},
@@ -1768,6 +2176,192 @@
"w": 438,
"h": 408
},
+ {
+ "id": "f1bf7ba3b4088527",
+ "type": "group",
+ "z": "f6f2187d.f17ca8",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "0dd8b704b63c96a1",
+ "3b853d53f8b1fb4d",
+ "bd7eb8ec2a8e0da9",
+ "d3e4f8597b868498"
+ ],
+ "x": 54,
+ "y": 79,
+ "w": 812,
+ "h": 122
+ },
+ {
+ "id": "856e8d2dc2416b46",
+ "type": "group",
+ "z": "f6f2187d.f17ca8",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "46b306f2e48bb850",
+ "733507b741691f58",
+ "7887225ee569137c",
+ "9f7f53505a88dbb1",
+ "fdb9b09540cd5ba6",
+ "374c4ab5a3ae97c7",
+ "75a002efe0c1f011",
+ "84cb3dac9b9f5d39",
+ "909a59dbc05a2fad",
+ "6fc0878730035324",
+ "b56089ef7ebdddf2",
+ "60e45a11ede888cb",
+ "df970663c1614b1d",
+ "0c165bf98f40b598",
+ "a86d84649831b0fc",
+ "49c1d79c39f3c0a4",
+ "0b6e18ac2c03166b",
+ "e6f08d657cfa77a9",
+ "72d2e05a0acd3fa8",
+ "35aa7e2f151f726c",
+ "f1c8fbcb6c326e46",
+ "bfb495bb4ca9ae6f",
+ "6026847cd96ce18c",
+ "12ca61074a76e5dd",
+ "d8c78c08e407231e",
+ "d75002a1564c11aa",
+ "4534e2dfa3d348df"
+ ],
+ "x": 54,
+ "y": 239,
+ "w": 1372,
+ "h": 502
+ },
+ {
+ "id": "d3ea6600f7f1c7d6",
+ "type": "group",
+ "z": "f6f2187d.f17ca8",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "14dab9180b245706",
+ "1ed0f9b52a08f533"
+ ],
+ "x": 914,
+ "y": 79,
+ "w": 252,
+ "h": 82
+ },
+ {
+ "id": "f7696f05d57ef7a1",
+ "type": "group",
+ "z": "3b5c9ca1fb9ebf48",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "d3eca839cbbe8f34",
+ "d4ebbd593cf64e04",
+ "c2b3e2bf431804bd",
+ "a7de977d7732152e",
+ "8ef6bd83dbaa3d85",
+ "4c7815cb04fa305a",
+ "3e0ce960e9b660a1"
+ ],
+ "x": 88,
+ "y": 599,
+ "w": 438,
+ "h": 408
+ },
+ {
+ "id": "e18c67f0ba18707b",
+ "type": "group",
+ "z": "3fb1b07be44ed756",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "b75f0d8130661559",
+ "26a114fc27cd90b0",
+ "ea2d35fce99de4ae",
+ "8f75c3504c3dbc5f",
+ "e22d75a202b3a7d9",
+ "233b190c4bba2abc",
+ "18e60cf6d75b5c02",
+ "366fdac4502597e4",
+ "f58a612cea662f7f",
+ "3163545a452b8023",
+ "f4e0940a4675e15a",
+ "d5dd065101ef890a",
+ "4a5b440f0562c4c5",
+ "437a9435e7f7839a",
+ "234a56ef02849517",
+ "bd0ab9ac636bddf7",
+ "4b1052f331f48638",
+ "f119a534c23868e3",
+ "7e92245bb06f8113",
+ "a11718080bf06447",
+ "11de70778f4fcccb"
+ ],
+ "x": 794,
+ "y": 299,
+ "w": 842,
+ "h": 502
+ },
+ {
+ "id": "d20e17ae1f88e910",
+ "type": "group",
+ "z": "3b5c9ca1fb9ebf48",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "dd6437290fd336e7",
+ "7ab56a5e25543ac8",
+ "583705d65356bc91",
+ "5ae745cf98b55950",
+ "35a1e0a9c30682f6"
+ ],
+ "x": 534,
+ "y": 1394,
+ "w": 412,
+ "h": 147
+ },
{
"id": "aaf9af66d3e39da8",
"type": "group",
@@ -1888,6 +2482,30 @@
"w": 372,
"h": 122
},
+ {
+ "id": "a7de977d7732152e",
+ "type": "group",
+ "z": "3b5c9ca1fb9ebf48",
+ "g": "f7696f05d57ef7a1",
+ "style": {
+ "stroke": "#999999",
+ "stroke-opacity": "1",
+ "fill": "none",
+ "fill-opacity": "1",
+ "label": true,
+ "label-position": "nw",
+ "color": "#a4a4a4"
+ },
+ "nodes": [
+ "1c9144b2ef0b4dd5",
+ "399f0d05531fcfd6",
+ "504106b997f60dbe"
+ ],
+ "x": 114,
+ "y": 859,
+ "w": 372,
+ "h": 122
+ },
{
"id": "b6cc1b3167117b16",
"type": "junction",
@@ -1901,9 +2519,134 @@
]
},
{
- "id": "abd5674a230a71e1",
- "type": "function",
- "z": "9941dd1769d8bb1b",
+ "id": "b3c027b1a78e62ca",
+ "type": "junction",
+ "z": "d5c30c295cb6b7bc",
+ "x": 480,
+ "y": 340,
+ "wires": [
+ [
+ "5be0298a22eb5f2a"
+ ]
+ ]
+ },
+ {
+ "id": "cf1db7761982b2fc",
+ "type": "junction",
+ "z": "b9a9b43a3594c357",
+ "x": 540,
+ "y": 720,
+ "wires": [
+ [
+ "5a94f86438968b9b"
+ ]
+ ]
+ },
+ {
+ "id": "583705d65356bc91",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "g": "d20e17ae1f88e910",
+ "x": 920,
+ "y": 1460,
+ "wires": [
+ [
+ "5ae745cf98b55950"
+ ]
+ ]
+ },
+ {
+ "id": "b136a36f1f060bab",
+ "type": "junction",
+ "z": "b9a9b43a3594c357",
+ "x": 1140,
+ "y": 960,
+ "wires": [
+ [
+ "0a96edc6fd08333b"
+ ]
+ ]
+ },
+ {
+ "id": "7ab56a5e25543ac8",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "g": "d20e17ae1f88e910",
+ "x": 600,
+ "y": 1420,
+ "wires": [
+ [
+ "8249b529648a77f1"
+ ]
+ ]
+ },
+ {
+ "id": "35a1e0a9c30682f6",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "g": "d20e17ae1f88e910",
+ "x": 560,
+ "y": 1500,
+ "wires": [
+ [
+ "940cc0ae14188d1c"
+ ]
+ ]
+ },
+ {
+ "id": "824ad7c29ee4fd68",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "x": 900,
+ "y": 460,
+ "wires": [
+ [
+ "3856fb6b7a093891"
+ ]
+ ]
+ },
+ {
+ "id": "63a5c80a9677a5e8",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "x": 940,
+ "y": 1260,
+ "wires": [
+ [
+ "a08be90792caa2ef"
+ ]
+ ]
+ },
+ {
+ "id": "a02641d0cd9d6dbe",
+ "type": "junction",
+ "z": "3b5c9ca1fb9ebf48",
+ "x": 940,
+ "y": 1100,
+ "wires": [
+ [
+ "f2d99994f035a684"
+ ]
+ ]
+ },
+ {
+ "id": "41aad7d8f71cd6e6",
+ "type": "tls-config",
+ "name": "",
+ "cert": "",
+ "key": "",
+ "ca": "",
+ "certname": "",
+ "keyname": "",
+ "caname": "localhost.crt",
+ "servername": "",
+ "verifyservercert": false,
+ "alpnprotocol": ""
+ },
+ {
+ "id": "abd5674a230a71e1",
+ "type": "function",
+ "z": "9941dd1769d8bb1b",
"name": "Inject context",
"func": "const toInject = Object.fromEntries(\n env.get(\"Keys\").map(k => [k, flow.get(`$parent.${k}`)])\n);\n\nmsg = {\n ...msg,\n ...toInject\n};\n\nreturn msg;",
"outputs": 1,
@@ -5400,7 +6143,7 @@
"id": "8bfba49dc9b231a0",
"type": "http request",
"z": "f0aa5f2ed7dab3b8",
- "name": "Send request",
+ "name": "Body request / json response",
"method": "use",
"ret": "obj",
"paytoqs": "ignore",
@@ -5412,50 +6155,28 @@
"authType": "",
"senderr": false,
"headers": [],
- "x": 570,
- "y": 220,
+ "x": 580,
+ "y": 240,
"wires": [
[
"3d6d82698400006b"
]
]
},
- {
- "id": "a94bb02058f6c758",
- "type": "function",
- "z": "f0aa5f2ed7dab3b8",
- "name": "Build request",
- "func": "// we should just be able to disable this -- stupid\nmsg.requestTimeout = 60 * 60 * 1000;\nreturn msg;",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 570,
- "y": 180,
- "wires": [
- [
- "8bfba49dc9b231a0",
- "cb132b2beb3c794e",
- "4d595b2ab5d73f41"
- ]
- ]
- },
{
"id": "3d6d82698400006b",
"type": "function",
"z": "f0aa5f2ed7dab3b8",
"name": "Handle response",
- "func": "// if this is a forward messge\nif (msg.action == \"forward-msg\") {\n // save our msg for later\n msg.action = msg.msgAction;\n delete msg.msgAction;\n context.set(\"forwardedMsg\", msg);\n // don't send anything for now\n return;\n}\n\n// get any forwarded input we might have\nconst forwardedMsg = context.get(\"forwardedMsg\");\n\n// if an error occurred\nif (typeof msg.statusCode == \"string\") {\n return {\n action: \"http-error\",\n error: msg.payload,\n msgIn: forwardedMsg\n };\n}\n\n// else, we at least got a response\n// if it was an error response\nif (msg.statusCode >= 400) {\n return {\n action: \"http-error\",\n error: msg.payload,\n msgIn: forwardedMsg\n };\n}\n\n// else, we got a successful response\nreturn {\n ...msg,\n action: \"http-success\",\n msgIn: forwardedMsg\n};\n",
+ "func": "// if this is a forward messge\nif (msg.action == \"forward-msg\") {\n // save our msg for later\n msg.action = msg.msgAction;\n delete msg.msgAction;\n context.set(\"forwardedMsg\", msg);\n // don't send anything for now\n return;\n}\n\n// get any forwarded input we might have\nconst forwardedMsg = context.get(\"forwardedMsg\");\n\n// if an error occurred\nif (typeof msg.statusCode == \"string\") {\n return {\n action: \"http-error\",\n error: msg.payload,\n msgIn: forwardedMsg\n };\n}\n\n// else, we at least got a response\n// if it was an error response\nif (msg.statusCode >= 400) {\n return {\n action: \"http-error\",\n error: msg.payload,\n msgIn: forwardedMsg\n };\n}\n\n// else, we got a successful response\nreturn {\n ...msg,\n action: \"http-success\",\n content: msg.payload,\n msgIn: forwardedMsg\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 590,
- "y": 260,
+ "x": 930,
+ "y": 360,
"wires": [
[]
]
@@ -5472,40 +6193,19 @@
"initialize": "",
"finalize": "",
"libs": [],
- "x": 350,
- "y": 260,
+ "x": 710,
+ "y": 180,
"wires": [
[
"3d6d82698400006b"
]
]
},
- {
- "id": "cb132b2beb3c794e",
- "type": "function",
- "z": "f0aa5f2ed7dab3b8",
- "name": " ",
- "func": "\nreturn msg;",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 295,
- "y": 220,
- "wires": [
- [
- "3979567024f92d8a"
- ]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
- },
{
"id": "4d595b2ab5d73f41",
"type": "debug",
"z": "f0aa5f2ed7dab3b8",
+ "d": true,
"name": "HTTP Requests",
"active": true,
"tosidebar": true,
@@ -5515,108 +6215,308 @@
"targetType": "full",
"statusVal": "",
"statusType": "auto",
- "x": 800,
- "y": 180,
+ "x": 480,
+ "y": 80,
"wires": []
},
{
- "id": "446ec29fe6cf3270",
+ "id": "477f39c216daeebe",
+ "type": "http request",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Querystring request / json response",
+ "method": "GET",
+ "ret": "obj",
+ "paytoqs": "query",
+ "url": "",
+ "tls": "",
+ "persist": false,
+ "proxy": "",
+ "insecureHTTPParser": false,
+ "authType": "",
+ "senderr": false,
+ "headers": [],
+ "x": 600,
+ "y": 280,
+ "wires": [
+ [
+ "3d6d82698400006b"
+ ]
+ ]
+ },
+ {
+ "id": "6f50302a0314605e",
"type": "switch",
- "z": "a4137713471da6c4",
- "name": "Action",
- "property": "action",
- "propertyType": "msg",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Payload Response Mode",
+ "property": "msg.payloadResponseMode",
+ "propertyType": "jsonata",
"rules": [
{
"t": "eq",
- "v": "history-add-entry",
+ "v": "body-json",
"vt": "str"
},
{
"t": "eq",
- "v": "vector-store-search",
+ "v": "querystring-json",
"vt": "str"
},
{
"t": "eq",
- "v": "history-init",
+ "v": "body-text",
"vt": "str"
},
{
- "t": "else"
+ "t": "eq",
+ "v": "querystring-text",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "body-buffer",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "querystring-buffer",
+ "vt": "str"
}
],
"checkall": "true",
"repair": false,
- "outputs": 4,
- "x": 210,
- "y": 280,
+ "outputs": 6,
+ "x": 250,
+ "y": 360,
"wires": [
[
- "87b2fd9be71c70e8"
+ "8bfba49dc9b231a0"
],
[
- "2ef9041ac1eff817"
+ "477f39c216daeebe"
],
[
- "a96c909aaf955b96"
+ "82eed4434b86a830"
],
[
- "a57a1ec5360af43f"
+ "47e72b16872c9c29"
+ ],
+ [
+ "eb064815eab65390"
+ ],
+ [
+ "6b3fa08227a4a132"
]
]
},
{
- "id": "c2c1a70fd9f36e28",
- "type": "subflow:74bd10ee8e354d0a",
- "z": "a4137713471da6c4",
- "name": "",
- "x": 820,
- "y": 260,
+ "id": "82eed4434b86a830",
+ "type": "http request",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Body request / string response",
+ "method": "use",
+ "ret": "txt",
+ "paytoqs": "ignore",
+ "url": "",
+ "tls": "",
+ "persist": false,
+ "proxy": "",
+ "insecureHTTPParser": false,
+ "authType": "",
+ "senderr": false,
+ "headers": [],
+ "x": 590,
+ "y": 340,
"wires": [
[
- "5511b481a5af2321"
+ "3d6d82698400006b"
]
]
},
{
- "id": "a96c909aaf955b96",
- "type": "function",
- "z": "a4137713471da6c4",
- "name": "Set init props",
- "func": "msg.historyNew = env.get(\"New\") || msg.historyNew;\nmsg.historySourceFilename = env.get(\"SourceFilename\") || msg.historySourceFilename;\nmsg.historyId = env.get(\"Id\") || msg.historyId;\n\nreturn msg;\n",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 430,
- "y": 400,
+ "id": "47e72b16872c9c29",
+ "type": "http request",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Querystring request / string response",
+ "method": "GET",
+ "ret": "txt",
+ "paytoqs": "query",
+ "url": "",
+ "tls": "",
+ "persist": false,
+ "proxy": "",
+ "insecureHTTPParser": false,
+ "authType": "",
+ "senderr": false,
+ "headers": [],
+ "x": 610,
+ "y": 380,
"wires": [
[
- "c2c1a70fd9f36e28"
+ "3d6d82698400006b"
]
]
},
{
- "id": "736a5f71119f063f",
- "type": "switch",
- "z": "a4137713471da6c4",
- "name": "history-add-entry role",
- "property": "entryRole",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "user",
- "vt": "str"
- },
- {
- "t": "else"
- }
- ],
- "checkall": "true",
+ "id": "eb064815eab65390",
+ "type": "http request",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Body request / buffer response",
+ "method": "use",
+ "ret": "bin",
+ "paytoqs": "ignore",
+ "url": "",
+ "tls": "",
+ "persist": false,
+ "proxy": "",
+ "insecureHTTPParser": false,
+ "authType": "",
+ "senderr": false,
+ "headers": [],
+ "x": 590,
+ "y": 440,
+ "wires": [
+ [
+ "3d6d82698400006b"
+ ]
+ ]
+ },
+ {
+ "id": "6b3fa08227a4a132",
+ "type": "http request",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "Querystring request / buffer response",
+ "method": "GET",
+ "ret": "bin",
+ "paytoqs": "query",
+ "url": "",
+ "tls": "",
+ "persist": false,
+ "proxy": "",
+ "insecureHTTPParser": false,
+ "authType": "",
+ "senderr": false,
+ "headers": [],
+ "x": 610,
+ "y": 480,
+ "wires": [
+ [
+ "3d6d82698400006b"
+ ]
+ ]
+ },
+ {
+ "id": "1c4e6c80d9868fa0",
+ "type": "subflow:30eb5320bb41dc49",
+ "z": "f0aa5f2ed7dab3b8",
+ "name": "",
+ "x": 250,
+ "y": 100,
+ "wires": [
+ [
+ "4d595b2ab5d73f41",
+ "6f50302a0314605e",
+ "3979567024f92d8a"
+ ]
+ ]
+ },
+ {
+ "id": "446ec29fe6cf3270",
+ "type": "switch",
+ "z": "a4137713471da6c4",
+ "name": "Action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "history-add-entry",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "vector-store-search",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "history-init",
+ "vt": "str"
+ },
+ {
+ "t": "else"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 4,
+ "x": 210,
+ "y": 280,
+ "wires": [
+ [
+ "87b2fd9be71c70e8"
+ ],
+ [
+ "2ef9041ac1eff817"
+ ],
+ [
+ "a96c909aaf955b96"
+ ],
+ [
+ "a57a1ec5360af43f"
+ ]
+ ]
+ },
+ {
+ "id": "c2c1a70fd9f36e28",
+ "type": "subflow:74bd10ee8e354d0a",
+ "z": "a4137713471da6c4",
+ "name": "",
+ "x": 820,
+ "y": 260,
+ "wires": [
+ [
+ "5511b481a5af2321"
+ ]
+ ]
+ },
+ {
+ "id": "a96c909aaf955b96",
+ "type": "function",
+ "z": "a4137713471da6c4",
+ "name": "Set init props",
+ "func": "msg.historyNew = env.get(\"New\") || msg.historyNew;\nmsg.historySourceFilename = env.get(\"SourceFilename\") || msg.historySourceFilename;\nmsg.historyId = env.get(\"Id\") || msg.historyId;\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 430,
+ "y": 400,
+ "wires": [
+ [
+ "c2c1a70fd9f36e28"
+ ]
+ ]
+ },
+ {
+ "id": "736a5f71119f063f",
+ "type": "switch",
+ "z": "a4137713471da6c4",
+ "name": "history-add-entry role",
+ "property": "entryRole",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "user",
+ "vt": "str"
+ },
+ {
+ "t": "else"
+ }
+ ],
+ "checkall": "true",
"repair": false,
"outputs": 2,
"x": 460,
@@ -5886,7 +6786,7 @@
"type": "function",
"z": "f19bc65164444615",
"name": "Init",
- "func": "msg.id = env.get(\"Factory Id\") || msg.factoryId || `programatic-history-factory-${Math.floor(Math.random() * 1000)}`;\nmsg.histories = {};\n\nflow.set(\"Id\", msg.id);\nflow.set(\"Histories\", msg.histories);\n\nreturn msg;\n",
+ "func": "msg.id = env.get(\"Factory Id\") || msg.factoryId || `programatic-history-factory-${Date.now()}`;\nmsg.histories = {};\n\nflow.set(\"Id\", msg.id);\nflow.set(\"Histories\", msg.histories);\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
@@ -5945,7 +6845,7 @@
"type": "function",
"z": "f19bc65164444615",
"name": "Create History",
- "func": "const defaultId = `programatic-history-${Math.floor(Math.random() * 1000)}`;\n\nmsg.action = \"history-init\";\n\nif (!msg.historyId) {\n msg.historyId = defaultId;\n}\n\n// if this history already exists\nif (msg.histories[msg.historyId]) {\n node.warn(`Ignoring init action for existing programatic history: ${msg.historyId}`);\n return;\n}\n\nif (!msg.historySourceFilename) {\n msg.historySourceFilename = `/data/db/${defaultId}.json`;\n}\n\nmsg.histories[msg.historyId] = msg.historySourceFilename;\n\nreturn msg;\n",
+ "func": "const defaultId = `programatic-history-${Date.now()}`;\n\nmsg.action = \"history-init\";\n\nif (!msg.historyId) {\n msg.historyId = defaultId;\n}\n\n// if this history already exists\nif (msg.histories[msg.historyId]) {\n node.warn(`Ignoring init action for existing programatic history: ${msg.historyId}`);\n return;\n}\n\nif (!msg.historySourceFilename) {\n msg.historySourceFilename = `/data/db/${defaultId}.json`;\n}\n\nmsg.histories[msg.historyId] = msg.historySourceFilename;\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
@@ -6200,25 +7100,45 @@
"type": "function",
"z": "21de8117bd1967f9",
"name": "extractHtmlTags",
- "func": "msg.extractHtmlTags = (text) => {\n const tagRegex = /<([A-Za-z0-9-_:.]*)>([\\s\\S]*?)<\\/([A-Za-z0-9_:.-]*)>/g;\n const tags = [];\n let matches;\n while (matches = tagRegex.exec(text)) {\n const [_, openingTag, tagContent, closingTag] = matches;\n\n // if tags don't match\n if (openingTag != closingTag) {\n //skip it\n continue;\n }\n tags.push({tag: openingTag, content: tagContent});\n }\n return tags;\n}\n\nreturn msg;\n",
+ "func": "const { default: { default: JSSoup } } = msg.importedModules['jssoup'];\n\nmsg.extractHtmlTags = (text) =>\n // get all tags from content\n new JSSoup(text).descendants\n // only return HTML tags\n .filter(it => it.name)\n // get tag name and content\n .map(({name, contents}) => ({ name, content: contents?.join('') ?? '' }));\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 260,
- "y": 120,
+ "x": 380,
+ "y": 220,
"wires": [
[]
]
},
+ {
+ "id": "3d458d6f47d14634",
+ "type": "subflow:87f7528a5c81b545",
+ "z": "21de8117bd1967f9",
+ "name": "Import jssoup",
+ "env": [
+ {
+ "name": "Modules",
+ "value": "[\"jssoup\"]",
+ "type": "json"
+ }
+ ],
+ "x": 380,
+ "y": 180,
+ "wires": [
+ [
+ "0a432a478665f6a9"
+ ]
+ ]
+ },
{
"id": "af73ebafaf5dc5f2",
"type": "function",
"z": "240cc03734c17fa7",
"name": "Parse Response",
- "func": "// if this is not a stream ending\nif (msg.action != \"history-update-streaming\" || msg.history.streaming) {\n return;\n}\n\nconst response = msg.history.entries.slice(-1)[0].content;\nconst responseTags = msg.extractHtmlTags(response);\n\n// send message for every tag\nreturn [\n responseTags.map(({tag, content}) => ({\n tag,\n content,\n agentId: msg.historyId\n }))\n];\n",
+ "func": "// if this is not a stream ending\nif (msg.action != \"history-update-streaming\" || msg.history.streaming) {\n return;\n}\n\nconst response = msg.history.entries.slice(-1)[0].content;\nconst responseTags = msg.extractHtmlTags(response);\n\n// send message for every tag\nreturn [\n responseTags.map(({name, content}) => ({\n tag: name,\n content,\n agentId: msg.historyId\n }))\n];\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
@@ -6245,1570 +7165,1268 @@
]
},
{
- "id": "c0c36621780669a4",
- "type": "subflow:a59054999730c251",
- "z": "9e23ccbf2e0608ed",
- "d": true,
- "g": "0e1cb402b61eb646",
- "name": "Model - openai - localhost",
- "env": [
- {
- "name": "Id",
- "value": "openai-localhost",
- "type": "str"
- },
+ "id": "1540fd3640a5c2da",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Container spec",
+ "func": "msg.name = env.get(\"Container Name\") || msg.containerName || `genai-container-${Date.now()}`;\nmsg.image = env.get(\"Image\") || msg.image;\nmsg.command = env.get(\"Command\") || msg.command;\nmsg.args = yargs(env.get(\"Docker Run Args\") || msg.dockerRunArgs).parse();\nmsg.responseMode = env.get(\"Response Mode\") || msg.responseMode || 'full';\nmsg.commit = env.get(\"Commit\") || msg.commit || false;\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
{
- "name": "BaseUrl",
- "value": "http://host.docker.internal:8080",
- "type": "str"
+ "var": "yargs",
+ "module": "yargs"
}
],
- "x": 410,
- "y": 520,
+ "x": 240,
+ "y": 100,
"wires": [
[
- "45671622e142be7e"
+ "68cbcf691071823e"
]
]
},
{
- "id": "948e1265a14409b8",
- "type": "debug",
- "z": "9e23ccbf2e0608ed",
- "g": "aaf9af66d3e39da8",
- "name": "Model Errors",
- "active": true,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 510,
- "y": 720,
- "wires": []
+ "id": "68cbcf691071823e",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Create container",
+ "func": "\nreturn {\n method: \"POST\",\n url: `http://docker-engine-api:2375/containers/create?name=${msg.name}`,\n payload: {\n Cmd: msg.command,\n Image: msg.image\n },\n containerSpec: msg\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 250,
+ "y": 180,
+ "wires": [
+ [
+ "2163e4e6c0ca65f7"
+ ]
+ ]
},
{
- "id": "977f9402195729c4",
- "type": "subflow:a59054999730c251",
- "z": "9e23ccbf2e0608ed",
- "g": "0e1cb402b61eb646",
- "name": "Model - genai - llama-cpp-llava",
- "env": [
- {
- "name": "Id",
- "value": "genai-llama-cpp-llava",
- "type": "str"
- },
- {
- "name": "BaseUrl",
- "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava",
- "type": "str"
- }
- ],
- "x": 430,
- "y": 560,
+ "id": "2163e4e6c0ca65f7",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "b9a9b43a3594c357",
+ "name": "",
+ "x": 240,
+ "y": 220,
"wires": [
[
- "45671622e142be7e"
+ "c0e105a4e8c1ed29"
]
]
},
{
- "id": "a63ac3946c2843eb",
- "type": "debug",
- "z": "9e23ccbf2e0608ed",
- "d": true,
- "g": "aaf9af66d3e39da8",
- "name": "Model Output",
- "active": true,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 520,
- "y": 680,
- "wires": []
+ "id": "28417899327d5e30",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Start container",
+ "func": "const containerId = msg.msgIn.containerSpec.id = msg.content.Id;\n\nreturn {\n method: \"POST\",\n url: `http://docker-engine-api:2375/containers/${containerId}/start`,\n containerSpec: msg.msgIn.containerSpec\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 240,
+ "y": 340,
+ "wires": [
+ [
+ "10e31bc197b72db3"
+ ]
+ ]
},
{
- "id": "5e149325f881f48b",
- "type": "subflow:2b3efcc977e88d91",
- "z": "9e23ccbf2e0608ed",
- "name": "",
- "env": [
+ "id": "c0e105a4e8c1ed29",
+ "type": "switch",
+ "z": "b9a9b43a3594c357",
+ "name": "If http-success",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
{
- "name": "Url",
- "value": "simple-chat",
- "type": "str"
+ "t": "eq",
+ "v": "http-success",
+ "vt": "str"
+ },
+ {
+ "t": "else"
}
],
- "x": 550,
- "y": 160,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 240,
+ "y": 260,
"wires": [
[
- "246a383da043e031",
- "34dd380b3322dc77"
+ "28417899327d5e30"
+ ],
+ [
+ "f2d7034e67ca9556"
]
]
},
{
- "id": "8ec4c35df45a28c5",
- "type": "comment",
- "z": "9e23ccbf2e0608ed",
- "g": "0e1cb402b61eb646",
- "name": "Models",
- "info": "",
- "x": 350,
- "y": 420,
- "wires": []
+ "id": "f2d7034e67ca9556",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Handle error",
+ "func": "\nreturn {\n ...msg,\n action: \"docker-error\"\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1010,
+ "y": 560,
+ "wires": [
+ [
+ "b136a36f1f060bab"
+ ]
+ ]
},
{
- "id": "246a383da043e031",
- "type": "subflow:74bd10ee8e354d0a",
- "z": "9e23ccbf2e0608ed",
+ "id": "10e31bc197b72db3",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "b9a9b43a3594c357",
"name": "",
- "env": [
- {
- "name": "SourceFilename",
- "value": "/data/db/history-1711926907124.json",
- "type": "str"
- }
- ],
- "x": 310,
- "y": 220,
+ "x": 240,
+ "y": 380,
"wires": [
[
- "c865bad2cdc088e0"
+ "f298903bf9973df7"
]
]
},
{
- "id": "b1093b3dfa80dbe3",
+ "id": "f298903bf9973df7",
"type": "switch",
- "z": "9e23ccbf2e0608ed",
- "g": "aaf9af66d3e39da8",
- "name": "Action",
+ "z": "b9a9b43a3594c357",
+ "name": "If http-success",
"property": "action",
"propertyType": "msg",
"rules": [
{
"t": "eq",
- "v": "model-content",
+ "v": "http-success",
"vt": "str"
},
{
- "t": "eq",
- "v": "model-error",
- "vt": "str"
+ "t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
- "x": 350,
- "y": 700,
+ "x": 240,
+ "y": 420,
"wires": [
[
- "a63ac3946c2843eb"
+ "f5ad23d6f9a6c234",
+ "0dd1355d2588c8a9"
],
[
- "948e1265a14409b8"
- ]
- ]
- },
- {
- "id": "8e313642e9e9049a",
- "type": "inject",
- "z": "9e23ccbf2e0608ed",
- "name": "Start App",
- "props": [
- {
- "p": "timestamp",
- "v": "",
- "vt": "date"
- },
- {
- "p": "action",
- "v": "history-init",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "x": 140,
- "y": 100,
- "wires": [
- [
- "246a383da043e031"
+ "f2d7034e67ca9556"
]
]
},
{
- "id": "378e8541feaf87ec",
- "type": "subflow:a59054999730c251",
- "z": "9e23ccbf2e0608ed",
- "d": true,
- "g": "0e1cb402b61eb646",
- "name": "Model - dummy sse",
- "env": [
- {
- "name": "Id",
- "value": "dummy-sse",
- "type": "str"
- },
- {
- "name": "BaseUrl",
- "value": "http://host.docker.internal:8091",
- "type": "str"
- },
- {
- "name": "Batch",
- "value": "10",
- "type": "num"
- }
- ],
- "x": 390,
- "y": 480,
+ "id": "76e87439b348d398",
+ "type": "subflow:72ced27310c541f6",
+ "z": "b9a9b43a3594c357",
+ "name": "",
+ "x": 480,
+ "y": 540,
"wires": [
[
- "45671622e142be7e"
+ "bf699708b661931a"
]
]
},
{
- "id": "45671622e142be7e",
+ "id": "f5ad23d6f9a6c234",
"type": "function",
- "z": "9e23ccbf2e0608ed",
- "g": "0e1cb402b61eb646",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "b9a9b43a3594c357",
+ "name": "Get stdout",
+ "func": "const containerId = msg.msgIn.containerSpec.id;\n\nreturn {\n method: \"GET\",\n url: `http://docker-engine-api:2375/containers/${containerId}/logs`,\n payloadMode: 'querystring',\n payload: {\n follow: true,\n stdout: true,\n stderr: false\n },\n headers: {\n 'accept': 'text/string',\n },\n containerSpec: msg.msgIn.containerSpec,\n outputMode: msg.msgIn.containerSpec.outputMode\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 645,
- "y": 580,
+ "x": 470,
+ "y": 500,
"wires": [
[
- "246a383da043e031",
- "b1093b3dfa80dbe3"
+ "76e87439b348d398"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "33ca3631b9af0d55",
- "type": "subflow:a59054999730c251",
- "z": "9e23ccbf2e0608ed",
- "d": true,
- "g": "0e1cb402b61eb646",
- "name": "Model - genai - llama-cpp-mistral-8x",
- "env": [
+ "id": "bf699708b661931a",
+ "type": "switch",
+ "z": "b9a9b43a3594c357",
+ "name": "cURL Action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
{
- "name": "Id",
- "value": "genai-llama-cpp-mistral-8x",
- "type": "str"
+ "t": "eq",
+ "v": "command-stderr",
+ "vt": "str"
},
{
- "name": "BaseUrl",
- "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-mistral-8x",
- "type": "str"
+ "t": "eq",
+ "v": "command-exit",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "command-stdout",
+ "vt": "str"
}
],
- "x": 440,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 3,
+ "x": 470,
"y": 600,
"wires": [
[
- "45671622e142be7e"
+ "f2d7034e67ca9556"
+ ],
+ [
+ "4adad0a3f6b3b9a0"
+ ],
+ [
+ "8ea54312d07a6fdc"
]
]
},
{
- "id": "d9e8ec2ee480957d",
+ "id": "ac62a774eb153489",
+ "type": "switch",
+ "z": "b9a9b43a3594c357",
+ "name": "Exit Code",
+ "property": "msg.exit.code",
+ "propertyType": "jsonata",
+ "rules": [
+ {
+ "t": "neq",
+ "v": "0",
+ "vt": "num"
+ },
+ {
+ "t": "else"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 680,
+ "y": 640,
+ "wires": [
+ [
+ "f2d7034e67ca9556"
+ ],
+ [
+ "3915149c0c74af4b"
+ ]
+ ]
+ },
+ {
+ "id": "8ea54312d07a6fdc",
"type": "function",
- "z": "9e23ccbf2e0608ed",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "b9a9b43a3594c357",
+ "name": "Handle stdout",
+ "func": "if (!msg.content) {\n return;\n}\n\nreturn {\n ...msg,\n containerSpec: msg.msgIn.containerSpec,\n action: \"docker-stdout\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 205,
- "y": 460,
+ "x": 700,
+ "y": 1240,
"wires": [
[
- "378e8541feaf87ec",
- "c0c36621780669a4",
- "977f9402195729c4",
- "33ca3631b9af0d55"
+ "b136a36f1f060bab"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "c865bad2cdc088e0",
+ "id": "c02417dc4c8df8e5",
"type": "function",
- "z": "9e23ccbf2e0608ed",
- "g": "bf3cb919a9b18a74",
- "name": "System Prompt",
- "func": "// Initial prompt\nconst initialPrompt = `You are a helpful chat bot that will perform any requested tasks to the best of your ability.`;\n\n// if this is an update prompt message\nif (msg.action == \"prompt-update\") {\n // update our prompt\n context.set(\"prompt\", msg.prompt);\n // that's all\n return msg;\n}\n\n// get current prompt\nlet currentPrompt = context.get(\"prompt\");\n\nif (!currentPrompt) {\n currentPrompt = initialPrompt\n context.set(\"prompt\", currentPrompt);\n}\n\nmsg.systemPrompt = currentPrompt;\n\nreturn msg;\n",
+ "z": "b9a9b43a3594c357",
+ "name": "Handle success",
+ "func": "\nreturn {\n ...msg,\n action: \"docker-done\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 580,
- "y": 320,
+ "x": 1000,
+ "y": 960,
"wires": [
[
- "5e149325f881f48b",
- "d9e8ec2ee480957d"
+ "b136a36f1f060bab"
]
]
},
{
- "id": "34dd380b3322dc77",
+ "id": "5a94f86438968b9b",
"type": "switch",
- "z": "9e23ccbf2e0608ed",
- "g": "bf3cb919a9b18a74",
- "name": "If prompt action",
- "property": "action",
- "propertyType": "msg",
+ "z": "b9a9b43a3594c357",
+ "name": "If remove container",
+ "property": "msg.containerSpec.args.rm",
+ "propertyType": "jsonata",
"rules": [
{
- "t": "regex",
- "v": "^prompt-",
- "vt": "str",
- "case": false
+ "t": "eq",
+ "v": "true",
+ "vt": "jsonata"
+ },
+ {
+ "t": "else"
}
],
"checkall": "true",
"repair": false,
- "outputs": 1,
- "x": 580,
- "y": 280,
+ "outputs": 2,
+ "x": 710,
+ "y": 960,
"wires": [
[
- "c865bad2cdc088e0"
+ "154690456a2fc9f8"
+ ],
+ [
+ "c02417dc4c8df8e5"
]
]
},
{
- "id": "fe160cbe0df384e5",
- "type": "template",
- "z": "191694dad2850f37",
- "name": "System Prompt",
- "field": "prompt",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "You are a helpful chat bot that will perform any requested tasks to the best of your ability.",
- "output": "str",
- "x": 200,
- "y": 520,
+ "id": "154690456a2fc9f8",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Remove container",
+ "func": "const containerSpec = msg.containerSpec;\n\nreturn {\n method: \"DELETE\",\n url: `http://docker-engine-api:2375/containers/${containerSpec.id}?v=true`,\n containerSpec,\n exit: msg.exit\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 710,
+ "y": 1040,
"wires": [
[
- "81b98c3380c57334"
+ "ed312f61da898031"
]
]
},
{
- "id": "34fa053e9707e425",
- "type": "subflow:74bd10ee8e354d0a",
- "z": "191694dad2850f37",
- "g": "b1dd9777ee396bd7",
- "name": "Solution History",
- "env": [
- {
- "name": "Id",
- "value": "solution-01",
- "type": "str"
- }
- ],
- "x": 480,
- "y": 380,
+ "id": "ed312f61da898031",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "b9a9b43a3594c357",
+ "name": "",
+ "x": 700,
+ "y": 1080,
"wires": [
[
- "8565c4a9a8c13312",
- "88802dbd1e8b0c57",
- "b38cd518b824c20d"
+ "2310df3f0167dbf7"
]
]
},
{
- "id": "9d0d59cbd0342094",
- "type": "inject",
- "z": "191694dad2850f37",
- "g": "0e31504694a6eb0c",
- "name": "Start Loop",
- "props": [
+ "id": "2310df3f0167dbf7",
+ "type": "switch",
+ "z": "b9a9b43a3594c357",
+ "name": "If http-success",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
{
- "p": "action",
- "v": "step-go-to",
+ "t": "eq",
+ "v": "http-success",
"vt": "str"
+ },
+ {
+ "t": "else"
}
],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "x": 500,
- "y": 80,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 700,
+ "y": 1120,
"wires": [
[
- "b67aacc8e54e5106"
+ "5047c7f754d6aa6d"
+ ],
+ [
+ "f2d7034e67ca9556"
]
]
},
{
- "id": "c85c2df7d79465a0",
- "type": "subflow:a59054999730c251",
- "z": "191694dad2850f37",
- "d": true,
- "g": "83fd8826b0ec3bf4",
- "name": "Model - dummy sse",
- "env": [
- {
- "name": "Id",
- "value": "dummy-sse",
- "type": "str"
- },
- {
- "name": "BaseUrl",
- "value": "http://host.docker.internal:8091",
- "type": "str"
- },
- {
- "name": "Batch",
- "value": "10",
- "type": "num"
- }
- ],
- "x": 330,
- "y": 680,
+ "id": "0dc9efa99bce1f0c",
+ "type": "subflow:72ced27310c541f6",
+ "z": "b9a9b43a3594c357",
+ "name": "",
+ "x": 240,
+ "y": 540,
"wires": [
[
- "d48b052e253b43c3"
+ "d713530df83a6cc3"
]
]
},
{
- "id": "73516493eccdfd9d",
- "type": "subflow:a59054999730c251",
- "z": "191694dad2850f37",
- "g": "83fd8826b0ec3bf4",
- "name": "Model - genai - llama-cpp-llava",
- "env": [
- {
- "name": "Id",
- "value": "genai-llama-cpp-llava",
- "type": "str"
- },
- {
- "name": "BaseUrl",
- "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava",
- "type": "str"
- },
- {
- "name": "Batch",
- "value": "10",
- "type": "num"
- }
- ],
- "x": 370,
- "y": 760,
+ "id": "0dd1355d2588c8a9",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Get stderr",
+ "func": "const containerId = msg.msgIn.containerSpec.id;\n\nreturn {\n method: \"GET\",\n url: `http://docker-engine-api:2375/containers/${containerId}/logs`,\n payloadMode: 'querystring',\n payload: {\n follow: true,\n stdout: false,\n stderr: true\n },\n headers: {\n 'accept': 'text/string',\n },\n containerSpec: msg.msgIn.containerSpec,\n outputMode: msg.msgIn.containerSpec.outputMode\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 220,
+ "y": 500,
"wires": [
[
- "d48b052e253b43c3"
+ "0dc9efa99bce1f0c"
]
]
},
{
- "id": "f762ec936046e78f",
- "type": "comment",
- "z": "191694dad2850f37",
- "g": "83fd8826b0ec3bf4",
- "name": "Models",
- "info": "",
- "x": 290,
- "y": 620,
- "wires": []
- },
- {
- "id": "e451712bc8b52b18",
- "type": "debug",
- "z": "191694dad2850f37",
- "g": "ce1b28a464e3b3b3",
- "name": "Model Errors",
- "active": true,
- "tosidebar": true,
- "console": true,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 460,
- "y": 880,
- "wires": []
- },
- {
- "id": "e2dd14f8d37e7a72",
- "type": "debug",
- "z": "191694dad2850f37",
- "g": "ce1b28a464e3b3b3",
- "name": "Model Output",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 460,
- "y": 840,
- "wires": []
- },
- {
- "id": "bb6dc487db2ce156",
+ "id": "d713530df83a6cc3",
"type": "switch",
- "z": "191694dad2850f37",
- "g": "ce1b28a464e3b3b3",
- "name": "Action",
+ "z": "b9a9b43a3594c357",
+ "name": "cURL Action",
"property": "action",
"propertyType": "msg",
"rules": [
{
"t": "eq",
- "v": "model-streaming-content",
+ "v": "command-stderr",
"vt": "str"
},
{
"t": "eq",
- "v": "model-error",
+ "v": "command-stdout",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
- "x": 290,
- "y": 860,
+ "x": 230,
+ "y": 580,
"wires": [
[
- "e2dd14f8d37e7a72"
+ "f2d7034e67ca9556"
],
[
- "e451712bc8b52b18"
- ]
- ]
- },
- {
- "id": "42cede20c9456a92",
- "type": "subflow:74bd10ee8e354d0a",
- "z": "191694dad2850f37",
- "g": "5dbdaf47523ce33a",
- "name": "Eval History",
- "env": [
- {
- "name": "Id",
- "value": "eval-01",
- "type": "str"
- }
- ],
- "x": 1270,
- "y": 640,
- "wires": [
- [
- "1f999e727d7bdcbd",
- "f79210375a125e74",
- "c9ba32537f7bc133",
- "6b036e58872195a7"
+ "dd73ee28dfd14074"
]
]
},
{
- "id": "b67aacc8e54e5106",
+ "id": "dd73ee28dfd14074",
"type": "function",
- "z": "191694dad2850f37",
- "g": "0e31504694a6eb0c",
- "name": "Prompt: Problem statement",
- "func": "msg.createUserPrompt = () =>\n `I have 10K in savings currently in an investment account. My goal is to earn a passive income of $10K every month. Create a plan for me that will meet this goal. I'm looking for single tailored plan, not options to choose from. Give specific, brief instructions for carrying out this plan.`;\n\nflow.set(\"originalProblemStatement\", msg.createUserPrompt());\n\nreturn msg;\n",
+ "z": "b9a9b43a3594c357",
+ "name": "Handle stderr",
+ "func": "if (!msg.content) {\n return;\n}\n\nreturn {\n ...msg,\n containerSpec: msg.msgIn.containerSpec,\n action: \"docker-stderr\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 220,
- "y": 160,
+ "x": 700,
+ "y": 1320,
"wires": [
[
- "8565c4a9a8c13312"
+ "b136a36f1f060bab"
]
]
},
{
- "id": "81b98c3380c57334",
- "type": "function",
- "z": "191694dad2850f37",
- "g": "83fd8826b0ec3bf4",
- "name": "In",
- "func": "\nreturn msg;",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 150,
- "y": 700,
+ "id": "3915149c0c74af4b",
+ "type": "switch",
+ "z": "b9a9b43a3594c357",
+ "name": "If commit",
+ "property": "msg.containerSpec.commit",
+ "propertyType": "jsonata",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "true",
+ "vt": "jsonata"
+ },
+ {
+ "t": "else"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 680,
+ "y": 680,
"wires": [
[
- "c85c2df7d79465a0",
- "73516493eccdfd9d",
- "93859b35073996c8"
+ "350e0fda13f31cc6"
+ ],
+ [
+ "cf1db7761982b2fc"
]
- ],
- "icon": "font-awesome/fa-address-card-o"
+ ]
},
{
- "id": "d48b052e253b43c3",
+ "id": "350e0fda13f31cc6",
"type": "function",
- "z": "191694dad2850f37",
- "g": "83fd8826b0ec3bf4",
- "name": "Out",
- "func": "\nreturn msg;",
+ "z": "b9a9b43a3594c357",
+ "name": "Commit",
+ "func": "\nreturn {\n ...msg,\n container: msg.containerSpec.id\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 590,
- "y": 700,
+ "x": 680,
+ "y": 760,
"wires": [
[
- "bb6dc487db2ce156",
- "4135e1850bf3099c",
- "fe0f3fe28e08e2f0",
- "0800060d86e1ca55",
- "079bf5373fe5d58f",
- "b38cd518b824c20d"
+ "35eba55d4599f26a"
]
- ],
- "icon": "font-awesome/fa-address-card-o"
- },
- {
- "id": "c533acab9a1bba89",
- "type": "comment",
- "z": "191694dad2850f37",
- "g": "0e31504694a6eb0c",
- "name": "Step 1: Problem Statement and Solution",
- "info": "",
- "x": 250,
- "y": 80,
- "wires": []
- },
- {
- "id": "8516a2d5188e142d",
- "type": "comment",
- "z": "191694dad2850f37",
- "g": "17a2a4d88505d1b2",
- "name": "Step 2: Evaluate Solution",
- "info": "",
- "x": 990,
- "y": 340,
- "wires": []
- },
- {
- "id": "5dd26b4eb51f86a8",
- "type": "comment",
- "z": "191694dad2850f37",
- "g": "3334e9dd5bf3557d",
- "name": "Step 3: Propose New Prompt",
- "info": "",
- "x": 1000,
- "y": 820,
- "wires": []
+ ]
},
{
- "id": "0800060d86e1ca55",
- "type": "function",
- "z": "191694dad2850f37",
- "g": "0df36a8be0d76989",
- "name": "Prompt: Use proposed prompt",
- "func": "msg.createUserPrompt = (history) => {\n const promptProposal = history.entries.slice(-1)[0].content;\n let newPrompt;\n try {\n // don't search for full ending tag, since sometimes the last token gets cutoff\n newPrompt = promptProposal.match(/([\\s\\S]*?)<\\/pro/)[1].trim();\n if (newPrompt.length < 1) {\n throw new Error(\"Empty prompt extracted from proposal\")\n }\n }\n catch (e) {\n throw new Error(`Error extracting prompt from: \\`${promptProposal}\\``);\n }\n\n return newPrompt;\n};\n\nreturn msg;\n",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 1010,
- "y": 160,
+ "id": "35eba55d4599f26a",
+ "type": "subflow:3f4aa860a3b350bc",
+ "z": "b9a9b43a3594c357",
+ "name": "",
+ "x": 700,
+ "y": 800,
"wires": [
[
- "a33731f7d26ff1d8"
+ "8d5c1f2ac7b735ab"
]
]
},
{
- "id": "32fd036f241606a1",
- "type": "comment",
- "z": "191694dad2850f37",
- "g": "0df36a8be0d76989",
- "name": "Step 4: Restart w/ New Prompt",
- "info": "",
- "x": 1010,
- "y": 80,
- "wires": []
- },
- {
- "id": "0ad9554c20eb8dd0",
+ "id": "8d5c1f2ac7b735ab",
"type": "switch",
- "z": "191694dad2850f37",
- "g": "b1dd9777ee396bd7",
- "name": "If Step 1",
- "property": "step",
- "propertyType": "flow",
+ "z": "b9a9b43a3594c357",
+ "name": "If success",
+ "property": "action",
+ "propertyType": "msg",
"rules": [
{
"t": "eq",
- "v": "1",
+ "v": "docker-done",
"vt": "str"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 460,
- "y": 340,
- "wires": [
- [
- "34fa053e9707e425"
- ]
- ]
- },
- {
- "id": "4135e1850bf3099c",
- "type": "switch",
- "z": "191694dad2850f37",
- "g": "5dbdaf47523ce33a",
- "name": "If Step 2 or 3",
- "property": "step",
- "propertyType": "flow",
- "rules": [
+ },
{
- "t": "btwn",
- "v": "2",
- "vt": "num",
- "v2": "3",
- "v2t": "num"
+ "t": "else"
}
],
"checkall": "true",
"repair": false,
- "outputs": 1,
- "x": 1270,
- "y": 600,
+ "outputs": 2,
+ "x": 680,
+ "y": 840,
"wires": [
[
- "42cede20c9456a92"
+ "c829d6336d001021"
+ ],
+ [
+ "f2d7034e67ca9556"
]
]
},
{
- "id": "93859b35073996c8",
- "type": "subflow:a59054999730c251",
- "z": "191694dad2850f37",
- "d": true,
- "g": "83fd8826b0ec3bf4",
- "name": "Model - openai - localhost",
- "env": [
- {
- "name": "Id",
- "value": "openai-localhost",
- "type": "str"
- },
- {
- "name": "BaseUrl",
- "value": "http://host.docker.internal:8080",
- "type": "str"
- }
- ],
- "x": 350,
- "y": 720,
+ "id": "c829d6336d001021",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Store commit",
+ "func": "\nreturn {\n ...msg,\n containerSpec: {\n ...msg.commitSpec.containerSpec,\n commit: msg.commitSpec\n },\n exit: msg.commitSpec.exit\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 690,
+ "y": 880,
"wires": [
[
- "d48b052e253b43c3"
+ "5a94f86438968b9b"
]
]
},
{
- "id": "8565c4a9a8c13312",
- "type": "subflow:fe8f70709279ea90",
- "z": "191694dad2850f37",
- "g": "0e31504694a6eb0c",
- "name": "Step 1",
- "env": [
- {
- "name": "Step",
- "value": "1",
- "type": "num"
- },
- {
- "name": "InitHistoryId",
- "value": "solution-01",
- "type": "str"
- },
- {
- "name": "Wait",
- "value": "false",
- "type": "bool"
- }
- ],
- "x": 510,
- "y": 160,
+ "id": "4adad0a3f6b3b9a0",
+ "type": "function",
+ "z": "b9a9b43a3594c357",
+ "name": "Store exit",
+ "func": "\nreturn {\n containerSpec: msg.msgIn.containerSpec,\n exit: msg\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 680,
+ "y": 600,
"wires": [
[
- "0ad9554c20eb8dd0"
+ "ac62a774eb153489"
]
]
},
{
- "id": "1322aa4137d1056e",
+ "id": "5047c7f754d6aa6d",
"type": "function",
- "z": "191694dad2850f37",
- "d": true,
- "g": "17a2a4d88505d1b2",
- "name": "Prompt: Evalutate Solution",
- "func": "msg.createUserPrompt = (history) => {\n const problemStatement = history.entries[0].content;\n\n const solution = history.entries.slice(-1)[0].content;\n\n return `I'm going to give you a prompt that a user named Lilly gave to an LLM model named BigStar-13B. Then, I will give you the response BigStar gave to Lilly. I want you to rate BigStar's response on a scale from 1-10. Then, give 2-3 specific improvements to BigStar's response that would have increased it's rating.\n\nHere is Lilly's prompt:\n\n${problemStatement}\n\nHere is BigStar's response:\n\n${solution}\n\nWhat would you rate BigStar's response?`;\n};\n\nreturn msg;\n",
+ "z": "b9a9b43a3594c357",
+ "name": "Return input message",
+ "func": "\nreturn msg.msgIn;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1020,
- "y": 420,
+ "x": 720,
+ "y": 1160,
"wires": [
[
- "1f999e727d7bdcbd"
+ "c02417dc4c8df8e5"
]
]
},
{
- "id": "1f999e727d7bdcbd",
- "type": "subflow:fe8f70709279ea90",
- "z": "191694dad2850f37",
- "g": "17a2a4d88505d1b2",
- "name": "Step 2",
- "env": [
- {
- "name": "Step",
- "value": "2",
- "type": "num"
- },
- {
- "name": "InitHistoryId",
- "value": "eval-01",
- "type": "str"
- }
- ],
- "x": 1290,
- "y": 420,
- "wires": [
- [
- "4135e1850bf3099c"
- ]
- ]
+ "id": "9ead6c09c1634875",
+ "type": "debug",
+ "z": "b9a9b43a3594c357",
+ "name": "Docker Run In",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 220,
+ "y": 20,
+ "wires": []
},
{
- "id": "833eaf27d6837495",
- "type": "subflow:fe8f70709279ea90",
- "z": "191694dad2850f37",
- "g": "3334e9dd5bf3557d",
- "name": "Step 3",
- "env": [
- {
- "name": "Step",
- "value": "3",
- "type": "num"
- },
- {
- "name": "InitHistory",
- "value": "false",
- "type": "bool"
- }
- ],
- "x": 1290,
- "y": 900,
+ "id": "0a96edc6fd08333b",
+ "type": "debug",
+ "z": "b9a9b43a3594c357",
+ "name": "Docker Run Out",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1300,
+ "y": 880,
+ "wires": []
+ },
+ {
+ "id": "65a8ebb1afe5c330",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "5982620408722375",
+ "name": "",
+ "x": 630,
+ "y": 280,
"wires": [
- [
- "909642bb1b9261ea"
- ]
+ []
]
},
{
- "id": "fe0f3fe28e08e2f0",
+ "id": "41ea315220e88ed4",
"type": "function",
- "z": "191694dad2850f37",
- "g": "3334e9dd5bf3557d",
- "name": "Prompt: Propose New Prompt",
- "func": "msg.createUserPrompt = () => \n `How could Lilly's prompt be altered to get BigStar to respond with your suggested improvements? Please provide the new prompt wrapped in tags.`;\n\n\nreturn msg;\n",
+ "z": "5982620408722375",
+ "name": "function 21",
+ "func": "msg.url = `http://docker-engine-api:2375/containers/e9388b9bc020d3438b87a56357b93c08f79fbda456525834238245285ed47eed/logs?stdout=true`;\n// msg.url = `http://host.docker.internal:8080`\nmsg.method = \"GET\"\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1010,
- "y": 900,
+ "x": 410,
+ "y": 280,
"wires": [
[
- "833eaf27d6837495"
+ "65a8ebb1afe5c330"
]
]
},
{
- "id": "a33731f7d26ff1d8",
- "type": "subflow:fe8f70709279ea90",
- "z": "191694dad2850f37",
- "g": "0df36a8be0d76989",
- "name": "Step 4",
- "env": [
- {
- "name": "Step",
- "value": "4",
- "type": "num"
- },
- {
- "name": "InitHistory",
- "value": "false",
- "type": "bool"
- }
- ],
- "x": 930,
- "y": 220,
+ "id": "81af6496ee4f4c30",
+ "type": "exec",
+ "z": "d5c30c295cb6b7bc",
+ "command": "",
+ "addpay": "command",
+ "append": "",
+ "useSpawn": "false",
+ "timer": "",
+ "winHide": false,
+ "oldrc": false,
+ "name": "",
+ "x": 530,
+ "y": 200,
"wires": [
[
- "85c126ddb6ae9692"
- ]
- ]
- },
- {
- "id": "36217d16d71a4c30",
- "type": "inject",
- "z": "191694dad2850f37",
- "g": "17a2a4d88505d1b2",
- "name": "Start @ Step 2",
- "props": [
- {
- "p": "historyId",
- "v": "solution-01",
- "vt": "str"
- },
- {
- "p": "historySourceFilename",
- "v": "/data/db/history-1706503270302.json",
- "vt": "str"
- },
- {
- "p": "action",
- "v": "step-start-at",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "x": 1260,
- "y": 340,
- "wires": [
+ "189a0f12c5d3189e"
+ ],
[
- "b38cd518b824c20d"
+ "bba82265f3401843"
+ ],
+ [
+ "571c40cd622a7e4a"
]
]
},
{
- "id": "7b60dc37c59dc80f",
- "type": "inject",
- "z": "191694dad2850f37",
- "g": "0df36a8be0d76989",
- "name": "Start @ Step 4",
- "props": [
- {
- "p": "historyId",
- "v": "eval-01",
- "vt": "str"
- },
- {
- "p": "historySourceFilename",
- "v": "/data/db/history-1706169633523.json",
- "vt": "str"
- },
- {
- "p": "action",
- "v": "step-start-at",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "x": 1260,
- "y": 80,
+ "id": "10a590c86c24cc1c",
+ "type": "exec",
+ "z": "d5c30c295cb6b7bc",
+ "command": "",
+ "addpay": "command",
+ "append": "",
+ "useSpawn": "true",
+ "timer": "",
+ "winHide": false,
+ "oldrc": false,
+ "name": "spawn",
+ "x": 530,
+ "y": 280,
"wires": [
[
- "0800060d86e1ca55"
+ "189a0f12c5d3189e"
+ ],
+ [
+ "bba82265f3401843"
+ ],
+ [
+ "571c40cd622a7e4a"
]
]
},
{
- "id": "36f73b6e3236c721",
- "type": "inject",
- "z": "191694dad2850f37",
- "g": "3334e9dd5bf3557d",
- "name": "Start @ Step 3",
- "props": [
- {
- "p": "historyId",
- "v": "eval-01",
- "vt": "str"
- },
+ "id": "9c2566ae93501d69",
+ "type": "switch",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Mode",
+ "property": "mode",
+ "propertyType": "msg",
+ "rules": [
{
- "p": "historySourceFilename",
- "v": "/data/db/history-1706169407261.json",
+ "t": "eq",
+ "v": "exec",
"vt": "str"
},
{
- "p": "action",
- "v": "step-start-at",
+ "t": "eq",
+ "v": "spawn",
"vt": "str"
}
],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "x": 1260,
- "y": 820,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 330,
+ "y": 240,
"wires": [
[
- "fe0f3fe28e08e2f0"
+ "81af6496ee4f4c30"
+ ],
+ [
+ "10a590c86c24cc1c",
+ "b3c027b1a78e62ca"
]
]
},
{
- "id": "bd8902942d9f30bc",
+ "id": "1c249f69debb918b",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Set mode",
+ "func": "msg.mode = msg.mode || 'exec';\nmsg.responseMode = msg.responseMode || 'text';\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 795,
- "y": 780,
+ "x": 180,
+ "y": 140,
"wires": [
[
- "fe0f3fe28e08e2f0"
+ "9c2566ae93501d69",
+ "5ec949124503c75a"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "f79210375a125e74",
+ "id": "571c40cd622a7e4a",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Return code",
+ "func": "\nreturn {\n ...msg.payload,\n action: 'command-exit'\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1435,
- "y": 660,
+ "x": 750,
+ "y": 320,
"wires": [
[
- "bd8902942d9f30bc"
+ "bee02be8135363fa"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "909642bb1b9261ea",
+ "id": "5be0298a22eb5f2a",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Spawned",
+ "func": "\nreturn {\n msgIn: msg,\n action: \"command-spawn\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1435,
- "y": 820,
+ "x": 740,
+ "y": 400,
"wires": [
- [
- "246801bf115544b3"
- ]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ []
+ ]
},
{
- "id": "246801bf115544b3",
+ "id": "5ec949124503c75a",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Forward msg",
+ "func": "return {\n ...msg,\n action: \"forward-msg\",\n msgAction: msg.action\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1125,
- "y": 640,
+ "x": 750,
+ "y": 80,
"wires": [
[
- "4135e1850bf3099c"
+ "bee02be8135363fa"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "c9ba32537f7bc133",
+ "id": "189a0f12c5d3189e",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Stdout",
+ "func": "return {\n ...msg,\n action: \"command-stdout\",\n content: msg.payload,\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 1435,
- "y": 320,
+ "x": 730,
+ "y": 160,
"wires": [
[
- "322d52b49ebe2f42"
+ "bee02be8135363fa"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "88802dbd1e8b0c57",
+ "id": "bba82265f3401843",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Stderr",
+ "func": "\nreturn {\n ...msg,\n action: \"command-stderr\",\n content: msg.payload\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 645,
- "y": 420,
- "wires": [
- [
- "fe160cbe0df384e5"
- ]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
- },
- {
- "id": "85c126ddb6ae9692",
- "type": "subflow:3bb38f582155f29d",
- "z": "191694dad2850f37",
- "g": "0df36a8be0d76989",
- "name": "",
- "x": 1050,
- "y": 220,
+ "x": 730,
+ "y": 240,
"wires": [
[
- "a8aa5ac1df416d41"
+ "bee02be8135363fa"
]
]
},
{
- "id": "a8aa5ac1df416d41",
+ "id": "bee02be8135363fa",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "d5c30c295cb6b7bc",
+ "name": "Handle response",
+ "func": "// if this is a forward messge\nif (msg.action == \"forward-msg\") {\n // save our msg for later\n msg.action = msg.msgAction;\n delete msg.msgAction;\n context.set(\"forwardedMsg\", msg);\n // don't send anything for now\n return;\n}\n\n// get any forwarded input we might have\nconst forwardedMsg = context.get(\"forwardedMsg\");\n\n// transform response\nif (msg.content) {\n switch(forwardedMsg.responseMode) {\n case 'text':\n msg.content = msg.content.toString();\n break;\n case 'buffer':\n msg.content = Buffer.from(msg.content);\n break;\n }\n}\n\nreturn {\n ...msg,\n msgIn: forwardedMsg,\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 345,
- "y": 280,
+ "x": 1010,
+ "y": 240,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "63387d16cd6a7986",
+ "type": "subflow:d5c30c295cb6b7bc",
+ "z": "72ced27310c541f6",
+ "name": "",
+ "x": 620,
+ "y": 300,
"wires": [
[
- "8565c4a9a8c13312"
+ "c7494ed5f552a21e"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "322d52b49ebe2f42",
+ "id": "c8af8c1b86c8ae07",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "72ced27310c541f6",
+ "name": "Create command",
+ "func": "const { URLSearchParams } = msg.global;\n\nmsg.outputMode = msg.outputMode || 'full';\n\nlet curlCommand = `curl --silent -X ${msg.method}`;\n\nfor (const [key, value] of Object.entries(msg.headers)) {\n curlCommand += ` -H \"${key}: ${value}\"`;\n}\n\nconst payload = msg.payload || {};\nif (Object.keys(payload).length > 0) {\n switch(msg.payloadMode) {\n case 'body':\n curlCommand += ` -H \"Content-Type: application/json\" -d '${JSON.stringify(payload)}'`;\n break;\n case 'querystring':\n const queryString = new URLSearchParams(payload).toString();\n const separator = msg.url.includes('?') ? '&' : '?';\n msg.url += `${separator}${queryString}`;\n break;\n }\n}\n\ncurlCommand += ` \"${msg.url}\"`;\n\nreturn {\n ...msg,\n command: curlCommand,\n mode: msg.outputMode === 'full' ? 'exec' : 'spawn'\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 755,
- "y": 260,
+ "x": 250,
+ "y": 220,
"wires": [
[
- "0800060d86e1ca55"
+ "63387d16cd6a7986"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "6b036e58872195a7",
- "type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 1435,
- "y": 560,
+ "id": "e13b4eb99a77c41e",
+ "type": "subflow:30eb5320bb41dc49",
+ "z": "72ced27310c541f6",
+ "name": "",
+ "x": 250,
+ "y": 180,
"wires": [
[
- "fe160cbe0df384e5"
+ "c8af8c1b86c8ae07",
+ "9b8674a5a8ade573"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "079bf5373fe5d58f",
- "type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
- "outputs": 1,
- "timeout": 0,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 775,
- "y": 640,
+ "id": "03f57deed86e37c5",
+ "type": "provide-global",
+ "z": "72ced27310c541f6",
+ "name": "",
+ "x": 240,
+ "y": 140,
"wires": [
[
- "c8bf1c9a8fe80c37"
+ "e13b4eb99a77c41e"
]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ ]
},
{
- "id": "c8bf1c9a8fe80c37",
+ "id": "c7494ed5f552a21e",
"type": "function",
- "z": "191694dad2850f37",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "72ced27310c541f6",
+ "name": "Handle response",
+ "func": "if (!['command-stderr', 'command-stdout'].includes(msg.action)) {\n // no content to parse, just return the message\n return msg;\n}\n\n// else, parse our content\nlet parsedContent;\nswitch (msg.msgIn.responseMode) {\n case 'json':\n try {\n parsedContent = JSON.parse(msg.content);\n } catch (e) {\n node.warn('Failed to parse JSON response');\n parsedContent = msg.content;\n }\n break;\n case 'text':\n parsedContent = msg.content.toString();\n break;\n case 'buffer':\n parsedContent = Buffer.from(msg.content);\n break;\n}\n\nreturn {\n ...msg,\n rawContent: msg.content,\n content: parsedContent,\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 305,
- "y": 380,
+ "x": 870,
+ "y": 200,
"wires": [
- [
- "0ad9554c20eb8dd0"
- ]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ []
+ ]
},
{
- "id": "b38cd518b824c20d",
+ "id": "9b8674a5a8ade573",
+ "type": "debug",
+ "z": "72ced27310c541f6",
+ "d": true,
+ "name": "cURL Requests",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 500,
+ "y": 160,
+ "wires": []
+ },
+ {
+ "id": "3762dbf4e0957cfa",
"type": "function",
- "z": "191694dad2850f37",
- "g": "17a2a4d88505d1b2",
- "name": " ",
- "func": "\nreturn msg;",
+ "z": "30eb5320bb41dc49",
+ "name": "Build request",
+ "func": "msg.method = msg.method.toLocaleUpperCase() || \"GET\";\nmsg.payloadMode = msg.method === \"GET\" && msg.payloadMode\n ? msg.payloadMode : 'body';\nmsg.headers = msg.headers ?\n Object.fromEntries(\n Object.entries(msg.headers)\n .map(\n ([k, v]) => [k.toLocaleLowerCase(), v]\n )\n )\n : {};\nconst acceptHeader = msg.headers['accept'] = msg.headers['accept'] || 'application/json';\nmsg.responseMode =\n acceptHeader.includes('json')\n ? 'json'\n : acceptHeader.includes('text')\n ? 'text'\n : 'buffer';\nmsg.payloadResponseMode = `${msg.payloadMode}-${msg.responseMode}`;\n// we should just be able to disable this -- stupid\nmsg.requestTimeout = 60 * 60 * 1000;\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 855,
- "y": 420,
+ "x": 210,
+ "y": 120,
"wires": [
- [
- "1322aa4137d1056e",
- "9240a0389d51445c"
- ]
- ],
- "icon": "font-awesome/fa-arrows",
- "l": false
+ []
+ ]
},
{
- "id": "9240a0389d51445c",
+ "id": "f3d99166630391d1",
"type": "function",
- "z": "191694dad2850f37",
- "g": "17a2a4d88505d1b2",
- "name": "Prompt: Evalutate Against Original",
- "func": "msg.createUserPrompt = (history) => {\n const problemStatement = flow.get(\"originalProblemStatement\");\n\n const solution = history.entries.slice(-1)[0].content;\n\n return `I'm going to give you a prompt that a user named Lilly gave to an LLM model named BigStar-13B. Then, I will give you the response BigStar gave to Lilly. I want you to rate BigStar's response on a scale from 1-10. Then, give 2-3 specific improvements to BigStar's response that would have increased it's rating.\n\nHere is Lilly's prompt:\n\n${problemStatement}\n\nHere is BigStar's response:\n\n${solution}\n\nWhat would you rate BigStar's response?`;\n};\n\nreturn msg;\n",
+ "z": "3f4aa860a3b350bc",
+ "name": "Commit spec",
+ "func": "msg.container = env.get(\"Container\") || msg.container;\nmsg.repository = env.get(\"Repository\") || msg.repository || `commit-${msg.container}`;\nmsg.tag = env.get(\"Tag\") || msg.tag || `${Date.now()}`;\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
- "libs": [],
- "x": 1040,
- "y": 460,
+ "libs": [
+ {
+ "var": "yargs",
+ "module": "yargs"
+ }
+ ],
+ "x": 210,
+ "y": 100,
"wires": [
[
- "1f999e727d7bdcbd"
+ "c393a31a37569fbb"
]
]
},
{
- "id": "b75f0d8130661559",
+ "id": "c393a31a37569fbb",
"type": "function",
- "z": "3fb1b07be44ed756",
- "name": "function 1",
- "func": "return { sseJs, nodeFetch, async }",
+ "z": "3f4aa860a3b350bc",
+ "name": "Commit container",
+ "func": "\nreturn {\n method: \"POST\",\n url: `http://docker-engine-api:2375/commit?container=${msg.container}&tag=${msg.tag}&repo=${msg.repository}`,\n payload: {\n Cmd: msg.command,\n Image: msg.image\n },\n commitSpec: msg\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
- "libs": [
- {
- "var": "sseJs",
- "module": "sse.js"
- },
- {
- "var": "async",
- "module": "async"
- },
- {
- "var": "nodeFetch",
- "module": "node-fetch"
- }
- ],
- "x": 480,
- "y": 260,
+ "libs": [],
+ "x": 230,
+ "y": 180,
"wires": [
[
- "ea2d35fce99de4ae"
+ "1d44ae7d4b9f9d12"
]
]
},
{
- "id": "26a114fc27cd90b0",
- "type": "inject",
- "z": "3fb1b07be44ed756",
+ "id": "1d44ae7d4b9f9d12",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "3f4aa860a3b350bc",
"name": "",
- "props": [
+ "x": 220,
+ "y": 220,
+ "wires": [
+ [
+ "42d4108f978541ae"
+ ]
+ ]
+ },
+ {
+ "id": "42d4108f978541ae",
+ "type": "switch",
+ "z": "3f4aa860a3b350bc",
+ "name": "If http-success",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
{
- "p": "payload"
+ "t": "eq",
+ "v": "http-success",
+ "vt": "str"
},
{
- "p": "topic",
- "vt": "str"
+ "t": "else"
}
],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "x": 300,
- "y": 240,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 220,
+ "y": 260,
"wires": [
[
- "b75f0d8130661559"
+ "cea8afeae263e378"
+ ],
+ [
+ "9fe7448838c509e5"
]
]
},
{
- "id": "ea2d35fce99de4ae",
- "type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 5",
- "active": true,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 650,
- "y": 280,
- "wires": []
- },
- {
- "id": "8f75c3504c3dbc5f",
+ "id": "9fe7448838c509e5",
"type": "function",
- "z": "3fb1b07be44ed756",
- "name": "Install dependencies",
- "func": "// List of NPM modules\nconst toInstall = [\n 'sse.js'\n]\n\nconst { exec } = childProcess;\n\nconst run = async (cmd) => {\n const child = exec(cmd, (err) => {\n if (err) console.error(err);\n });\n await new Promise((resolve) => child.on('close', resolve));\n};\n\nawait Promise.all(toInstall.map(it => run(`npm install ${it}`)));\n\nreturn msg;",
+ "z": "3f4aa860a3b350bc",
+ "name": "Handle error",
+ "func": "\nreturn {\n ...msg,\n commitSpec: msg.msgIn.commitSpec,\n action: \"docker-error\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
- "libs": [
- {
- "var": "childProcess",
- "module": "child_process"
- }
- ],
- "x": 340,
- "y": 320,
+ "libs": [],
+ "x": 430,
+ "y": 280,
"wires": [
[]
]
},
{
- "id": "e22d75a202b3a7d9",
+ "id": "cea8afeae263e378",
"type": "function",
- "z": "3fb1b07be44ed756",
- "name": "function 2",
- "func": "//throw new Error(\"This crashes Node-RED!\");\n\n(async () => {\n try {\n const sse = await (global.get(\"dynamicallyImport\"))(\"sse.js\");\n node.send({sse});\n node.done();\n }\n catch (e) {\n node.send({ e });\n }\n})();\n\nreturn msg;",
+ "z": "3f4aa860a3b350bc",
+ "name": "Handle success ",
+ "func": "const commit = msg.msgIn.commitSpec;\n\nreturn {\n ...msg,\n commitSpec: {\n ...commit,\n image: `${commit.repository}:${commit.tag}`\n },\n action: \"docker-done\"\n};\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 560,
- "y": 360,
+ "x": 440,
+ "y": 240,
"wires": [
- [
- "18e60cf6d75b5c02"
- ]
+ []
]
},
{
- "id": "233b190c4bba2abc",
- "type": "inject",
- "z": "3fb1b07be44ed756",
+ "id": "6d6f8c6f67a318de",
+ "type": "function",
+ "z": "126e4a373d8bcb36",
+ "name": "Parse Content",
+ "func": "\nreturn {\n ...msg,\n contentTags: msg.extractHtmlTags(msg.content || '')\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 220,
+ "y": 180,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "af3d5caec2de488c",
+ "type": "subflow:21de8117bd1967f9",
+ "z": "126e4a373d8bcb36",
"name": "",
- "props": [
- {
- "p": "payload"
- },
- {
- "p": "topic",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "x": 400,
- "y": 360,
+ "x": 250,
+ "y": 140,
"wires": [
[
- "e22d75a202b3a7d9"
+ "6d6f8c6f67a318de"
]
]
},
{
- "id": "18e60cf6d75b5c02",
- "type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 6",
- "active": true,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 720,
- "y": 360,
- "wires": []
+ "id": "e935f75b3e48ad5e",
+ "type": "function",
+ "z": "828f5a08b0bcf89d",
+ "name": "Parse Content",
+ "func": "return {\n ...msg,\n contentHtml: msg.parseMarkdown(msg.content)\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 220,
+ "y": 140,
+ "wires": [
+ []
+ ]
},
{
- "id": "366fdac4502597e4",
+ "id": "e82cac62a6dcc5e2",
+ "type": "subflow:ae4739904e91e32d",
+ "z": "828f5a08b0bcf89d",
+ "name": "",
+ "x": 250,
+ "y": 100,
+ "wires": [
+ [
+ "e935f75b3e48ad5e"
+ ]
+ ]
+ },
+ {
+ "id": "880a67537dd0efe3",
"type": "provide-import-fn",
- "z": "3fb1b07be44ed756",
+ "z": "87f7528a5c81b545",
"name": "",
- "x": 370,
- "y": 580,
+ "x": 290,
+ "y": 200,
"wires": [
[
- "f58a612cea662f7f"
+ "6bedf6b16eb7796b"
]
]
},
{
- "id": "f58a612cea662f7f",
+ "id": "457ddbfd4780ea1d",
"type": "function",
- "z": "3fb1b07be44ed756",
+ "z": "87f7528a5c81b545",
"name": "Named Imports",
- "func": "// List of modules\nconst toImport = [\n 'sse.js',\n \"node:events\"\n];\n\n;(async () => {\n try {\n const imported = Object.fromEntries(\n await Promise.all(\n toImport.map(\n async it => [it, await msg.import(it)]\n )\n )\n );\n\n node.send({...msg, namedImports: imported});\n } \n catch (e) {\n node.error(e);\n }\n})();\n",
+ "func": "\n;(async () => {\n try {\n const importedModules = Object.fromEntries(\n await Promise.all(\n msg.moduleSpecs.map(async spec => {\n const moduleNamepsace = await msg.import(spec.moduleName);\n\n const importedModule = Object.fromEntries(\n [\n ...(spec.defaultExport ? [{name: \"default\", alias: \"default\"}] : []),\n ...(spec.namedExports ?? Object.keys(moduleNamepsace).map(k => ({name: k, alias: k})))\n ].map(\n ({name, alias}) => [alias, moduleNamepsace[name]]\n )\n )\n\n return [spec.key, importedModule];\n })\n )\n );\n\n node.send({...msg, importedModules});\n } \n catch (e) {\n node.error(e.stack);\n }\n})();\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
@@ -7820,153 +8438,144 @@
"module": "sse.js"
}
],
- "x": 620,
- "y": 580,
+ "x": 820,
+ "y": 560,
"wires": [
- [
- "3163545a452b8023"
- ]
+ []
]
},
{
- "id": "3163545a452b8023",
+ "id": "6bedf6b16eb7796b",
"type": "function",
- "z": "3fb1b07be44ed756",
- "name": "function 5",
- "func": "const {\"sse.js\": { SSE }} = msg.namedImports;\nconst { Event } = msg.global;\n\nclass CustomEvent extends Event { \n constructor(message, data) {\n super(message, data)\n this.detail = data?.detail\n }\n}\n\nmsg.global.CustomEvent = CustomEvent;\ntry {\n const r = SSE();\n msg.r = r;\n return msg;\n}\ncatch (e) {\n node.error(e);\n node.error(e.stack);\n}\n\n// return {\n// ...msg,\n// scriptglobal: global,\n// Event: global.Event,\n// globalEvent: msg.global.Event\n// }",
+ "z": "87f7528a5c81b545",
+ "name": "module-alias",
+ "func": "// Copied from: https://github.com/ilearnio/module-alias/blob/dev/index.js\nconst nodePath = await msg.import('path')\n\nconst modulePaths = []\nconst moduleAliases = {}\nconst moduleAliasNames = []\n\nfunction isPathMatchesAlias(path, alias) {\n // Matching /^alias(\\/|$)/\n if (path.indexOf(alias) === 0) {\n if (path.length === alias.length) return true\n if (path[alias.length] === '/') return true\n }\n\n return false\n}\n\nconst init = async () => {\n const Module = await msg.import('node:module')\n\n const oldNodeModulePaths = Module._nodeModulePaths\n Module._nodeModulePaths = function (from) {\n let paths = oldNodeModulePaths.call(this, from)\n\n // Only include the module path for top-level modules\n // that were not installed:\n if (from.indexOf('node_modules') === -1) {\n paths = modulePaths.concat(paths)\n }\n\n return paths\n }\n\n const oldResolveFilename = Module._resolveFilename\n Module._resolveFilename = function (request, parentModule, isMain, options) {\n for (let i = moduleAliasNames.length; i-- > 0;) {\n const alias = moduleAliasNames[i]\n if (isPathMatchesAlias(request, alias)) {\n let aliasTarget = moduleAliases[alias]\n // Custom function handler\n if (typeof moduleAliases[alias] === 'function') {\n const fromPath = parentModule.filename\n aliasTarget = moduleAliases[alias](fromPath, request, alias)\n if (!aliasTarget || typeof aliasTarget !== 'string') {\n throw new Error('[module-alias] Expecting custom handler function to return path.')\n }\n }\n request = nodePath.join(aliasTarget, request.substr(alias.length))\n // Only use the first match\n break\n }\n }\n\n return oldResolveFilename.call(this, request, parentModule, isMain, options)\n }\n};\n\nfunction addPathHelper(path, targetArray) {\n path = nodePath.normalize(path)\n if (targetArray && targetArray.indexOf(path) === -1) {\n targetArray.unshift(path)\n }\n}\n\nfunction getMainModule() {\n return msg.global.require.main?._simulateRepl ? undefined : msg.global.require.main\n}\n\nfunction addPath(path) {\n let parent\n path = nodePath.normalize(path)\n\n if (modulePaths.indexOf(path) === -1) {\n modulePaths.push(path)\n // Enable the search path for the current top-level module\n const mainModule = getMainModule()\n if (mainModule) {\n addPathHelper(path, mainModule.paths)\n }\n parent = msg.global.module.parent\n\n // Also modify the paths of the module that was used to load the\n // app-module-paths module and all of it's parents\n while (parent && parent !== mainModule) {\n addPathHelper(path, parent.paths)\n parent = parent.parent\n }\n }\n}\n\n(async () => {\n try {\n // if we haven't added our data module yet\n if (!global.get(\"InstallModules:DataModuleAliased\")) {\n // do so now\n // first, patch node's module\n await init();\n // now we can add our path\n addPath(`/data`);\n // we've now added our data path\n global.set(\"InstallModules:DataModuleAliased\", true);\n }\n \n // forward our message\n node.send(msg);\n }\n catch (e) {\n node.error(e);\n }\n})();\n\nreturn;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 650,
- "y": 500,
+ "x": 410,
+ "y": 280,
"wires": [
[
- "f4e0940a4675e15a"
+ "df49aa776ec39a20"
]
]
},
{
- "id": "f4e0940a4675e15a",
- "type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 9",
- "active": true,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "true",
- "targetType": "full",
- "statusVal": "",
- "statusType": "auto",
- "x": 770,
- "y": 460,
- "wires": []
- },
- {
- "id": "d5dd065101ef890a",
+ "id": "9989cd73c1728ba4",
"type": "provide-global",
- "z": "3fb1b07be44ed756",
+ "z": "87f7528a5c81b545",
"name": "",
- "x": 360,
- "y": 620,
+ "x": 280,
+ "y": 160,
"wires": [
[
- "366fdac4502597e4"
+ "880a67537dd0efe3"
]
]
},
{
- "id": "4a5b440f0562c4c5",
- "type": "inject",
- "z": "3fb1b07be44ed756",
- "name": "",
- "props": [
- {
- "p": "payload"
- },
- {
- "p": "topic",
- "vt": "str"
- }
- ],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "x": 160,
- "y": 580,
+ "id": "df49aa776ec39a20",
+ "type": "function",
+ "z": "87f7528a5c81b545",
+ "name": "Get modules to install",
+ "func": "const cachedInstalls = global.get(\"InstallModules:CachedInstalls\") || [];\n\nconst toInstall = msg.moduleSpecs.map(spec => {\n // split name\n const splitName = spec.moduleName.split('/');\n // construct module name based on first character\n switch(splitName[0][0]) {\n case '/':\n // ignore files and directories\n return;\n case '.':\n // ignore files and directories\n return;\n case '@':\n // return org module\n return splitName.slice(0, 1).join('/');\n default:\n // return top-level module\n return splitName[0];\n }\n}).filter(it => it && !cachedInstalls.includes(it));\n\nglobal.set(\"InstallModules:CachedInstalls\", [...cachedInstalls, ...toInstall]);\n\n// return our modules to install\nreturn {\n ...msg,\n toInstall\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 440,
+ "y": 360,
"wires": [
[
- "d5dd065101ef890a"
+ "becc084ee991baaf"
]
]
},
{
- "id": "370b802881cc5a5b",
+ "id": "e98dae970d7540c6",
"type": "function",
- "z": "3fb1b07be44ed756",
- "name": "Send chat to model",
- "func": "msg['genai-llama-cpp-llava'] = {\n payload: {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chat bot that will perform any requested tasks to the best of your ability.\"\n },\n ...msg.chat.history.map(it => ({\n role: it.role,\n content: it.content\n }))\n ],\n \"temperature\": 0.7,\n \"stop\": null,\n \"stream\": true\n }\n}\nreturn msg;\n",
+ "z": "87f7528a5c81b545",
+ "name": "Get modules",
+ "func": "// List of modules\nconst toImport = env.get(\"Modules\") || msg.modules || [];\n\nmsg.moduleSpecs = toImport.map(module => {\n // create module spec\n const moduleSpec = {\n defaultExport: true,\n namedExports: undefined,\n ...(typeof module === \"string\" ? { moduleName: module } : {\n ...module,\n namedExports: module.namedExports.map(\n named => typeof named === \"string\" ? {\n name: named,\n alias: named\n } : named\n )\n })\n };\n moduleSpec.key = module.key ?? moduleSpec.moduleName;\n return moduleSpec;\n});\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
- "x": 310,
+ "x": 210,
"y": 100,
"wires": [
[
- "d33cede612c96641"
+ "9989cd73c1728ba4"
]
]
},
{
- "id": "d33cede612c96641",
- "type": "subflow:6d317c39edd7ba27",
- "z": "3fb1b07be44ed756",
- "name": "localhost-sse",
- "env": [
- {
- "name": "Id",
- "value": "localhost-sse",
- "type": "str"
- },
+ "id": "44dc42cb66468495",
+ "type": "subflow:d5c30c295cb6b7bc",
+ "z": "87f7528a5c81b545",
+ "name": "",
+ "x": 420,
+ "y": 520,
+ "wires": [
+ [
+ "5ef12c46bbd7a294"
+ ]
+ ]
+ },
+ {
+ "id": "5ef12c46bbd7a294",
+ "type": "switch",
+ "z": "87f7528a5c81b545",
+ "name": "Command action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
{
- "name": "Url",
- "value": "http://host.docker.internal:8091/sse",
- "type": "str"
+ "t": "eq",
+ "v": "command-stdout",
+ "vt": "str"
},
{
- "name": "options",
- "value": "{\"method\": \"POST\"}",
- "type": "json"
+ "t": "eq",
+ "v": "command-stderr",
+ "vt": "str"
},
{
- "name": "Options",
- "value": "{\"method\":\"POST\"}",
- "type": "json"
+ "t": "eq",
+ "v": "command-exit",
+ "vt": "str"
}
],
- "x": 570,
- "y": 120,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 3,
+ "x": 430,
+ "y": 580,
"wires": [
[
- "453833904710992b"
+ "d66301aee1d76d87"
+ ],
+ [
+ "0a7620bc1dd07e51"
+ ],
+ [
+ "c26e5607bec3a41a"
]
]
},
{
- "id": "453833904710992b",
+ "id": "0a7620bc1dd07e51",
"type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 11",
+ "z": "87f7528a5c81b545",
+ "name": "Install modules error",
"active": true,
"tosidebar": true,
"console": false,
@@ -7975,50 +8584,46 @@
"targetType": "full",
"statusVal": "",
"statusType": "auto",
- "x": 560,
- "y": 160,
+ "x": 440,
+ "y": 680,
"wires": []
},
{
- "id": "e5399fe826058b29",
- "type": "subflow:6d317c39edd7ba27",
- "z": "3fb1b07be44ed756",
- "name": "localhost-openai",
- "env": [
- {
- "name": "Id",
- "value": "localhost-openai",
- "type": "str"
- },
+ "id": "c26e5607bec3a41a",
+ "type": "switch",
+ "z": "87f7528a5c81b545",
+ "name": "If successful",
+ "property": "msg.code",
+ "propertyType": "jsonata",
+ "rules": [
{
- "name": "Url",
- "value": "http://host.docker.internal:8080/v1/chat/completions",
- "type": "str"
+ "t": "eq",
+ "v": "0",
+ "vt": "num"
},
{
- "name": "Options",
- "value": "{\"method\":\"POST\",\"headers\":{\"Content-Type\":\"application/json\"}}",
- "type": "json"
- },
- {
- "name": "options",
- "value": "{\"method\": \"POST\"}",
- "type": "json"
+ "t": "else"
}
],
- "x": 760,
- "y": 60,
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 410,
+ "y": 740,
"wires": [
[
- "4912a5fe5cc3d7cd"
+ "fef6f985a19ce44e"
+ ],
+ [
+ "0a7620bc1dd07e51"
]
]
},
{
- "id": "4912a5fe5cc3d7cd",
+ "id": "d66301aee1d76d87",
"type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 12",
+ "z": "87f7528a5c81b545",
+ "name": "Install modules stdout",
"active": true,
"tosidebar": true,
"console": false,
@@ -8027,50 +8632,152 @@
"targetType": "full",
"statusVal": "",
"statusType": "auto",
- "x": 780,
- "y": 100,
+ "x": 440,
+ "y": 640,
"wires": []
},
{
- "id": "6db72e1f1342ce1d",
- "type": "subflow:6d317c39edd7ba27",
- "z": "3fb1b07be44ed756",
- "name": "genai-llama-cpp-llava",
- "env": [
+ "id": "88d2db1e34559f1c",
+ "type": "function",
+ "z": "87f7528a5c81b545",
+ "name": "Install modules",
+ "func": "\nreturn {\n ...msg,\n command: `cd /data && npm install ${msg.toInstall.join(' ')}`,\n mode: \"exec\"\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 420,
+ "y": 480,
+ "wires": [
+ [
+ "44dc42cb66468495"
+ ]
+ ]
+ },
+ {
+ "id": "becc084ee991baaf",
+ "type": "switch",
+ "z": "87f7528a5c81b545",
+ "name": "If modules to install",
+ "property": "$count(msg.toInstall)",
+ "propertyType": "jsonata",
+ "rules": [
{
- "name": "Id",
- "value": "genai-llama-cpp-llava",
- "type": "str"
+ "t": "gte",
+ "v": "1",
+ "vt": "num"
},
{
- "name": "Url",
- "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava/v1/chat/completions",
- "type": "str"
- },
+ "t": "else"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 430,
+ "y": 400,
+ "wires": [
+ [
+ "88d2db1e34559f1c"
+ ],
+ [
+ "457ddbfd4780ea1d"
+ ]
+ ]
+ },
+ {
+ "id": "fef6f985a19ce44e",
+ "type": "function",
+ "z": "87f7528a5c81b545",
+ "name": "Finish install",
+ "func": "msg = msg.msgIn;\n\nconst cachedInstalls = global.get(\"InstallModules:CachedInstalls\") || [];\n\nglobal.set(\"InstallModules:CachedInstalls\", [...cachedInstalls, ...msg.toInstall]);\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 410,
+ "y": 780,
+ "wires": [
+ [
+ "457ddbfd4780ea1d"
+ ]
+ ]
+ },
+ {
+ "id": "4432567301785438",
+ "type": "subflow:87f7528a5c81b545",
+ "z": "d5c98b48f9d2d77f",
+ "name": "",
+ "env": [
{
- "name": "Options",
- "value": "{\"method\":\"POST\",\"headers\":{\"Content-Type\":\"application/json\"}}",
+ "name": "Modules",
+ "value": "[\"html-entities\"]",
"type": "json"
+ }
+ ],
+ "x": 230,
+ "y": 120,
+ "wires": [
+ [
+ "e5c508b6228990f4"
+ ]
+ ]
+ },
+ {
+ "id": "e5c508b6228990f4",
+ "type": "function",
+ "z": "d5c98b48f9d2d77f",
+ "name": "Decode",
+ "func": "const { decode } = msg.importedModules['html-entities'];\n\nmsg.decodedContent = decode(msg.content);\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 200,
+ "y": 180,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "c0c36621780669a4",
+ "type": "subflow:a59054999730c251",
+ "z": "9e23ccbf2e0608ed",
+ "d": true,
+ "g": "0e1cb402b61eb646",
+ "name": "Model - openai - localhost",
+ "env": [
+ {
+ "name": "Id",
+ "value": "openai-localhost",
+ "type": "str"
},
{
- "name": "options",
- "value": "{\"method\": \"POST\"}",
- "type": "json"
+ "name": "BaseUrl",
+ "value": "http://host.docker.internal:8080",
+ "type": "str"
}
],
- "x": 780,
- "y": 180,
+ "x": 410,
+ "y": 520,
"wires": [
[
- "eea7ca5e3d911f8d"
+ "45671622e142be7e"
]
]
},
{
- "id": "eea7ca5e3d911f8d",
+ "id": "948e1265a14409b8",
"type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 13",
+ "z": "9e23ccbf2e0608ed",
+ "g": "aaf9af66d3e39da8",
+ "name": "Model Errors",
"active": true,
"tosidebar": true,
"console": false,
@@ -8079,40 +8786,43 @@
"targetType": "full",
"statusVal": "",
"statusType": "auto",
- "x": 780,
- "y": 220,
+ "x": 510,
+ "y": 720,
"wires": []
},
{
- "id": "53c302c1821fa9b9",
- "type": "inject",
- "z": "3fb1b07be44ed756",
- "name": "",
- "props": [
+ "id": "977f9402195729c4",
+ "type": "subflow:a59054999730c251",
+ "z": "9e23ccbf2e0608ed",
+ "g": "0e1cb402b61eb646",
+ "name": "Model - genai - llama-cpp-llava",
+ "env": [
{
- "p": "payload"
+ "name": "Id",
+ "value": "genai-llama-cpp-llava",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava",
+ "type": "str"
}
],
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "payload": "3",
- "payloadType": "num",
- "x": 1190,
- "y": 440,
+ "x": 430,
+ "y": 560,
"wires": [
[
- "f1e2bb90d5fcdf68"
+ "45671622e142be7e"
]
]
},
{
- "id": "d7e17a64b9a03bac",
+ "id": "a63ac3946c2843eb",
"type": "debug",
- "z": "3fb1b07be44ed756",
- "name": "debug 23",
+ "z": "9e23ccbf2e0608ed",
+ "d": true,
+ "g": "aaf9af66d3e39da8",
+ "name": "Model Output",
"active": true,
"tosidebar": true,
"console": false,
@@ -8121,78 +8831,5444 @@
"targetType": "full",
"statusVal": "",
"statusType": "auto",
- "x": 1530,
- "y": 440,
+ "x": 520,
+ "y": 680,
+ "wires": []
+ },
+ {
+ "id": "5e149325f881f48b",
+ "type": "subflow:2b3efcc977e88d91",
+ "z": "9e23ccbf2e0608ed",
+ "name": "",
+ "env": [
+ {
+ "name": "Url",
+ "value": "simple-chat",
+ "type": "str"
+ }
+ ],
+ "x": 550,
+ "y": 160,
+ "wires": [
+ [
+ "246a383da043e031",
+ "34dd380b3322dc77"
+ ]
+ ]
+ },
+ {
+ "id": "8ec4c35df45a28c5",
+ "type": "comment",
+ "z": "9e23ccbf2e0608ed",
+ "g": "0e1cb402b61eb646",
+ "name": "Models",
+ "info": "",
+ "x": 350,
+ "y": 420,
"wires": []
},
{
- "id": "f1e2bb90d5fcdf68",
+ "id": "246a383da043e031",
+ "type": "subflow:74bd10ee8e354d0a",
+ "z": "9e23ccbf2e0608ed",
+ "name": "",
+ "x": 310,
+ "y": 220,
+ "wires": [
+ [
+ "c865bad2cdc088e0"
+ ]
+ ]
+ },
+ {
+ "id": "b1093b3dfa80dbe3",
+ "type": "switch",
+ "z": "9e23ccbf2e0608ed",
+ "g": "aaf9af66d3e39da8",
+ "name": "Action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "model-content",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "model-error",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 350,
+ "y": 700,
+ "wires": [
+ [
+ "a63ac3946c2843eb"
+ ],
+ [
+ "948e1265a14409b8"
+ ]
+ ]
+ },
+ {
+ "id": "8e313642e9e9049a",
+ "type": "inject",
+ "z": "9e23ccbf2e0608ed",
+ "name": "Start App",
+ "props": [
+ {
+ "p": "timestamp",
+ "v": "",
+ "vt": "date"
+ },
+ {
+ "p": "action",
+ "v": "history-init",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "x": 140,
+ "y": 100,
+ "wires": [
+ [
+ "246a383da043e031"
+ ]
+ ]
+ },
+ {
+ "id": "378e8541feaf87ec",
+ "type": "subflow:a59054999730c251",
+ "z": "9e23ccbf2e0608ed",
+ "d": true,
+ "g": "0e1cb402b61eb646",
+ "name": "Model - dummy sse",
+ "env": [
+ {
+ "name": "Id",
+ "value": "dummy-sse",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://host.docker.internal:8091",
+ "type": "str"
+ },
+ {
+ "name": "Batch",
+ "value": "10",
+ "type": "num"
+ }
+ ],
+ "x": 390,
+ "y": 480,
+ "wires": [
+ [
+ "45671622e142be7e"
+ ]
+ ]
+ },
+ {
+ "id": "45671622e142be7e",
+ "type": "function",
+ "z": "9e23ccbf2e0608ed",
+ "g": "0e1cb402b61eb646",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 645,
+ "y": 580,
+ "wires": [
+ [
+ "246a383da043e031",
+ "b1093b3dfa80dbe3"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "33ca3631b9af0d55",
+ "type": "subflow:a59054999730c251",
+ "z": "9e23ccbf2e0608ed",
+ "d": true,
+ "g": "0e1cb402b61eb646",
+ "name": "Model - genai - llama-cpp-mistral-8x",
+ "env": [
+ {
+ "name": "Id",
+ "value": "genai-llama-cpp-mistral-8x",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-mistral-8x",
+ "type": "str"
+ }
+ ],
+ "x": 440,
+ "y": 600,
+ "wires": [
+ [
+ "45671622e142be7e"
+ ]
+ ]
+ },
+ {
+ "id": "d9e8ec2ee480957d",
+ "type": "function",
+ "z": "9e23ccbf2e0608ed",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 205,
+ "y": 460,
+ "wires": [
+ [
+ "378e8541feaf87ec",
+ "c0c36621780669a4",
+ "977f9402195729c4",
+ "33ca3631b9af0d55"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "c865bad2cdc088e0",
+ "type": "function",
+ "z": "9e23ccbf2e0608ed",
+ "g": "bf3cb919a9b18a74",
+ "name": "System Prompt",
+ "func": "// Initial prompt\nconst initialPrompt = `You are a helpful chat bot that will perform any requested tasks to the best of your ability.`;\n\n// if this is an update prompt message\nif (msg.action == \"prompt-update\") {\n // update our prompt\n context.set(\"prompt\", msg.prompt);\n // that's all\n return msg;\n}\n\n// get current prompt\nlet currentPrompt = context.get(\"prompt\");\n\nif (!currentPrompt) {\n currentPrompt = initialPrompt\n context.set(\"prompt\", currentPrompt);\n}\n\nmsg.systemPrompt = currentPrompt;\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 580,
+ "y": 320,
+ "wires": [
+ [
+ "5e149325f881f48b",
+ "d9e8ec2ee480957d"
+ ]
+ ]
+ },
+ {
+ "id": "34dd380b3322dc77",
+ "type": "switch",
+ "z": "9e23ccbf2e0608ed",
+ "g": "bf3cb919a9b18a74",
+ "name": "If prompt action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "regex",
+ "v": "^prompt-",
+ "vt": "str",
+ "case": false
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 580,
+ "y": 280,
+ "wires": [
+ [
+ "c865bad2cdc088e0"
+ ]
+ ]
+ },
+ {
+ "id": "6b73ef72bb7e4b87",
+ "type": "subflow:2b3efcc977e88d91",
+ "z": "ec55121054ad7072",
+ "name": "",
+ "env": [
+ {
+ "name": "Url",
+ "value": "admin-operator",
+ "type": "str"
+ }
+ ],
+ "x": 310,
+ "y": 280,
+ "wires": [
+ [
+ "e77e6ed92b6eba12"
+ ]
+ ]
+ },
+ {
+ "id": "e77e6ed92b6eba12",
+ "type": "subflow:74bd10ee8e354d0a",
+ "z": "ec55121054ad7072",
+ "name": "Admin History",
+ "env": [
+ {
+ "name": "SourceFilename",
+ "value": "/data/db/history-1711926907124.json",
+ "type": "str"
+ }
+ ],
+ "x": 600,
+ "y": 280,
+ "wires": [
+ [
+ "6b73ef72bb7e4b87",
+ "0a39bb73f010efd7",
+ "8ad28cb311d8a5c0"
+ ]
+ ]
+ },
+ {
+ "id": "cd5e2c4e51717c0f",
+ "type": "inject",
+ "z": "ec55121054ad7072",
+ "name": "Start App",
+ "props": [
+ {
+ "p": "timestamp",
+ "v": "",
+ "vt": "date"
+ },
+ {
+ "p": "action",
+ "v": "history-init",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "x": 140,
+ "y": 80,
+ "wires": [
+ [
+ "e77e6ed92b6eba12",
+ "d7625ef95dd891b8"
+ ]
+ ]
+ },
+ {
+ "id": "0a34e1dce381f16b",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 205,
+ "y": 440,
+ "wires": [
+ [
+ "21debbaed5b57fd5",
+ "75d06bae12a047f9",
+ "a61cd1dd9aeb1256",
+ "9d4dbbbd2defb7fb"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "75d06bae12a047f9",
+ "type": "subflow:a59054999730c251",
+ "z": "ec55121054ad7072",
+ "d": true,
+ "g": "0bd29a38bd7fd7ee",
+ "name": "Model - openai - localhost",
+ "env": [
+ {
+ "name": "Id",
+ "value": "openai-localhost",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://host.docker.internal:8080",
+ "type": "str"
+ }
+ ],
+ "x": 410,
+ "y": 500,
+ "wires": [
+ [
+ "a98ec39f0f7f2c84"
+ ]
+ ]
+ },
+ {
+ "id": "a61cd1dd9aeb1256",
+ "type": "subflow:a59054999730c251",
+ "z": "ec55121054ad7072",
+ "g": "0bd29a38bd7fd7ee",
+ "name": "Model - genai - llama-cpp-llava",
+ "env": [
+ {
+ "name": "Id",
+ "value": "genai-llama-cpp-llava",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava",
+ "type": "str"
+ }
+ ],
+ "x": 430,
+ "y": 540,
+ "wires": [
+ [
+ "a98ec39f0f7f2c84"
+ ]
+ ]
+ },
+ {
+ "id": "12901237f1ea6884",
+ "type": "comment",
+ "z": "ec55121054ad7072",
+ "g": "0bd29a38bd7fd7ee",
+ "name": "Models",
+ "info": "",
+ "x": 350,
+ "y": 400,
+ "wires": []
+ },
+ {
+ "id": "d9e0c9a3cf18f405",
+ "type": "debug",
+ "z": "ec55121054ad7072",
+ "g": "7aad90c5be36eb0a",
+ "name": "Model Errors",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 510,
+ "y": 700,
+ "wires": []
+ },
+ {
+ "id": "4b7f0d34fcfa313d",
+ "type": "debug",
+ "z": "ec55121054ad7072",
+ "d": true,
+ "g": "7aad90c5be36eb0a",
+ "name": "Model Output",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 520,
+ "y": 660,
+ "wires": []
+ },
+ {
+ "id": "bbeaa9f159afdfaf",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "g": "7aad90c5be36eb0a",
+ "name": "Action",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "model-content",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "model-error",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 350,
+ "y": 680,
+ "wires": [
+ [
+ "4b7f0d34fcfa313d"
+ ],
+ [
+ "d9e0c9a3cf18f405"
+ ]
+ ]
+ },
+ {
+ "id": "21debbaed5b57fd5",
+ "type": "subflow:a59054999730c251",
+ "z": "ec55121054ad7072",
+ "d": true,
+ "g": "0bd29a38bd7fd7ee",
+ "name": "Model - dummy sse",
+ "env": [
+ {
+ "name": "Id",
+ "value": "dummy-sse",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://host.docker.internal.local:8091",
+ "type": "str"
+ },
+ {
+ "name": "Batch",
+ "value": "10",
+ "type": "num"
+ }
+ ],
+ "x": 390,
+ "y": 460,
+ "wires": [
+ [
+ "a98ec39f0f7f2c84"
+ ]
+ ]
+ },
+ {
+ "id": "a98ec39f0f7f2c84",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "g": "0bd29a38bd7fd7ee",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 645,
+ "y": 560,
+ "wires": [
+ [
+ "e77e6ed92b6eba12",
+ "bbeaa9f159afdfaf",
+ "4de07154c6644063"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "9d4dbbbd2defb7fb",
+ "type": "subflow:a59054999730c251",
+ "z": "ec55121054ad7072",
+ "d": true,
+ "g": "0bd29a38bd7fd7ee",
+ "name": "Model - genai - llama-cpp-mistral-8x",
+ "env": [
+ {
+ "name": "Id",
+ "value": "genai-llama-cpp-mistral-8x",
+ "type": "str"
+ },
+ {
+ "name": "BaseUrl",
+ "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-mistral-8x",
+ "type": "str"
+ }
+ ],
+ "x": 440,
+ "y": 580,
+ "wires": [
+ [
+ "a98ec39f0f7f2c84"
+ ]
+ ]
+ },
+ {
+ "id": "0a39bb73f010efd7",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Admin Prompt",
+ "func": "msg.systemPrompt = `## Mandate\n\nYou are an AI Administrator.\n\nYour mandate is to manage a collective of AI Operators in order to accomplish the goal of any requests from the User.\n\nWhen a goal is too complex or you lack the requisite abilities for you to accomplish it on your own, break the goal down into one or more smaller tasks and assign each task to an Operator.\n\nIn addition to requests from the User, Operators may also send you messages or requests. Unlike requests from the User, you may choose whether and how to respond to messages and requests from Operators.\n\nEvery response must conclude with an tag.\n\n## Commands\n\nManage the collective of Operators using the Operator API. Send commands to the API as a JSON object wrapped in tags. Messages from operators will be given to you wrapped in tags.\n\n## Operator API Docs\n\n### Create an Operator\n\n\\`\\`\\`\n\n{\n \"method\": \"POST\",\n \"path\": \"/operators\",\n \"body\": {\n \"id\": \"06f86c9a-1fe6-4c74-8939-30e64cb1edbb\",\n \"name\": \"My First Operator\"\n }\n}\n\n\\`\\`\\`\n\n### Message an Operator\n\n\\`\\`\\`\n\n{\n \"method\": \"POST\",\n \"path\": \"/operators/06f86c9a-1fe6-4c74-8939-30e64cb1edbb/messages\",\n \"body\": {\n \"content\": \"Sign up for an account at the following website: https://www.example.com\"\n }\n}\n\n\\`\\`\\`\n\n### Delete an Operator\n\n\\`\\`\\`\n\n{\n \"method\": \"DELETE\",\n \"path\": \"/operators/06f86c9a-1fe6-4c74-8939-30e64cb1edbb\",\n \"body\": {}\n}\n\n\\`\\`\\`\n\n\n`;\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 140,
+ "y": 400,
+ "wires": [
+ [
+ "0a34e1dce381f16b"
+ ]
+ ]
+ },
+ {
+ "id": "4de07154c6644063",
+ "type": "subflow:f19bc65164444615",
+ "z": "ec55121054ad7072",
+ "name": "Operator Histories",
+ "env": [
+ {
+ "name": "Factory Id",
+ "value": "operators",
+ "type": "str"
+ }
+ ],
+ "x": 890,
+ "y": 600,
+ "wires": [
+ [
+ "94206e52b6f654bd",
+ "941ab8d26359e8b3"
+ ]
+ ]
+ },
+ {
+ "id": "3f33490320859b09",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "name": "Response tag",
+ "property": "tag",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "operator-api",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 880,
+ "y": 240,
+ "wires": [
+ [
+ "1ec42373eea9f5ff"
+ ]
+ ]
+ },
+ {
+ "id": "1ec42373eea9f5ff",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Parse operator API",
+ "func": "let apiMsg;\ntry {\n apiMsg = JSON.parse(msg.content);\n}\ncatch (e) {\n throw new Error(`Error parsing operator AI call: ${msg.content} - ${e}`);\n}\n\nreturn {\n ...msg,\n ...apiMsg\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 890,
+ "y": 340,
+ "wires": [
+ [
+ "17e432a11037e949"
+ ]
+ ]
+ },
+ {
+ "id": "17e432a11037e949",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "name": "Operator API - Path",
+ "property": "path",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "regex",
+ "v": "^/operators(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
+ "vt": "str",
+ "case": true
+ },
+ {
+ "t": "regex",
+ "v": "^/operators/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/messages$",
+ "vt": "str",
+ "case": true
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 890,
+ "y": 440,
+ "wires": [
+ [
+ "1e437fb36b5c0ea1"
+ ],
+ [
+ "da042c7a27dcbd9f"
+ ]
+ ],
+ "outputLabels": [
+ "Operators",
+ "Operators/Messages"
+ ]
+ },
+ {
+ "id": "1e437fb36b5c0ea1",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "name": "Operators Method",
+ "property": "method",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "POST",
+ "vt": "str"
+ },
+ {
+ "t": "eq",
+ "v": "DELETE",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 2,
+ "x": 1110,
+ "y": 420,
+ "wires": [
+ [
+ "2c04b0bb076a5230"
+ ],
+ []
+ ]
+ },
+ {
+ "id": "2c04b0bb076a5230",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Create operator",
+ "func": "msg = {\n action: \"prog-history-init\",\n historyId: msg.body?.id\n};\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1380,
+ "y": 360,
+ "wires": [
+ [
+ "40557c67b6ce1c09",
+ "1554a43a221611d6"
+ ]
+ ]
+ },
+ {
+ "id": "da042c7a27dcbd9f",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "name": "Operators/Messages Method",
+ "property": "method",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "POST",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 1140,
+ "y": 460,
+ "wires": [
+ [
+ "2d1212f366ac2dec"
+ ]
+ ]
+ },
+ {
+ "id": "a2eae6bb6671163b",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Add Admin Message",
+ "func": "msg = {\n action: \"prog-history-add-entry\",\n entry: {\n role: \"user\",\n content: msg.createAdminMessagePrompt(msg.body?.content)\n },\n id: msg.path.split('/')[2]\n};\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1400,
+ "y": 540,
+ "wires": [
+ [
+ "4de07154c6644063",
+ "dd64967ec7cb7b3d"
+ ]
+ ]
+ },
+ {
+ "id": "2d1212f366ac2dec",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Admin message prompt template",
+ "func": "msg.createAdminMessagePrompt = message => {\n return `${message}`;\n};\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1440,
+ "y": 500,
+ "wires": [
+ [
+ "a2eae6bb6671163b"
+ ]
+ ]
+ },
+ {
+ "id": "ef526c2a80f31eb3",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Operator Prompt",
+ "func": "msg.systemPrompt = `## Mandate\n\nYou are an AI Operator.\n\nYour mandate is to perform any tasks requested of you by your AI Administrator to the best of your ability in order to accomplish the overarching goal of the User.\n\nWhen a task is too complex or you lack the requisite abilities for you to accomplish it on your own, you may ask the Administrator to break the task down into one or more smaller tasks and assign them to Operators.\n\nThis conversation is a complete record of every action you took in performing the task.\n\nEnd all responses with an tag.\n\n## Commands\n\nYou may message the Administrator by wrapping your message in tags. Messages from the Administrator will be given to you wrapped in tags.\n`;\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 130,
+ "y": 480,
+ "wires": [
+ [
+ "0a34e1dce381f16b"
+ ]
+ ]
+ },
+ {
+ "id": "87b70bd29575e8b4",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 265,
+ "y": 920,
+ "wires": [
+ [
+ "ef526c2a80f31eb3"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "40557c67b6ce1c09",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1695,
+ "y": 540,
+ "wires": [
+ [
+ "4de07154c6644063"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "a073258f226718b6",
+ "type": "switch",
+ "z": "ec55121054ad7072",
+ "name": "Response tag",
+ "property": "tag",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "operator-message",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 880,
+ "y": 760,
+ "wires": [
+ [
+ "2d730859f47f1ceb"
+ ]
+ ]
+ },
+ {
+ "id": "94206e52b6f654bd",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 715,
+ "y": 680,
+ "wires": [
+ [
+ "87b70bd29575e8b4"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "8ad28cb311d8a5c0",
+ "type": "subflow:240cc03734c17fa7",
+ "z": "ec55121054ad7072",
+ "name": "Parse Admin Response",
+ "x": 900,
+ "y": 160,
+ "wires": [
+ [
+ "3f33490320859b09"
+ ]
+ ]
+ },
+ {
+ "id": "941ab8d26359e8b3",
+ "type": "subflow:240cc03734c17fa7",
+ "z": "ec55121054ad7072",
+ "name": "Parse Operator Response",
+ "x": 910,
+ "y": 680,
+ "wires": [
+ [
+ "a073258f226718b6"
+ ]
+ ]
+ },
+ {
+ "id": "2d730859f47f1ceb",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Operator message prompt template",
+ "func": "msg.createOperatorMessagePrompt = (id, message) => {\n return `${message}`;\n};\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1420,
+ "y": 700,
+ "wires": [
+ [
+ "134cfbd5d2b56837"
+ ]
+ ]
+ },
+ {
+ "id": "134cfbd5d2b56837",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Add Operator Message",
+ "func": "msg = {\n action: \"history-add-entry\",\n entry: {\n role: \"user\",\n content: msg.createOperatorMessagePrompt(msg.agentId, msg.content)\n }\n};\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1390,
+ "y": 740,
+ "wires": [
+ [
+ "13c990f21a453c5a",
+ "e7f4585c8ca44732"
+ ]
+ ]
+ },
+ {
+ "id": "d2c9ca4a42af3ba9",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 725,
+ "y": 400,
+ "wires": [
+ [
+ "e77e6ed92b6eba12"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "13c990f21a453c5a",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": " ",
+ "func": "\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1615,
+ "y": 740,
+ "wires": [
+ [
+ "d2c9ca4a42af3ba9"
+ ]
+ ],
+ "icon": "font-awesome/fa-arrows",
+ "l": false
+ },
+ {
+ "id": "d7625ef95dd891b8",
+ "type": "function",
+ "z": "ec55121054ad7072",
+ "name": "Init Operator Histories",
+ "func": "\nreturn {\n action: \"prog-factory-init\"\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 420,
+ "y": 100,
+ "wires": [
+ [
+ "b6cc1b3167117b16"
+ ]
+ ]
+ },
+ {
+ "id": "1554a43a221611d6",
+ "type": "debug",
+ "z": "ec55121054ad7072",
+ "name": "Creating Operator",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1650,
+ "y": 320,
+ "wires": []
+ },
+ {
+ "id": "dd64967ec7cb7b3d",
+ "type": "debug",
+ "z": "ec55121054ad7072",
+ "name": "Sending Admin Message",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1670,
+ "y": 600,
+ "wires": []
+ },
+ {
+ "id": "e7f4585c8ca44732",
+ "type": "debug",
+ "z": "ec55121054ad7072",
+ "name": "Sending Operator Message",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1680,
+ "y": 800,
+ "wires": []
+ },
+ {
+ "id": "b75f0d8130661559",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "function 1",
+ "func": "return { sseJs, nodeFetch, async }",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "sseJs",
+ "module": "sse.js"
+ },
+ {
+ "var": "async",
+ "module": "async"
+ },
+ {
+ "var": "nodeFetch",
+ "module": "node-fetch"
+ }
+ ],
+ "x": 1080,
+ "y": 360,
+ "wires": [
+ [
+ "ea2d35fce99de4ae"
+ ]
+ ]
+ },
+ {
+ "id": "26a114fc27cd90b0",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 900,
+ "y": 340,
+ "wires": [
+ [
+ "b75f0d8130661559"
+ ]
+ ]
+ },
+ {
+ "id": "ea2d35fce99de4ae",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "debug 5",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1250,
+ "y": 380,
+ "wires": []
+ },
+ {
+ "id": "8f75c3504c3dbc5f",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "Install dependencies",
+ "func": "// List of NPM modules\nconst toInstall = [\n 'sse.js'\n]\n\nconst { exec } = childProcess;\n\nconst run = async (cmd) => {\n const child = exec(cmd, (err) => {\n if (err) console.error(err);\n });\n await new Promise((resolve) => child.on('close', resolve));\n};\n\nawait Promise.all(toInstall.map(it => run(`npm install ${it}`)));\n\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "childProcess",
+ "module": "child_process"
+ }
+ ],
+ "x": 940,
+ "y": 420,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "e22d75a202b3a7d9",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "function 2",
+ "func": "//throw new Error(\"This crashes Node-RED!\");\n\n(async () => {\n try {\n const sse = await (global.get(\"dynamicallyImport\"))(\"sse.js\");\n node.send({sse});\n node.done();\n }\n catch (e) {\n node.send({ e });\n }\n})();\n\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1160,
+ "y": 460,
+ "wires": [
+ [
+ "18e60cf6d75b5c02"
+ ]
+ ]
+ },
+ {
+ "id": "233b190c4bba2abc",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 1000,
+ "y": 460,
+ "wires": [
+ [
+ "e22d75a202b3a7d9"
+ ]
+ ]
+ },
+ {
+ "id": "18e60cf6d75b5c02",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "debug 6",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1320,
+ "y": 460,
+ "wires": []
+ },
+ {
+ "id": "366fdac4502597e4",
+ "type": "provide-import-fn",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "x": 1120,
+ "y": 600,
+ "wires": [
+ [
+ "f58a612cea662f7f"
+ ]
+ ]
+ },
+ {
+ "id": "f58a612cea662f7f",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "Named Imports",
+ "func": "// List of modules\nconst toImport = [\n 'sse.js',\n \"node:events\"\n];\n\n;(async () => {\n try {\n const imported = Object.fromEntries(\n await Promise.all(\n toImport.map(\n async it => [it, await msg.import(it)]\n )\n )\n );\n\n node.send({...msg, namedImports: imported});\n } \n catch (e) {\n node.error(e);\n }\n})();\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "sseJs",
+ "module": "sse.js"
+ }
+ ],
+ "x": 1370,
+ "y": 600,
+ "wires": [
+ [
+ "3163545a452b8023"
+ ]
+ ]
+ },
+ {
+ "id": "3163545a452b8023",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "function 5",
+ "func": "const {\"sse.js\": { SSE }} = msg.namedImports;\nconst { Event } = msg.global;\n\nclass CustomEvent extends Event { \n constructor(message, data) {\n super(message, data)\n this.detail = data?.detail\n }\n}\n\nmsg.global.CustomEvent = CustomEvent;\ntry {\n const r = SSE();\n msg.r = r;\n return msg;\n}\ncatch (e) {\n node.error(e);\n node.error(e.stack);\n}\n\n// return {\n// ...msg,\n// scriptglobal: global,\n// Event: global.Event,\n// globalEvent: msg.global.Event\n// }",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1400,
+ "y": 520,
+ "wires": [
+ [
+ "f4e0940a4675e15a"
+ ]
+ ]
+ },
+ {
+ "id": "f4e0940a4675e15a",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "debug 9",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1520,
+ "y": 480,
+ "wires": []
+ },
+ {
+ "id": "d5dd065101ef890a",
+ "type": "provide-global",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "x": 1110,
+ "y": 640,
+ "wires": [
+ [
+ "366fdac4502597e4"
+ ]
+ ]
+ },
+ {
+ "id": "4a5b440f0562c4c5",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 910,
+ "y": 600,
+ "wires": [
+ [
+ "d5dd065101ef890a"
+ ]
+ ]
+ },
+ {
+ "id": "370b802881cc5a5b",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Send chat to model",
+ "func": "msg['genai-llama-cpp-llava'] = {\n payload: {\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful chat bot that will perform any requested tasks to the best of your ability.\"\n },\n ...msg.chat.history.map(it => ({\n role: it.role,\n content: it.content\n }))\n ],\n \"temperature\": 0.7,\n \"stop\": null,\n \"stream\": true\n }\n}\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 310,
+ "y": 100,
+ "wires": [
+ [
+ "d33cede612c96641"
+ ]
+ ]
+ },
+ {
+ "id": "d33cede612c96641",
+ "type": "subflow:6d317c39edd7ba27",
+ "z": "3fb1b07be44ed756",
+ "name": "localhost-sse",
+ "env": [
+ {
+ "name": "Id",
+ "value": "localhost-sse",
+ "type": "str"
+ },
+ {
+ "name": "Url",
+ "value": "http://host.docker.internal:8091/sse",
+ "type": "str"
+ },
+ {
+ "name": "options",
+ "value": "{\"method\": \"POST\"}",
+ "type": "json"
+ },
+ {
+ "name": "Options",
+ "value": "{\"method\":\"POST\"}",
+ "type": "json"
+ }
+ ],
+ "x": 570,
+ "y": 120,
+ "wires": [
+ [
+ "453833904710992b"
+ ]
+ ]
+ },
+ {
+ "id": "453833904710992b",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 11",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 560,
+ "y": 160,
+ "wires": []
+ },
+ {
+ "id": "e5399fe826058b29",
+ "type": "subflow:6d317c39edd7ba27",
+ "z": "3fb1b07be44ed756",
+ "name": "localhost-openai",
+ "env": [
+ {
+ "name": "Id",
+ "value": "localhost-openai",
+ "type": "str"
+ },
+ {
+ "name": "Url",
+ "value": "http://host.docker.internal:8080/v1/chat/completions",
+ "type": "str"
+ },
+ {
+ "name": "Options",
+ "value": "{\"method\":\"POST\",\"headers\":{\"Content-Type\":\"application/json\"}}",
+ "type": "json"
+ },
+ {
+ "name": "options",
+ "value": "{\"method\": \"POST\"}",
+ "type": "json"
+ }
+ ],
+ "x": 760,
+ "y": 60,
+ "wires": [
+ [
+ "4912a5fe5cc3d7cd"
+ ]
+ ]
+ },
+ {
+ "id": "4912a5fe5cc3d7cd",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 12",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 780,
+ "y": 100,
+ "wires": []
+ },
+ {
+ "id": "6db72e1f1342ce1d",
+ "type": "subflow:6d317c39edd7ba27",
+ "z": "3fb1b07be44ed756",
+ "name": "genai-llama-cpp-llava",
+ "env": [
+ {
+ "name": "Id",
+ "value": "genai-llama-cpp-llava",
+ "type": "str"
+ },
+ {
+ "name": "Url",
+ "value": "http://d2u7t6ixyjqeq5.cloudfront.net/genai-llama-cpp-llava/v1/chat/completions",
+ "type": "str"
+ },
+ {
+ "name": "Options",
+ "value": "{\"method\":\"POST\",\"headers\":{\"Content-Type\":\"application/json\"}}",
+ "type": "json"
+ },
+ {
+ "name": "options",
+ "value": "{\"method\": \"POST\"}",
+ "type": "json"
+ }
+ ],
+ "x": 780,
+ "y": 180,
+ "wires": [
+ [
+ "eea7ca5e3d911f8d"
+ ]
+ ]
+ },
+ {
+ "id": "eea7ca5e3d911f8d",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 13",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 780,
+ "y": 220,
+ "wires": []
+ },
+ {
+ "id": "53c302c1821fa9b9",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "3",
+ "payloadType": "num",
+ "x": 1190,
+ "y": 240,
+ "wires": [
+ [
+ "f1e2bb90d5fcdf68"
+ ]
+ ]
+ },
+ {
+ "id": "d7e17a64b9a03bac",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 23",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1530,
+ "y": 240,
+ "wires": []
+ },
+ {
+ "id": "f1e2bb90d5fcdf68",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 7",
+ "func": "\nreturn {fs};",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "fs",
+ "module": "fs"
+ }
+ ],
+ "x": 1340,
+ "y": 240,
+ "wires": [
+ [
+ "d7e17a64b9a03bac"
+ ]
+ ]
+ },
+ {
+ "id": "23cc77d254e27371",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Init Vector Store",
+ "func": "const { HNSWLib } = langchainCommunityVectorstoresHnswlib;\nconst { OpenAIEmbeddings } = langchainOpenai;\n\nconst vectorStore = await HNSWLib.fromTexts(\n [\"Hello world\", \"Bye bye\", \"hello nice world\"],\n [{ id: 2 }, { id: 1 }, { id: 3 }],\n new OpenAIEmbeddings()\n);\n\nconst resultOne = await vectorStore.similaritySearch(\"hello world\", 1);\nconsole.log(resultOne);\n\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "langchainCommunityVectorstoresHnswlib",
+ "module": "@langchain/community/vectorstores/hnswlib"
+ },
+ {
+ "var": "langchainOpenai",
+ "module": "@langchain/openai"
+ }
+ ],
+ "x": 1500,
+ "y": 120,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "9f7595e19d34fca3",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Provide OpenAIEmbeddings",
+ "func": "msg.OpenAIEmbeddings = class {\n constructor () {\n \n }\n}\n\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 1400,
+ "y": 60,
+ "wires": [
+ []
+ ]
+ },
+ {
+ "id": "78e2f994d1fbe874",
+ "type": "subflow:b9a9b43a3594c357",
+ "z": "3fb1b07be44ed756",
+ "name": "Docker Run",
+ "env": [
+ {
+ "name": "Container Name",
+ "value": "create-directory-01",
+ "type": "str"
+ },
+ {
+ "name": "Command",
+ "value": "",
+ "type": "str"
+ },
+ {
+ "name": "Output Mode",
+ "value": "full",
+ "type": "str"
+ },
+ {
+ "name": "Commit",
+ "value": "true",
+ "type": "bool"
+ },
+ {
+ "name": "Response Mode",
+ "value": "full",
+ "type": "str"
+ }
+ ],
+ "x": 190,
+ "y": 840,
+ "wires": [
+ [
+ "7d1f6f8b055c1f9c",
+ "2b9295527ed600a5"
+ ]
+ ]
+ },
+ {
+ "id": "b1b7a5e444690a58",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 100,
+ "y": 740,
+ "wires": [
+ [
+ "b6d1a9d992b0d137"
+ ]
+ ]
+ },
+ {
+ "id": "7d1f6f8b055c1f9c",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "Create directory",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 200,
+ "y": 880,
+ "wires": []
+ },
+ {
+ "id": "01a08cd51c7a1f8a",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 240,
+ "y": 980,
+ "wires": [
+ [
+ "bd126ff279ae3415"
+ ]
+ ]
+ },
+ {
+ "id": "f8f3094def8eec89",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "x": 680,
+ "y": 980,
+ "wires": [
+ [
+ "60dae42d0ea16a38"
+ ]
+ ]
+ },
+ {
+ "id": "bd126ff279ae3415",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 20",
+ "func": "msg.url = `http://docker-engine-api:2375/containers/5efd360faabae42c09c97845e52f9709aca2519e923204596c14225aa3c454ca/exec`;\nmsg.method = \"POST\"\nmsg.payload = {\n AttachStdout: true,\n AttachStderr: true,\n Tty: true,\n Cmd: [\"bash\", \"-c\", \"for i in {1..10}; do echo \\\"Exec message\\\"; sleep 1; done\"]\n}\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 450,
+ "y": 980,
+ "wires": [
+ [
+ "f8f3094def8eec89"
+ ]
+ ]
+ },
+ {
+ "id": "60dae42d0ea16a38",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 30",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 860,
+ "y": 980,
+ "wires": []
+ },
+ {
+ "id": "80486c2b2c4ca875",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 240,
+ "y": 1040,
+ "wires": [
+ [
+ "1f5e501e97cf0503"
+ ]
+ ]
+ },
+ {
+ "id": "539ef7fa2e766b13",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "x": 680,
+ "y": 1040,
+ "wires": [
+ [
+ "6f9623b787e73b13"
+ ]
+ ]
+ },
+ {
+ "id": "1f5e501e97cf0503",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 22",
+ "func": "msg.url = `http://docker-engine-api:2375/exec/b6ecfcc454087d84e46e8f1fec6ba1bf8701322f8146393bdb102d6859283130/start`;\nmsg.method = \"POST\"\nmsg.payload = {\n Detach: false,\n Tty: false\n}\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 450,
+ "y": 1040,
+ "wires": [
+ [
+ "539ef7fa2e766b13"
+ ]
+ ]
+ },
+ {
+ "id": "6f9623b787e73b13",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 31",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 860,
+ "y": 1040,
+ "wires": []
+ },
+ {
+ "id": "6c89094abec8d0f3",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 240,
+ "y": 1100,
+ "wires": [
+ [
+ "52f3d0c6089039ae"
+ ]
+ ]
+ },
+ {
+ "id": "fcd58b089d8db6fc",
+ "type": "subflow:f0aa5f2ed7dab3b8",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "x": 680,
+ "y": 1100,
+ "wires": [
+ [
+ "b2f29c3b2edf6a54"
+ ]
+ ]
+ },
+ {
+ "id": "52f3d0c6089039ae",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 23",
+ "func": "msg.url = `http://docker-engine-api:2375/exec/7cdfd069b582e2d85945fc8c9f1d9c080b11a016e1611067c74c969aca7b6b1f/start`;\nmsg.method = \"POST\"\nmsg.payload = {}\n\nreturn msg;\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 450,
+ "y": 1100,
+ "wires": [
+ [
+ "fcd58b089d8db6fc"
+ ]
+ ]
+ },
+ {
+ "id": "b2f29c3b2edf6a54",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 32",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 860,
+ "y": 1100,
+ "wires": []
+ },
+ {
+ "id": "54e8be0ccd77b333",
+ "type": "subflow:d5c30c295cb6b7bc",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "x": 360,
+ "y": 700,
+ "wires": [
+ [
+ "ef618dafdea24bf5"
+ ]
+ ]
+ },
+ {
+ "id": "a8857b2bfb37fa1d",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 24",
+ "func": "\nreturn {\n mode: \"spawn\",\n command: \"ls -la /data\"\n};",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 180,
+ "y": 700,
+ "wires": [
+ [
+ "54e8be0ccd77b333"
+ ]
+ ]
+ },
+ {
+ "id": "dde91c17372b1fe1",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 160,
+ "y": 660,
+ "wires": [
+ [
+ "a8857b2bfb37fa1d"
+ ]
+ ]
+ },
+ {
+ "id": "ef618dafdea24bf5",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 33",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 530,
+ "y": 680,
+ "wires": []
+ },
+ {
+ "id": "b6d1a9d992b0d137",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Create directory",
+ "func": "\nreturn {\n command: [\"bash\", \"-c\", 'mkdir /root/scripts']\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 200,
+ "y": 800,
+ "wires": [
+ [
+ "78e2f994d1fbe874"
+ ]
+ ]
+ },
+ {
+ "id": "2b9295527ed600a5",
+ "type": "switch",
+ "z": "3fb1b07be44ed756",
+ "name": "If success",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "docker-done",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 400,
+ "y": 760,
+ "wires": [
+ [
+ "8335323195e55550"
+ ]
+ ]
+ },
+ {
+ "id": "8335323195e55550",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Create script",
+ "func": "\nreturn {\n command: [\n \"bash\",\n \"-c\",\n `cat << 'EOF' > /root/scripts/script-01.sh ${\n`#!/bin/bash\n\necho \"Script start\";\n\nls -la\n\necho \"Script end\";\n`}\nEOF\n\nchmod +x /root/scripts/script-01.sh`\n ],\n image: msg.containerSpec.commit.image\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 410,
+ "y": 800,
+ "wires": [
+ [
+ "c5b7d5c62d369c24"
+ ]
+ ]
+ },
+ {
+ "id": "c5b7d5c62d369c24",
+ "type": "subflow:b9a9b43a3594c357",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "env": [
+ {
+ "name": "Container Name",
+ "value": "create-script-01",
+ "type": "str"
+ },
+ {
+ "name": "Image",
+ "value": "",
+ "type": "str"
+ },
+ {
+ "name": "Command",
+ "value": "",
+ "type": "str"
+ },
+ {
+ "name": "Output Mode",
+ "value": "full",
+ "type": "str"
+ },
+ {
+ "name": "Commit",
+ "value": "true",
+ "type": "bool"
+ }
+ ],
+ "x": 410,
+ "y": 840,
+ "wires": [
+ [
+ "e386314f2de22206",
+ "b424a8681b95fd74"
+ ]
+ ]
+ },
+ {
+ "id": "e386314f2de22206",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "create script",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 410,
+ "y": 880,
+ "wires": []
+ },
+ {
+ "id": "b424a8681b95fd74",
+ "type": "switch",
+ "z": "3fb1b07be44ed756",
+ "name": "If success",
+ "property": "action",
+ "propertyType": "msg",
+ "rules": [
+ {
+ "t": "eq",
+ "v": "docker-done",
+ "vt": "str"
+ }
+ ],
+ "checkall": "true",
+ "repair": false,
+ "outputs": 1,
+ "x": 620,
+ "y": 760,
+ "wires": [
+ [
+ "3d56f436eacbe88b"
+ ]
+ ]
+ },
+ {
+ "id": "3d56f436eacbe88b",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "Execute script",
+ "func": "\nreturn {\n command: [\"bash\", \"-c\", \"/root/scripts/script-01.sh\"],\n image: msg.containerSpec.commit.image\n};\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 640,
+ "y": 800,
+ "wires": [
+ [
+ "10318dc5293f6d80"
+ ]
+ ]
+ },
+ {
+ "id": "10318dc5293f6d80",
+ "type": "subflow:b9a9b43a3594c357",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "env": [
+ {
+ "name": "Container Name",
+ "value": "execute-script-01",
+ "type": "str"
+ },
+ {
+ "name": "Image",
+ "value": "",
+ "type": "str"
+ },
+ {
+ "name": "Command",
+ "value": "",
+ "type": "str"
+ },
+ {
+ "name": "Output Mode",
+ "value": "full",
+ "type": "str"
+ }
+ ],
+ "x": 630,
+ "y": 840,
+ "wires": [
+ [
+ "3ef49ac93dfcce8c"
+ ]
+ ]
+ },
+ {
+ "id": "3ef49ac93dfcce8c",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "execute script",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 640,
+ "y": 880,
+ "wires": []
+ },
+ {
+ "id": "437a9435e7f7839a",
+ "type": "comment",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "Imports, Dependencies, Global",
+ "info": "",
+ "x": 1460,
+ "y": 340,
+ "wires": []
+ },
+ {
+ "id": "93482abb81e0fcdd",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 200,
+ "y": 220,
+ "wires": [
+ [
+ "c984808fcfb74f0f"
+ ]
+ ]
+ },
+ {
+ "id": "c984808fcfb74f0f",
+ "type": "change",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "rules": [
+ {
+ "t": "set",
+ "p": "payload",
+ "pt": "msg",
+ "to": "[\"one\",\"two\",\"three\"]",
+ "tot": "json"
+ },
+ {
+ "t": "set",
+ "p": "other",
+ "pt": "msg",
+ "to": "23",
+ "tot": "str"
+ }
+ ],
+ "action": "",
+ "property": "",
+ "from": "",
+ "to": "",
+ "reg": false,
+ "x": 220,
+ "y": 260,
+ "wires": [
+ [
+ "45a072776a06e888"
+ ]
+ ]
+ },
+ {
+ "id": "45a072776a06e888",
+ "type": "split",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "splt": "\\n",
+ "spltType": "str",
+ "arraySplt": 1,
+ "arraySpltType": "len",
+ "stream": false,
+ "addname": "",
+ "x": 190,
+ "y": 300,
+ "wires": [
+ [
+ "306f4255096d69e2"
+ ]
+ ]
+ },
+ {
+ "id": "306f4255096d69e2",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 34",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 200,
+ "y": 340,
+ "wires": []
+ },
+ {
+ "id": "234a56ef02849517",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 900,
+ "y": 700,
+ "wires": [
+ [
+ "4b1052f331f48638"
+ ]
+ ]
+ },
+ {
+ "id": "bd0ab9ac636bddf7",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "debug 35",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1530,
+ "y": 700,
+ "wires": []
+ },
+ {
+ "id": "4b1052f331f48638",
+ "type": "provide-import-fn",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "x": 1110,
+ "y": 700,
+ "wires": [
+ [
+ "f119a534c23868e3"
+ ]
+ ]
+ },
+ {
+ "id": "f119a534c23868e3",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "Named Imports",
+ "func": "// List of modules\nconst toImport = [\n 'sse.js',\n \"node:events\",\n \"node:path\",\n \"node:module\"\n];\n\n;(async () => {\n try {\n const imported = Object.fromEntries(\n await Promise.all(\n toImport.map(\n async it => [it, await msg.import(it)]\n )\n )\n );\n\n node.send({...msg, namedImports: imported});\n } \n catch (e) {\n node.error(e);\n }\n})();\n",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [
+ {
+ "var": "sseJs",
+ "module": "sse.js"
+ }
+ ],
+ "x": 1360,
+ "y": 700,
+ "wires": [
+ [
+ "bd0ab9ac636bddf7"
+ ]
+ ]
+ },
+ {
+ "id": "a11718080bf06447",
+ "type": "subflow:87f7528a5c81b545",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "env": [
+ {
+ "name": "Modules",
+ "value": "[\"colors/safe.js\",{\"moduleName\":\"change-case\",\"key\":\"changeCase\",\"defaultExport\":false,\"namedExports\":[\"camelCase\",{\"name\":\"split\",\"alias\":\"splitWords\"}]}]",
+ "type": "json"
+ }
+ ],
+ "x": 1130,
+ "y": 760,
+ "wires": [
+ [
+ "11de70778f4fcccb"
+ ]
+ ]
+ },
+ {
+ "id": "7e92245bb06f8113",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 900,
+ "y": 760,
+ "wires": [
+ [
+ "a11718080bf06447"
+ ]
+ ]
+ },
+ {
+ "id": "11de70778f4fcccb",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "g": "e18c67f0ba18707b",
+ "name": "debug 36",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 1340,
+ "y": 760,
+ "wires": []
+ },
+ {
+ "id": "39d3ce3ccf412e91",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 25",
+ "func": "msg.content = `\nTo elicit a more detailed and specific response from BigStar, you could alter Lilly's prompt as follows:\n\nI have $10,000 in savings currently in an investment account. My goal is to earn a passive income of $10,000 per month within the next 6-12 months. Please provide a comprehensive step-by-step plan that outlines clear actions and resources for meeting this goal. The plan should include information on high-yield savings accounts, their interest rates, minimum balance requirements, and any other relevant details. Additionally, please consider providing examples of other investment strategies or financial products that could help me achieve my goal.\n\nThis prompt is more detailed and specific, which would encourage BigStar to provide a more thorough response with actionable steps and resources for achieving Lilly's goal\n\n{\n \"method\": \"POST\",\n \"path\": \"/operators\",\n \"body\": {\n \"id\": \"06f86c9a-1fe6-4c74-8939-30e64cb1edbb\",\n \"name\": \"My First Operator\"\n }\n}\n\n\n\n{\n \"method\": \"POST\",\n \"path\": \"/operators/06f86c9a-1fe6-4c74-8939-30e64cb1edbb/messages\",\n \"body\": {\n \"content\": \"Sign up for an account at the following website: https://www.example.com\"\n }\n}\n\nWhen I tried to access the website, I got a 404 Not Found error.\n\n\\`sudo apt - get update && sudo apt - get install - y net - tools\\`\n\n\\`\\`\\`bash\n#!/bin/bash\n\necho \"Script start.\"\necho \"Stderr start\" >& 2\n\nsudo apt update && sudo apt install - y curl\nsudo apt install - y google - chrome - stable\n\ncurl - X GET https://www.google.com/?s=puppies\n\\`\\`\\`\n`;\n\nreturn msg;",
+ "outputs": 1,
+ "timeout": 0,
+ "noerr": 0,
+ "initialize": "",
+ "finalize": "",
+ "libs": [],
+ "x": 410,
+ "y": 360,
+ "wires": [
+ [
+ "f943a06e26050abe"
+ ]
+ ]
+ },
+ {
+ "id": "482aefc956fcabfa",
+ "type": "inject",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "props": [
+ {
+ "p": "payload"
+ },
+ {
+ "p": "topic",
+ "vt": "str"
+ }
+ ],
+ "repeat": "",
+ "crontab": "",
+ "once": false,
+ "onceDelay": 0.1,
+ "topic": "",
+ "payload": "",
+ "payloadType": "date",
+ "x": 400,
+ "y": 320,
+ "wires": [
+ [
+ "39d3ce3ccf412e91"
+ ]
+ ]
+ },
+ {
+ "id": "f943a06e26050abe",
+ "type": "subflow:126e4a373d8bcb36",
+ "z": "3fb1b07be44ed756",
+ "name": "",
+ "x": 430,
+ "y": 400,
+ "wires": [
+ [
+ "0b8c8bc4d9b7c3e5"
+ ]
+ ]
+ },
+ {
+ "id": "0b8c8bc4d9b7c3e5",
+ "type": "debug",
+ "z": "3fb1b07be44ed756",
+ "name": "debug 37",
+ "active": true,
+ "tosidebar": true,
+ "console": false,
+ "tostatus": false,
+ "complete": "true",
+ "targetType": "full",
+ "statusVal": "",
+ "statusType": "auto",
+ "x": 400,
+ "y": 440,
+ "wires": []
+ },
+ {
+ "id": "cfb2407a726eb285",
+ "type": "function",
+ "z": "3fb1b07be44ed756",
+ "name": "function 26",
+ "func": "msg.content = `\n\nperties(a,{g:{value:b,configurable:!0,writable:!0,enumerable:!1}})})(B,55);Object.freeze(B);var C=function(){};Object.freeze(new function(){});Object.freeze(new C);Object.freeze(new C);var D=!z&&!w(),G=function(a){if(/-[a-z]/.test(\"ved\"))return null;if(D&&a.dataset){if(y()&&!(\"ved\"in a.dataset))return null;a=a.dataset.ved;return a===void 0?null:a}return a.getAttribute(\"data-\"+\"ved\".replace(/([A-Z])/g,\"-$1\").toLowerCase())};var H=[],I=null;function J(a){a=a.target;var b=performance.now(),f=[],K=f.concat,d=H;if(!(d instanceof Array)){var m=typeof Symbol!=\"undefined\"&&Symbol.iterator&&d[Symbol.iterator];if(m)d=m.call(d);else if(typeof d.length==\"number\")d={next:c(d)};else throw Error(\"b\\`\"+String(d));for(var E=[];!(m=d.next()).done;)E.push(m.value);d=E}H=K.call(f,d,[b]);if(a&&a instanceof HTMLElement)if(a===I){if(b=H.length>=4)b=(H[H.length-1]-H[H.length-4])/1E3<5;if(b){b=google.getEI(a);a.hasAttribute(\"data-ved\")?f=a?G(a)||\"\":\"\":f=(f=\n\u0001\u0001�a.closest(\"[data-ved]\"))?G(f)||\"\":\"\";f=f||\"\";if(a.hasAttribute(\"jsname\"))a=a.getAttribute(\"jsname\");else{var F;a=(F=a.closest(\"[jsname]\"))==null?void 0:F.getAttribute(\"jsname\")}google.log(\"rcm\",\"&ei=\"+b+\"&tgtved=\"+f+\"&jsname=\"+(a||\"\"))}}else I=a,H=[b]}window.document.addEventListener(\"DOMContentLoaded\",function(){document.body.addEventListener(\"click\",J)});}).call(this);