node-red-contrib-vectorprime 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vectorprime.html +46 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-vectorprime",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "VectorPrime Decision Kernel node for Node-RED",
5
5
  "main": "vectorprime.js",
6
6
  "license": "MIT",
package/vectorprime.html CHANGED
@@ -68,7 +68,6 @@
68
68
  return;
69
69
  }
70
70
 
71
- // Call backend directly from the editor
72
71
  const resp = await fetch(`${baseUrl}/v1/keys/free`, {
73
72
  method: "POST",
74
73
  headers: { "Content-Type": "application/json" },
@@ -104,6 +103,7 @@
104
103
  })();
105
104
  </script>
106
105
 
106
+
107
107
  <script type="text/html" data-template-name="vectorprime-rank">
108
108
  <div class="form-row">
109
109
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
@@ -122,57 +122,79 @@
122
122
 
123
123
  <div class="form-row">
124
124
  <div style="font-size:12px; color:#666;">
125
- ✅ <b>1-second summary:</b> Send a decision prompt + options get ranking + probabilities back.
125
+ Sends <code>msg.payload</code> to VectorPrime and returns the response in <code>msg.payload</code>.
126
126
  </div>
127
127
  </div>
128
128
  </script>
129
129
 
130
130
  <script type="text/javascript">
131
131
  RED.nodes.registerType("vectorprime-rank", {
132
- // ✅ REQUIRED: Change category to Network
133
- category: "network",
134
-
135
- // ✅ Easy to see, not black
132
+ category: "network", // ✅ CHANGED: Network category
136
133
  color: "#2563EB",
137
-
138
134
  defaults: {
139
135
  name: { value: "" },
140
136
  config: { type: "vectorprime-config", required: true },
141
137
  endpoint: { value: "/v1/kernel/rank", required: true }
142
138
  },
143
-
144
139
  inputs: 1,
145
140
  outputs: 1,
146
141
  icon: "font-awesome/fa-bolt",
147
142
 
148
- // ✅ REQUIRED: Make it instantly understandable in palette
149
- paletteLabel: "Rank Decision (VectorPrime)",
143
+ paletteLabel: "Rank Decision (VectorPrime)", // 1-second clarity
150
144
 
151
145
  label: function () {
152
146
  return this.name || "Rank Decision (VectorPrime)";
153
147
  },
154
148
 
155
- outputLabels: ["ranking + probabilities"]
149
+ labelStyle: function () {
150
+ return this.name ? "node_label_italic" : "";
151
+ }
156
152
  });
157
153
  </script>
158
154
 
159
- <script type="text/markdown" data-help-name="vectorprime-rank">
160
- # Rank Decision (VectorPrime)
161
155
 
162
- **What it does (1 second):**
163
- Send a decision prompt + options → VectorPrime returns **ranking + probabilities**.
156
+ <!-- Help docs (fixes “no information available”) -->
157
+ <script type="text/html" data-help-name="vectorprime-config">
158
+ <p><b>VectorPrime Config</b></p>
159
+ <p>
160
+ Stores your VectorPrime backend URL + API Key securely using Node-RED credentials.
161
+ </p>
162
+
163
+ <h3>Fields</h3>
164
+ <ul>
165
+ <li><b>Base URL</b> — your VectorPrime backend (Render URL by default).</li>
166
+ <li><b>API Key</b> — stored securely (not exported with flows).</li>
167
+ </ul>
168
+
169
+ <p>
170
+ Click <b>Get Free Key</b> to generate a free-tier key automatically (requires backend support).
171
+ </p>
172
+ </script>
173
+
174
+ <script type="text/html" data-help-name="vectorprime-rank">
175
+ <p><b>Rank Decision (VectorPrime)</b></p>
164
176
 
165
- ## Input: `msg.payload`
166
- Example:
177
+ <p>
178
+ Sends <code>msg.payload</code> to VectorPrime for ranking and returns the result in <code>msg.payload</code>.
179
+ </p>
167
180
 
168
- ```json
169
- {
181
+ <h3>Input Example</h3>
182
+ <pre>{
170
183
  "decision_id": "node-red-demo-001",
171
184
  "prompt": "Pick one.",
172
- "options": [
173
- { "id": "a", "label": "A" },
174
- { "id": "b", "label": "B" }
175
- ],
185
+ "options": [{"id":"a","label":"A"},{"id":"b","label":"B"}],
176
186
  "engine": "classical",
177
187
  "seed": 123
178
- }
188
+ }</pre>
189
+
190
+ <h3>Output</h3>
191
+ <p>
192
+ Returns ranked options, probabilities, and metadata in <code>msg.payload</code>.
193
+ </p>
194
+
195
+ <h3>Authentication</h3>
196
+ <ul>
197
+ <li>If <code>msg.headers.Authorization</code> is provided, it uses that.</li>
198
+ <li>Otherwise it uses the key stored in <b>VectorPrime Config</b>.</li>
199
+ </ul>
200
+ </script>