unstructured feat/enable github enterprise (v 3.10.8) connection

w46czmvw  于 2个月前  发布在  Git
关注(0)|答案(1)|浏览(35)

您的功能请求是否与问题相关?请描述。

GithubRunner 可以从 Github 中提取数据,但无法使用相同的运行器从企业帐户中提取数据。

描述您希望的解决方案

我希望使用 GithubRunner 从 Github Enterprise 帐户中提取数据。因此,为了实现这个功能,我认为 SimpleGitHubConfig 类应该有一个新参数来传递 Github Enterprise 的 base URL API,如下所示:

from unstructured.ingest.connector.git import GitAccessConfig
from unstructured.ingest.connector.github import SimpleGitHubConfig
from unstructured.ingest.interfaces import PartitionConfig, ProcessorConfig, ReadConfig
from unstructured.ingest.runner import GithubRunner

if __name__ == "__main__":
    runner = GithubRunner(
        processor_config=ProcessorConfig(
            verbose=True,
            output_dir="github-ingest-output",
            num_processes=2,
        ),
        read_config=ReadConfig(),
        partition_config=PartitionConfig(),
        connector_config=SimpleGitHubConfig(
            url="<MyOrg>/<MyInternalRepo>", branch="main", access_config=GitAccessConfig(), base_url=base_url="https://<host_of_my_github_enterprise>/api/v3"
        ),
    )
    runner.run()

描述您考虑过的替代方案

当然,源代码必须与 Github 和 Github Enterprise API 兼容,但我已经测试过了,移除第32行的条件应该是有趣的,以便允许其他 GitHub 主机。因为这样一来,我们就无法配置具有不同域名的 Github Enterprise 帐户。

附加上下文

  • 用户应该能够传递除 "github.com" 之外的其他域名。
ffvjumwh

ffvjumwh1#

感谢创建这个问题@DanielBarbosabit :)。我们正在将其作为增强功能进行跟踪,并在有带宽时更仔细地查看它。在此期间,如果您已经有了实现的想法,请随时打开一个PR,我们很乐意进行审查!

相关问题