Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update docs #1167

Merged
merged 11 commits into from
Jan 8, 2025
34 changes: 10 additions & 24 deletions docs/faq/integrations_and_connections/list_of_tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,41 @@ sidebarTitle: "Listing Tools & Actions"
description: "This section will walk you through discovering and managing the tools, integrations, actions, and more."
---

### Listing All Tools

You can list all available applications in Composio along with their logos, descriptions, and more.


### Listing All Apps (Tools)
<CodeGroup>
```python Python Get all apps
```python Python
from composio import ComposioToolSet

toolset = ComposioToolSet()

print(toolset.get_apps()) # Get all apps
print(toolset.get_apps())
```

```javascript Javascript Get all apps
```javascript JavaScript
import { Composio } from "composio-core";

const composio = new Composio();
const apps = await composio.apps.list();
console.log(await composio.apps.list());
```

```bash CLI Get all apps
```bash CLI
composio apps
```


</CodeGroup>

### Listing all Actions

All actions supported by the Composio along with function signatures and parameter descriptions.

### Listing All Actions
<CodeGroup>
```python Python Get all actions
```python Python
from composio import Composio

client = Composio()
print(client.actions.get(limit=10)) # print all actions supported
```

```javascript Javascript Get all actions
```javascript JavaScript
import { Composio } from "composio-core";
const composio = new Composio();
const actions = await composio.actions.list({ data: { limit: 10 } });

console.log(actions); // print all actions supported
```

```bash CLI Get all actions
```bash CLI
composio actions --limit 10
```
</CodeGroup>
2 changes: 1 addition & 1 deletion docs/framework/phidata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pip install composio-phidata
<Step title="Import Libraries & Initialize ComposioToolSet & LLM">
```python Python
from phi.assistant import Assistant
from composio_phidata import Action, ComposioToolSet
from composio_phidata import Action, App, ComposioToolSet

toolset = ComposioToolSet()
```
Expand Down
29 changes: 13 additions & 16 deletions docs/introduction/intro/quickstart-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ sidebarTitle: "Quick Start - Tools"
description: "Learn how to use Tools in less than 5 minutes"
---

## Composio Quick Start
In this guide we'll use GitHub tools to star a repo on GitHub.
## Star A Repository on GitHub
In this guide, we'll:

1. 🔐 Connect your GitHub account with Composio
2. 🛠 Fetch GitHub actions
3. 🧠 Pass these actions to an LLM
4. ⭐ Instruct to star the `composiohq/composio` repository
5. ✅ Execute the action

<Tip>
**Tools** represent a group of actions specific to an app. **Actions** are operations you can perform - like starring a repo on GitHub or creating an issue in Linear.
</Tip>

<Tabs>
<Tab title="Python">
Expand All @@ -21,7 +31,7 @@ pip install composio_core composio_openai
</Step>

<Step title="Connect Your GitHub Account">
We'll use **`default`** as the user id [(entity id)](../../patterns/Auth/connected_account#entities).
We'll use **`default`** as the user id, also known as [entity id](../../patterns/Auth/connected_account#entities).
<Info>You need to have an active GitHub Integration. Learn how to do this [here](https://youtu.be/LmyWy4LiedQ?si=u5uFArlNL0tew0Wf)</Info>
<CodeGroup>
```shell CLI
Expand Down Expand Up @@ -171,19 +181,6 @@ print(result)
</Tab>
</Tabs>


## What Just Happened? 🎉

Congratulations! You've just:

1. 🔐 Connected your GitHub account with Composio
2. 🛠 Fetched GitHub actions
3. 🧠 Passed these actions to an AI language model
4. ⭐ Instructed the AI to star the `composiohq/composio` repository
5. ✅ Successfully executed the action on GitHub

<br/>

## Next Steps
Now that you've seen how to use tools, you can explore the following resources:
<CardGroup cols={2}>
Expand Down
26 changes: 13 additions & 13 deletions docs/introduction/intro/quickstart-triggers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ sidebarTitle: "Quick Start - Triggers"
description: "Learn how to use Triggers in less than 5 minutes"
---

## Composio Quick Start
In this guide we'll configure and enable a trigger to listen to new emails in Gmail & configure an agent to add important label to emails that contains details about bank transactions.
## Listen to New Emails in Gmail
In this guide, we'll:

1. 🔐 Connect your Gmail account with Composio
2. 🛠 Enable Triggers to listen to new emails in Gmail
3. 🧠 Pass these triggers event payloads to an AI language model to identify bank transactions
4. ⭐ Execute an action from Gmail tool to add **important** label to relevant emails

<Tip>
**Tools** represent a group of actions specific to an app. **Actions** are operations you can perform - like starring a repo on GitHub or creating an issue in Linear.
</Tip>

<Tabs>
<Tab title="Python">
Expand All @@ -18,7 +27,7 @@ pip install composio-core composio_openai
</Step>

<Step title="Connect Your Gmail Account">
We'll use **`Jessica`** as the user id [(entity id)](../../patterns/Auth/connected_account#entities).
We'll use **`default`** as the user id, also known as [entity id](../../patterns/Auth/connected_account#entities).
<Info>You need to have an active Gmail Integration. Learn how to do this [here](https://youtu.be/LmyWy4LiedQ?si=u5uFArlNL0tew0Wf)</Info>
<CodeGroup>
```shell CLI
Expand Down Expand Up @@ -115,7 +124,7 @@ npm install composio-core openai
</Step>

<Step title="Connect Your Gmail Account">
We'll use **`Jessica`** as the user id [(entity id)](../../patterns/Auth/connected_account#entities).
We'll use **`default`** as the user id [(entity id)](../../patterns/Auth/connected_account#entities).
<Info>You need to have an active Gmail Integration. Learn how to do this [here](https://youtu.be/LmyWy4LiedQ?si=u5uFArlNL0tew0Wf)</Info>

<CodeGroup>
Expand Down Expand Up @@ -216,16 +225,7 @@ toolset.triggers.subscribe(
</Tab>
</Tabs>

## What Just Happened? 🎉

Congratulations! You've just:

1. 🔐 Connected your Gmail account with Composio
2. 🛠 Enabled Triggers
3. 🧠 Passed these triggers event payloads to an AI language model
4. ⭐ Executed an action from Gmail tool

<br/>

## Next Steps
Now that you've seen how to use triggers, you can explore the following resources:
Expand Down
13 changes: 11 additions & 2 deletions docs/patterns/tools/build-tools/custom-action-without-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ Custom Actions are powerful building blocks that enable you to create custom fun
## Creating a Custom Tool without Authentication

<Steps>
<Step title="Import necessary modules">

<Step title="Install required libraries">
<CodeGroup>
```bash Python
pip install composio-openai openai
```
Comment on lines 11 to +18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation Improvement: The change adds a step to install required libraries, which is a beneficial addition to the documentation. However, the step title 'Import necessary modules' was removed, which might lead to confusion if the import step is still necessary. Consider re-adding or clarifying the import step if it is required.

🔧 Suggested Code Diff:
 ## Creating a Custom Tool without Authentication

 <Steps>
+<Step title="Import necessary modules">
+<CodeGroup>
+```python
+import composio_openai
+import openai
+```
+<Step title="Install required libraries">
<CodeGroup>
```bash
pip install composio-openai openai
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
## Creating a Custom Tool without Authentication
<Steps>
<Step title="Import necessary modules">
<Step title="Install required libraries">
<CodeGroup>
```bash Python
pip install composio-openai openai
```
## Creating a Custom Tool without Authentication
<Steps>
<Step title="Import necessary modules">
<CodeGroup>
```python
import composio_openai
import openai
```bash pip install composio-openai openai ``` ```

```bash JavaScript
npm install composio-core openai
```
</CodeGroup>
</Step>
<Step title="Import libraries">
<CodeGroup>
```python Python
from composio_openai import ComposioToolSet, action
Expand Down
24 changes: 23 additions & 1 deletion docs/patterns/tools/use-tools/action-guide-with-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ description: "Guide to using Tools with LLMs"

Composio enables you to integrate various tools (such as Gmail, GitHub, and Salesforce) and perform actions (such as sending emails or creating GitHub issues). Browse our complete list of supported [Tools](https://app.composio.dev/apps).

Here's how to use Tools with LLMs:
Install packages:
<CodeGroup>
```bash Python
pip install composio-openai openai
```
```bash JavaScript
npm install composio-core openai
```
</CodeGroup>

Using tools with LLMs:
<CodeGroup>
```python Python
# Import required libraries
Expand Down Expand Up @@ -73,6 +83,18 @@ This code demonstrates how to use LLMs with Composio Tools to execute actions. T

### How can I use Tools for a specific user?
You can use the `entity_id` parameter to specify the user on behalf of whom you want to execute the action. Learn more about Entities [here](/patterns/Auth/connected_account#entities).

Install packages:
<CodeGroup>
```bash Python
pip install composio-openai openai
```
```bash JavaScript
npm install composio-core openai
```
</CodeGroup>

Using tools for a specific user:
<CodeGroup>
```python Python {7}
# Import required libraries
Expand Down
11 changes: 11 additions & 0 deletions docs/patterns/tools/use-tools/action-guide-without-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ description: "Guide to use Tools directly as function calls"

Composio allows you to execute tools directly as function calls. When calling a tool directly, you'll need to provide the input parameters. Checkout [Get Action Schema](/patterns/tools/use-tools/get-action-inputs) to learn how to get the input parameters for an action.

Install packages:
<CodeGroup>
```bash Python
pip install composio-core
```
```bash JavaScript
npm install composio-core
```
</CodeGroup>

Using tools directly:
<CodeGroup>
```python Python
from composio import ComposioToolSet, Action
Expand Down
5 changes: 5 additions & 0 deletions docs/patterns/tools/use-tools/configure-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ When setting up Composio tools, you might need to provide various configuration
For example, if you're using the Image Analyzer tool, you'll need to provide an OpenAI API key. Similarly, other tools might require their own specific configuration parameters to function properly.

<Steps>
<Step title="Install required libraries">
```bash Python
pip install langchain langchain-openai composio-langchain
```
</Step>
<Step title="Import required libraries">
<CodeGroup>
```python Python
Expand Down
13 changes: 12 additions & 1 deletion docs/patterns/tools/use-tools/get-action-inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ When executing actions without agents, you'll need to provide the input paramete

<Tabs>
<Tab title="SDK">
Install packages:
<CodeGroup>
```bash Python
pip install composio-openai
```
```bash JavaScript
npm install composio-core
```
</CodeGroup>

Import libraries & get action schema:
<CodeGroup>
```python Python
from composio import ComposioToolSet, Action
Expand All @@ -27,7 +38,7 @@ action_schema = composio_toolset.get_action_schemas(actions=[Action.GITHUB_STAR_
print(json.dumps(action_schema[0].parameters.properties, indent=2))
```

```javascript Javascript
```javascript JavaScript
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in the capitalization of "JavaScript". In this file it's written as "Javascript" while in other documentation files it's written as "JavaScript". Please maintain consistency by using "JavaScript" throughout the documentation.

import { OpenAIToolSet } from "composio-core";

const composio_toolset = new OpenAIToolSet();
Expand Down
10 changes: 10 additions & 0 deletions docs/patterns/tools/use-tools/processing-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ These can be applied at two levels:
<Tabs>
<Tab title="Python">
<Steps>
<Step title="Install required libraries">
```bash Python
pip install langchain langchain-openai composio-langchain
```
</Step>
<Step title="Import required libraries">
```python Python
from langchain.agents import create_openai_functions_agent, AgentExecutor
Expand Down Expand Up @@ -101,6 +106,11 @@ agent_executor.invoke({"input": task})
</Tab>
<Tab title="TypeScript">
<Steps>
<Step title="Install required libraries">
```bash TypeScript
npm install composio-core @langchain/openai langchain @langchain/core
```
</Step>
<Step title="Import required libraries">
```typescript TypeScript
import { ActionExecutionResDto, LangchainToolSet, RawActionData, TPostProcessor, TPreProcessor, TSchemaProcessor } from "composio-core";
Expand Down
9 changes: 9 additions & 0 deletions docs/patterns/tools/use-tools/use-tools-with-your-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Composio allows you to [execute actions directly](action-guide-without-agents) u

<Tabs>
<Tab title="Python">
Install packages:
```bash
pip install composio-core
```

Use the `add_auth` method to add the existing authentication to the toolset for the app you want to use. `in_` is where you want to add the auth, `name` is the name of the header you want to add and `value` is the value of the header.
```python {7-13}
from composio import ComposioToolSet, App
Expand All @@ -34,6 +39,10 @@ toolset.execute_action(
```
</Tab>
<Tab title="JavaScript">
Install packages:
```bash
npm install composio-core
```
Here you need to pass the authentication parameters inside the `authConfig`. `in_` is where you want to add the auth, `name` is the name of the header you want to add and `value` is the value of the header.
Comment on lines 39 to 46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting Issue: The code block for installing the JavaScript package is not properly formatted. The closing backticks for the code block are missing, which can lead to rendering issues in the documentation. Additionally, ensure consistency in the formatting style across different sections of the document.

🔧 Suggested Code Diff:
 ```bash
 npm install composio-core

</details>
<!-- suggestion_start -->

<details>
<summary><strong>📝 Committable Code Suggestion</strong></summary>

> ‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation. 

```suggestion
<Tab title="JavaScript">

```bash
npm install composio-core
```

```javascript {10-14}
import { OpenAIToolSet } from "composio-core";
Expand Down
Loading
Loading