Skip to content

Commit

Permalink
Fix/docs misc (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohamganatra authored Jul 31, 2024
1 parent cb8b214 commit 8b16e12
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
1 change: 1 addition & 0 deletions cookbook/js-example
1 change: 1 addition & 0 deletions cookbook/python-examples
4 changes: 4 additions & 0 deletions cookbook/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The Composio Cookbook is a collection of AI agents and workflows built using the Composio toolset. By contributing, you can showcase how you used Composio to solve real-world problems and help others learn from your examples.

## All Python Examples - [here](https://github.com/ComposioHQ/composio/tree/master/python/examples)

## All JS Examples - [here](https://github.com/ComposioHQ/composio/tree/master/js/examples)

## 📚 Contribute to the Composio Cookbook

We are excited to have you contribute to the Composio Cookbook! This is a space where you can share your AI agents and workflows built with Composio.
Expand Down
15 changes: 5 additions & 10 deletions docs/introduction/foundations/basic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: "book"
description: "Platform's core concepts and functionalities."
---

Let's get you started building with Composio! You should be familiar with core concepts of Composio Platform to best utilise it.
Let's get you started building with Composio! This section will get you familiar with Composio’s core concepts.

Goal of this section is to give you a brief walkthrough of each component and how they go together.

Expand All @@ -16,9 +16,6 @@ Goal of this section is to give you a brief walkthrough of each component and ho
<Card color="#7bee0c" title="Entity" icon="users" href="./components/entity/entity-guide">
</Card>

<Card color="#7bee0c" title="Connected Accounts" icon="plug" href="./components/integrations/connected-account">
</Card>

<Card color="#7bee0c" title="Actions" icon="wand-magic-sparkles" href="./components/actions/action-guide">
</Card>

Expand All @@ -34,16 +31,14 @@ Goal of this section is to give you a brief walkthrough of each component and ho

| Component | Description | Examples |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Integrations | Integrations are tool configurations (eg. Permissions to ask for when connecting an account, ClientID/Secret in the case of OAuth) that will be used to connect your users account to Composio. You can use your own configuration or use Composio's default integrations. | Github Integration that requires repo permission & User data (ex. 1). Linear Integration requiring API Key (2). Linear Integration using Oauth (3) |
| Entity | Entity is a catch all term for your users who can be individuals, entities, teams, organisations. Composio manages authentication at `Entity` level. | Melissa, Sam, ABC Corp, etc |
| ConnectedAccounts | Connected accounts represent connections between your app and third-party platforms. They are user-specific instances of integrations, storing credentials and specific configuration details. | Melissa's Github account after completing auth with integration, Similarly Sam's Hubspot account. |
| 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. ex. `send email via gmail` | Send email via Gmail, Send email via Outlook, Send email via Sendgrid, etc |
| 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 |


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.



If you prefer something quicker, checkout [Quickstart Guide](../intro/quickstart)
38 changes: 28 additions & 10 deletions docs/introduction/intro/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ icon: "play"
description: "Use Composio to connect OpenAI Assistant to GitHub (via OAUTH2) to perform a task using natural language"
---

## Goal: Star a repository on GitHub with natural language
## Quick Start Guide

In this quickstart, you will learn how to:

- Install Composio package
- Connect your GitHub account
- Use Composio with OpenAI to perform actions on GitHub using natural language

<Steps>

Expand Down Expand Up @@ -204,7 +210,7 @@ Replace `OPENAIKEY`.

## Step 3
from openai import OpenAI
from composio_openai import ComposioToolSet, App
from composio_openai import ComposioToolSet, App,Action

openai_client = OpenAI(api_key="******OPENAIKEY******")

Expand All @@ -219,14 +225,26 @@ actions = composio_toolset.get_actions(actions=[Action.GITHUB_STAR_A_REPOSITORY_
## Step 5
my_task = "Star a repo composiohq/composio on GitHub"

# Create a chat completion request to decide on the action
response = openai_client.chat.completions.create(
model="gpt-4-turbo",
tools=actions, # Passing actions we fetched earlier.
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": my_task}
]
# 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
)


Expand Down
5 changes: 4 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
{
"group": "Core Concepts",
"pages": [
"introduction/foundations/howtos/get_api_key",
"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",
Expand Down Expand Up @@ -271,6 +271,9 @@
},
"posthog": {
"apiKey": "phc_Gz8DBv1ZMbOwt3hE8sJZwKGsDl5FtMSkvBNSR0HC07c"
},
"plausible": {
"domain": "composio.dev"
}
},
"api": {
Expand Down

0 comments on commit 8b16e12

Please sign in to comment.