Skip to content

GithubAPIWrapper throws list index out of range error #14550

Description

System Info

Name: langchain
Version: 0.0.348

Name: PyGithub
Version: 2.1.1

Who can help?

Harrison Chase (@hwchase17)
Ankush Gola (@agola11)

Traceback (most recent call last):
  File "/Users/mac/Dev Projects/Chainlit_qa/test.py", line 12, in <module>
    github = GitHubAPIWrapper(
             ^^^^^^^^^^^^^^^^^
  File "/Users/mac/Dev Projects/Chainlit_qa/myenv/lib/python3.11/site-packages/pydantic/v1/main.py", line 339, in __init__
    values, fields_set, validation_error = validate_model(__pydantic_self__.__class__, data)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mac/Dev Projects/Chainlit_qa/myenv/lib/python3.11/site-packages/pydantic/v1/main.py", line 1102, in validate_model
    values = validator(cls_, values)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mac/Dev Projects/Chainlit_qa/myenv/lib/python3.11/site-packages/langchain/utilities/github.py", line 69, in validate_environment
    installation = gi.get_installations()[0]
                   ~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/Users/mac/Dev Projects/Chainlit_qa/myenv/lib/python3.11/site-packages/github/PaginatedList.py", line 62, in __getitem__
    return self.__elements[index]
           ~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of range

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

Run basic python file:

from langchain.agents.agent_toolkits.github.toolkit import GitHubToolkit
from langchain.utilities.github import GitHubAPIWrapper

github = GitHubAPIWrapper()
toolkit = GitHubToolkit.from_github_api_wrapper(github)
tools = toolkit.get_tools()

Expected behavior

Fetching github repository information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions