Conversation
iuliaturc
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
I left a suggestion around preventing duplication.
Additionally, could you please run these formatting commands:
isort --profile=black .
black --line-length=120 .
sage/chat.py
Outdated
|
|
||
| validator = sage_config.add_all_args(parser) | ||
| args = parser.parse_args() | ||
| print(args) |
There was a problem hiding this comment.
Nit: could you please remove the print statement?
| ) | ||
| parser.add( | ||
| "--repo-mode", | ||
| default = "remote", |
There was a problem hiding this comment.
We should also define the possible values (e.g. choices=["local", "remote"])
sage/data_manager.py
Outdated
| def from_args_localRepo(args: Dict): | ||
| """Creates a GitHubRepoManager from command-line arguments and clones the underlying repository.""" | ||
| repo_manager = GitHubRepoManager( | ||
| repo_id=args.repo_id, | ||
| commit_hash=args.commit_hash, | ||
| access_token=os.getenv("GITHUB_TOKEN"), | ||
| local_dir=args.local_dir, | ||
| inclusion_file=args.include, | ||
| exclusion_file=args.exclude, | ||
| ) | ||
| if not repo_manager.local_dir: | ||
| # Proceed if local_dir exists and is not empty | ||
| raise ValueError( | ||
| f"The given Directory is empty, please provide the correct local dir " | ||
| ) | ||
|
|
||
| return repo_manager |
There was a problem hiding this comment.
Instead of creating a new from_args_localRepo method (which introduces a lot of duplication with from_args), I would simply change the implementation of repo_manager.download() to only call git clone if the repository doesn't already exist locally.
|
I have made the required changes you mentioned, please have a look. @iuliaturc |
What does this PR do?
It enable users to chat with their Repo's instead of pulling them from Github.
To index now this is what the CLI command should look like:

and this is the chat command:

Fixes # (issue)
#103
Before submitting
to it if that's the case.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who
may be interested in your PR.