diff --git a/docs/guides/examples/Example.mdx b/docs/examples/examples/Example.mdx
similarity index 84%
rename from docs/guides/examples/Example.mdx
rename to docs/examples/examples/Example.mdx
index 0fe2911f01a..16fb5f76048 100644
--- a/docs/guides/examples/Example.mdx
+++ b/docs/examples/examples/Example.mdx
@@ -6,10 +6,10 @@ description: "The Composio coding cookbook contain in-depth examples and code.
These examples can be used as reference to better understand the core principles and applications of composio."
---
-
+
-
+
diff --git a/docs/guides/gmail-trigger-setup.gif b/docs/examples/gmail-trigger-setup.gif
similarity index 100%
rename from docs/guides/gmail-trigger-setup.gif
rename to docs/examples/gmail-trigger-setup.gif
diff --git a/docs/guides/javascript/calendar-agent.mdx b/docs/examples/javascript/calendar-agent.mdx
similarity index 100%
rename from docs/guides/javascript/calendar-agent.mdx
rename to docs/examples/javascript/calendar-agent.mdx
diff --git a/docs/guides/javascript/code-execution-agent.mdx b/docs/examples/javascript/code-execution-agent.mdx
similarity index 100%
rename from docs/guides/javascript/code-execution-agent.mdx
rename to docs/examples/javascript/code-execution-agent.mdx
diff --git a/docs/guides/javascript/investment-analyst.mdx b/docs/examples/javascript/investment-analyst.mdx
similarity index 100%
rename from docs/guides/javascript/investment-analyst.mdx
rename to docs/examples/javascript/investment-analyst.mdx
diff --git a/docs/guides/javascript/rag_agent.mdx b/docs/examples/javascript/rag_agent.mdx
similarity index 100%
rename from docs/guides/javascript/rag_agent.mdx
rename to docs/examples/javascript/rag_agent.mdx
diff --git a/docs/guides/python/calendar-agent.mdx b/docs/examples/python/calendar-agent.mdx
similarity index 100%
rename from docs/guides/python/calendar-agent.mdx
rename to docs/examples/python/calendar-agent.mdx
diff --git a/docs/guides/python/competitor-researcher.mdx b/docs/examples/python/competitor-researcher.mdx
similarity index 100%
rename from docs/guides/python/competitor-researcher.mdx
rename to docs/examples/python/competitor-researcher.mdx
diff --git a/docs/guides/python/interpreter_agent.mdx b/docs/examples/python/interpreter_agent.mdx
similarity index 100%
rename from docs/guides/python/interpreter_agent.mdx
rename to docs/examples/python/interpreter_agent.mdx
diff --git a/docs/guides/python/investment-analyst.mdx b/docs/examples/python/investment-analyst.mdx
similarity index 100%
rename from docs/guides/python/investment-analyst.mdx
rename to docs/examples/python/investment-analyst.mdx
diff --git a/docs/guides/python/news-summary.mdx b/docs/examples/python/news-summary.mdx
similarity index 100%
rename from docs/guides/python/news-summary.mdx
rename to docs/examples/python/news-summary.mdx
diff --git a/docs/guides/python/rag_agent.mdx b/docs/examples/python/rag_agent.mdx
similarity index 100%
rename from docs/guides/python/rag_agent.mdx
rename to docs/examples/python/rag_agent.mdx
diff --git a/docs/guides/python/research-assistant.mdx b/docs/examples/python/research-assistant.mdx
similarity index 100%
rename from docs/guides/python/research-assistant.mdx
rename to docs/examples/python/research-assistant.mdx
diff --git a/docs/guides/python/sql-agent.mdx b/docs/examples/python/sql-agent.mdx
similarity index 100%
rename from docs/guides/python/sql-agent.mdx
rename to docs/examples/python/sql-agent.mdx
diff --git a/docs/introduction/foundations/basic.mdx b/docs/introduction/foundations/basic.mdx
index 61284121bd9..90858fb28af 100644
--- a/docs/introduction/foundations/basic.mdx
+++ b/docs/introduction/foundations/basic.mdx
@@ -31,12 +31,12 @@ Goal of this section is to give you a brief walkthrough of each component and ho
| Component | Description | Examples |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
-| Entity | Entity is a **catch all term for your users** which can be of type `individuals`, `teams`, `organisations`. | Melissa, Sam, ABC Corp, etc |
-| ConnectedAccounts | Connections represent **link between your app and third-party platforms accounts of your user**. | Melissa's Github account after completing auth with integration, Similarly Sam's Hubspot account. |
-| Integrations | Integrations are customisable configurations (settings) that are used while creating a new connected account. | Github Integration that that will ask Melissa for private repo permission|
-| Tools | Tools refer to the various applications or tools that can be integrated and used by your agents via Composio. | Shell manager, Hubspot, Github, Slack & many others |
-| Actions | Actions are tasks that can be performed by your agents.| Send email via Gmail, Send email via Outlook, Send email via Sendgrid, etc |
-| Triggers | Triggers are predefined conditions that, when met, initiate webhooks to your agents. | New Github Issue, New Github Pull Request, New Github Release, New Hubspot Ticket, New Hubspot Case, etc |
+| Entity | Entity represents the user and all accounts that belong to a specific user will have same entity id. [Learn More...](./components/entity/entity-guide) | Entity could be Melissa, Sam, ABC Corp, etc |
+| ConnectedAccounts | Connections represent **link between your app and third-party platforms accounts of your user**. [Learn More...](./components/entity/entity-guide) | Melissa's Github account after completing auth with integration, Similarly Sam's Hubspot account. |
+| Integrations | Integrations are customisable configurations (settings) that are used while creating a new connected account. [Learn More...](./components/integrations/integration-guide) | Github Integration that that will ask Melissa for private repo permission|
+| Tools | Tools refer to the various applications or tools that can be integrated and used by your agents via Composio. [Learn More...](./components/tools/tool-guide) | Shell manager, Hubspot, Github, Slack & many others |
+| Actions | Actions are tasks that can be performed by your agents. [Learn More...](./components/actions/action-guide) | Send email via Gmail, Send email via Outlook, Send email via Sendgrid, etc |
+| Triggers | Triggers are predefined conditions that, when met, initiate webhooks to your agents. [Learn More...](./components/triggers/trigger-guide) | New Github Issue, New Github Pull Request, New Github Release, New Hubspot Ticket, New Hubspot Case, etc |
In next few pages, we can go through each component in detail. They will explain how to use each component in the code and what the expected flow should look like.
diff --git a/docs/introduction/foundations/components/actions/action-guide.mdx b/docs/introduction/foundations/components/actions/action-guide.mdx
index bb6509576a7..499c63d9a9c 100644
--- a/docs/introduction/foundations/components/actions/action-guide.mdx
+++ b/docs/introduction/foundations/components/actions/action-guide.mdx
@@ -93,7 +93,7 @@ Check out the coding guides provided in the examples section to have a better un
tool_set = ComposioToolSet()
- tools = tool_set.getActions(actions=[Action.GITHUB_CREATE_ISSUE])
+ tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_AN_ISSUE])
print(tools)
```
@@ -130,7 +130,9 @@ Check out the coding guides provided in the examples section to have a better un
use_case="Star a repo on github"
- action_enums=toolset.find_actions_by_use_case(app=App.GITHUB, use_case=use_case)
+ # can pass multiple apps
+ action_enums=tool_set.find_actions_by_use_case(App.GITHUB,App.SLACK,use_case=use_case)
+
tools = toolset.get_actions(actions=action_enums)
# use tools as per your framework
diff --git a/docs/introduction/foundations/components/entity/entity-guide.mdx b/docs/introduction/foundations/components/entity/entity-guide.mdx
index d7a51771a01..023ea4fc83a 100644
--- a/docs/introduction/foundations/components/entity/entity-guide.mdx
+++ b/docs/introduction/foundations/components/entity/entity-guide.mdx
@@ -26,7 +26,7 @@ from composio import ComposioToolSet
toolset = ComposioToolSet(entity_id="default")
-entity = toolset.getEntity(id='default')
+entity = toolset.get_entity(id='default')
```
@@ -269,13 +269,13 @@ openai_client = OpenAI()
# can be configured to use the entity id of the user
tool_set = ComposioToolSet(entity_id="melissa")
-actions = z.get_actions(app_name = App.GITHUB)
+actions = tool_set.get_tools(apps=[App.GITHUB])
```
-```python Execute Agent
+```javascript Execute Agent
import { OpenAIToolSet } from "composio-core";
import { OpenAI } from "openai";
@@ -332,18 +332,36 @@ Now, let's call our agent for this entity to perform the task on Github on behal
```python execute agent
-const task = "Star a repo composiohq/composio on GitHub"
-const response = await openAI.chat.completions.create({
- model: "gpt-4-turbo-preview",
- tools: tools,
- messages: [
- { role: "system", content: "You are a helpful assistant." },
- { role: "user", content: task },
- ],
-});
+my_task = "Star a repo composiohq/composio on GitHub"
+
+# Setup openai assistant
+assistant_instruction = "You are a super intelligent personal assistant"
+
+assistant = openai_client.beta.assistants.create(
+ name="Personal Assistant",
+ instructions=assistant_instruction,
+ model="gpt-4-turbo-preview",
+ tools=actions, # type: ignore
+)
+
+
+# create a thread
+thread = openai_client.beta.threads.create()
+message = openai_client.beta.threads.messages.create(thread_id=thread.id,role="user",content=my_task)
+
+# Execute Agent with integrations
+run = openai_client.beta.threads.runs.create(thread_id=thread.id,assistant_id=assistant.id)
+response_after_tool_calls = tool_set.wait_and_handle_assistant_tool_calls(
+ client=openai_client,
+ run=run,
+ thread=thread,
+)
+
+print(response_after_tool_calls)
+
+
-await toolset.handle_tool_calls(response, entity.id);
```
diff --git a/docs/introduction/foundations/howtos/install.mdx b/docs/introduction/foundations/howtos/install.mdx
deleted file mode 100644
index 5c7dfdacf32..00000000000
--- a/docs/introduction/foundations/howtos/install.mdx
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: "💻 Install Composio CLI"
-sidebarTitle: "Install Composio SDK"
-icon: "terminal"
-description: "Composio SDK allows you to connect your agents with various tools and services. Install the SDK to get started."
----
diff --git a/docs/introduction/foundations/production/install.mdx b/docs/introduction/foundations/production/install.mdx
deleted file mode 100644
index 5c7dfdacf32..00000000000
--- a/docs/introduction/foundations/production/install.mdx
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: "💻 Install Composio CLI"
-sidebarTitle: "Install Composio SDK"
-icon: "terminal"
-description: "Composio SDK allows you to connect your agents with various tools and services. Install the SDK to get started."
----
diff --git a/docs/mint.json b/docs/mint.json
index 9f9627556cb..ce2d06634c8 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -33,7 +33,7 @@
"thumbsRating": true
},
"search": {
- "prompt": "Make my agents useful _/\\_ ..."
+ "prompt": "Make my agents useful ..."
},
"metadata": {
"og:image": "https://framerusercontent.com/images/YwaNXXQETYRs9LymxFCnTjp83Q.svg",
@@ -65,7 +65,7 @@
},
{
"name": "Examples",
- "url": "guides"
+ "url": "examples"
},
{
"name": "API",
@@ -84,7 +84,6 @@
"group": "Core Concepts",
"pages": [
"introduction/foundations/basic",
- "introduction/foundations/howtos/get_api_key",
"introduction/foundations/components/entity/entity-guide",
"introduction/foundations/components/integrations/integration-guide",
"introduction/foundations/components/actions/action-guide",
@@ -138,14 +137,14 @@
]
},
{
- "group": "CLI",
+ "group": "SweKit (JS)",
"pages": [
- "sdk/cli/install",
- "sdk/cli/trigger"
+ "swekit-js/introduction",
+ "swekit-js/workspace-env"
]
},
{
- "group": "SweKit",
+ "group": "SweKit (Python)",
"pages": [
"swekit/introduction",
"swekit/workspace-env",
@@ -153,14 +152,6 @@
"swekit/benchmarks"
]
},
- {
- "group": "SweKit.js",
- "pages": [
- "swekit-js/introduction",
- "swekit-js/workspace-env"
- ]
- },
-
{
"group": "Guides",
"pages": [
@@ -171,9 +162,17 @@
"patterns/functions/triggers"
]
},
+ {
+ "group": "Using CLI",
+ "pages": [
+ "patterns/cli/install",
+ "patterns/cli/trigger"
+ ]
+ },
{
"group": "How Tos",
"pages": [
+ "patterns/howtos/get_api_key",
"patterns/howtos/usecase",
"patterns/howtos/tool-finding",
"patterns/howtos/listing-connections",
@@ -191,27 +190,27 @@
{
"group": "Examples",
"pages": [
- "guides/examples/Example",
+ "examples/examples/Example",
{
"group": "Python Guides",
"pages":[
- "guides/python/investment-analyst",
- "guides/python/research-assistant",
- "guides/python/sql-agent",
- "guides/python/competitor-researcher",
- "guides/python/rag_agent",
- "guides/python/interpreter_agent",
- "guides/python/news-summary",
- "guides/python/calendar-agent"
+ "examples/python/investment-analyst",
+ "examples/python/research-assistant",
+ "examples/python/sql-agent",
+ "examples/python/competitor-researcher",
+ "examples/python/rag_agent",
+ "examples/python/interpreter_agent",
+ "examples/python/news-summary",
+ "examples/python/calendar-agent"
]
},
{
"group":"Javascript Guides",
"pages":[
- "guides/javascript/calendar-agent",
- "guides/javascript/code-execution-agent",
- "guides/javascript/rag_agent",
- "guides/javascript/investment-analyst"
+ "examples/javascript/calendar-agent",
+ "examples/javascript/code-execution-agent",
+ "examples/javascript/rag_agent",
+ "examples/javascript/investment-analyst"
]
}
]
@@ -283,6 +282,18 @@
}
},
"redirects": [
+ {
+ "source": "/introduction/foundations/howtos/get_api_key",
+ "destination": "/patterns/howtos/get_api_key"
+ },
+ {
+ "source": "/sdk/cli/trigger",
+ "destination": "/patterns/cli/trigger"
+ },
+ {
+ "source": "/guides/:slug1*",
+ "destination": "/examples/:slug1*"
+ },
{
"source": "/apps/usecases/langchain_blogs/:slug2*",
"destination": "https://composio.dev/tools/:slug2*"
diff --git a/docs/sdk/cli/install.mdx b/docs/patterns/cli/install.mdx
similarity index 100%
rename from docs/sdk/cli/install.mdx
rename to docs/patterns/cli/install.mdx
diff --git a/docs/sdk/cli/trigger.mdx b/docs/patterns/cli/trigger.mdx
similarity index 100%
rename from docs/sdk/cli/trigger.mdx
rename to docs/patterns/cli/trigger.mdx
diff --git a/docs/introduction/foundations/howtos/get_api_key.mdx b/docs/patterns/howtos/get_api_key.mdx
similarity index 100%
rename from docs/introduction/foundations/howtos/get_api_key.mdx
rename to docs/patterns/howtos/get_api_key.mdx