Skip to content

Commit

Permalink
fix(docs): resolve merge conflicts in auth docs
Browse files Browse the repository at this point in the history
Co-Authored-By: Soham Ganatra <soham@composio.dev>
  • Loading branch information
2 parents d139292 + 44f9adb commit 7509caa
Show file tree
Hide file tree
Showing 169 changed files with 10,192 additions and 3,571 deletions.
52 changes: 11 additions & 41 deletions docs/examples/combined/newsletter-summarizer-javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ sidebarTitle: "Newsletter Summarizer"
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."
---




<Tabs>

<Tab title="Javascript">
<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">
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.
<CardBody>
</CardBody>
</Card>
<Steps>
<Step title="Import base packages">
Expand Down Expand Up @@ -47,13 +41,13 @@ description: "This project serves as an example of how to use Composio to seamle
```javascript Define Webhook
app.get('/webhook', async (req, res) => {
try {
const body = `Please research on Arxiv about \`${researchTopic}\`, organize
the top ${nIssues} results as ${nIssues} issues for
a GitHub repository, and finally raise those issues with proper
title, body, implementation guidance, and references in
the ${targetRepo} repo, as well as relevant tags and assignees as
const body = `Please research on Arxiv about \`${researchTopic}\`, organize
the top ${nIssues} results as ${nIssues} issues for
a GitHub repository, and finally raise those issues with proper
title, body, implementation guidance, and references in
the ${targetRepo} repo, as well as relevant tags and assignees as
the repo owner.`;

const toolset = new OpenAIToolSet({
apiKey: process.env.COMPOSIO_API_KEY,
});
Expand All @@ -79,7 +73,7 @@ description: "This project serves as an example of how to use Composio to seamle
assistant_id: assistant.id,
});
run = await toolset.wait_and_handle_assistant_tool_calls(client, run, thread);

// Check if the run is completed
if (run.status === "completed") {
let messages = await client.beta.threads.messages.list(thread.id);
Expand Down Expand Up @@ -110,34 +104,11 @@ description: "This project serves as an example of how to use Composio to seamle
```
</CodeGroup>
</Step>

</Steps>
</Tab>
</Tabs>

























## Putting It All Together

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

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

export default app;
```
</CodeGroup>


</CodeGroup>
28 changes: 2 additions & 26 deletions docs/examples/combined/newsletter_summarizer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ description: "This project serves as an example of how to use Composio to seamle
<Tab title="Python">
<Card color="#7bee0c" title="Newsletter Summarizer GitHub Repository" icon="github" href="https://www.github.com/ComposioHQ/composio/blob/master/python/examples/newsletter_summarizer/">
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.
<CardBody>
</CardBody>
</Card>
<Steps>
<Step title="Import Base Packages">
Expand Down Expand Up @@ -150,8 +148,6 @@ description: "This project serves as an example of how to use Composio to seamle
<Tab title="Javascript">
<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">
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.
<CardBody>
</CardBody>
</Card>
<Steps>
<Step title="Import base packages">
Expand Down Expand Up @@ -255,26 +251,6 @@ description: "This project serves as an example of how to use Composio to seamle
























## Putting It All Together

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

if (!connection) {
// If the user hasn't connected their GitHub account
const connection = await entity.initiateConnection('github');
const connection = await entity.initiateConnection({appName: "GITHUB"});
console.log('Log in via: ', connection.redirectUrl);
c.json({ redirectUrl: connection.redirectUrl, message: 'Please log in to continue and then call this API again.' });
}
Expand Down
8 changes: 7 additions & 1 deletion docs/introduction/intro/quickstart-entities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ We'll use Jessica as our example user. There are multiple ways to authenticate a
const client = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });

const entity = await client.getEntity("Jessica");
const connection = await entity.initiateConnection('googlecalendar');
const connection = await entity.initiateConnection({appName: "googlecalendar"});

console.log(`Open this URL to authenticate: ${connection.redirectUrl}`);
```
Expand All @@ -181,7 +181,13 @@ We'll use Jessica as our example user. There are multiple ways to authenticate a
Set up your development environment:

<CodeGroup>
<<<<<<< HEAD
```javascript Initialize Composio Toolset and OpenAI
||||||| 0378f58b
```javascript Initialize Composio and OpenAI
=======
```javascript Initialize Composio's OpenAI Toolset and OpenAI
>>>>>>> 44f9adb9f45a48b9ce6bd352c62a5a39f9b74a23
import { OpenAI } from "openai";
import { OpenAIToolSet } from "composio-core";

Expand Down
4 changes: 2 additions & 2 deletions docs/introduction/intro/quickstart_3_backup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Follow these 5 steps to list your emails as soon as you receive them:
const client = new Composio(process.env.COMPOSIO_API_KEY);

const entity = await client.getEntity("Jessica");
const connection = await entity.initiateConnection('gmail');
const connection = await entity.initiateConnection({appName: "gmail"});

console.log(`Open this URL to authenticate: ${connection.redirectUrl}`);
```
Expand Down Expand Up @@ -187,7 +187,7 @@ Follow these 5 steps to list your emails as soon as you receive them:
</Tab>
<Tab title="JavaScript">
<CodeGroup>
```javascript Initialize Composio and OpenAI
```javascript Initialize Composio's OpenAI Toolset and OpenAI
import { OpenAI } from "openai";
import { OpenAIToolSet } from "composio-core";

Expand Down
4 changes: 2 additions & 2 deletions docs/javascript/langchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const toolset = new LangchainToolSet({ apiKey: process.env.COMPOSIO_API_KEY, });

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

if (!connection) {
// If this entity/user hasn't already connected the account
const connection = await entity.initiateConnection(appName);
const connection = await entity.initiateConnection({appName: appName});
console.log("Log in via: ", connection.redirectUrl);
return connection.waitUntilActive(60);
}
Expand Down
4 changes: 2 additions & 2 deletions docs/javascript/openai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const appName = 'github';

async function setupUserConnectionIfNotExists(entityId) {
const entity = toolset.client.getEntity(entityId);
const connection = await entity.getConnection(appName);
const connection = await entity.getConnection({ appName: appName });

if (!connection) {
const connection = await entity.initiateConnection(appName);
const connection = await entity.initiateConnection({appName: appName});
console.log("Log in via: ", connection.redirectUrl);
return connection.waitUntilActive(60);
}
Expand Down
16 changes: 8 additions & 8 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
},
{
"name": "All Tools",
"url": "https://composio.dev/tools"
"url": "https://app.composio.dev/apps"
},
{
"name": "Chat with Code",
"url": "https://chatgpt.com/g/g-67697db23c808191a1787ea4b86ac1ce-composio"
"url": "https://entelligence.ai/ComposioHQ&composio"
}
],
"navigation": [
Expand Down Expand Up @@ -371,23 +371,23 @@
},
{
"source": "/apps/usecases/langchain_blogs/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/usecases/crewai/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/usecases/autogen_blogs/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps",
"destination": "https://composio.dev/tools/"
"destination": "https://app.composio.dev/apps"
},
{
"source": "/python/local_tools",
Expand All @@ -398,4 +398,4 @@
"destination": "/introduction/foundations/components/custom_actions"
}
]
}
}
18 changes: 9 additions & 9 deletions docs/mint.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
},
{
"name": "All Tools",
"url": "https://composio.dev/tools"
"url": "https://app.composio.dev/apps"
},
{
"name": "Chat with Repo",
"url": "https://dub.composio.dev/composio-chat-with-repo"
"name": "Chat with Code",
"url": "https://entelligence.ai/ComposioHQ&composio"
}
],
"navigation": [
Expand Down Expand Up @@ -262,23 +262,23 @@
},
{
"source": "/apps/usecases/langchain_blogs/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/usecases/crewai/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/usecases/autogen_blogs/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
"destination": "https://app.composio.dev/apps/:slug2*"
},
{
"source": "/apps",
"destination": "https://composio.dev/tools/"
"destination": "https://app.composio.dev/apps"
},
{
"source": "/python/local_tools",
Expand All @@ -289,4 +289,4 @@
"destination": "/introduction/foundations/components/custom_actions"
}
]
}
}
Loading

0 comments on commit 7509caa

Please sign in to comment.