feat: per-request GitHubConfig repo + cookbook examples#7536
Draft
Mustafa-Esoofally wants to merge 4 commits intomainfrom
Draft
feat: per-request GitHubConfig repo + cookbook examples#7536Mustafa-Esoofally wants to merge 4 commits intomainfrom
Mustafa-Esoofally wants to merge 4 commits intomainfrom
Conversation
Make `repo` optional on `GitHubConfig` and accept it at request time on `/knowledge/remote-content`, so a single configured GitHub source (and its auth credentials) can serve multiple repositories without registering a new config per repo. - `GitHubConfig.repo` is now `Optional[str]`; `file()` and `folder()` accept a `repo` override that flows through to `GitHubContent`. - `GitHubContent` carries a new `repo` field; the loader resolves the effective repo as `content.repo or gh_config.repo` and errors clearly if neither is set. All API URLs, virtual paths, and metadata use the resolved repo. - `/knowledge/remote-content` accepts an optional `repo` form field. It is rejected for non-GitHub sources, and required when the GitHub config has no default repo. - Tests cover the optional field, the per-request override on file/folder, the endpoint override path, and the non-GitHub rejection.
- 05_github_dynamic_repo.py: demonstrates GitHubConfig without a default repo using per-request repo overrides to load files from multiple repositories through one stateless config - 06_multi_source.py: demonstrates multiple remote sources in a single Knowledge instance with two GitHub configs (public + authenticated) plus optional S3/GCS/SharePoint/Azure Blob scaffolding gated by environment variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two GitHub-related cookbook examples and exposes
GitHubConfig.repoas a per-request parameter:feat: allow GitHubConfig repo to be specified per request— lets callers pick the repo per tool invocation instead of being hard-coded.cookbook: add GitHub dynamic repo and multi-source integration examples— demonstrates the new parameter plus multi-source knowledge integration.Why
The previous API required the repo to be pinned at config time, which prevented agents from working across multiple GitHub repos within a single session.
Status: needs rebase
This branch was cut before several test files landed on
main(resolve_db_from_config, citation_suppression, components_router, workflow_custom_table_names, etc.). A direct diff againstmaincurrently appears to delete ~1100 lines of tests — those tests actually exist onmainand are missing from this branch's base. Rebase onto currentmainbefore merging to get a clean diff.Test plan
mainGitHubConfigper-request repo still pass