@composio/llamaindex 0.11.1 → 0.11.3-canary.1
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/README.md +1 -1
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +14 -16
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ const result = await myAgent.run(
|
|
|
40
40
|
console.log(result.data.result);
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
The provider
|
|
43
|
+
The provider gives LlamaIndex each tool's JSON Schema as the parameters the model sees, with internal `$ref`s inlined, and validates tool-call arguments with a Zod schema built from the same JSON Schema. Execution is wired through Composio, so LlamaIndex can call the tools directly.
|
|
44
44
|
|
|
45
45
|
## Links
|
|
46
46
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Llamaindex Provider
|
|
3
|
+
*
|
|
4
|
+
* This provider provides a set of tools for interacting with Llamaindex.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module providers/llamaindex
|
|
8
|
+
*/
|
|
1
9
|
import { BaseAgenticProvider, ExecuteToolFn, McpServerGetResponse, McpUrlResponse, Tool } from "@composio/core";
|
|
2
10
|
import { tool } from "llamaindex";
|
|
3
|
-
//#region src/index.d.ts
|
|
4
11
|
export type LlamaindexTool = ReturnType<typeof tool>;
|
|
5
12
|
export type LlamaindexToolCollection = Array<LlamaindexTool>;
|
|
6
13
|
export declare class LlamaindexProvider extends BaseAgenticProvider<Array<LlamaindexTool>, LlamaindexTool, McpServerGetResponse> {
|
|
@@ -26,5 +33,4 @@ export declare class LlamaindexProvider extends BaseAgenticProvider<Array<Llamai
|
|
|
26
33
|
* @returns Standard MCP server response format
|
|
27
34
|
*/
|
|
28
35
|
wrapMcpServerResponse(data: McpUrlResponse): McpServerGetResponse;
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
36
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseAgenticProvider, dereferenceJsonSchema, jsonSchemaToZodSchema, normalizeToolArguments } from "@composio/core";
|
|
2
|
-
import {
|
|
1
|
+
import { BaseAgenticProvider, deduplicateJsonSchemaRequiredArrays, dereferenceJsonSchema, jsonSchemaToZodSchema, normalizeToolArguments } from "@composio/core";
|
|
2
|
+
import { FunctionTool } from "llamaindex";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/index.ts
|
|
5
5
|
/**
|
|
6
6
|
* Llamaindex Provider
|
|
7
7
|
*
|
|
@@ -17,18 +17,17 @@ var LlamaindexProvider = class extends BaseAgenticProvider {
|
|
|
17
17
|
* @param tool - The tool to wrap.
|
|
18
18
|
* @returns The wrapped tool.
|
|
19
19
|
*/
|
|
20
|
-
wrapTool(tool
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
20
|
+
wrapTool(tool, executeTool) {
|
|
21
|
+
const parameters = deduplicateJsonSchemaRequiredArrays(dereferenceJsonSchema(tool.inputParameters ?? {}, { onUnresolved: "sentinel" }));
|
|
22
|
+
const execute = async (input) => {
|
|
23
|
+
const result = await executeTool(tool.slug, normalizeToolArguments(input, tool.slug));
|
|
24
|
+
return JSON.stringify(result);
|
|
25
|
+
};
|
|
26
|
+
return new FunctionTool(execute, {
|
|
27
|
+
name: tool.slug,
|
|
28
|
+
description: tool.description ?? tool.name ?? "",
|
|
29
|
+
parameters
|
|
30
|
+
}, jsonSchemaToZodSchema(parameters));
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
34
33
|
* Wrap a list of tools in the llamaindex format.
|
|
@@ -54,5 +53,4 @@ var LlamaindexProvider = class extends BaseAgenticProvider {
|
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
//#endregion
|
|
58
56
|
export { LlamaindexProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/llamaindex",
|
|
3
|
-
"version": "0.11.1",
|
|
3
|
+
"version": "0.11.3-canary.1",
|
|
4
4
|
"description": "Agentic Provider for llamaindex in Composio SDK",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"author": "",
|
|
38
38
|
"license": "ISC",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@composio/core": "
|
|
40
|
+
"@composio/core": "0.33.1-canary.1",
|
|
41
41
|
"llamaindex": "^0.12.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"tsdown": "^0.23.
|
|
44
|
+
"tsdown": "^0.23.7",
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
|
-
"@composio/core": "0.
|
|
46
|
+
"@composio/core": "0.33.1-canary.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsdown",
|