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/actions with custom auth docs #846

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"patterns/actions/action-guide-with-agents",
"patterns/actions/action-guide-without-agents",
"patterns/actions/custom_actions",
"patterns/actions/action-guide-with-custom-auth-without-agents",
"patterns/actions/usecase",
"patterns/actions/action-guide-faqs"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Actions with Custom Authentication - With Agents"
sidebarTitle: "Actions with Custom Authentication - With Agents"
icon: "user-secret"
description: "Guide to Executing Actions with Custom Authentication With Agents"
---

Composio enables you to perform actions using Custom Authentication. For each specific tool, you can obtain the required parameters and pass your authentication headers to execute the action effectively.

This guide will demonstrate how to execute actions without relying on Agents, utilizing custom authentication methods.

<Tabs>
<Tab title="Python">
```python Python
Coming Soon
```
</Tab>
<Tab title="Javascript">
```javascript JavaScript
Coming Soon
```
</Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "Actions with Custom Authentication - Without Agents"
sidebarTitle: "Actions with Custom Authentication - Without Agents"
icon: "user-secret"
description: "Guide to Executing Actions with Custom Authentication Without Agents"
---

Composio enables you to perform actions using Custom Authentication. For each specific tool, you can obtain the required parameters and pass your authentication headers to execute the action effectively.

This guide will demonstrate how to execute actions without relying on Agents, utilizing custom authentication methods.

<Tabs>
<Tab title="Python">
```python Python
from composio import ComposioToolSet, App, Action

toolset = ComposioToolSet()
toolset.add_auth(
app=App.ASANA, # App name for the Action you want to execute
parameters=[{"in_": "header", "name": "Authorization", "value": "Bearer <TOKEN>"}], # Authentication parameters for the Action you want to execute
base_url="<BASE URL IF ANY>", # Base URL if any
body={},
)
toolset.execute_action(
Action.ASANA_ADD_A_PORTFOLIO_ITEM, # Action Id for the Action you want to execute
params={},
)
```
The above code demonstrates how you can execute an Action using your credentials for Authentication.
</Tab>
<Tab title="Javascript">
```javascript JavaScript
import { OpenAIToolSet } from "composio-core";

const toolset = new OpenAIToolSet();

const customAuthAction = await toolset.client.actions.execute({
actionName: "GITHUB_GITHUB_API_ROOT", // Action Id for the Action you want to execute
requestBody: {
appName: "github", // App name for the Action you want to execute
authConfig: {
parameters: [{ // Authentication parameters for the Action you want to execute
name: "Authorization",
in: "header",
value: `Bearer YOUR_API_KEY` // Pass your token/API Key here
}]
},
input: {} // Input parameters for the Action you want to execute
}
});
```
The above code demonstrates how you can execute an Action using your credentials for Authentication.
</Tab>
</Tabs>
Loading