@composio/llamaindex 0.11.3-canary.4 → 0.12.0-canary.6
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/index.mjs +7 -4
- package/package.json +7 -4
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { prepareJsonSchemaObjectPolicy } from "@composio/json-schema-to-zod/schema-policy";
|
|
2
|
+
import { jsonSchemaToZod } from "@composio/json-schema-to-zod";
|
|
3
|
+
import { BaseAgenticProvider, deduplicateJsonSchemaRequiredArrays, normalizeToolArguments } from "@composio/core";
|
|
2
4
|
import { FunctionTool } from "llamaindex";
|
|
3
5
|
|
|
4
6
|
// src/index.ts
|
|
@@ -18,16 +20,17 @@ var LlamaindexProvider = class extends BaseAgenticProvider {
|
|
|
18
20
|
* @returns The wrapped tool.
|
|
19
21
|
*/
|
|
20
22
|
wrapTool(tool, executeTool) {
|
|
21
|
-
const parameters = deduplicateJsonSchemaRequiredArrays(
|
|
23
|
+
const parameters = deduplicateJsonSchemaRequiredArrays(prepareJsonSchemaObjectPolicy(tool.inputParameters ?? {}));
|
|
24
|
+
const validator = jsonSchemaToZod(parameters);
|
|
22
25
|
const execute = async (input) => {
|
|
23
|
-
const result = await executeTool(tool.slug, normalizeToolArguments(input, tool.slug));
|
|
26
|
+
const result = await executeTool(tool.slug, await validator.parseAsync(normalizeToolArguments(input, tool.slug)));
|
|
24
27
|
return JSON.stringify(result);
|
|
25
28
|
};
|
|
26
29
|
return new FunctionTool(execute, {
|
|
27
30
|
name: tool.slug,
|
|
28
31
|
description: tool.description ?? tool.name ?? "",
|
|
29
32
|
parameters
|
|
30
|
-
},
|
|
33
|
+
}, validator);
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Wrap a list of tools in the llamaindex format.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/llamaindex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-canary.6",
|
|
4
4
|
"description": "Agentic Provider for llamaindex in Composio SDK",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -37,13 +37,16 @@
|
|
|
37
37
|
"author": "",
|
|
38
38
|
"license": "ISC",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"llamaindex": "^0.12.0",
|
|
41
|
+
"@composio/core": "^1.0.0-canary.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsdown": "^0.23.7",
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
|
-
"@composio/core": "0.
|
|
46
|
+
"@composio/core": "1.0.0-canary.6"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@composio/json-schema-to-zod": "1.0.0-canary.6"
|
|
47
50
|
},
|
|
48
51
|
"scripts": {
|
|
49
52
|
"build": "tsdown",
|