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.
@@ -27,7 +27,7 @@ export declare function createLLMFunctions({ modules, callRPCMethod, callControl
27
27
  }): {
28
28
  tools: {
29
29
  [k: string]: {
30
- execute: (functionName: string, input: [{
30
+ execute: (input: [{
31
31
  body?: KnownAny;
32
32
  query?: KnownAny;
33
33
  params?: KnownAny;
@@ -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 = (functionName, input) => {
7
- const [moduleName, handlerName] = functionName.split('.');
6
+ const execute = (input) => {
8
7
  const { body, query, params } = input[0];
9
- const module = modules[moduleName];
8
+ const module = modules[rpcModuleName];
10
9
  if (!module) {
11
- throw new Error(`Module "${moduleName}" not found.`);
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 "${moduleName}".`);
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 "${moduleName}" not found.`);
18
+ throw new Error(`Schema for handler "${handlerName}" in module "${rpcModuleName}" not found.`);
20
19
  }
21
20
  if (isRPC) {
22
21
  return callRPCMethod({
@@ -27,7 +27,7 @@ export declare function createLLMFunctions({ modules, callRPCMethod, callControl
27
27
  }): {
28
28
  tools: {
29
29
  [k: string]: {
30
- execute: (functionName: string, input: [{
30
+ execute: (input: [{
31
31
  body?: KnownAny;
32
32
  query?: KnownAny;
33
33
  params?: KnownAny;
@@ -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 = (functionName, input) => {
7
- const [moduleName, handlerName] = functionName.split('.');
6
+ const execute = (input) => {
8
7
  const { body, query, params } = input[0];
9
- const module = modules[moduleName];
8
+ const module = modules[rpcModuleName];
10
9
  if (!module) {
11
- throw new Error(`Module "${moduleName}" not found.`);
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 "${moduleName}".`);
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 "${moduleName}" not found.`);
18
+ throw new Error(`Schema for handler "${handlerName}" in module "${rpcModuleName}" not found.`);
20
19
  }
21
20
  if (isRPC) {
22
21
  return callRPCMethod({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.160",
3
+ "version": "3.0.0-draft.162",
4
4
  "main": "./cjs/index.js",
5
5
  "module": "./mjs/index.js",
6
6
  "types": "./mjs/index.d.ts",