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>
20 changes: 18 additions & 2 deletions docs/framework/autogen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebarTitle: "Autogen"
description: "Integrate Composio with Autogen agents to let them seamlessly interact with external Apps"
---

## Star A Repository on Github
In this example, we will use Autogen Agent to star a repository on Github using Composio Tools
## Star A Repository on GitHub
In this example, we will use Autogen Agent to star a repository on GitHub using Composio Tools

<Steps>
<Step title="Install Packages">
Expand All @@ -29,6 +29,22 @@ llm_config = {
}
```
</Step>
<Step title="Connect Your GitHub Account">
<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
composio login
composio add github
```
```python Python
request = toolset.initiate_connection(app=App.GITHUB)
print(f"Open this URL to authenticate: {request.redirectUrl}")
```
</CodeGroup>
<Tip>
Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environment variables.
</Tip>
</Step>

<Step title="Define the Assistant & resigter the tools">
You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/camelai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Ensure you have the necessary packages installed and connect your GitHub account
``` bash Run command
pip install camel-ai
pip install composio-camel -U
# Connect your Github so agents can use it.
# Connect your GitHub so agents can use it.
composio add github
# Check all different apps which you can connect with
composio apps
Expand Down Expand Up @@ -107,7 +107,7 @@ Execute the following code to execute the agent, ensuring that the intended task
<CodeGroup>
```python CAMEL Agent Execution
prompt = (
"I have created a new Github Repo,"
"I have created a new GitHub Repo,"
"Please star my github repository: camel-ai/camel"
)
user_msg = BaseMessage.make_user_message(role_name="User", content=prompt)
Expand Down
29 changes: 23 additions & 6 deletions docs/framework/crewai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebarTitle: "CrewAI"
description: "Integrate Composio with CrewAI agents to let them seamlessly interact with external apps"
---

## Star A Repository on Github
In this example, we will use CrewAI Agent to star a repository on Github using Composio Tools
## Star A Repository on GitHub
In this example, we will use CrewAI Agent to star a repository on GitHub using Composio Tools

<Steps>
<Step title="Install Packages">
Expand All @@ -24,7 +24,24 @@ llm = ChatOpenAI(api_key="<your-openai-api-key>")
```
</Step>

<Step title="Get All Github Tools">
<Step title="Connect Your GitHub Account">
<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
composio login
composio add github
```
```python Python
request = toolset.initiate_connection(app=App.GITHUB)
print(f"Open this URL to authenticate: {request.redirectUrl}")
```
</CodeGroup>
<Tip>
Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environment variables.
</Tip>
</Step>

<Step title="Get All GitHub Tools">
You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)
<CodeGroup>
```python Python
Expand All @@ -36,9 +53,9 @@ tools = toolset.get_tools(apps=[App.GITHUB])
<Step title="Define the Agent, Task & Crew">
```python Python
crewai_agent = Agent(
role="Github Agent",
goal="You take action on Github using Github APIs",
backstory="You are AI agent that is responsible for taking actions on Github on behalf of users using Github APIs",
role="GitHub Agent",
goal="You take action on GitHub using GitHub APIs",
backstory="You are AI agent that is responsible for taking actions on GitHub on behalf of users using GitHub APIs",
verbose=True,
tools=tools,
llm=llm,
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/griptape.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ description: "Integrate Composio with Griptape agents to let them seamlessly int

### Install Packages & Connect a Tool

These commands prepare your environment for seamless interaction between Griptape and Github.
These commands prepare your environment for seamless interaction between Griptape and GitHub.

<CodeGroup>
``` bash Run command
pip install composio_griptape
# Connect your Github so agents can use it.
# Connect your GitHub so agents can use it.
composio add github
# Check all different apps which you can connect with
composio show-apps
Expand Down
8 changes: 4 additions & 4 deletions docs/framework/groq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ description: "Integrate Composio with Groq to seamlessly interact with external

### Install Packages & Connect a Tool

These commands prepare your environment for seamless interaction between Groq and Github.
These commands prepare your environment for seamless interaction between Groq and GitHub.

<CodeGroup>
```bash python
pip install composio-langchain
pip install langchain-groq

#Connect your Github so agents can use it
#Connect your GitHub so agents can use it
composio add github

#Check all different apps which you can connect with
Expand All @@ -29,7 +29,7 @@ These commands prepare your environment for seamless interaction between Groq an
npm install composio-core
npm install langchain

// Connect your Github so agents can use it
// Connect your GitHub so agents can use it
composio add github

// Check all different apps which you can connect with
Expand Down Expand Up @@ -75,7 +75,7 @@ These commands prepare your environment for seamless interaction between Groq an
```
</CodeGroup>
</Step>
<Step title="Fetch all Github Langchain Tools via Composio">
<Step title="Fetch all GitHub Langchain Tools via Composio">
<CodeGroup>
```python python
# Import from composio_langchain
Expand Down
27 changes: 24 additions & 3 deletions docs/framework/langchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebarTitle: "LangChain"
description: "Integrate Composio with LangChain agents to let them seamlessly interact with external apps"
---

## Star A Repository on Github
In this example, we will use LangChain Agent to star a repository on Github using Composio Tools
## Star A Repository on GitHub
In this example, we will use LangChain Agent to star a repository on GitHub using Composio Tools

<Steps>
<Step title="Install Packages">
Expand Down Expand Up @@ -41,7 +41,28 @@ const toolset = new LangchainToolSet();
</CodeGroup>
</Step>

<Step title="Get All Github Tools">
<Step title="Connect Your GitHub Account">
<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
composio login
composio add github
```
```python Python
request = composio_toolset.initiate_connection(app=App.GITHUB)
print(f"Open this URL to authenticate: {request.redirectUrl}")
```
```javascript JavaScript
const connection = await toolset.connectedAccounts.initiate({appName: "github"})
console.log(`Open this URL to authenticate: ${connection.redirectUrl}`);
```
</CodeGroup>
<Tip>
Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environment variables.
</Tip>
</Step>

<Step title="Get All GitHub Tools">
You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)
<CodeGroup>
```python Python
Expand Down
12 changes: 6 additions & 6 deletions docs/framework/langflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebarTitle: "LangFlow"
description: "Use Composio with LangFlow to create LLM agents that can interact with external apps"
---

## Star A Repository on Github
In this example, we will use LangFlow to star a repository on Github using Composio Tools
## Star A Repository on GitHub
In this example, we will use LangFlow to star a repository on GitHub using Composio Tools

<Steps>
<Step title="Add Composio Component">
Expand All @@ -14,14 +14,14 @@ Head over to the [LangFlow](https://astra.datastax.com/langflow) website, create
<img src="media/langflow/2.jpg" />
</Step>
<Step title="Configure Composio Component">
Go to your [Composio Dashboard](https://app.composio.dev/) and copy your API key, paste it in the API Key field in the Composio component and then search for Github in apps list and select it
Go to your [Composio Dashboard](https://app.composio.dev/) and copy your API key, paste it in the API Key field in the Composio component and then search for GitHub in apps list and select it
<img src="media/langflow/3.jpg" />
<img src="media/langflow/4.jpg" />
</Step>
<Step title="Authenticate with Github">
Click on refresh button, a link to authenticate with Github will be generated (if you don't have connected Github account), click on it and authenticate
<Step title="Authenticate with GitHub">
Click on refresh button, a link to authenticate with GitHub will be generated (if you don't have connected GitHub account), click on it and authenticate
<Info>
Most recent connected Github account with entity Id `default` will be considered for executing the action
Most recent connected GitHub account with entity Id `default` will be considered for executing the action
</Info>
<img src="media/langflow/5.jpg" />
<img src="media/langflow/6.jpg" />
Expand Down
56 changes: 42 additions & 14 deletions docs/framework/langgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebarTitle: "LangGraph"
description: "Integrate Composio with LangGraph agents to let them seamlessly interact with external apps"
---

## Star A Repository on Github
In this example, we will use LangGraph Agent to star a repository on Github using Composio Tools
## Star A Repository on GitHub
In this example, we will use LangGraph Agent to star a repository on GitHub using Composio Tools

<Steps>
<Step title="Install Packages">
Expand All @@ -21,8 +21,8 @@ npm i @langchain/core
```
</CodeGroup>
</Step>
<Step title="Import Libraries & Initialize ComposioToolSet & LLM">
You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)

<Step title="Import Libraries & Initialize ComposioToolSet">
<CodeGroup>
```python Python
from typing import Literal
Expand All @@ -32,14 +32,6 @@ from langgraph.prebuilt import ToolNode
from composio_langgraph import Action, ComposioToolSet, App

composio_toolset = ComposioToolSet()
tools = composio_toolset.get_tools(
apps=[App.GITHUB]
)

tool_node = ToolNode(tools)

model = ChatOpenAI(temperature=0, streaming=True)
model_with_tools = model.bind_tools(tools)
```
```typescript TypeScript
import { LangGraphToolSet } from "composio-core";
Expand All @@ -49,7 +41,43 @@ import { StateGraph, END, MessagesAnnotation, START } from "@langchain/langgraph
import { HumanMessage } from "@langchain/core/messages";

const composioToolset = new LangGraphToolSet();
```
</CodeGroup>
</Step>

<Step title="Connect Your GitHub Account">
<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
composio login
composio add github
```
```python Python
request = composio_toolset.initiate_connection(app=App.GITHUB)
print(f"Open this URL to authenticate: {request.redirectUrl}")
```
```javascript TypeScript
const connection = await composioToolset.connectedAccounts.initiate({appName: "github"})
console.log(`Open this URL to authenticate: ${connection.redirectUrl}`);
```
</CodeGroup>
<Tip>
Don't forget to set your `COMPOSIO_API_KEY` and `OPENAI_API_KEY` in your environment variables.
</Tip>
</Step>

<Step title="Get And Bind Tools">
You can get all the tools for a given app as shown below, but you can get **specific actions** and filter actions using **usecase** & **tags**. Learn more [here](../../patterns/tools/use-tools/use-specific-actions)
<CodeGroup>
```python Python
tools = composio_toolset.get_tools(
apps=[App.GITHUB]
)
tool_node = ToolNode(tools)
model = ChatOpenAI(temperature=0, streaming=True)
model_with_tools = model.bind_tools(tools)
```
```typescript TypeScript
const tools = await composioToolset.getTools({
apps: ["github"],
});
Expand Down Expand Up @@ -150,7 +178,7 @@ for chunk in app.stream(
"messages": [
(
"human",
"Star the Github Repository composiohq/composio",
"Star the GitHub Repository composiohq/composio",
)
]
},
Expand All @@ -161,7 +189,7 @@ for chunk in app.stream(
```typescript TypeScript
const stream = await app.invoke({
messages: [
new HumanMessage("Star the Github Repository composiohq/composio"),
new HumanMessage("Star the GitHub Repository composiohq/composio"),
],
});

Expand Down
Loading
Loading