community[patch]: helpful error message for GitHubAPIWrapper (#14803)

Very simple change in relation to the issue
https://github.com/langchain-ai/langchain/issues/14550

@baskaryan, @eyurtsev, @hwchase17.

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
pull/14881/head^2
Mohammad Mohtashim 7 months ago committed by GitHub
parent 922693caba
commit e3abe12243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,8 +76,16 @@ class GitHubAPIWrapper(BaseModel):
private_key,
)
gi = GithubIntegration(auth=auth)
installation = gi.get_installations()[0]
installation = gi.get_installations()
if not installation:
raise ValueError(
f"Please make sure to install the created github app with id "
f"{github_app_id} on the repo: {github_repository}"
"More instructions can be found at "
"https://docs.github.com/en/apps/using-"
"github-apps/installing-your-own-github-app"
)
installation = installation[0]
# create a GitHub instance:
g = installation.get_github_for_installation()
repo = g.get_repo(github_repository)

Loading…
Cancel
Save