Commit Graph

145 Commits

Author SHA1 Message Date
Kyle Mistele 825e47ee1a fix: types for API keys (#2077) 2025-03-21 12:43:04 -07:00
Kyle Mistele 6ba47b15f2 chore: bump patch level 2025-03-20 21:38:44 -05:00
Kyle Mistele a6eca2ebef feat: add ability to set API Key for client auth 2025-03-20 21:23:37 -05:00
Kyle Mistele 0706b05d20 add setApiKey method to base client 2025-03-20 21:23:37 -05:00
emrgnt-cmplxty 188eb8f7a5 improve default conversation name generation scenarios 2025-03-20 00:40:16 -07:00
Nolan Tremelling 79e9a33db7 Append and Replace Document Metadata (#2054)
* Append and Replace Document Metadata

* X-code examples

* Fix docstring
2025-03-18 16:26:34 -07:00
Nolan Tremelling 4c0e077098 Remove Posthog, disable rate limit test (#2052)
* Remove Posthog, disable rate limit test

* Fix errors
2025-03-17 23:31:33 -07:00
NolanTrem 0fd91eb154 Variable names mismatched 2025-03-14 23:33:37 -07:00
NolanTrem cd706f34c0 Some cleanup 2025-03-14 21:17:28 -07:00
emrgnt-cmplxty ddeec0f36e roll back async change 2025-03-14 16:44:07 -07:00
emrgnt-cmplxty 11d1c09e34 change api base 2025-03-14 16:04:01 -07:00
emrgnt-cmplxty f516f9c699 polish merge diffs 2025-03-14 14:41:36 -07:00
emrgnt-cmplxty 318e30eb46 rm compose 2025-03-14 13:02:04 -07:00
emrgnt-cmplxty 6dfa64d4ad up 2025-03-14 12:48:50 -07:00
emrgnt-cmplxty cea9f2f7c9 up 2025-03-14 12:02:11 -07:00
Nolan Tremelling 31be771f8f Fix Boolean Options in JS SDK (#2043)
* Fix JS Boolean Logic Bugs

* Fix JS Boolean Logic Bugs
2025-03-14 10:48:49 -07:00
Nolan Tremelling ed55e3f6e4 Fix use_extended_prompt on sync client (#2031) 2025-03-06 10:28:39 -08:00
Nolan Tremelling f2bd15f682 Fix JS Message type (#2025)
* Fix JS Message type

* Bump package
2025-03-05 17:43:48 -08:00
Nolan Tremelling d010711a36 Fix JS WrappedTokenResponse type (#1997)
* Fix JS WrappedTokenResponse type

* Fix JS WrappedTokenResponse type

* Remove ts-ignore
2025-02-21 20:05:12 -08:00
NolanTrem 8ee2557e0c Hotfix: pypi build and js package 2025-02-20 18:42:30 -08:00
emrgnt-cmplxty df193bf24c up 2025-02-19 20:32:05 -08:00
emrgnt-cmplxty f41cef2d46 update serve 2025-02-19 18:41:44 -08:00
Diego Gil 943aef72ff fix document creation providing collection_ids in js sdk (#1989) 2025-02-19 14:29:07 -08:00
emrgnt-cmplxty a3714295f9 add uniq check and get collection by name 2025-02-10 22:51:07 -08:00
Nolan Tremelling 9062135d12 Fix 'fast' ingestion, type errors (#1957)
* Clean up type errors

* Fix fast ingestion
2025-02-10 19:53:30 -08:00
emrgnt-cmplxty 4ad0abd9bf fix js reasoning agent name 2025-02-10 11:22:22 -08:00
emrgnt-cmplxty 1eaf85c384 up 2025-02-08 09:42:27 -08:00
emrgnt-cmplxty 9484500430 add compose files 2025-02-08 08:36:27 -08:00
emrgnt-cmplxty 50505c8ade up 2025-02-07 21:31:10 -08:00
emrgnt-cmplxty aaaeac11cc merge 2025-02-07 18:41:39 -08:00
Nolan Tremelling 5abf1b096c Move Python SDK to Objects (#1939) 2025-02-06 17:37:59 -08:00
emrgnt-cmplxty e5b54733f9 up 2025-02-05 19:21:25 -06:00
emrgnt-cmplxty 53953c8322 bump js pkg 2025-01-31 15:06:41 -08:00
emrgnt-cmplxty 6f8830a3f3 add deepseek example paper 2025-01-31 15:04:17 -08:00
emrgnt-cmplxty 28c441c95c extending reasoning models 2025-01-31 12:30:27 -08:00
emrgnt-cmplxty f2a6bbe4c8 up 2025-01-30 18:27:00 -08:00
emrgnt-cmplxty e84804a443 up 2025-01-30 18:26:14 -08:00
emrgnt-cmplxty 1c3392012a merge w/ main 2025-01-30 14:42:07 -08:00
emrgnt-cmplxty fbcc97a330 add reasoning agent breakout 2025-01-30 14:39:09 -08:00
Nolan Tremelling 2a0fd93d7e Add useExtendedPrompt agent param to JS SDK (#1907) 2025-01-30 11:22:34 -08:00
Cristian Cezar Moisés 47ff83f135 Some improvements (#1882)
* Update main.py

* Update main.py

Type Annotations and Descriptions: Added Field descriptions for better API documentation and validation.
Improved Logging: Enhanced logging to include more context and error tracebacks for easier debugging.
Input Validation: Used List from typing to enforce type checking and improve clarity.
Response Model: Ensured the response model is clearly defined with descriptions.
Exception Handling: Enhanced error handling to log the stack trace.
Code Formatting and Comments: Improved overall code formatting and added comments for clarity.

This revised version provides better maintainability and clarity for users of the API.

* Update collections.py

Utility Function: Introduced execute_collection_command to handle API calls, reducing code repetition and improving readability.
Type Hints: Added type hints for function arguments and return types, enhancing code clarity and allowing for better static analysis.
Error Messages: Improved error messages to specify the type of exception encountered, which can be useful for debugging.
Documentation: Updated docstrings for more clarity on what each command does.
Optional Parameters: Set default values for optional parameters in type hints.

This structure makes the code easier to maintain and understand while providing a clearer interface for handling API interactions.

* Update config.py

Type Hints: Added type hints to functions for better clarity and type checking.
Improved Docstrings: Enhanced the docstrings for clarity on what each method does.
Code Structure: Improved the organization of the code, particularly in the view function, to enhance readability.
Use of Constants: Used constants for repeated strings to avoid hardcoding, allowing easier adjustments in the future.
Console Output: Kept feedback messages concise and clear for better user experience.

* Update conversations.py

Error Messages: Improved the clarity and specificity of error messages to indicate which operation failed and with which ID.
Default Values: Clarified the purpose of the offset and limit options in the list and list_users commands.
Response Handling: Used response.get("results", []) to safely handle cases where the response may not contain the expected "results" key.
Consistent Formatting: Ensured consistent formatting in echo messages across different commands.
Improved Documentation: Enhanced the command descriptions for better understanding of their functionality.

These enhancements should improve the usability and maintainability of the CLI.

* Update database.py

Function check_connection_and_run: This function encapsulates the logic for checking the database connection and running the Alembic command, reducing duplication across your command functions.
Improved Exit Handling: All commands now return their results to handle exit codes more consistently.
Type Annotations: Each async command function is annotated with types for clarity.
User Prompts: The confirmation prompt for downgrades is improved to inform the user of the consequences of their action.

This refactored code should be cleaner, easier to maintain, and more user-friendly.

* Update documents.py

Modularization: Created helper functions like create_document_table, create_metadata_table, create_chunk_table, and create_collection_table to reduce code duplication and improve readability.
Error Handling: Enhanced error messages for better visibility and understanding of errors.
Use of Context Managers: Use of with statements for file handling, ensuring that files are properly closed.
Type Annotations: Ensured type annotations are consistent throughout the code, improving code clarity.
General Cleanup: Improved formatting, added comments for clarity, and ensured consistent usage of string formatting.

* Update graphs.py

Helper Functions: Added handle_response and handle_error functions to reduce code duplication and improve readability.
Consistent Success Messages: Each command now has a consistent success message upon successful execution.
Improved Error Handling: Centralized error handling simplifies the main command logic and enhances readability.
Comments: Added comments to provide context for the structure and purpose of functions.

* Update indices.py

Improved Error Messages: Specific prefixes for R2R errors help in distinguishing them from unexpected errors.
Check for Empty Results: Added a check in the list command to inform the user if no indices are found.
Type Annotations: Added type annotations for method parameters to improve readability and help with type checking.
Functionality in Delete Command: It seems your delete command was incorrectly retrieving instead of deleting. This has been corrected assuming a delete method exists in the client.indices object.
User Feedback: Added a success message for the delete operation to inform the user that the operation was completed successfully.

With these enhancements, the code is not only cleaner but also user-friendly, providing better feedback and handling various scenarios more gracefully.

* Update prompts.py

Logging: Added logging to track the flow of commands and errors. This can help in debugging and maintaining the code.
Type Hints: Added type hints for function parameters and return types for better clarity and tooling support.
Default Values and Help Text: Added help text for options in the retrieve command to provide more context to the user.
Use of get Method: Used .get() to handle potential KeyError when accessing the results key in the response dictionary in the list command.
Error Messages: Simplified the error messages for consistency and clarity.

These improvements should make the code more maintainable, user-friendly, and easier to debug.

* Update retrieval.py

Readability: Improved formatting and added comments for clarity.
Consistency: Maintained consistent naming conventions and structure across both command functions.
Error Handling: Improved error messages for better clarity.
Documentation: Enhanced docstrings for commands and parameters to provide better context.
Code Duplication: Reduced redundancy in the handling of search settings between the search and rag commands.

* Update system.py

Type Hints: Added type hints to function signatures for clarity.
Improved Error Messages: Enhanced error messages to be more descriptive, indicating the operation that failed.
Code Organization: Organized imports and structured the code for readability.
Consolidated Logic: Simplified condition checks where possible.
Consistent Logging: Ensured consistent logging of messages to assist with debugging and user feedback.
Function Documentation: Kept docstrings consistent and informative for each function.

* Update users.py

Improved Error Messages: Each command now provides more context in error messages, indicating which operation failed and why.
Use of get Method: When accessing dictionary keys (like response["results"]), switched to using .get() to avoid potential KeyError.
Documentation: Enhanced docstrings for each command to provide clearer explanations.
Type Hinting: Ensured all parameters have clear type hints for better readability and maintainability.
Code Consistency: Maintained consistent formatting and structure throughout the code for readability.
UUID Handling: The UUID conversion is done in a more concise way.
Default Values: Clearly stated default values in the help message for options.

* Bump nanoid in /js/sdk in the npm_and_yarn group across 1 directory

Bumps the npm_and_yarn group with 1 update in the /js/sdk directory: [nanoid](https://github.com/ai/nanoid).


Updates `nanoid` from 3.3.7 to 3.3.8
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump python-multipart in /py in the pip group across 1 directory

Bumps the pip group with 1 update in the /py directory: [python-multipart](https://github.com/Kludex/python-multipart).


Updates `python-multipart` from 0.0.9 to 0.0.18
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.9...0.0.18)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump gunicorn in /py in the pip group across 1 directory

Bumps the pip group with 1 update in the /py directory: [gunicorn](https://github.com/benoitc/gunicorn).


Updates `gunicorn` from 21.2.0 to 22.0.0
- [Release notes](https://github.com/benoitc/gunicorn/releases)
- [Commits](https://github.com/benoitc/gunicorn/compare/21.2.0...22.0.0)

---
updated-dependencies:
- dependency-name: gunicorn
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

* Pre-commit

* Remove venv directory from tracking

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nolan Tremelling <34580718+NolanTrem@users.noreply.github.com>
2025-01-29 16:49:24 -08:00
Nolan Tremelling bfa923d2cd Add API key support to JS SDK, modify hello_r2r.js to use this (#1896)
* Add API key support to JS SDK, modify hello_r2r.js to use this

* Remove posthog
2025-01-29 15:51:14 -08:00
NolanTrem 7f4c4ae47c Don't fail when naming conversation doesn't work 2025-01-23 16:56:29 -08:00
Nolan Tremelling 8e3cfbdd33 Improve error handling around invalid JSON files (#1873) 2025-01-23 13:45:49 -08:00
emrgnt-cmplxty 62bf79c477 bump pkg and toml 2025-01-22 14:40:29 -08:00
emrgnt-cmplxty 50d19672f6 up 2025-01-21 21:20:08 -08:00
Nolan Tremelling bf369039a7 Escape backslashes while generating document ID (#1846) 2025-01-20 15:11:19 -08:00
Nolan Tremelling 3f27fee835 Reintroduce contextual enrichment (#1832)
* Reintroduce contextual enrichment

* Config files
2025-01-15 17:43:21 -08:00
Nolan Tremelling 7ba5105d83 Disable automatic extraction and deduplication for local models (#1831)
* Disable automatic extraction and deduplication for local

* Bump js
2025-01-15 11:26:55 -08:00
Nolan Tremelling 5c1b4cb527 Fix document count on collections (#1827)
* Fix document count on collections

* Fix tests
2025-01-14 17:13:44 -08:00