Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Header Handling for Azure-Specific Authorization (#162)
# Description This pull request fixes #161 by updating header management for Azure-specific authorization requirements in both the `lib/modelHelpers.py` and `Images/ai-images.py` files. ## Changes 1. **lib/modelHelpers.py:** - **Moved header setup:** The Authorization and Content-Type headers were moved closer to the request execution. - **Conditional logic for Azure endpoints:** For Azure endpoints, the api-key header is used instead of Authorization. Non-Azure endpoints continue using the Authorization header. 2. **Images/ai-images.py:** - **Modified header setup:** Added conditional logic to handle the api-key header for Azure and Authorization for OpenAI. ## Note While the headers have been updated for Azure compatibility, image generation will still not function with Azure, as the endpoint remains hardcoded to OpenAI. A future PR will be required to support Azure image generation. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Colton Loftus <[email protected]>
- Loading branch information