mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-08 12:31:49 +00:00
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>
This commit is contained in:
parent
922693caba
commit
e3abe12243
@ -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…
Reference in New Issue
Block a user