Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add api key support #1735

Merged
merged 4 commits into from
Dec 28, 2024
Merged

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Dec 28, 2024

Important

Adds API key support to CLI, refactors imports, and improves error handling across multiple files.

  • API Key Support:
    • Adds initialize_client() in command_group.py to load API key from ~/.r2r/config.json.
    • Adds set-api-key and get-api commands in main.py to manage API keys.
  • Configuration:
    • Introduces load_config() and save_config() in command_group.py for handling CLI configuration.
  • Refactoring:
    • Reorders imports in command_group.py, config.py, database.py, documents.py, system.py, users.py, main.py.
    • Removes unused imports and fixes import order in several files.
  • Error Handling:
    • Improves error handling in initialize_client() and set_api_key().
  • Tests:
    • Updates CLI tests to reflect new API key functionality and refactored imports.

This description was created by Ellipsis for a653d00. It will automatically update as commits are pushed.

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review December 28, 2024 03:19
@emrgnt-cmplxty emrgnt-cmplxty merged commit 493655e into main Dec 28, 2024
14 checks passed
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to a653d00 in 1 minute and 43 seconds

More details
  • Looked at 1897 lines of code in 62 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/cli/command_group.py:144
  • Draft comment:
    The load_config function is defined but not used in the initialize_client function. Ensure that the configuration is loaded correctly to avoid potential issues.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_Eo6RxouGiJAEdYl7


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -118,11 +143,33 @@ def exit(self, code: int = 0) -> Never:
raise SystemExit(code)


def initialize_client(base_url: str) -> R2RAsyncClient:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base_url parameter is not used when initializing R2RAsyncClient. Consider passing base_url to R2RAsyncClient to ensure the client connects to the correct URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant