openai-chat-app-quickstart  by Azure-Samples

Chat application for Azure OpenAI interaction

Created 3 years ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
Project Summary

A simple chat application using Azure OpenAI is provided, designed for streamlined deployment on Azure Container Apps via the Azure Developer CLI. It targets developers aiming to quickly integrate AI chat capabilities into their applications, offering automated resource provisioning and secure authentication using Managed Identity.

How It Works

The project features a Python Quart backend that utilizes the openai package to generate responses to user messages. A basic HTML/JS frontend streams these responses efficiently using JSON Lines over a ReadableStream. Infrastructure deployment is managed through Bicep files, automating the setup of Azure OpenAI, Azure Container Apps, Azure Container Registry, and Azure Log Analytics. Authentication to Azure OpenAI is handled securely via Managed Identity, eliminating the need for explicit secrets within the application code.

Quick Start & Requirements

  • Primary Install/Run: Utilize the Azure Developer CLI (azd). Initialize the project with azd init -t openai-chat-app-quickstart. Provision and deploy all resources using azd up. Deploy code changes with azd deploy.
  • Prerequisites: An Azure account with an active subscription, Azure Developer CLI (azd), Python 3.10+, Docker Desktop, and Git are required. Access approval for Azure OpenAI Service must be obtained via https://aka.ms/oai/access.
  • Setup: For simplified setup, GitHub Codespaces or VS Code Dev Containers are recommended. Local development requires cloning the repository, creating and activating a Python virtual environment, and installing dependencies via pip install -r requirements-dev.txt.
  • Local Development Server: Start the development server using python -m quart --app src.quartapp run --port 50505.

Highlighted Details

  • Managed Identity: Employs Managed Identity for secure, credential-free authentication to Azure OpenAI Service.
  • Infrastructure as Code: Leverages Bicep templates for declarative provisioning of necessary Azure resources.
  • Containerized Deployment: Optimized for deployment on Azure Container Apps.
  • CI/CD Integration: Includes a GitHub Actions workflow for automated deployment upon code pushes to the main branch.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or roadmap were found in the provided README snippet.

Licensing & Compatibility

The specific open-source license is not detailed in the provided README snippet. Compatibility for commercial use or closed-source linking cannot be determined without this information.

Limitations & Caveats

Access to Azure OpenAI Service requires prior approval through a request form. Deployment success may be influenced by the chosen Azure region due to potential availability constraints for OpenAI resources. Local development necessitates proper configuration of Azure OpenAI credentials.

Health Check
Last Commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.