node-red-contrib-vectorprime 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vectorprime.html +68 -36
package/package.json
CHANGED
package/vectorprime.html
CHANGED
|
@@ -27,6 +27,27 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
|
+
<!-- ✅ HELP TEXT (this fixes "no information available" for config node) -->
|
|
31
|
+
<script type="text/html" data-help-name="vectorprime-config">
|
|
32
|
+
<p><b>VectorPrime Config</b></p>
|
|
33
|
+
|
|
34
|
+
<p>
|
|
35
|
+
Stores the VectorPrime backend URL and your API key securely using Node-RED credentials.
|
|
36
|
+
This is shared across VectorPrime nodes so you only configure it once.
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p><b>Quick Start</b></p>
|
|
40
|
+
<ol>
|
|
41
|
+
<li>Leave <b>Base URL</b> as default unless you self-host VectorPrime.</li>
|
|
42
|
+
<li>Click <b>Get Free Key</b> to generate a key instantly.</li>
|
|
43
|
+
<li>Hit <b>Done</b> to save.</li>
|
|
44
|
+
</ol>
|
|
45
|
+
|
|
46
|
+
<p style="margin-top:8px; font-size:12px; color:#666;">
|
|
47
|
+
Tip: Your API key is not exported in flow JSON and stays encrypted inside Node-RED credentials.
|
|
48
|
+
</p>
|
|
49
|
+
</script>
|
|
50
|
+
|
|
30
51
|
<script type="text/javascript">
|
|
31
52
|
(function () {
|
|
32
53
|
function normalizeBaseUrl(url) {
|
|
@@ -68,7 +89,6 @@
|
|
|
68
89
|
return;
|
|
69
90
|
}
|
|
70
91
|
|
|
71
|
-
// Call backend directly from the editor
|
|
72
92
|
const resp = await fetch(`${baseUrl}/v1/keys/free`, {
|
|
73
93
|
method: "POST",
|
|
74
94
|
headers: { "Content-Type": "application/json" },
|
|
@@ -104,6 +124,10 @@
|
|
|
104
124
|
})();
|
|
105
125
|
</script>
|
|
106
126
|
|
|
127
|
+
<!-- ========================= -->
|
|
128
|
+
<!-- ✅ VectorPrime Rank Node -->
|
|
129
|
+
<!-- ========================= -->
|
|
130
|
+
|
|
107
131
|
<script type="text/html" data-template-name="vectorprime-rank">
|
|
108
132
|
<div class="form-row">
|
|
109
133
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
@@ -122,57 +146,65 @@
|
|
|
122
146
|
|
|
123
147
|
<div class="form-row">
|
|
124
148
|
<div style="font-size:12px; color:#666;">
|
|
125
|
-
✅ <
|
|
149
|
+
✅ Sends <code>msg.payload</code> to VectorPrime and returns results in <code>msg.payload</code>.
|
|
126
150
|
</div>
|
|
127
151
|
</div>
|
|
128
152
|
</script>
|
|
129
153
|
|
|
154
|
+
<!-- ✅ HELP TEXT (this fixes your tooltip + makes it MARKETABLE) -->
|
|
155
|
+
<script type="text/html" data-help-name="vectorprime-rank">
|
|
156
|
+
<p><b>Rank Decision (VectorPrime)</b></p>
|
|
157
|
+
|
|
158
|
+
<p>
|
|
159
|
+
Instantly ranks options by <b>best next action</b> using the VectorPrime Decision Kernel.
|
|
160
|
+
Use this when your flow needs to choose the best outcome from multiple choices — fast and deterministically.
|
|
161
|
+
</p>
|
|
162
|
+
|
|
163
|
+
<p><b>Most valuable use-cases (why developers install this)</b></p>
|
|
164
|
+
<ul>
|
|
165
|
+
<li><b>Automation routing:</b> pick which workflow runs next based on priority + risk</li>
|
|
166
|
+
<li><b>Incident response:</b> rank mitigation steps during outages (fastest safe fix)</li>
|
|
167
|
+
<li><b>Agent coordination:</b> choose the best tool/action from multiple agent outputs</li>
|
|
168
|
+
<li><b>Ops decisioning:</b> prioritize tickets/tasks using a deterministic decision score</li>
|
|
169
|
+
</ul>
|
|
170
|
+
|
|
171
|
+
<p><b>Input</b></p>
|
|
172
|
+
<pre>{
|
|
173
|
+
"decision_id": "any-string",
|
|
174
|
+
"prompt": "What should we do next?",
|
|
175
|
+
"options": [
|
|
176
|
+
{"id":"a","label":"Option A"},
|
|
177
|
+
{"id":"b","label":"Option B"}
|
|
178
|
+
],
|
|
179
|
+
"engine": "classical",
|
|
180
|
+
"seed": 123
|
|
181
|
+
}</pre>
|
|
182
|
+
|
|
183
|
+
<p><b>Output</b></p>
|
|
184
|
+
<p>
|
|
185
|
+
Returns the ranking result in <code>msg.payload</code> (ordered options + scores/probabilities depending on engine).
|
|
186
|
+
</p>
|
|
187
|
+
|
|
188
|
+
<p style="margin-top:8px; font-size:12px; color:#666;">
|
|
189
|
+
Tip: If the free tier limit is reached, the response includes an upgrade URL so flows can upgrade cleanly.
|
|
190
|
+
</p>
|
|
191
|
+
</script>
|
|
192
|
+
|
|
130
193
|
<script type="text/javascript">
|
|
131
194
|
RED.nodes.registerType("vectorprime-rank", {
|
|
132
|
-
// ✅ REQUIRED: Change category to Network
|
|
133
195
|
category: "network",
|
|
134
|
-
|
|
135
|
-
// ✅ Easy to see, not black
|
|
196
|
+
paletteLabel: "Rank Decision (VectorPrime)",
|
|
136
197
|
color: "#2563EB",
|
|
137
|
-
|
|
138
198
|
defaults: {
|
|
139
199
|
name: { value: "" },
|
|
140
200
|
config: { type: "vectorprime-config", required: true },
|
|
141
201
|
endpoint: { value: "/v1/kernel/rank", required: true }
|
|
142
202
|
},
|
|
143
|
-
|
|
144
203
|
inputs: 1,
|
|
145
204
|
outputs: 1,
|
|
146
205
|
icon: "font-awesome/fa-bolt",
|
|
147
|
-
|
|
148
|
-
// ✅ REQUIRED: Make it instantly understandable in palette
|
|
149
|
-
paletteLabel: "Rank Decision (VectorPrime)",
|
|
150
|
-
|
|
151
206
|
label: function () {
|
|
152
207
|
return this.name || "Rank Decision (VectorPrime)";
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
outputLabels: ["ranking + probabilities"]
|
|
208
|
+
}
|
|
156
209
|
});
|
|
157
|
-
</script>
|
|
158
|
-
|
|
159
|
-
<script type="text/markdown" data-help-name="vectorprime-rank">
|
|
160
|
-
# Rank Decision (VectorPrime)
|
|
161
|
-
|
|
162
|
-
**What it does (1 second):**
|
|
163
|
-
Send a decision prompt + options → VectorPrime returns **ranking + probabilities**.
|
|
164
|
-
|
|
165
|
-
## Input: `msg.payload`
|
|
166
|
-
Example:
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"decision_id": "node-red-demo-001",
|
|
171
|
-
"prompt": "Pick one.",
|
|
172
|
-
"options": [
|
|
173
|
-
{ "id": "a", "label": "A" },
|
|
174
|
-
{ "id": "b", "label": "B" }
|
|
175
|
-
],
|
|
176
|
-
"engine": "classical",
|
|
177
|
-
"seed": 123
|
|
178
|
-
}
|
|
210
|
+
</script>
|