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

[Fix] Update GitHub API import and implement GitHubAPIWrapper class #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 10 additions & 1 deletion libs/langchain/langchain/utilities/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
from github.Issue import Issue


class GitHubAPIWrapper(BaseModel):
class GitHubAPIWrapper(BaseModel):
def __init__(self, github, github_repo_instance, github_repository, github_app_id, github_app_private_key, github_branch, github_base_branch):

Check failure on line 15 in libs/langchain/langchain/utilities/github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (E501)

langchain/utilities/github.py:15:89: E501 Line too long (148 > 88)

Check failure on line 15 in libs/langchain/langchain/utilities/github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (E501)

langchain/utilities/github.py:15:89: E501 Line too long (148 > 88)
"""Wrapper for GitHub API."""
self.github = github #: :meta private:
self.github_repo_instance = github_repo_instance #: :meta private:
self.github_repository = github_repository
self.github_app_id = github_app_id
self.github_app_private_key = github_app_private_key
self.github_branch = github_branch
self.github_base_branch = github_base_branch
"""Wrapper for GitHub API."""

github: Any #: :meta private:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Integration test for Github Wrapper."""
import pytest

from langchain.utilities.github import GitHubAPIWrapper
from libs.langchain.langchain.utilities.github import GitHubAPIWrapper

# Make sure you have set the following env variables:

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (I001)

tests/integration_tests/utilities/test_github.py:2:1: I001 Import block is un-sorted or un-formatted

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (I001)

tests/integration_tests/utilities/test_github.py:2:1: I001 Import block is un-sorted or un-formatted
# GITHUB_REPOSITORY
# GITHUB_BRANCH
# GITHUB_APP_ID
Expand Down
Loading