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

Refactor token handling and update headers #787

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Oct 19, 2024

This pull request refactors the token handling mechanism and updates the HTTP headers used in API requests. It removes the deprecated curlHeaders property and replaces it with more standardized header names, ensuring consistency across the codebase. Additionally, it introduces new constants for Azure AI inference, enhancing the overall structure and maintainability of the token management logic. This update aims to improve the clarity and functionality of the API interactions.


Pull Request Description

Summary of Changes:

  • 🔄 Refactored Token Handling:

    • Updated token creation to accept scopes as a parameter, enhancing flexibility.
    • Introduced separate handling for Azure OpenAI and Azure AI Inference tokens.
  • 🛠️ Enhanced Azure Token Management:

    • Added support for Azure Serverless model provider.
    • Implemented checks and logging for token expiration, improving reliability.
  • 🚀 Improved API Integration:

    • Adjusted API headers for consistency with standard naming conventions.
    • Removed redundant curlHeaders configurations for cleaner code.
  • 🧹 Code Cleanup:

    • Removed unused imports and variables to streamline the codebase.
    • Simplified logic in token parsing functions for better maintainability.
  • 📦 Constants Update:

    • Added new constants for Azure AI Inference versioning and scopes.
    • Unified token expiration constants for consistency.

These changes aim to improve the robustness and maintainability of the Azure token management and API integration processes.

generated by prd

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