Use github with Langchain Python

A platform for version control and collaboration, allowing you to work together on projects from anywhere.
🔗 Connect and Use github
1. 🔑 Connect your github account
2. ✅ Select an action
3. 🚀 Go live with the agent
What do you want to do?
Actions
meta
- GITHUB API ROOT
security-advisories
apps
classroom
codes-of-conduct
emojis
dependabot
secret-scanning
activity
gists
gitignore
issues
licenses
markdown
orgs
actions
oidc
code-scanning
codespaces
copilot
packages
interactions
migrations
projects
repos
billing
teams
reactions
rate-limit
checks
dependency-graph
git
pulls
search
users
Main

API actions for github for AI assitants/agents

Language
JS
PYTHON
Framework

Git

CREATE A BLOB

This API endpoint enables creating a new blob in a specified repository, supporting `UTF-8` and `base64` encodings. It requires blob content in the request body and returns blob details, inclu
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_BLOB])

GET A BLOB

The endpoint returns blob data, offering raw data or JSON with base64 encoded `content`. Supports files up to 100MB. More on media types at GitHub docs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_BLOB])

CREATE A COMMIT

Git commits' `verification` object confirms signature validity, detailing verification status and reason, with fields like `verified`, `reason`, `signature`, and `payload`, indicating reasons
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_COMMIT])

GET A COMMIT OBJECT

GitHub's commit object includes a `verification` object summarizing the result of the commit's signature verification, detailing if it was verified, the reason, signature, and signed value. De
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_COMMIT_OBJECT])

LIST MATCHING REFERENCES

The Git database API retrieves ref arrays for branches or tags. Without specifying `:ref`, it returns all references. Non-existent `:ref`s yield starting matches. Mergeability requires a pull
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_MATCHING_REFERENCES])

GET A REFERENCE

Fetches a Git reference using a formatted URL for branches (`heads/<branch name>`) or tags (`tags/<tag name>`). Returns a 404 if not found. For pull request mergeability, a separate request is
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_REFERENCE])

CREATE A REFERENCE

Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_REFERENCE])

UPDATE A REFERENCE

Updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_A_REFERENCE])

DELETE A REFERENCE

Deletes the provided reference.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_DELETE_A_REFERENCE])

CREATE A TAG OBJECT

Creating an annotated Git tag involves making a tag object and a `refs/tags/[tag]` reference. Lightweight tags need only the reference. The `verification` object shows if the signature is veri
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_TAG_OBJECT])

GET A TAG

The `verification` object in commit responses includes boolean `verified`, `reason` for verification status, `signature`, and `payload` signed. Reasons for `reason` field range from expired ke
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_TAG])

CREATE A TREE

The tree creation API allows for nested entries and modifying trees, where changes require committing and updating branches. Using this API can add, delete, or modify files but returns an erro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_TREE])

GET A TREE

Fetches a tree by SHA1 or ref name. If `truncated` is true, the tree exceeds limits (100,000 entries, 7 MB with `recursive`). Fetch more items by getting sub-trees non-recursively.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_TREE])

Repos

LIST REPOSITORY WEBHOOKS

Lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_REPOSITORY_WEBHOOKS])

CREATE A REPOSITORY WEBHOOK

Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can share the same `config` as long as those webhooks do not have any `events`
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_A_REPOSITORY_WEBHOOK])

GET A REPOSITORY WEBHOOK

Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuratio
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_REPOSITORY_WEBHOOK])

UPDATE A REPOSITORY WEBHOOK

Update a repository's webhook by providing the same or a new `secret`; otherwise, the `secret` is removed. For partial `config` updates, use the specific webhook configuration update guide.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_A_REPOSITORY_WEBHOOK])

DELETE A REPOSITORY WEBHOOK

To remove a repository webhook in GitHub Cloud or GitHub Apps, use the repository owner's name, the repository's name, and the webhook's ID. A 204 code confirms deletion, and a 404 code signif
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_DELETE_A_REPOSITORY_WEBHOOK])

GET A WEBHOOK CONFIGURATION FOR A REPOSITORY

This text outlines how to retrieve a repository's webhook configuration and details, specifying that OAuth app tokens and personal access tokens require `read:repo_hook` or `repo` scope for ac
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_WEBHOOK_CONFIGURATION_FOR_A_REPOSITORY])

UPDATE A WEBHOOK CONFIGURATION FOR A REPOSITORY

This text explains how to update a repository's webhook configuration, including its `active` state and `events`, by using a specific update endpoint. OAuth or classic tokens with `write:repo_
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_A_WEBHOOK_CONFIGURATION_FOR_A_REPOSITORY])

LIST DELIVERIES FOR A REPOSITORY WEBHOOK

Returns a list of webhook deliveries for a webhook configured in a repository.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_DELIVERIES_FOR_A_REPOSITORY_WEBHOOK])

GET A DELIVERY FOR A REPOSITORY WEBHOOK

Returns a delivery for a webhook configured in a repository.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_A_DELIVERY_FOR_A_REPOSITORY_WEBHOOK])

REDELIVER A DELIVERY FOR A REPOSITORY WEBHOOK

Redeliver a webhook delivery for a webhook configured in a repository.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_REDELIVER_A_DELIVERY_FOR_A_REPOSITORY_WEBHOOK])

PING A REPOSITORY WEBHOOK

This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_PING_A_REPOSITORY_WEBHOOK])

TEST THE PUSH REPOSITORY WEBHOOK

This text explains that using a specified command can trigger a hook for the latest push in a repository if it's subscribed to `push` events. Without subscription, it responds with 204, withou
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_TEST_THE_PUSH_REPOSITORY_WEBHOOK])

LIST REPOSITORY INVITATIONS

When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_REPOSITORY_INVITATIONS])

UPDATE A REPOSITORY INVITATION

Update GitHub repo invitations by specifying user permissions (read, write, admin) through the path `{owner}/{repo}/invitations/{invitation_id}`. More info on GitHub Docs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_A_REPOSITORY_INVITATION])

DELETE A REPOSITORY INVITATION

Delete a repository invitation by specifying the repo's owner, repository name, and invitation ID. For detailed API usage, visit: https://docs.github.com/rest/collaborators/invitations#delete-a-re
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_DELETE_A_REPOSITORY_INVITATION])

Migrations

GET AN IMPORT STATUS

The import endpoint will be deprecated on April 12, 2024, due to low usage. It involves steps from detecting to completion and reports issues like `auth_failed`. For alternatives, see the chan
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_AN_IMPORT_STATUS])

START AN IMPORT

Use GitHub Importer for source imports to a repository. If the repository has GitHub Actions, the import will fail with a 422 error. This feature is deprecated and will be removed on April 12,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_START_AN_IMPORT])

UPDATE AN IMPORT

API enables updating imports with credentials or project selection. Without parameters, it restarts imports. For multi-project servers, use `project_choices`. The endpoint will be deprecated a
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_AN_IMPORT])

CANCEL AN IMPORT

The import feature for repositories is deprecated due to low usage and alternatives, ceasing on April 12, 2024. More info can be found in the changelog.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CANCEL_AN_IMPORT])

GET COMMIT AUTHORS

Different source control systems have varied author identification methods, leading to inaccuracies in author mapping. GitHub Importer tries to fix this, but will be deprecated by April 12, 20
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_COMMIT_AUTHORS])

MAP A COMMIT AUTHOR

Update an author's identity in your application before pushing new commits. The endpoint will be deprecated on April 12, 2024, due to low usage. See the changelog for alternatives.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_MAP_A_COMMIT_AUTHOR])

GET LARGE FILES

This endpoint, listing files over 100MB from imports, is deprecated due to low use and alternatives. It'll be discontinued on April 12, 2024. Details at [changelog](https://gh.io/source-import
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_LARGE_FILES])

UPDATE GIT LFS PREFERENCE

Import repositories with files over 100MB from SVN, Mercurial, and TFS using Git LFS. Note: This feature will be deprecated on April 12, 2024. More details and alternatives are in the changelo
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_GIT_LFS_PREFERENCE])

Interactions

GET INTERACTION RESTRICTIONS FOR A REPOSITORY

Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_INTERACTION_RESTRICTIONS_FOR_A_REPOSITORY])

SET INTERACTION RESTRICTIONS FOR A REPOSITORY

This text outlines how to restrict interactions in a GitHub repository to specific user types. It requires owner or admin access. Setting restrictions when there's already a limit at the user/
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_SET_INTERACTION_RESTRICTIONS_FOR_A_REPOSITORY])

REMOVE INTERACTION RESTRICTIONS FOR A REPOSITORY

This text outlines the process for removing interaction restrictions from a repository, requiring owner or admin access. Attempting to change limits at the user or organization level without p
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_REMOVE_INTERACTION_RESTRICTIONS_FOR_A_REPOSITORY])

Issues

LIST REPOSITORY ISSUES

GitHub's "Issues" endpoint lists only open issues but may include pull requests, identifiable by the `pull_request` key. Use "List pull requests" for PR IDs. Supports various media types for m
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_REPOSITORY_ISSUES])

CREATE AN ISSUE

Pull access users can create issues unless disabled. API may return `410 Gone` if issues off. Excessive endpoint use can trigger rate limiting. It supports raw, text, HTML formats for return d
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_AN_ISSUE])

LIST ISSUE COMMENTS FOR A REPOSITORY

The REST API lists comments on repository issues and pull requests, treating all pull requests as issues but not vice versa. Comments are sorted by ID, with different media types available for
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_ISSUE_COMMENTS_FOR_A_REPOSITORY])

GET AN ISSUE COMMENT

The REST API allows fetching comments on issues and PRs, noting that not all issues are PRs. It supports several media types for different markdown representations: raw, text, HTML, and a full
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_GET_AN_ISSUE_COMMENT])

UPDATE AN ISSUE COMMENT

The REST API lets you update comments on issues and PRs; PRs are issues, but not all issues are PRs. It supports media types for different representations of markdown: raw, text, HTML, or all.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_UPDATE_AN_ISSUE_COMMENT])

DELETE AN ISSUE COMMENT

You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_DELETE_AN_ISSUE_COMMENT])

ISSUES LIST FOR REPO

GitHub's "Issues" endpoint lists only open issues but may include pull requests, identifiable by the `pull_request` key. Use "List pull requests" for PR IDs. Supports various media types for m
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_ISSUES_LIST_FOR_REPO])

ISSUES CREATE

Pull access users can create issues unless disabled. API may return `410 Gone` if issues off. Excessive endpoint use can trigger rate limiting. It supports raw, text, HTML formats for return d
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_ISSUES_CREATE])

Reactions

LIST REACTIONS FOR AN ISSUE COMMENT

List the reactions to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment).
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_LIST_REACTIONS_FOR_AN_ISSUE_COMMENT])

CREATE REACTION FOR AN ISSUE COMMENT

Create a reaction to an [issue comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_CREATE_REACTION_FOR_AN_ISSUE_COMMENT])

DELETE AN ISSUE COMMENT REACTION

You can delete a reaction to an issue comment by specifying `repository_id` using the route `DELETE /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.GITHUB_DELETE_AN_ISSUE_COMMENT_REACTION])

Frequently asked questions

What is Composio.dev?

Composio.dev is a cutting-edge framework for building AI applications, designed to make the process of developing AI solutions super easy and fun! It's a collection of powerful tools and libraries that simplify the process of creating AI applications, allowing you to focus on the creative aspects of your project without getting bogged down by the technical details.

How does Composio.dev support github?

Composio.dev seamlessly integrates with github, making it a breeze to leverage its capabilities within the Composio.dev platform. You can use github to call functions on various platforms like Google, GitHub, and others, allowing you to incorporate different services into your AI applications with ease. It also supports user login via OAuth2 and can work with other popular frameworks such as LangChain and CrewAI, giving you the flexibility to build truly innovative AI solutions.

What models can I use with github and langchain_python?

When using github and langchain_python, you have access to a wide range of state-of-the-art language models, including GPT-4o (OpenAI), GPT-3.5 (OpenAI), GPT-4 (OpenAI), Claude (Anthropic), PaLM (Google), LLaMA and LLaMA 2 (Meta), Gemini, and many others. This flexibility allows you to choose the model that best suits your specific use case, whether you're building a chatbot, a content creation tool, or any other AI-powered application. You can experiment with different models and find the one that delivers the best performance for your project.

How can I integrate github with langchain_python?

Integrating github with langchain_python is super easy with Composio.dev! You can use the Composio.dev API to call functions from both github and langchain_python, allowing you to tap into their capabilities with just a few lines of code. The SDK is available in Python, JavaScript, and TypeScript, so you can work with the language you're most comfortable with and integrate these powerful tools into your projects seamlessly.

What is the pricing for github and langchain_python?

Both github and langchain_python are completely free to use, with a generous free tier that allows up to 1000 requests per month. This makes them accessible for developers and organizations of all sizes, whether you're a student working on a personal project or a startup building the next big thing. You can get started with these powerful tools without worrying about breaking the bank.

What kind of authentication is supported for github and langchain_python?

github and langchain_python support OAuth2 authentication, ensuring secure and authorized access to their functionalities. You can use the Composio.dev API to handle authentication and call functions from both github and langchain_python seamlessly. The SDK is available in Python, JavaScript, and TypeScript for your convenience, making it easy to integrate authentication into your projects and keep your users' data safe and secure.

Can I add github to my project?

Absolutely! You can easily incorporate github into your project by utilizing the Composio.dev API. This API allows you to call functions from both github and langchain_python, enabling you to leverage their capabilities within your application. The SDK is available in Python, JavaScript, and TypeScript to facilitate integration, so you can work with the language you're most comfortable with and add these powerful tools to your project with ease.

What is the accuracy of github and langchain_python?

github and langchain_python are designed to provide highly accurate and reliable results, ensuring that your AI applications perform at their best. The integration with Composio.dev ensures precise function calls, enabling you to build robust and powerful AI applications with confidence. The comprehensive framework and the ability to leverage state-of-the-art models ensure reliable and accurate outcomes for your AI development needs, whether you're working on a chatbot, a content creation tool, or any other AI-powered project.

What are some common use cases for github and langchain_python?

github and langchain_python can be used for a wide range of AI applications, making them versatile tools for developers and creators alike. Some common use cases include natural language processing, text generation, question answering, sentiment analysis, and more. They're particularly useful for building chatbots, virtual assistants, content creation tools, and other AI-powered applications that can help you automate tasks, engage with users, and create compelling content. Whether you're working on a personal project or building a product for your startup, these tools can help you bring your ideas to life.

How does github handle data privacy and security?

Data privacy and security are crucial considerations when working with AI systems, and github takes these issues seriously. It follows industry best practices and adheres to strict data protection regulations, ensuring that your data is kept safe and secure. github provides robust security measures, such as encryption and access controls, to ensure the confidentiality and integrity of your data. You can rest assured that your sensitive information is protected when using github for your AI development needs.

Can I customize github and langchain_python for my specific needs?

Absolutely! github and langchain_python are highly customizable and extensible, allowing you to tailor their functionality, models, and configurations to meet your specific requirements. Whether you're building a chatbot, a content creation tool, or any other AI-powered application, you can customize these tools to fit your unique needs. Additionally, Composio.dev provides a flexible platform for integrating and orchestrating various AI tools and services, enabling you to create custom AI solutions that are tailored to your project.

What kind of support and documentation is available for github and langchain_python?

github and langchain_python have comprehensive documentation and a supportive community, making it easy for you to get started and find answers to your questions. Composio.dev also provides extensive resources, including tutorials, guides, and a dedicated support team to assist you throughout your AI development journey. Whether you're a beginner or an experienced developer, you'll have access to the resources you need to make the most of these powerful tools.
+ Integrate seamlessly with your agentic frameworks
Composio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and Sizes
Building for AI across continents🧪