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

next
ts 21 lines 585 Bytes
Raw
1 /**
2 * OpenAI × Composio — Tool Router
3 *
4 * Creates a HackerNews-scoped session, gives the session's router tools to
5 * OpenAI, and executes every model-requested tool through that same session.
6 *
7 * Prerequisites:
8 * - COMPOSIO_API_KEY (https://app.composio.dev)
9 * - OPENAI_API_KEY
10 *
11 * Run:
12 * bun ts/examples/openai/src/tool-router.ts
13 */
14 import 'dotenv/config';
15
16 import { runToolRouterHackerNewsAgent } from './hackernews-agent/tool-router';
17
18 const text = await runToolRouterHackerNewsAgent(process.env);
19
20 console.log('\n🤖 Agent response:\n');
21 console.log(text);