@composio/vercel 0.1.10-alpha.0 → 0.1.11-alpha.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/README.md +16 -16
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/package.json +6 -5
- package/src/index.ts +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @composio/vercel
|
|
2
2
|
|
|
3
|
-
The Vercel AI SDK
|
|
3
|
+
The Vercel AI SDK provider for Composio SDK, providing seamless integration with Vercel's AI SDK and tools.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -25,12 +25,12 @@ pnpm add @composio/vercel
|
|
|
25
25
|
|
|
26
26
|
```typescript
|
|
27
27
|
import { Composio } from '@composio/core';
|
|
28
|
-
import {
|
|
28
|
+
import { VercelProvider } from '@composio/vercel';
|
|
29
29
|
|
|
30
|
-
// Initialize Composio with Vercel
|
|
30
|
+
// Initialize Composio with Vercel provider
|
|
31
31
|
const composio = new Composio({
|
|
32
32
|
apiKey: 'your-composio-api-key',
|
|
33
|
-
|
|
33
|
+
provider: new VercelProvider(),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
// Get available tools
|
|
@@ -49,13 +49,13 @@ const sendEmailTool = await composio.tools.get('user123', 'GMAIL_SEND_EMAIL');
|
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
51
|
import { Composio } from '@composio/core';
|
|
52
|
-
import {
|
|
52
|
+
import { VercelProvider } from '@composio/vercel';
|
|
53
53
|
import { useChat } from 'ai/react';
|
|
54
54
|
|
|
55
|
-
// Initialize Composio with Vercel
|
|
55
|
+
// Initialize Composio with Vercel provider
|
|
56
56
|
const composio = new Composio({
|
|
57
57
|
apiKey: process.env.COMPOSIO_API_KEY,
|
|
58
|
-
|
|
58
|
+
provider: new VercelProvider()
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// In your React component
|
|
@@ -109,12 +109,12 @@ export async function POST(req: Request) {
|
|
|
109
109
|
|
|
110
110
|
```typescript
|
|
111
111
|
import { Composio } from '@composio/core';
|
|
112
|
-
import {
|
|
112
|
+
import { VercelProvider } from '@composio/vercel';
|
|
113
113
|
import { streamText } from 'ai';
|
|
114
114
|
|
|
115
115
|
const composio = new Composio({
|
|
116
116
|
apiKey: process.env.COMPOSIO_API_KEY,
|
|
117
|
-
|
|
117
|
+
provider: new VercelProvider(),
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
// Example API route that handles tool execution
|
|
@@ -131,7 +131,7 @@ export async function POST(req: Request) {
|
|
|
131
131
|
callbacks: {
|
|
132
132
|
onToolCall: async tool => {
|
|
133
133
|
// Execute the tool and return result
|
|
134
|
-
return await composio.
|
|
134
|
+
return await composio.provider.executeToolCall(tool);
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
});
|
|
@@ -144,12 +144,12 @@ export async function POST(req: Request) {
|
|
|
144
144
|
|
|
145
145
|
```typescript
|
|
146
146
|
import { Composio } from '@composio/core';
|
|
147
|
-
import {
|
|
147
|
+
import { VercelProvider } from '@composio/vercel';
|
|
148
148
|
import { streamObject } from 'ai';
|
|
149
149
|
|
|
150
150
|
const composio = new Composio({
|
|
151
151
|
apiKey: process.env.COMPOSIO_API_KEY,
|
|
152
|
-
|
|
152
|
+
provider: new VercelProvider(),
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
// Example API route that returns structured data
|
|
@@ -180,9 +180,9 @@ export async function POST(req: Request) {
|
|
|
180
180
|
|
|
181
181
|
## API Reference
|
|
182
182
|
|
|
183
|
-
###
|
|
183
|
+
### VercelProvider Class
|
|
184
184
|
|
|
185
|
-
The `
|
|
185
|
+
The `VercelProvider` class extends `BaseComposioProvider` and provides Vercel AI SDK-specific functionality.
|
|
186
186
|
|
|
187
187
|
#### Methods
|
|
188
188
|
|
|
@@ -191,7 +191,7 @@ The `VercelToolset` class extends `BaseComposioToolset` and provides Vercel AI S
|
|
|
191
191
|
Executes a tool call and returns the result.
|
|
192
192
|
|
|
193
193
|
```typescript
|
|
194
|
-
const result = await
|
|
194
|
+
const result = await provider.executeToolCall(toolCall);
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
##### `handleToolCalls(stream: AIStream): AsyncGenerator<AIStreamEvent>`
|
|
@@ -199,7 +199,7 @@ const result = await toolset.executeToolCall(toolCall);
|
|
|
199
199
|
Handles tool calls from a stream and yields events.
|
|
200
200
|
|
|
201
201
|
```typescript
|
|
202
|
-
for await (const event of
|
|
202
|
+
for await (const event of provider.handleToolCalls(stream)) {
|
|
203
203
|
// Handle events
|
|
204
204
|
}
|
|
205
205
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
|
|
23
|
+
VercelProvider: () => VercelProvider
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var import_core = require("@composio/core");
|
|
27
27
|
var import_ai = require("ai");
|
|
28
|
-
var
|
|
28
|
+
var VercelProvider = class extends import_core.BaseAgenticProvider {
|
|
29
29
|
name = "vercel";
|
|
30
30
|
/**
|
|
31
31
|
* Wrap a Composio tool in a Vercel tool.
|
|
@@ -56,5 +56,5 @@ var VercelToolset = class extends import_core.BaseAgenticToolset {
|
|
|
56
56
|
};
|
|
57
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
58
|
0 && (module.exports = {
|
|
59
|
-
|
|
59
|
+
VercelProvider
|
|
60
60
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAgenticProvider, Tool as Tool$1, ExecuteToolFn } from '@composio/core';
|
|
2
2
|
import { Tool } from 'ai';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Vercel AI
|
|
5
|
+
* Vercel AI Provider
|
|
6
6
|
* To be used with the Vercel AI SDK
|
|
7
7
|
*
|
|
8
8
|
* Author: Musthaq Ahamad <musthaq@composio.dev>
|
|
9
9
|
* Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/frameworks/vercel.ts
|
|
10
10
|
*
|
|
11
|
-
* This
|
|
11
|
+
* This provider provides a set of tools for interacting with Vercel AI SDK.
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
|
-
* @module
|
|
14
|
+
* @module providers/vercel
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
type VercelToolCollection = Record<string, Tool>;
|
|
18
|
-
declare class
|
|
18
|
+
declare class VercelProvider extends BaseAgenticProvider<VercelToolCollection, Tool> {
|
|
19
19
|
readonly name = "vercel";
|
|
20
20
|
/**
|
|
21
21
|
* Wrap a Composio tool in a Vercel tool.
|
|
@@ -31,4 +31,4 @@ declare class VercelToolset extends BaseAgenticToolset<VercelToolCollection, Too
|
|
|
31
31
|
wrapTools(tools: Tool$1[], executeTool: ExecuteToolFn): VercelToolCollection;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export {
|
|
34
|
+
export { VercelProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAgenticProvider, Tool as Tool$1, ExecuteToolFn } from '@composio/core';
|
|
2
2
|
import { Tool } from 'ai';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Vercel AI
|
|
5
|
+
* Vercel AI Provider
|
|
6
6
|
* To be used with the Vercel AI SDK
|
|
7
7
|
*
|
|
8
8
|
* Author: Musthaq Ahamad <musthaq@composio.dev>
|
|
9
9
|
* Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/frameworks/vercel.ts
|
|
10
10
|
*
|
|
11
|
-
* This
|
|
11
|
+
* This provider provides a set of tools for interacting with Vercel AI SDK.
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
|
-
* @module
|
|
14
|
+
* @module providers/vercel
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
type VercelToolCollection = Record<string, Tool>;
|
|
18
|
-
declare class
|
|
18
|
+
declare class VercelProvider extends BaseAgenticProvider<VercelToolCollection, Tool> {
|
|
19
19
|
readonly name = "vercel";
|
|
20
20
|
/**
|
|
21
21
|
* Wrap a Composio tool in a Vercel tool.
|
|
@@ -31,4 +31,4 @@ declare class VercelToolset extends BaseAgenticToolset<VercelToolCollection, Too
|
|
|
31
31
|
wrapTools(tools: Tool$1[], executeTool: ExecuteToolFn): VercelToolCollection;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export {
|
|
34
|
+
export { VercelProvider };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
2
|
+
import { BaseAgenticProvider } from "@composio/core";
|
|
3
3
|
import { jsonSchema, tool } from "ai";
|
|
4
|
-
var
|
|
4
|
+
var VercelProvider = class extends BaseAgenticProvider {
|
|
5
5
|
name = "vercel";
|
|
6
6
|
/**
|
|
7
7
|
* Wrap a Composio tool in a Vercel tool.
|
|
@@ -31,5 +31,5 @@ var VercelToolset = class extends BaseAgenticToolset {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
VercelProvider
|
|
35
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/vercel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsup",
|
|
25
|
-
"test": "
|
|
25
|
+
"test": "vitest run"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [],
|
|
28
28
|
"author": "",
|
|
@@ -33,9 +33,10 @@
|
|
|
33
33
|
"ai": "^4.3.8"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@composio/core": "
|
|
36
|
+
"@composio/core": "0.1.11-alpha.0",
|
|
37
37
|
"tsup": "^8.4.0",
|
|
38
|
-
"typescript": "^5.8.3"
|
|
38
|
+
"typescript": "^5.8.3",
|
|
39
|
+
"vitest": "^3.1.3"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a4e9ff190c198e6a20797c0bf35762b149ae081c"
|
|
41
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Vercel AI
|
|
2
|
+
* Vercel AI Provider
|
|
3
3
|
* To be used with the Vercel AI SDK
|
|
4
4
|
*
|
|
5
5
|
* Author: Musthaq Ahamad <musthaq@composio.dev>
|
|
6
6
|
* Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/frameworks/vercel.ts
|
|
7
7
|
*
|
|
8
|
-
* This
|
|
8
|
+
* This provider provides a set of tools for interacting with Vercel AI SDK.
|
|
9
9
|
*
|
|
10
10
|
* @packageDocumentation
|
|
11
|
-
* @module
|
|
11
|
+
* @module providers/vercel
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { BaseAgenticProvider, Tool as ComposioTool, ExecuteToolFn } from '@composio/core';
|
|
14
14
|
import type { Tool as VercelTool } from 'ai';
|
|
15
15
|
import { jsonSchema, tool } from 'ai';
|
|
16
16
|
|
|
17
17
|
type VercelToolCollection = Record<string, VercelTool>;
|
|
18
|
-
export class
|
|
18
|
+
export class VercelProvider extends BaseAgenticProvider<VercelToolCollection, VercelTool> {
|
|
19
19
|
readonly name = 'vercel';
|
|
20
20
|
|
|
21
21
|
/**
|