@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
md 75 lines 1.57 KB
Rendered Raw
1 # Vercel Example with Composio SDK
2
3 This example demonstrates how to use the Composio SDK with Vercel's AI SDK to create an AI-powered application that can interact with HackerNews data.
4
5 ## Features
6
7 - Integration with Composio SDK and Vercel AI SDK
8 - HackerNews front page summarization using GPT-4
9 - Streaming AI responses
10 - TypeScript support
11
12 ## Prerequisites
13
14 - [Node.js](https://nodejs.org/) (Latest LTS version recommended)
15 - [pnpm](https://pnpm.io/) (v10.8.0 or later)
16 - Composio API Key
17 - OpenAI API Key
18
19 ## Getting Started
20
21 1. Clone the repository and navigate to the example directory:
22
23 ```bash
24 cd examples/vercel
25 ```
26
27 2. Install dependencies:
28
29 ```bash
30 pnpm install
31 ```
32
33 3. Copy the `.env.example` file to `.env` and fill in your API keys:
34
35 ```bash
36 cp .env.example .env
37 ```
38
39 4. Update the `.env` file with your credentials:
40
41 ```env
42 COMPOSIO_API_KEY=your_composio_api_key
43 OPENAI_API_KEY=your_openai_api_key
44 ```
45
46 5. Start the development server:
47
48 ```bash
49 pnpm start
50 ```
51
52 ## How It Works
53
54 This example showcases how to:
55
56 1. Initialize the Composio SDK with the Vercel provider
57 2. Use the HackerNews tool to fetch front page data
58 3. Generate AI responses using OpenAI's GPT-4
59 4. Handle tool calls and results in a chat-like interface
60
61 ## Dependencies
62
63 - `@composio/core`: Core Composio SDK
64 - `@composio/vercel`: Vercel integration for Composio
65 - `@ai-sdk/openai`: OpenAI integration
66 - `ai`: Vercel's AI SDK
67 - TypeScript for type safety
68
69 ## License
70
71 ISC
72
73 ## Support
74
75 For questions and support, please refer to the [Composio documentation](https://docs.composio.dev) or open an issue in the repository.