Skip to content

Commit 385772e

Browse files
Merge branch 'master' into devin/1735478042-update-entity-id-and-execute-format
2 parents be4f2bd + 343f57a commit 385772e

File tree

174 files changed

+10616
-2545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+10616
-2545
lines changed

docs/examples/combined/newsletter-summarizer-javascript.mdx

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@ sidebarTitle: "Newsletter Summarizer"
44
description: "This project serves as an example of how to use Composio to seamlessly fetch and summarize newsletter emails. It automatically retrieves recent newsletters, summarizes their content, and sends a well-formatted email to the specified recipient."
55
---
66

7-
8-
9-
107
<Tabs>
11-
128
<Tab title="Javascript">
139
<Card color="#7bee0c" title="Newsletter Summarizer GitHub Repository" icon="github" href="https://github.com/ComposioHQ/composio/tree/master/js/examples/newsletter_summarizer/newsletter_summarizer_cloudflare">
1410
Explore the complete source code for the Newsletter Summarizer project. This repository contains all the necessary files and scripts to set up and run the Newsletter Summarizer using Composio and Cloudflare.
15-
<CardBody>
16-
</CardBody>
1711
</Card>
1812
<Steps>
1913
<Step title="Import base packages">
@@ -47,13 +41,13 @@ description: "This project serves as an example of how to use Composio to seamle
4741
```javascript Define Webhook
4842
app.get('/webhook', async (req, res) => {
4943
try {
50-
const body = `Please research on Arxiv about \`${researchTopic}\`, organize
51-
the top ${nIssues} results as ${nIssues} issues for
52-
a GitHub repository, and finally raise those issues with proper
53-
title, body, implementation guidance, and references in
54-
the ${targetRepo} repo, as well as relevant tags and assignees as
44+
const body = `Please research on Arxiv about \`${researchTopic}\`, organize
45+
the top ${nIssues} results as ${nIssues} issues for
46+
a GitHub repository, and finally raise those issues with proper
47+
title, body, implementation guidance, and references in
48+
the ${targetRepo} repo, as well as relevant tags and assignees as
5549
the repo owner.`;
56-
50+
5751
const toolset = new OpenAIToolSet({
5852
apiKey: process.env.COMPOSIO_API_KEY,
5953
});
@@ -79,7 +73,7 @@ description: "This project serves as an example of how to use Composio to seamle
7973
assistant_id: assistant.id,
8074
});
8175
run = await toolset.wait_and_handle_assistant_tool_calls(client, run, thread);
82-
76+
8377
// Check if the run is completed
8478
if (run.status === "completed") {
8579
let messages = await client.beta.threads.messages.list(thread.id);
@@ -110,34 +104,11 @@ description: "This project serves as an example of how to use Composio to seamle
110104
```
111105
</CodeGroup>
112106
</Step>
107+
113108
</Steps>
114109
</Tab>
115110
</Tabs>
116111

117-
118-
119-
120-
121-
122-
123-
124-
125-
126-
127-
128-
129-
130-
131-
132-
133-
134-
135-
136-
137-
138-
139-
140-
141112
## Putting It All Together
142113

143114
<CodeGroup>
@@ -154,11 +125,11 @@ description: "This project serves as an example of how to use Composio to seamle
154125
// Function to set up the GitHub connection for the user if it doesn't exist
155126
async function setupUserConnectionIfNotExists(toolset, entityId, c) {
156127
const entity = await toolset.client.getEntity(entityId);
157-
const connection = await entity.getConnection('github');
128+
const connection = await entity.getConnection({ appName: "GITHUB" });
158129

159130
if (!connection) {
160131
// If the user hasn't connected their GitHub account
161-
const connection = await entity.initiateConnection('github');
132+
const connection = await entity.initiateConnection({appName: "GITHUB"});
162133
console.log('Log in via: ', connection.redirectUrl);
163134
c.json({ redirectUrl: connection.redirectUrl, message: 'Please log in to continue and then call this API again.' });
164135
}
@@ -231,6 +202,5 @@ description: "This project serves as an example of how to use Composio to seamle
231202

232203
export default app;
233204
```
234-
</CodeGroup>
235-
236205

206+
</CodeGroup>

docs/examples/combined/newsletter_summarizer.mdx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ description: "This project serves as an example of how to use Composio to seamle
1111
<Tab title="Python">
1212
<Card color="#7bee0c" title="Newsletter Summarizer GitHub Repository" icon="github" href="https://www.github.com/ComposioHQ/composio/blob/master/python/examples/newsletter_summarizer/">
1313
Explore the complete source code for the Newsletter Summarizer project. This repository contains all the necessary files and scripts to set up and run the Newsletter Summarizer using Composio and Cloudflare.
14-
<CardBody>
15-
</CardBody>
1614
</Card>
1715
<Steps>
1816
<Step title="Import Base Packages">
@@ -150,8 +148,6 @@ description: "This project serves as an example of how to use Composio to seamle
150148
<Tab title="Javascript">
151149
<Card color="#7bee0c" title="Newsletter Summarizer GitHub Repository" icon="github" href="https://github.com/ComposioHQ/composio/tree/master/js/examples/newsletter_summarizer/newsletter_summarizer_cloudflare">
152150
Explore the complete source code for the Newsletter Summarizer project. This repository contains all the necessary files and scripts to set up and run the Newsletter Summarizer using Composio and Cloudflare.
153-
<CardBody>
154-
</CardBody>
155151
</Card>
156152
<Steps>
157153
<Step title="Import base packages">
@@ -255,26 +251,6 @@ description: "This project serves as an example of how to use Composio to seamle
255251

256252

257253

258-
259-
260-
261-
262-
263-
264-
265-
266-
267-
268-
269-
270-
271-
272-
273-
274-
275-
276-
277-
278254

279255
## Putting It All Together
280256

@@ -387,11 +363,11 @@ print(result)
387363
// Function to set up the GitHub connection for the user if it doesn't exist
388364
async function setupUserConnectionIfNotExists(toolset, entityId, c) {
389365
const entity = await toolset.client.getEntity(entityId);
390-
const connection = await entity.getConnection('github');
366+
const connection = await entity.getConnection({ appName: "GITHUB" });
391367

392368
if (!connection) {
393369
// If the user hasn't connected their GitHub account
394-
const connection = await entity.initiateConnection('github');
370+
const connection = await entity.initiateConnection({appName: "GITHUB"});
395371
console.log('Log in via: ', connection.redirectUrl);
396372
c.json({ redirectUrl: connection.redirectUrl, message: 'Please log in to continue and then call this API again.' });
397373
}

docs/introduction/intro/quickstart-entities.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ We'll use **`default`** as our example user. There are multiple ways to authenti
6565

6666
</Step>
6767

68-
<Step title="Initialize Composio and OpenAI">
68+
<Step title="Initialize Composio Toolset and OpenAI">
6969
Set up your development environment:
7070

7171
<CodeGroup>
72-
```python Initialize Composio and OpenAI
72+
```python Initialize Composio Toolset and OpenAI
7373
from composio_openai import ComposioToolSet, Action
7474
from openai import OpenAI
7575

@@ -177,11 +177,11 @@ We'll use **`default`** as our example user. There are multiple ways to authenti
177177

178178
</Step>
179179

180-
<Step title="Initialize Composio and OpenAI">
180+
<Step title="Initialize Composio's OpenAIToolset and OpenAI">
181181
Set up your development environment:
182182

183183
<CodeGroup>
184-
```javascript Initialize Composio and OpenAI
184+
```javascript Initialize Composio's OpenAIToolset and OpenAI
185185
import { OpenAI } from "openai";
186186
import { OpenAIToolSet } from "composio-core";
187187

docs/introduction/intro/quickstart-tools.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environ
4242
</Tip>
4343
</Step>
4444

45-
<Step title="Initialize Composio and OpenAI">
45+
<Step title="Initialise Composio Toolset and OpenAI">
4646
<CodeGroup>
4747
```python Python
4848
from composio_openai import ComposioToolSet, App
@@ -88,7 +88,7 @@ print(result)
8888
</Steps>
8989

9090
</Tab>
91-
<Tab title="Javascript">
91+
<Tab title="JavaScript">
9292
<Steps>
9393

9494
<Step title="Install Libraries">
@@ -120,7 +120,7 @@ print(result)
120120
</CodeGroup>
121121
</Step>
122122

123-
<Step title="Initialize Composio and OpenAI">
123+
<Step title="Initialise Composio's OpenAIToolSet and OpenAI">
124124
<CodeGroup>
125125
```javascript JavaScript
126126
import { OpenAI } from "openai";
@@ -137,19 +137,19 @@ print(result)
137137

138138
<Step title="Fetch GitHub Actions & and pass them to LLM">
139139
<CodeGroup>
140-
```javascript Star a repo using LLM
140+
```javascript JavaScript
141141
const tools = await composio_toolset.getTools({
142-
actions: ["github_star_a_repository_for_the_authenticated_user"]
143-
});
142+
actions: ["github_star_a_repository_for_the_authenticated_user"],
143+
});
144144

145145
const instruction = "Star the repo composiohq/composio on GitHub";
146146

147147
const response = await openai_client.chat.completions.create({
148-
model: "gpt-4o",
149-
messages: [{ role: "user", content: instruction }],
150-
tools: tools,
151-
tool_choice: "auto",
152-
});
148+
model: "gpt-4o",
149+
messages: [{ role: "user", content: instruction }],
150+
tools: tools,
151+
tool_choice: "auto",
152+
});
153153
```
154154
</CodeGroup>
155155
<Tip>
@@ -159,7 +159,7 @@ print(result)
159159

160160
<Step title="Execute Tool Calls">
161161
<CodeGroup>
162-
```javascript Execute Function calls
162+
```javascript JavaScript
163163
const result = await composio_toolset.handleToolCall(response);
164164
console.log(result);
165165
```

docs/introduction/intro/quickstart-triggers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ const agentFunction = async (threadId, subject, senderMail) => {
193193
<Step title="Create a Trigger Listener">
194194
<CodeGroup>
195195
```javascript JavaScript
196-
toolset.client.triggers.subscribe(
196+
toolset.triggers.subscribe(
197197
(data) => {
198198
const {
199199
payload: {

docs/introduction/intro/quickstart_3_backup.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Follow these 5 steps to list your emails as soon as you receive them:
7676
const client = new Composio(process.env.COMPOSIO_API_KEY);
7777

7878
const entity = await client.getEntity("default");
79-
const connection = await entity.initiateConnection('gmail');
79+
const connection = await entity.initiateConnection({appName: "gmail"});
8080

8181
console.log(`Open this URL to authenticate: ${connection.redirectUrl}`);
8282
```
@@ -170,7 +170,7 @@ Follow these 5 steps to list your emails as soon as you receive them:
170170
</Tabs>
171171
</Step>
172172

173-
<Step title="Initialize Composio and OpenAI">
173+
<Step title="Initialize Composio Toolset and OpenAI">
174174
Set up your development environment:
175175

176176
<Tabs>
@@ -187,7 +187,7 @@ Follow these 5 steps to list your emails as soon as you receive them:
187187
</Tab>
188188
<Tab title="JavaScript">
189189
<CodeGroup>
190-
```javascript Initialize Composio and OpenAI
190+
```javascript Initialize Composio's OpenAI Toolset and OpenAI
191191
import { OpenAI } from "openai";
192192
import { OpenAIToolSet } from "composio-core";
193193

docs/javascript/langchain.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const toolset = new LangchainToolSet({ apiKey: process.env.COMPOSIO_API_KEY, });
2424

2525
async function setupUserConnectionIfNotExists(entityId) {
2626
const entity = toolset.client.getEntity(entityId);
27-
const connection = await entity.getConnection('github');
27+
const connection = await entity.getConnection({ appName: "GITHUB" });
2828

2929
if (!connection) {
3030
// If this entity/user hasn't already connected the account
31-
const connection = await entity.initiateConnection(appName);
31+
const connection = await entity.initiateConnection({appName: appName});
3232
console.log("Log in via: ", connection.redirectUrl);
3333
return connection.waitUntilActive(60);
3434
}

docs/javascript/openai.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ const appName = 'github';
4949

5050
async function setupUserConnectionIfNotExists(entityId) {
5151
const entity = toolset.client.getEntity(entityId);
52-
const connection = await entity.getConnection(appName);
52+
const connection = await entity.getConnection({ appName: appName });
5353

5454
if (!connection) {
55-
const connection = await entity.initiateConnection(appName);
55+
const connection = await entity.initiateConnection({appName: appName});
5656
console.log("Log in via: ", connection.redirectUrl);
5757
return connection.waitUntilActive(60);
5858
}

docs/mint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"name": "Chat with Code",
76-
"url": "https://chatgpt.com/g/g-67697db23c808191a1787ea4b86ac1ce-composio"
76+
"url": "https://entelligence.ai/ComposioHQ&composio"
7777
}
7878
],
7979
"navigation": [

docs/mint.json.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
"url": "https://app.composio.dev/apps"
7373
},
7474
{
75-
"name": "Chat with Repo",
76-
"url": "https://dub.composio.dev/composio-chat-with-repo"
75+
"name": "Chat with Code",
76+
"url": "https://entelligence.ai/ComposioHQ&composio"
7777
}
7878
],
7979
"navigation": [

0 commit comments

Comments
 (0)