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

Integrating Azure OpenAI and Cosmos DB with Improved Quart App Functionality #1081

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

Commits on Aug 22, 2024

  1. azure-openai-features.md

    This fork updates the existing Quart application with advanced AI capabilities and improves overall functionality by integrating Azure OpenAI services. The enhancements focus on providing dynamic AI responses, refining client initialization processes, and integrating additional features to leverage artificial intelligence effectively.
    
     Key Updates
    
    1. AI Integration with Azure OpenAI:
       - Added the `ask_ai` endpoint to handle POST requests for querying Azure OpenAI. This endpoint processes user questions and returns AI-generated responses using the Azure OpenAI service.
       - Implemented `init_openai_client` to configure and initialize the Azure OpenAI client, including API version checks, endpoint setup, and authentication mechanisms.
    
    2. CosmosDB Integration:
       - Integrated CosmosDB initialization with the `init_cosmosdb_client` function, which sets up connections for chat history and feedback mechanisms if configured.
       - Included logging and exception handling to ensure robust initialization and connectivity to CosmosDB.
    
    3. Environment and Debug Settings:
       - Added debug configuration settings based on environment variables to facilitate easier troubleshooting and development.
       - Configured a user agent string for Azure OpenAI requests to improve tracking and support.
    
    4. Static Asset Management:
       - Implemented the `/assets/<path:path>` route to serve static assets from the `static/assets` directory, allowing for better management and delivery of frontend resources.
    
    5. Frontend and Configuration Enhancements:
       - Updated frontend settings to include new configuration options such as feedback and authentication features based on environment settings.
       - Incorporated Microsoft Defender for Cloud integration with conditional settings based on environment variables.
    
    6. Model Argument Preparation:
       - Added the `prepare_model_args` function to construct and prepare arguments for AI model requests, including handling user details and data sources if applicable.
    
    Benefits
    - Enhanced User Interaction: By integrating Azure OpenAI, the application can now provide intelligent and contextually relevant responses to user queries.
    - Improved Debugging and Monitoring: Enhanced logging and debugging configurations make it easier to manage and troubleshoot issues.
    - Flexible Configuration: Updated settings and environment-based configurations offer better control and customization of application behavior.
    
    Usage
    To utilize the new AI features:
    1. Ensure that the necessary environment variables are set for Azure OpenAI and CosmosDB.
    2. Access the `/ai/ask` endpoint to query the AI service and receive responses based on the provided questions.
    RahulVadisetty91 authored Aug 22, 2024
    Configuration menu
    Copy the full SHA
    d7059e9 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from RahulVadisetty91/RahulVadisetty91-patch-1

    Integrate Azure OpenAI for AI-Powered Responses
    RahulVadisetty91 authored Aug 22, 2024
    Configuration menu
    Copy the full SHA
    95cabf4 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

  1. Configuration menu
    Copy the full SHA
    2303117 View commit details
    Browse the repository at this point in the history