Enhanced error message handling in SecureCompletionClient to provide more detailed information when unexpected status codes occur. The base URL for SecureChatCompletion has been updated.
This commit introduces the security_tier parameter to all SecureChatCompletion calls, allowing users to specify security levels (standard, high, maximum). It also refactors secure memory management in SecureCompletionClient.py to use secure_bytearray instead of secure_bytes, improves memory protection by aligning addresses to page boundaries, and enhances the secure memory locking mechanism. The README.md has been updated to document the new security_tier parameter and include missing import statements.
Integrate secure memory handling in SecureCompletionClient to protect plaintext payloads from disk swapping and memory lingering. The implementation uses a secure_bytes context manager to safeguard sensitive data during encryption. Added fallback mechanism with warning when SecureMemory module is unavailable. Updated docstring to reflect the new security measure.
Added new exception classes for API error handling including APIError, AuthenticationError, InvalidRequestError, APIConnectionError, RateLimitError, and ServerError to improve error handling and debugging capabilities in the SecureCompletionClient. These changes enhance the robustness of the API client by providing specific error types for different failure scenarios.
- Added `api_key` parameter to `SecureChatCompletion` and `send_secure_request`
- Implemented Bearer token authentication in request headers
- Updated test configuration to use API key
- Fixed missing newline at end of `.gitignore`
Replaced all print statements with appropriate logging levels (info, warning, debug) to improve maintainability and allow for better log management. Added module-level logger configuration for consistent logging across the application.
Add .gitignore file with rules for Python, IDE, test files, build artifacts, virtual environments, OS generated files, editor backups, test coverage, Python tooling, Jupyter, and RSA keypairs to improve repository cleanliness and prevent unwanted files from being committed.