Skip to content

Commit

Permalink
merged conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sohamganatra committed Oct 17, 2024
2 parents ee32d9a + 3b9bb48 commit eea04de
Show file tree
Hide file tree
Showing 97 changed files with 6,721 additions and 4,727 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
pip install tox==4.6.3
- name: Code style check
run: |
tox -e black-check
tox -e black-diff
tox -e isort-check
tox -e flake8
- name: Pylint check
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ refactor_debug.ipynb
python/dockerfiles/e2b-dev/composio
python/dockerfiles/composio
python/swe/dockerfiles/generated
python/swe/dockerfiles/logs
python/swe/dockerfiles/logs*
python/swe/logs
indexed
python/swe/tests/logs_dir
python/swe/dockerfiles/indexed
python/swe/agentic
python/swe/dockerfiles/generated*
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributions to the framework, its plugins, related tools and tools are welcome
There are various ways to contribute:

- If you need support, want to report a bug or ask for features, you can check the [Issues page](https://github.com/composiohq/composio/issues) and raise an issue, if applicable.
- If you would like to contribute a bug fix or feature then [Submit a pull request](https://github.com/composiohq/composio/pulls).
- If you would like to contribute a bug fix or feature, then [Submit a pull request](https://github.com/composiohq/composio/pulls).
- If you have other kinds of feedback, you can contact one of the [authors](https://github.com/composiohq/composio/blob/master/AUTHORS.md) by email.

> Before reading on, please have a look at the [code of conduct](https://github.com/composiohq/composio/blob/master/CODE_OF_CONDUCT.md).
Expand All @@ -25,9 +25,9 @@ If you have improvements, send us your pull requests!

A team member will be assigned to review your pull requests. All tests are run as part of CI as well as various other checks (code formatting, linters, static type checkers, etc). If there are any problems, feedback is provided via GitHub. Once the pull requests is approved and passes continuous integration checks, you or a team member can merge it.

If you want to contribute, start working through the codebase, navigate to the Github `issues` tab and start looking through interesting issues. If you are not sure of where to start, then start by trying one of the smaller/easier issues here i.e. issues with the `good first issue` label and then take a look at the issues with the `contributions welcome` label. These are issues that we believe are particularly well suited for outside contributions, often because we probably won't get to them right now. If you decide to start on an issue, leave a comment so that other people know that you're working on it. If you want to help out, but not alone, use the issue comment thread to coordinate.
If you want to contribute, start working through the codebase, navigate to the GitHub `issues` tab and start looking through interesting issues. If you are not sure of where to start, then start by trying one of the smaller/easier issues here i.e. issues with the `good first issue` label and then take a look at the issues with the `contributions welcome` label. These are issues that we believe are particularly well suited for outside contributions, often because we probably won't get to them right now. If you decide to start on an issue, leave a comment so that other people know that you're working on it. If you want to help out, but not alone, use the issue comment thread to coordinate.

*Note:* When openning a PR make sure you open the PR against `development` and not the `master` branch.
*Note:* When opening a PR make sure you open the PR against `development` and not the `master` branch.

## Development setup

Expand All @@ -52,4 +52,4 @@ We have various commands which are helpful during development.
- Use `tox -e flake8` and `tox -e pylint` to run code linters
- Use `tox -e mypy` for type checking

Read more detailed guides on development [here](python/docs/development.md).
Read more detailed guides on development [here](python/docs/development.md).
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
我们相信基于 AI 的代理/工作流是未来。
Composio 是将 AI 代理集成到最佳代理工具并用它们完成任务的最佳工具集。

<img alt="插图" src="./docs/imgs/banner.gif" style="border-radius: 5px"/>
<img alt="插图" src="./python/docs/imgs/banner.gif" style="border-radius: 5px"/>

## 🔥 主要特性

Expand Down
2 changes: 1 addition & 1 deletion README-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
私たちはAIベースのエージェント/ワークフローが未来であると信じています。
Composioは、AIエージェントを最高のエージェントツールに統合し、それらを使用してタスクを完了するための最良のツールセットです。

<img alt="イラスト" src="./docs/imgs/banner.gif" style="border-radius: 5px"/>
<img alt="イラスト" src="./python/docs/imgs/banner.gif" style="border-radius: 5px"/>

## 🔥 主要機能

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
We believe AI Based Agents/Workflows are the future.
Composio is the best toolset to integrate AI Agents to best Agentic Tools and use them to accomplish tasks.

<img alt="Illustration" src="./docs/imgs/banner.gif" style="border-radius: 5px"/>
<img alt="Illustration" src="./python/docs/imgs/banner.gif" style="border-radius: 5px"/>

## 🔥 Key Features

Expand All @@ -117,7 +117,7 @@ Composio is the best toolset to integrate AI Agents to best Agentic Tools and us
- **SWE**: Ngrok, Database, Redis, Vercel, Git, etc.
- **RAG**: Agentic RAG for any type of data on the fly!

- **Frameworks**: Use tools with agent frameworks like **OpenAI, Claude, LlamaIndex, Langchain, CrewAI, Autogen, Gemini, Julep, Lyzr**, and more in a single line of code.
- **Frameworks**: Use tools with agent frameworks like **OpenAI, Groq (OpenAI compatible), Claude, LlamaIndex, Langchain, CrewAI, Autogen, Gemini, Julep, Lyzr**, and more in a single line of code.
- **Managed Authorisation**: Supports six different auth protocols. _Access Token, Refresh token, OAuth, API Keys, JWT, and more_ abstracted out so you can focus on the building agents.
- **Accuracy**: Get _up to 40% better agentic accuracy_ in your tool calls due to better tool designs.
- **Embeddable**: Whitelabel in the backend of your applications managing Auth & Integrations for all your users & agents and maintain a consistent experience.
Expand Down
24 changes: 22 additions & 2 deletions docs/faq/integrations_and_connections/connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ composio connections
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const connectedAccounts = await client.connectedAccounts.list();

console.log(connectedAccounts)
```
</Tab>
<Tab title="API">
Coming Soon!
Expand Down Expand Up @@ -63,7 +73,17 @@ composio connections get 123
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const connectedAccount = await connectedAccounts.get({ connectedAccountId: `123` });

console.log(connectedAccount)
```
</Tab>
<Tab title="API">
Coming Soon!
Expand Down
35 changes: 25 additions & 10 deletions docs/faq/integrations_and_connections/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ composio integrations
</CodeGroup>
</Tab>
<Tab title="JS">
```javascript List all integrations via JS
import { OpenAIToolSet } from "composio-core";
```javascript javascript
import { Composio } from "composio-core";

const toolset = new OpenAIToolSet({
apiKey: COMPOSIO_API_KEY
});
const client = new Composio(
process.env.COMPOSIO_API_KEY
);

async function listIntegrations() {
const res = await toolset.client.integrations.list();
console.log(res);
}
const integrations = await client.integrations.list();

listIntegrations();
console.log(integrations)
```
</Tab>
<Tab title="API">
Coming Soon!
</Tab>
</Tabs>

This command will display a comprehensive list of all connections, providing an overview of the various users linked to your account.
Expand Down Expand Up @@ -71,6 +71,21 @@ composio integrations get 123
</CodeGroup>
</Tab>
<Tab title="JS">
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const integration = await integrations.get({
integrationId: "123",
});

console.log(integration)
```
</Tab>
<Tab title="API">
Coming Soon!
</Tab>
</Tabs>
36 changes: 33 additions & 3 deletions docs/patterns/howtos/listing-connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,30 @@ composio connections
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const connectedAccounts = await client.connectedAccounts.list();

console.log(connectedAccounts)
```
</Tab>
<Tab title="API">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const connectedAccounts = await client.connectedAccounts.list();

console.log(connectedAccounts)
```
</Tab>
</Tabs>

Expand Down Expand Up @@ -63,7 +83,17 @@ composio connections get 123
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const connectedAccount = await connectedAccounts.get({ connectedAccountId: `123` });

console.log(connectedAccount)
```
</Tab>
<Tab title="API">
Coming Soon!
Expand Down
26 changes: 24 additions & 2 deletions docs/patterns/howtos/listing-integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ composio integrations
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const integrations = await client.integrations.list();

console.log(integrations)
```
</Tab>
<Tab title="API">
Coming Soon!
Expand Down Expand Up @@ -61,7 +71,19 @@ composio integrations get 123
</CodeGroup>
</Tab>
<Tab title="JS">
Coming Soon!
```javascript javascript
import { Composio } from "composio-core";

const client = new Composio(
process.env.COMPOSIO_API_KEY
);

const integration = await client.integrations.get({
integrationId: "123",
});

console.log(integration)
```
</Tab>
<Tab title="API">
Coming Soon!
Expand Down
57 changes: 57 additions & 0 deletions js/examples/e2e/demo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

import { Composio } from "composio-core";

const composio = new Composio(process.env.COMPOSIO_API_KEY)

// Get this integrationId from
// app.composio.dev/app/gmail -> setup gmail integration ->
// Toggle off "use composio app for authentication" -> Click on Save
const gmailIntegrationId = "662a2010-f980-46f4-a4c4-6c2c8efa0769";

async function setupUserConnectionIfNotExists(entityId) {
const entity = await composio.getEntity(entityId);
const integration = await entity.integrations.get({
integrationId: gmailIntegrationId
});
const connections = await composio.connectedAccounts.list({
integrationId: gmailIntegrationId,
status: "ACTIVE"
})
const connection = connections.items[0];
if(!connection) {
const connectionRequest = await entity.initiateConnection(
"gmail",
undefined,
undefined,
undefined,
gmailIntegrationId
);

// For GMAIL, Bearer token auth mode - specify the token in the fieldInputs
await connectionRequest.saveUserAccessData({
fieldInputs: {
"token": "<Specify the token here>"
}
});

return connectionRequest.waitUntilActive(10);
}
return connection;
}

(async() => {
const entity = composio.getEntity("utkarsh");
const connection = await setupUserConnectionIfNotExists(entity.id);

const gmailIntegration = await entity.integrations.get({
integrationId: gmailIntegrationId
});

const gmailAction = await composio.actions.get({
actionName: "gmail_list_threads"
});
console.log("Connection", connection);
const result = await connection.execute(gmailAction.name, {}, "Hello world");
console.log("Result", result);
})();

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "composio-core",
"version": "0.1.18.2",
"version": "0.1.2",
"description": "",
"main": "lib/src/index.js",
"scripts": {
Expand Down
Loading

0 comments on commit eea04de

Please sign in to comment.