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.