这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: implement comprehensive Azure OpenAI API integration #184

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

harshith-eth
Copy link

Azure OpenAI Integration

Overview

This PR adds complete Azure OpenAI API support to Scira, allowing users to leverage their
Azure OpenAI deployments alongside existing models. The integration is designed to be
seamless for users with proper Azure credentials while maintaining backward compatibility.

Implementation Details

Environment Configuration

  • Added Azure OpenAI environment variables to enable proper authentication and deployment
    selection:
    • AZURE_OPENAI_API_KEY - For Azure-specific authentication
    • AZURE_OPENAI_ENDPOINT - For Azure OpenAI service URL
    • AZURE_OPENAI_API_VERSION - Defaults to '2024-10-01-preview'
    • AZURE_OPENAI_DEPLOYMENT_PREFIX - Optional prefix for deployment naming

Provider Integration

  • Integrated the Azure OpenAI provider from @ai-sdk/azure
  • Configured provider with proper authentication handling
  • Added support for various Azure deployment models:
    • GPT-3.5 Turbo
    • GPT-4
    • GPT-4 Vision
    • GPT-4o

UI Enhancements

  • Created a dedicated 'Azure' category in the model selection dropdown
  • Added a distinctive blue cloud icon to visually identify Azure models
  • Maintained consistent styling with the existing model selection UI
  • Preserved authentication and subscription requirement indicators

API Configuration

  • Added Azure-specific provider options in the search API route
  • Configured optimal parameters for Azure models
  • Enabled proper parallel tool calls and schema validation

Setup Instructions

To use Azure OpenAI models, users will need to:

  1. Install the Azure SDK: npm install @ai-sdk/azure
  2. Configure their environment variables in .env:
    AZURE_OPENAI_API_KEY=your_api_key
    AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com
    AZURE_OPENAI_API_VERSION=2024-10-01-preview # Optional, defaults to this value
  3. Deploy models in their Azure OpenAI service using names that match the configuration

Testing

Testing was performed by:

  • Validating proper Azure provider initialization
  • Confirming Azure models appear correctly in the UI
  • Verifying proper API parameter handling

Future Improvements

  • Add automatic Azure deployment discovery
  • Implement Azure token-based authentication
  • Add support for Azure-specific features like RBAC

This commit adds full Azure OpenAI support to Scira with the following enhancements:

Environment Configuration:
- Add AZURE_OPENAI_API_KEY for authentication
- Add AZURE_OPENAI_ENDPOINT for service URL
- Add AZURE_OPENAI_API_VERSION defaulting to 2024-10-01-preview
- Add AZURE_OPENAI_DEPLOYMENT_PREFIX for optional deployment naming

Provider Integration:
- Import Azure OpenAI provider from @ai-sdk/azure
- Configure Azure provider with proper authentication and endpoints
- Add Azure models to the language model registry
- Add support for gpt-35-turbo, gpt-4, gpt-4-vision, and gpt-4o deployments

UI Enhancements:
- Create dedicated 'Azure' category in model selection dropdown
- Add distinctive blue cloud icon for Azure models
- Implement consistent styling with existing model categories
- Preserve authentication indicators for Azure models

API Configuration:
- Add Azure-specific provider options in search API route
- Configure proper parameters for Azure models
- Enable parallel tool calls and schema validation

This integration allows users to leverage their Azure OpenAI deployments alongside existing models, providing enterprise-grade AI capabilities with seamless UI integration.
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