@devries-cameron20 / composio-1 / commits / 872dd4ab2
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.

Fix github workflow

haxzie committed Apr 28, 2025 at 12:22 UTC 872dd4ab235477ffe15c613e82b6f9d9401d554e
2 files changed +16 -13
.github/workflows/ci.yml
+4 -1
@@ -17,7 +17,7 @@ jobs:
17 - name: Setup PNPM
18 uses: pnpm/action-setup@v2
19 with:
20 - version: 10.8.0 # Match the version in package.json
20 + version: 10.8.0 # Match the version in package.json
21
22 - name: Set up Node.js
23 uses: actions/setup-node@v3
@@ -28,5 +28,8 @@ jobs:
28 - name: Install Dependencies
29 run: pnpm install --frozen-lockfile
30
31 + - name: Run Linting
32 + run: pnpm lint
33 +
34 - name: Run Build
35 run: pnpm turbo run build
examples/openai/src/index.ts
+12 -12
@@ -1,5 +1,5 @@
1 -import { Composio } from "@composio/core";
2 -import { OpenAI } from "openai";
1 +import { Composio } from '@composio/core';
2 +import { OpenAI } from 'openai';
3
4 const openai = new OpenAI({
5 apiKey: process.env.OPENAI_API_KEY,
@@ -13,29 +13,29 @@ const composio = new Composio({
13
14 // Fetch all the tools from the Composio API
15 // these tools are automatically typed and wrapped with the OpenAI Toolset
16 -const tool = await composio.getTool("HACKERNEWS_GET_USER");
16 +const tool = await composio.getTool('HACKERNEWS_GET_USER');
17
18 const task = "Fetch the details of the user 'haxzie'";
19
20 const messages: OpenAI.ChatCompletionMessageParam[] = [
21 - { role: "system", content: "You are a helpful assistant that can help with tasks." },
22 - { role: "user", content: task },
23 -]
21 + { role: 'system', content: 'You are a helpful assistant that can help with tasks.' },
22 + { role: 'user', content: task },
23 +];
24
25 const response = await openai.chat.completions.create({
26 - model: "gpt-4o-mini",
26 + model: 'gpt-4o-mini',
27 messages,
28 tools: [tool],
29 - tool_choice: "auto",
29 + tool_choice: 'auto',
30 });
31
32 -
32 if (response.choices[0].message.tool_calls) {
33 try {
35 -
36 - const result = await composio.toolset.executeToolCall(response.choices[0].message.tool_calls[0]);
34 + const result = await composio.toolset.executeToolCall(
35 + response.choices[0].message.tool_calls[0]
36 + );
37 console.log(JSON.stringify(result, null, 2));
38 } catch (error) {
39 console.error(JSON.stringify(error, null, 2));
40 }
41 -}
\ No newline at end of file
41 +}