@composio/llamaindex 0.9.2 → 0.10.0
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.d.mts +0 -1
- package/dist/index.mjs +3 -3
- package/package.json +17 -17
- package/dist/index.cjs +0 -58
- package/dist/index.d.cts +0 -33
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { BaseAgenticProvider, ExecuteToolFn, McpServerGetResponse, McpUrlRespons
|
|
|
2
2
|
import { tool } from "llamaindex";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
|
-
|
|
6
5
|
type LlamaindexTool = ReturnType<typeof tool>;
|
|
7
6
|
type LlamaindexToolCollection = Array<LlamaindexTool>;
|
|
8
7
|
declare class LlamaindexProvider extends BaseAgenticProvider<Array<LlamaindexTool>, LlamaindexTool, McpServerGetResponse> {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAgenticProvider, jsonSchemaToZodSchema } from "@composio/core";
|
|
1
|
+
import { BaseAgenticProvider, jsonSchemaToZodSchema, normalizeToolArguments } from "@composio/core";
|
|
2
2
|
import { tool } from "llamaindex";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
|
@@ -25,7 +25,7 @@ var LlamaindexProvider = class extends BaseAgenticProvider {
|
|
|
25
25
|
description: tool$1.description ?? tool$1.name ?? "",
|
|
26
26
|
parameters: inputParametersSchema,
|
|
27
27
|
execute: async (input) => {
|
|
28
|
-
const result = await executeTool(tool$1.slug, input);
|
|
28
|
+
const result = await executeTool(tool$1.slug, normalizeToolArguments(input, tool$1.slug));
|
|
29
29
|
return JSON.stringify(result);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -36,7 +36,7 @@ var LlamaindexProvider = class extends BaseAgenticProvider {
|
|
|
36
36
|
* @returns The wrapped tools.
|
|
37
37
|
*/
|
|
38
38
|
wrapTools(tools, executeTool) {
|
|
39
|
-
return tools.map((tool
|
|
39
|
+
return tools.map((tool) => this.wrapTool(tool, executeTool));
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Transform MCP URL response into Anthropic-specific format.
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/llamaindex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Agentic Provider for llamaindex in Composio SDK",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/ComposioHQ/composio.git",
|
|
10
|
+
"directory": "ts/packages/providers/llamaindex"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ComposioHQ/composio/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/ComposioHQ/composio/tree/main/ts/packages/providers/llamaindex#readme",
|
|
6
16
|
"publishConfig": {
|
|
7
17
|
"access": "public"
|
|
8
18
|
},
|
|
9
19
|
"exports": {
|
|
10
20
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"default": "./dist/index.mjs"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.cts",
|
|
17
|
-
"default": "./dist/index.cjs"
|
|
18
|
-
},
|
|
19
|
-
"default": {
|
|
20
|
-
"types": "./dist/index.d.cts",
|
|
21
|
-
"default": "./dist/index.cjs"
|
|
22
|
-
}
|
|
21
|
+
"types": "./dist/index.d.mts",
|
|
22
|
+
"default": "./dist/index.mjs"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"llamaindex": "^0.12.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"tsdown": "^0.
|
|
42
|
-
"typescript": "^
|
|
43
|
-
"@composio/core": "0.
|
|
41
|
+
"tsdown": "^0.22.3",
|
|
42
|
+
"typescript": "^6.0.3",
|
|
43
|
+
"@composio/core": "0.12.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "
|
|
46
|
+
"build": "tsdown",
|
|
47
47
|
"test": "vitest run"
|
|
48
48
|
},
|
|
49
49
|
"types": "dist/index.d.mts"
|
package/dist/index.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
let _composio_core = require("@composio/core");
|
|
2
|
-
let llamaindex = require("llamaindex");
|
|
3
|
-
|
|
4
|
-
//#region src/index.ts
|
|
5
|
-
/**
|
|
6
|
-
* Llamaindex Provider
|
|
7
|
-
*
|
|
8
|
-
* This provider provides a set of tools for interacting with Llamaindex.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
* @module providers/llamaindex
|
|
12
|
-
*/
|
|
13
|
-
var LlamaindexProvider = class extends _composio_core.BaseAgenticProvider {
|
|
14
|
-
name = "llamaindex";
|
|
15
|
-
/**
|
|
16
|
-
* Wrap a tool in the llamaindex format.
|
|
17
|
-
* @param tool - The tool to wrap.
|
|
18
|
-
* @returns The wrapped tool.
|
|
19
|
-
*/
|
|
20
|
-
wrapTool(tool, executeTool) {
|
|
21
|
-
const inputParams = tool.inputParameters;
|
|
22
|
-
const inputParametersSchema = (0, _composio_core.jsonSchemaToZodSchema)(inputParams ?? {});
|
|
23
|
-
return (0, llamaindex.tool)({
|
|
24
|
-
name: tool.slug,
|
|
25
|
-
description: tool.description ?? tool.name ?? "",
|
|
26
|
-
parameters: inputParametersSchema,
|
|
27
|
-
execute: async (input) => {
|
|
28
|
-
const result = await executeTool(tool.slug, input);
|
|
29
|
-
return JSON.stringify(result);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Wrap a list of tools in the llamaindex format.
|
|
35
|
-
* @param tools - The tools to wrap.
|
|
36
|
-
* @returns The wrapped tools.
|
|
37
|
-
*/
|
|
38
|
-
wrapTools(tools, executeTool) {
|
|
39
|
-
return tools.map((tool) => this.wrapTool(tool, executeTool));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Transform MCP URL response into Anthropic-specific format.
|
|
43
|
-
* By default, Anthropic uses the standard format (same as default),
|
|
44
|
-
* but this method is here to show providers can customize if needed.
|
|
45
|
-
*
|
|
46
|
-
* @param data - The MCP URL response data
|
|
47
|
-
* @returns Standard MCP server response format
|
|
48
|
-
*/
|
|
49
|
-
wrapMcpServerResponse(data) {
|
|
50
|
-
return data.map((item) => ({
|
|
51
|
-
url: new URL(item.url),
|
|
52
|
-
name: item.name
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
exports.LlamaindexProvider = LlamaindexProvider;
|
package/dist/index.d.cts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseAgenticProvider, ExecuteToolFn, McpServerGetResponse, McpUrlResponse, Tool } from "@composio/core";
|
|
2
|
-
import { tool } from "llamaindex";
|
|
3
|
-
|
|
4
|
-
//#region src/index.d.ts
|
|
5
|
-
|
|
6
|
-
type LlamaindexTool = ReturnType<typeof tool>;
|
|
7
|
-
type LlamaindexToolCollection = Array<LlamaindexTool>;
|
|
8
|
-
declare class LlamaindexProvider extends BaseAgenticProvider<Array<LlamaindexTool>, LlamaindexTool, McpServerGetResponse> {
|
|
9
|
-
readonly name = "llamaindex";
|
|
10
|
-
/**
|
|
11
|
-
* Wrap a tool in the llamaindex format.
|
|
12
|
-
* @param tool - The tool to wrap.
|
|
13
|
-
* @returns The wrapped tool.
|
|
14
|
-
*/
|
|
15
|
-
wrapTool(tool: Tool, executeTool: ExecuteToolFn): LlamaindexTool;
|
|
16
|
-
/**
|
|
17
|
-
* Wrap a list of tools in the llamaindex format.
|
|
18
|
-
* @param tools - The tools to wrap.
|
|
19
|
-
* @returns The wrapped tools.
|
|
20
|
-
*/
|
|
21
|
-
wrapTools(tools: Tool[], executeTool: ExecuteToolFn): LlamaindexToolCollection;
|
|
22
|
-
/**
|
|
23
|
-
* Transform MCP URL response into Anthropic-specific format.
|
|
24
|
-
* By default, Anthropic uses the standard format (same as default),
|
|
25
|
-
* but this method is here to show providers can customize if needed.
|
|
26
|
-
*
|
|
27
|
-
* @param data - The MCP URL response data
|
|
28
|
-
* @returns Standard MCP server response format
|
|
29
|
-
*/
|
|
30
|
-
wrapMcpServerResponse(data: McpUrlResponse): McpServerGetResponse;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { LlamaindexProvider, LlamaindexTool, LlamaindexToolCollection };
|