vovk 3.0.0-draft.159 → 3.0.0-draft.161

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.
@@ -26,23 +26,24 @@ export declare function createLLMFunctions({ modules, callRPCMethod, callControl
26
26
  callControllerMethod?: typeof defaultCallControllerMethod;
27
27
  }): {
28
28
  tools: {
29
- execute: (functionName: string, input: [{
30
- body?: KnownAny;
31
- query?: KnownAny;
32
- params?: KnownAny;
33
- }]) => Promise<any>;
34
- name: string;
35
- description: string;
36
- parameters: {
37
- type: string;
38
- properties: {
39
- params?: any;
40
- query?: any;
41
- body?: any;
29
+ [k: string]: {
30
+ execute: (functionName: string, input: [{
31
+ body?: KnownAny;
32
+ query?: KnownAny;
33
+ params?: KnownAny;
34
+ }]) => Promise<any>;
35
+ description: string;
36
+ parameters: {
37
+ type: string;
38
+ properties: {
39
+ params?: any;
40
+ query?: any;
41
+ body?: any;
42
+ };
43
+ required: string[];
44
+ additionalProperties: boolean;
42
45
  };
43
- required: string[];
44
- additionalProperties: boolean;
45
46
  };
46
- }[];
47
+ };
47
48
  };
48
49
  export {};
@@ -82,13 +82,14 @@ const defaultCallControllerMethod = async ({ handler, body, query, params, }) =>
82
82
  });
83
83
  };
84
84
  function createLLMFunctions({ modules, callRPCMethod = defaultCallRPCMethod, callControllerMethod = defaultCallControllerMethod, }) {
85
- const tools = Object.entries(modules)
85
+ const tools = Object.fromEntries(Object.entries(modules)
86
86
  .map(([rpcModuleName, module]) => {
87
87
  return Object.entries(module)
88
88
  .filter(([, handler]) => handler.schema)
89
89
  .map(([handlerName, handler]) => createLLMFunction({ rpcModuleName, handlerName, handler, callRPCMethod, callControllerMethod, modules }));
90
90
  })
91
- .flat();
91
+ .flat()
92
+ .map(({ name, ...rest }) => [name, rest]));
92
93
  return {
93
94
  tools,
94
95
  };
@@ -26,23 +26,24 @@ export declare function createLLMFunctions({ modules, callRPCMethod, callControl
26
26
  callControllerMethod?: typeof defaultCallControllerMethod;
27
27
  }): {
28
28
  tools: {
29
- execute: (functionName: string, input: [{
30
- body?: KnownAny;
31
- query?: KnownAny;
32
- params?: KnownAny;
33
- }]) => Promise<any>;
34
- name: string;
35
- description: string;
36
- parameters: {
37
- type: string;
38
- properties: {
39
- params?: any;
40
- query?: any;
41
- body?: any;
29
+ [k: string]: {
30
+ execute: (functionName: string, input: [{
31
+ body?: KnownAny;
32
+ query?: KnownAny;
33
+ params?: KnownAny;
34
+ }]) => Promise<any>;
35
+ description: string;
36
+ parameters: {
37
+ type: string;
38
+ properties: {
39
+ params?: any;
40
+ query?: any;
41
+ body?: any;
42
+ };
43
+ required: string[];
44
+ additionalProperties: boolean;
42
45
  };
43
- required: string[];
44
- additionalProperties: boolean;
45
46
  };
46
- }[];
47
+ };
47
48
  };
48
49
  export {};
@@ -82,13 +82,14 @@ const defaultCallControllerMethod = async ({ handler, body, query, params, }) =>
82
82
  });
83
83
  };
84
84
  function createLLMFunctions({ modules, callRPCMethod = defaultCallRPCMethod, callControllerMethod = defaultCallControllerMethod, }) {
85
- const tools = Object.entries(modules)
85
+ const tools = Object.fromEntries(Object.entries(modules)
86
86
  .map(([rpcModuleName, module]) => {
87
87
  return Object.entries(module)
88
88
  .filter(([, handler]) => handler.schema)
89
89
  .map(([handlerName, handler]) => createLLMFunction({ rpcModuleName, handlerName, handler, callRPCMethod, callControllerMethod, modules }));
90
90
  })
91
- .flat();
91
+ .flat()
92
+ .map(({ name, ...rest }) => [name, rest]));
92
93
  return {
93
94
  tools,
94
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.159",
3
+ "version": "3.0.0-draft.161",
4
4
  "main": "./cjs/index.js",
5
5
  "module": "./mjs/index.js",
6
6
  "types": "./mjs/index.d.ts",