Skip to content

This repository demonstrates how to use Composio to integrate with GitHub API and perform actions like retrieving the authenticated user's information.

Notifications You must be signed in to change notification settings

cycle-sync-ai/composio-get-started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composio GitHub Integration Example

This repository demonstrates how to use Composio to integrate with GitHub API and perform actions like retrieving the authenticated user's information.

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn
  • OpenAI API key
  • Composio account and API key

Installation

  1. Clone this repository:
git clone https://github.com/cycle-sync-ai/composio-get-started
cd composio-get-started
npm install
  1. Create a .env file in the root directory with your API keys:
echo "OPENAI_API_KEY=your_openai_api_key_here" > .env
echo "COMPOSIO_API_KEY=your_composio_api_key_here" >> .env

Usage

This example demonstrates how to use Composio's toolsets with OpenAI to interact with GitHub. The sample code retrieves the authenticated user's GitHub username.

Run the example:

npm run dev

How It Works

The application uses Composio's OpenAIToolSet to provide GitHub integration capabilities to OpenAI models. The code:

  1. Initializes the Composio toolset
  2. Configures the OpenAI client
  3. Requests specific GitHub actions (in this case, GITHUB_GET_THE_AUTHENTICATED_USER)
  4. Sends a prompt to OpenAI with the tools attached
  5. Handles the tool call response

Documentation

For more detailed information about Composio, check out the official documentation:

Additional Resources

Author

Github Telegram Discord Email

👻 Please follow me for new updates Dev.to | Github | Github Org
😉 Please join our discord server Discord
💫 Please have an interesting relationship with me Telegram | Email

About

This repository demonstrates how to use Composio to integrate with GitHub API and perform actions like retrieving the authenticated user's information.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published