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/configurable api base #1760

Merged
merged 7 commits into from
Jan 7, 2025
Merged

Conversation

emrgnt-cmplxty
Copy link
Contributor

@emrgnt-cmplxty emrgnt-cmplxty commented Jan 6, 2025

Important

This pull request adds API key management, enhances document handling, and improves configuration management across the system.

  • API Key Management:
    • Added ApiKey and ApiKeyNoPriv interfaces in types.ts.
    • Introduced WrappedAPIKeyResponse and WrappedAPIKeysResponse.
    • Added createApiKey, listApiKeys, and deleteApiKey methods in UsersClient.
  • Document Handling:
    • Updated create_document in documents_router.py to check file size against user-specific limits using get_max_upload_size_by_type.
    • Added logic to handle document ingestion with orchestration and without orchestration.
    • Implemented export functionalities for documents and entities in documents_router.py.
  • Configuration and Environment:
    • Modified initialize_client in command_group.py to set API base URL from environment variables or config.
    • Added set-api-base command in main.py to store API base URL locally.
  • Miscellaneous:
    • Removed --no-dev flag from Dockerfile for production builds.
    • Added token counting functions in retrieval_service.py for message processing.
    • Updated generate_api_key in nacl.py to use a new prefix for key IDs.

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

@emrgnt-cmplxty emrgnt-cmplxty marked this pull request as ready for review January 7, 2025 00:56
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.

👍 Looks good to me! Reviewed everything up to 1689f20 in 1 minute and 38 seconds

More details
  • Looked at 587 lines of code in 13 files
  • Skipped 2 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. py/sdk/async_client.py:126
  • Draft comment:
    The set_base_url method allows setting a custom base URL for the API, enhancing flexibility.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The set_base_url method is added to the R2RAsyncClient class, which allows setting a custom base URL for the API. This is a useful addition for flexibility in API endpoint configuration.
2. py/core/providers/crypto/nacl.py:95
  • Draft comment:
    The generate_api_key method uses pk_ and sk_ prefixes for key_id and raw_api_key, respectively, ensuring clear differentiation between public and secret keys.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The generate_api_key method in NaClCryptoProvider uses a prefix pk_ for key_id and sk_ for raw_api_key. This is a clear and consistent way to differentiate between public and secret keys.
3. py/core/main/services/management_service.py:843
  • Draft comment:
    The methods get_user_max_documents, get_user_max_chunks, and get_user_max_collections check for user-specific overrides before using default values, providing flexibility in user-specific configurations.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The get_user_max_documents, get_user_max_chunks, and get_user_max_collections methods in ManagementService check for user-specific overrides before falling back to default values. This provides flexibility in user-specific configurations.
4. py/core/main/services/management_service.py:871
  • Draft comment:
    The get_max_upload_size_by_type method checks for user-specific overrides for file upload sizes, providing flexibility and control over user-specific configurations.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The get_max_upload_size_by_type method in ManagementService checks for user-specific overrides for file upload sizes, providing flexibility and control over user-specific configurations.
5. js/sdk/src/v3/clients/users.ts:470
  • Draft comment:
    The createApiKey, listApiKeys, and deleteApiKey methods provide a clear interface for managing API keys, ensuring that only authorized users can perform these actions.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The createApiKey, listApiKeys, and deleteApiKey methods in UsersClient provide a clear interface for managing API keys, ensuring that only authorized users can perform these actions.

Workflow ID: wflow_MR7hylxBRlek98Sa


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@emrgnt-cmplxty emrgnt-cmplxty merged commit 4763c32 into main Jan 7, 2025
3 of 4 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.

👍 Looks good to me! Incremental review on 426cb90 in 59 seconds

More details
  • Looked at 301 lines of code in 14 files
  • Skipped 1 files when reviewing.
  • Skipped posting 7 drafted comments based on config settings.
1. py/tests/rateLimit.bash:7
  • Draft comment:
    The change from HTTP 429 to HTTP 503 for rate limiting might not be appropriate. HTTP 429 is typically used for rate limiting, while HTTP 503 indicates server overload or maintenance. Ensure this change aligns with the server's intended behavior.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. py/cli/commands/config.py:74
  • Draft comment:
    The default base URL has been changed from https://api.cloud.sciphi.ai to http://localhost:7272. Ensure this change is intentional and documented, as it affects the default configuration for users.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. py/core/base/providers/embedding.py:33
  • Draft comment:
    The max_retries for embedding requests has been reduced from 8 to 3. Ensure this change aligns with the desired reliability and robustness of the system.
  • Reason this comment was not posted:
    Comment did not seem useful.
4. py/core/base/providers/llm.py:26
  • Draft comment:
    The max_retries for LLM requests has been reduced from 8 to 3. Ensure this change aligns with the desired reliability and robustness of the system.
  • Reason this comment was not posted:
    Marked as duplicate.
5. js/sdk/src/baseClient.ts:157
  • Draft comment:
    The response type handling has been changed from arraybuffer to blob. Ensure this change aligns with the intended data processing and does not introduce any issues.
  • Reason this comment was not posted:
    Comment did not seem useful.
6. py/sdk/async_client.py:32
  • Draft comment:
    The default API version has been changed from v2 to v3. Ensure this change is compatible with the API endpoints and does not introduce any issues.
  • Reason this comment was not posted:
    Comment did not seem useful.
7. py/sdk/base/base_client.py:39
  • Draft comment:
    The default API version has been changed from v2 to v3. Ensure this change is compatible with the API endpoints and does not introduce any issues.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_HyVnBACFZyHroWrC


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on d2338aa in 48 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_kfZ8k20LRrQL3tC6


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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