vovk 3.0.0-draft.160 → 3.0.0-draft.162
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.
|
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createLLMFunctions = createLLMFunctions;
|
|
4
4
|
const createLLMFunction = ({ rpcModuleName, handlerName, handler, callRPCMethod, callControllerMethod, modules, }) => {
|
|
5
5
|
const { schema } = handler;
|
|
6
|
-
const execute = (
|
|
7
|
-
const [moduleName, handlerName] = functionName.split('.');
|
|
6
|
+
const execute = (input) => {
|
|
8
7
|
const { body, query, params } = input[0];
|
|
9
|
-
const module = modules[
|
|
8
|
+
const module = modules[rpcModuleName];
|
|
10
9
|
if (!module) {
|
|
11
|
-
throw new Error(`Module "${
|
|
10
|
+
throw new Error(`Module "${rpcModuleName}" not found.`);
|
|
12
11
|
}
|
|
13
12
|
const handler = module[handlerName];
|
|
14
13
|
if (!handler) {
|
|
15
|
-
throw new Error(`Handler "${handlerName}" not found in module "${
|
|
14
|
+
throw new Error(`Handler "${handlerName}" not found in module "${rpcModuleName}".`);
|
|
16
15
|
}
|
|
17
16
|
const { schema, isRPC } = handler;
|
|
18
17
|
if (!schema) {
|
|
19
|
-
throw new Error(`Schema for handler "${handlerName}" in module "${
|
|
18
|
+
throw new Error(`Schema for handler "${handlerName}" in module "${rpcModuleName}" not found.`);
|
|
20
19
|
}
|
|
21
20
|
if (isRPC) {
|
|
22
21
|
return callRPCMethod({
|
|
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createLLMFunctions = createLLMFunctions;
|
|
4
4
|
const createLLMFunction = ({ rpcModuleName, handlerName, handler, callRPCMethod, callControllerMethod, modules, }) => {
|
|
5
5
|
const { schema } = handler;
|
|
6
|
-
const execute = (
|
|
7
|
-
const [moduleName, handlerName] = functionName.split('.');
|
|
6
|
+
const execute = (input) => {
|
|
8
7
|
const { body, query, params } = input[0];
|
|
9
|
-
const module = modules[
|
|
8
|
+
const module = modules[rpcModuleName];
|
|
10
9
|
if (!module) {
|
|
11
|
-
throw new Error(`Module "${
|
|
10
|
+
throw new Error(`Module "${rpcModuleName}" not found.`);
|
|
12
11
|
}
|
|
13
12
|
const handler = module[handlerName];
|
|
14
13
|
if (!handler) {
|
|
15
|
-
throw new Error(`Handler "${handlerName}" not found in module "${
|
|
14
|
+
throw new Error(`Handler "${handlerName}" not found in module "${rpcModuleName}".`);
|
|
16
15
|
}
|
|
17
16
|
const { schema, isRPC } = handler;
|
|
18
17
|
if (!schema) {
|
|
19
|
-
throw new Error(`Schema for handler "${handlerName}" in module "${
|
|
18
|
+
throw new Error(`Schema for handler "${handlerName}" in module "${rpcModuleName}" not found.`);
|
|
20
19
|
}
|
|
21
20
|
if (isRPC) {
|
|
22
21
|
return callRPCMethod({
|