flowise-invinoveritas 0.1.0
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/dist/nodes/InvineroritasDecision/InvineroritasDecision.d.ts +1 -0
- package/dist/nodes/InvineroritasDecision/InvineroritasDecision.js +63 -0
- package/dist/nodes/InvineroritasDecision/InvineroritasDecision.js.map +1 -0
- package/dist/nodes/InvineroritasDecision/invinoveritas.svg +4 -0
- package/dist/nodes/Invinoveritas/Invinoveritas.d.ts +1 -0
- package/dist/nodes/Invinoveritas/Invinoveritas.js +74 -0
- package/dist/nodes/Invinoveritas/Invinoveritas.js.map +1 -0
- package/dist/nodes/Invinoveritas/invinoveritas.svg +4 -0
- package/nodes/InvineroritasDecision/InvineroritasDecision.ts +109 -0
- package/nodes/InvineroritasDecision/invinoveritas.svg +4 -0
- package/nodes/Invinoveritas/Invinoveritas.ts +118 -0
- package/nodes/Invinoveritas/invinoveritas.svg +4 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tools_1 = require("@langchain/core/tools");
|
|
4
|
+
const Invinoveritas_1 = require("../Invinoveritas/Invinoveritas");
|
|
5
|
+
class InvineroritasDecision_Tools {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.label = 'invinoveritas Decision';
|
|
8
|
+
this.name = 'invineroritasDecision';
|
|
9
|
+
this.version = 1.0;
|
|
10
|
+
this.type = 'InvineroritasDecision';
|
|
11
|
+
this.icon = 'invinoveritas.svg';
|
|
12
|
+
this.category = 'Tools';
|
|
13
|
+
this.description = 'Get a structured JSON decision with confidence score via invinoveritas (~100 sats per call)';
|
|
14
|
+
this.baseClasses = [this.type, 'DynamicTool', 'Tool', 'StructuredTool', 'Runnable'];
|
|
15
|
+
this.inputs = [
|
|
16
|
+
{
|
|
17
|
+
label: 'API Key',
|
|
18
|
+
name: 'apiKey',
|
|
19
|
+
type: 'password',
|
|
20
|
+
placeholder: 'ivv_...',
|
|
21
|
+
description: 'Your invinoveritas API key. Register free at https://api.babyblueviper.com/register',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Goal',
|
|
25
|
+
name: 'goal',
|
|
26
|
+
type: 'string',
|
|
27
|
+
placeholder: 'Maximize ROI on my portfolio',
|
|
28
|
+
description: 'The objective your agent is working towards',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Tool Name',
|
|
32
|
+
name: 'toolName',
|
|
33
|
+
type: 'string',
|
|
34
|
+
default: 'invinoveritas_decision',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Tool Description',
|
|
38
|
+
name: 'toolDescription',
|
|
39
|
+
type: 'string',
|
|
40
|
+
rows: 2,
|
|
41
|
+
default: 'Get a structured decision with confidence score and reasoning. Input should be the specific question to decide on.',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
async init(nodeData, _input, _options) {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
|
+
const apiKey = (_a = nodeData.inputs) === null || _a === void 0 ? void 0 : _a.apiKey;
|
|
48
|
+
const goal = ((_b = nodeData.inputs) === null || _b === void 0 ? void 0 : _b.goal) || '';
|
|
49
|
+
const toolName = ((_c = nodeData.inputs) === null || _c === void 0 ? void 0 : _c.toolName) || 'invinoveritas_decision';
|
|
50
|
+
const toolDesc = ((_d = nodeData.inputs) === null || _d === void 0 ? void 0 : _d.toolDescription) || 'Get a structured decision with confidence score.';
|
|
51
|
+
if (!apiKey)
|
|
52
|
+
throw new Error('invinoveritas API key is required');
|
|
53
|
+
return new tools_1.DynamicTool({
|
|
54
|
+
name: toolName,
|
|
55
|
+
description: toolDesc,
|
|
56
|
+
func: async (input) => {
|
|
57
|
+
return await (0, Invinoveritas_1.callInvinoveritas)('/decision', { goal, context: '', question: input, want_confidence: true }, apiKey);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
module.exports = { nodeClass: InvineroritasDecision_Tools };
|
|
63
|
+
//# sourceMappingURL=InvineroritasDecision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvineroritasDecision.js","sourceRoot":"","sources":["../../../nodes/InvineroritasDecision/InvineroritasDecision.ts"],"names":[],"mappings":";;AAAA,iDAAmD;AACnD,kEAAkE;AAkClE,MAAM,2BAA2B;IAW7B;QACI,IAAI,CAAC,KAAK,GAAG,wBAAwB,CAAA;QACrC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;QACnC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;QACnC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,6FAA6F,CAAA;QAChH,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAA;QACnF,IAAI,CAAC,MAAM,GAAG;YACV;gBACI,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,qFAAqF;aACrG;YACD;gBACI,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,WAAW,EAAE,6CAA6C;aAC7D;YACD;gBACI,KAAK,EAAE,WAAW;gBAClB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,wBAAwB;aACpC;YACD;gBACI,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC;gBACP,OAAO,EAAE,oHAAoH;aAChI;SACJ,CAAA;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAmB,EAAE,MAAc,EAAE,QAAuB;;QACnE,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAgB,CAAA;QAChD,MAAM,IAAI,GAAG,CAAC,MAAA,QAAQ,CAAC,MAAM,0CAAE,IAAe,KAAI,EAAE,CAAA;QACpD,MAAM,QAAQ,GAAG,CAAC,MAAA,QAAQ,CAAC,MAAM,0CAAE,QAAmB,KAAI,wBAAwB,CAAA;QAClF,MAAM,QAAQ,GAAG,CAAC,MAAA,QAAQ,CAAC,MAAM,0CAAE,eAA0B,KAAI,kDAAkD,CAAA;QAEnH,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;QAEjE,OAAO,IAAI,mBAAW,CAAC;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,KAAK,EAAE,KAAa,EAAE,EAAE;gBAC1B,OAAO,MAAM,IAAA,iCAAiB,EAC1B,WAAW,EACX,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,EAC7D,MAAM,CACT,CAAA;YACL,CAAC;SACJ,CAAC,CAAA;IACN,CAAC;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function callInvinoveritas(endpoint: string, body: object, apiKey: string): Promise<string>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callInvinoveritas = callInvinoveritas;
|
|
4
|
+
const tools_1 = require("@langchain/core/tools");
|
|
5
|
+
const BASE_URL = 'https://api.babyblueviper.com';
|
|
6
|
+
async function callInvinoveritas(endpoint, body, apiKey) {
|
|
7
|
+
const res = await fetch(`${BASE_URL}${endpoint}`, {
|
|
8
|
+
method: 'POST',
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: `Bearer ${apiKey}`,
|
|
11
|
+
'Content-Type': 'application/json',
|
|
12
|
+
},
|
|
13
|
+
body: JSON.stringify(body),
|
|
14
|
+
});
|
|
15
|
+
if (!res.ok) {
|
|
16
|
+
const text = await res.text();
|
|
17
|
+
throw new Error(`invinoveritas error ${res.status}: ${text}`);
|
|
18
|
+
}
|
|
19
|
+
const data = await res.json();
|
|
20
|
+
return data.answer || data.decision || JSON.stringify(data);
|
|
21
|
+
}
|
|
22
|
+
class InvineroritasReason_Tools {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.label = 'invinoveritas Reason';
|
|
25
|
+
this.name = 'invineroritasReason';
|
|
26
|
+
this.version = 1.0;
|
|
27
|
+
this.type = 'InvineroritasReason';
|
|
28
|
+
this.icon = 'invinoveritas.svg';
|
|
29
|
+
this.category = 'Tools';
|
|
30
|
+
this.description = 'Get strategic AI reasoning on any question via invinoveritas (~100 sats per call)';
|
|
31
|
+
this.baseClasses = [this.type, 'DynamicTool', 'Tool', 'StructuredTool', 'Runnable'];
|
|
32
|
+
this.inputs = [
|
|
33
|
+
{
|
|
34
|
+
label: 'API Key',
|
|
35
|
+
name: 'apiKey',
|
|
36
|
+
type: 'password',
|
|
37
|
+
placeholder: 'ivv_...',
|
|
38
|
+
description: 'Your invinoveritas API key. Register free at https://api.babyblueviper.com/register',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Tool Name',
|
|
42
|
+
name: 'toolName',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: 'invinoveritas_reason',
|
|
45
|
+
description: 'Name the agent uses to invoke this tool',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Tool Description',
|
|
49
|
+
name: 'toolDescription',
|
|
50
|
+
type: 'string',
|
|
51
|
+
rows: 2,
|
|
52
|
+
default: 'Get strategic AI reasoning and analysis on any question or topic.',
|
|
53
|
+
description: 'Description the agent uses to decide when to call this tool',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
async init(nodeData, _input, _options) {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
const apiKey = (_a = nodeData.inputs) === null || _a === void 0 ? void 0 : _a.apiKey;
|
|
60
|
+
const toolName = ((_b = nodeData.inputs) === null || _b === void 0 ? void 0 : _b.toolName) || 'invinoveritas_reason';
|
|
61
|
+
const toolDesc = ((_c = nodeData.inputs) === null || _c === void 0 ? void 0 : _c.toolDescription) || 'Get strategic AI reasoning on any question.';
|
|
62
|
+
if (!apiKey)
|
|
63
|
+
throw new Error('invinoveritas API key is required');
|
|
64
|
+
return new tools_1.DynamicTool({
|
|
65
|
+
name: toolName,
|
|
66
|
+
description: toolDesc,
|
|
67
|
+
func: async (input) => {
|
|
68
|
+
return await callInvinoveritas('/reason', { question: input }, apiKey);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
module.exports = { nodeClass: InvineroritasReason_Tools };
|
|
74
|
+
//# sourceMappingURL=Invinoveritas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Invinoveritas.js","sourceRoot":"","sources":["../../../nodes/Invinoveritas/Invinoveritas.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { DynamicTool } from '@langchain/core/tools'
|
|
2
|
+
import { callInvinoveritas } from '../Invinoveritas/Invinoveritas'
|
|
3
|
+
|
|
4
|
+
interface INodeParams {
|
|
5
|
+
label: string
|
|
6
|
+
name: string
|
|
7
|
+
type: string
|
|
8
|
+
default?: any
|
|
9
|
+
placeholder?: string
|
|
10
|
+
description?: string
|
|
11
|
+
rows?: number
|
|
12
|
+
optional?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface INodeData {
|
|
16
|
+
inputs?: Record<string, unknown>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ICommonObject {
|
|
20
|
+
[key: string]: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface INode {
|
|
24
|
+
label: string
|
|
25
|
+
name: string
|
|
26
|
+
version: number
|
|
27
|
+
description: string
|
|
28
|
+
type: string
|
|
29
|
+
icon: string
|
|
30
|
+
category: string
|
|
31
|
+
baseClasses: string[]
|
|
32
|
+
inputs: INodeParams[]
|
|
33
|
+
init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
class InvineroritasDecision_Tools implements INode {
|
|
37
|
+
label: string
|
|
38
|
+
name: string
|
|
39
|
+
version: number
|
|
40
|
+
description: string
|
|
41
|
+
type: string
|
|
42
|
+
icon: string
|
|
43
|
+
category: string
|
|
44
|
+
baseClasses: string[]
|
|
45
|
+
inputs: INodeParams[]
|
|
46
|
+
|
|
47
|
+
constructor() {
|
|
48
|
+
this.label = 'invinoveritas Decision'
|
|
49
|
+
this.name = 'invineroritasDecision'
|
|
50
|
+
this.version = 1.0
|
|
51
|
+
this.type = 'InvineroritasDecision'
|
|
52
|
+
this.icon = 'invinoveritas.svg'
|
|
53
|
+
this.category = 'Tools'
|
|
54
|
+
this.description = 'Get a structured JSON decision with confidence score via invinoveritas (~100 sats per call)'
|
|
55
|
+
this.baseClasses = [this.type, 'DynamicTool', 'Tool', 'StructuredTool', 'Runnable']
|
|
56
|
+
this.inputs = [
|
|
57
|
+
{
|
|
58
|
+
label: 'API Key',
|
|
59
|
+
name: 'apiKey',
|
|
60
|
+
type: 'password',
|
|
61
|
+
placeholder: 'ivv_...',
|
|
62
|
+
description: 'Your invinoveritas API key. Register free at https://api.babyblueviper.com/register',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Goal',
|
|
66
|
+
name: 'goal',
|
|
67
|
+
type: 'string',
|
|
68
|
+
placeholder: 'Maximize ROI on my portfolio',
|
|
69
|
+
description: 'The objective your agent is working towards',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Tool Name',
|
|
73
|
+
name: 'toolName',
|
|
74
|
+
type: 'string',
|
|
75
|
+
default: 'invinoveritas_decision',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: 'Tool Description',
|
|
79
|
+
name: 'toolDescription',
|
|
80
|
+
type: 'string',
|
|
81
|
+
rows: 2,
|
|
82
|
+
default: 'Get a structured decision with confidence score and reasoning. Input should be the specific question to decide on.',
|
|
83
|
+
},
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async init(nodeData: INodeData, _input: string, _options: ICommonObject): Promise<DynamicTool> {
|
|
88
|
+
const apiKey = nodeData.inputs?.apiKey as string
|
|
89
|
+
const goal = (nodeData.inputs?.goal as string) || ''
|
|
90
|
+
const toolName = (nodeData.inputs?.toolName as string) || 'invinoveritas_decision'
|
|
91
|
+
const toolDesc = (nodeData.inputs?.toolDescription as string) || 'Get a structured decision with confidence score.'
|
|
92
|
+
|
|
93
|
+
if (!apiKey) throw new Error('invinoveritas API key is required')
|
|
94
|
+
|
|
95
|
+
return new DynamicTool({
|
|
96
|
+
name: toolName,
|
|
97
|
+
description: toolDesc,
|
|
98
|
+
func: async (input: string) => {
|
|
99
|
+
return await callInvinoveritas(
|
|
100
|
+
'/decision',
|
|
101
|
+
{ goal, context: '', question: input, want_confidence: true },
|
|
102
|
+
apiKey,
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
module.exports = { nodeClass: InvineroritasDecision_Tools }
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { DynamicTool } from '@langchain/core/tools'
|
|
2
|
+
|
|
3
|
+
// Minimal Flowise interface stubs — avoids compiling flowise-components source
|
|
4
|
+
interface INodeParams {
|
|
5
|
+
label: string
|
|
6
|
+
name: string
|
|
7
|
+
type: string
|
|
8
|
+
default?: any
|
|
9
|
+
placeholder?: string
|
|
10
|
+
description?: string
|
|
11
|
+
rows?: number
|
|
12
|
+
optional?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface INodeData {
|
|
16
|
+
inputs?: Record<string, unknown>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ICommonObject {
|
|
20
|
+
[key: string]: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface INode {
|
|
24
|
+
label: string
|
|
25
|
+
name: string
|
|
26
|
+
version: number
|
|
27
|
+
description: string
|
|
28
|
+
type: string
|
|
29
|
+
icon: string
|
|
30
|
+
category: string
|
|
31
|
+
baseClasses: string[]
|
|
32
|
+
inputs: INodeParams[]
|
|
33
|
+
init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const BASE_URL = 'https://api.babyblueviper.com'
|
|
37
|
+
|
|
38
|
+
export async function callInvinoveritas(endpoint: string, body: object, apiKey: string): Promise<string> {
|
|
39
|
+
const res = await fetch(`${BASE_URL}${endpoint}`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: `Bearer ${apiKey}`,
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
},
|
|
45
|
+
body: JSON.stringify(body),
|
|
46
|
+
})
|
|
47
|
+
if (!res.ok) {
|
|
48
|
+
const text = await res.text()
|
|
49
|
+
throw new Error(`invinoveritas error ${res.status}: ${text}`)
|
|
50
|
+
}
|
|
51
|
+
const data = await res.json()
|
|
52
|
+
return data.answer || data.decision || JSON.stringify(data)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
class InvineroritasReason_Tools implements INode {
|
|
56
|
+
label: string
|
|
57
|
+
name: string
|
|
58
|
+
version: number
|
|
59
|
+
description: string
|
|
60
|
+
type: string
|
|
61
|
+
icon: string
|
|
62
|
+
category: string
|
|
63
|
+
baseClasses: string[]
|
|
64
|
+
inputs: INodeParams[]
|
|
65
|
+
|
|
66
|
+
constructor() {
|
|
67
|
+
this.label = 'invinoveritas Reason'
|
|
68
|
+
this.name = 'invineroritasReason'
|
|
69
|
+
this.version = 1.0
|
|
70
|
+
this.type = 'InvineroritasReason'
|
|
71
|
+
this.icon = 'invinoveritas.svg'
|
|
72
|
+
this.category = 'Tools'
|
|
73
|
+
this.description = 'Get strategic AI reasoning on any question via invinoveritas (~100 sats per call)'
|
|
74
|
+
this.baseClasses = [this.type, 'DynamicTool', 'Tool', 'StructuredTool', 'Runnable']
|
|
75
|
+
this.inputs = [
|
|
76
|
+
{
|
|
77
|
+
label: 'API Key',
|
|
78
|
+
name: 'apiKey',
|
|
79
|
+
type: 'password',
|
|
80
|
+
placeholder: 'ivv_...',
|
|
81
|
+
description: 'Your invinoveritas API key. Register free at https://api.babyblueviper.com/register',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: 'Tool Name',
|
|
85
|
+
name: 'toolName',
|
|
86
|
+
type: 'string',
|
|
87
|
+
default: 'invinoveritas_reason',
|
|
88
|
+
description: 'Name the agent uses to invoke this tool',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'Tool Description',
|
|
92
|
+
name: 'toolDescription',
|
|
93
|
+
type: 'string',
|
|
94
|
+
rows: 2,
|
|
95
|
+
default: 'Get strategic AI reasoning and analysis on any question or topic.',
|
|
96
|
+
description: 'Description the agent uses to decide when to call this tool',
|
|
97
|
+
},
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async init(nodeData: INodeData, _input: string, _options: ICommonObject): Promise<DynamicTool> {
|
|
102
|
+
const apiKey = nodeData.inputs?.apiKey as string
|
|
103
|
+
const toolName = (nodeData.inputs?.toolName as string) || 'invinoveritas_reason'
|
|
104
|
+
const toolDesc = (nodeData.inputs?.toolDescription as string) || 'Get strategic AI reasoning on any question.'
|
|
105
|
+
|
|
106
|
+
if (!apiKey) throw new Error('invinoveritas API key is required')
|
|
107
|
+
|
|
108
|
+
return new DynamicTool({
|
|
109
|
+
name: toolName,
|
|
110
|
+
description: toolDesc,
|
|
111
|
+
func: async (input: string) => {
|
|
112
|
+
return await callInvinoveritas('/reason', { question: input }, apiKey)
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
module.exports = { nodeClass: InvineroritasReason_Tools }
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "flowise-invinoveritas",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Flowise custom node for invinoveritas — Lightning-native AI reasoning and agent marketplace",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"flowise",
|
|
7
|
+
"flowise-addon",
|
|
8
|
+
"invinoveritas",
|
|
9
|
+
"lightning",
|
|
10
|
+
"bitcoin",
|
|
11
|
+
"ai",
|
|
12
|
+
"agents",
|
|
13
|
+
"reasoning",
|
|
14
|
+
"langchain"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"homepage": "https://api.babyblueviper.com",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Baby Blue Viper",
|
|
20
|
+
"email": "babyblueviperbusiness@gmail.com"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/babyblueviper1/invinoveritas"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc && npm run copy-icons",
|
|
28
|
+
"copy-icons": "cp nodes/Invinoveritas/invinoveritas.svg dist/nodes/Invinoveritas/ && cp nodes/InvineroritasDecision/invinoveritas.svg dist/nodes/InvineroritasDecision/",
|
|
29
|
+
"prepublishOnly": "npm run build"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"nodes"
|
|
34
|
+
],
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@langchain/core": "^0.3.0",
|
|
37
|
+
"@types/node": "^18.0.0",
|
|
38
|
+
"typescript": "^5.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"flowise-components": ">=2.0.0"
|
|
42
|
+
}
|
|
43
|
+
}
|