AppConfiguration
AppConfiguration copied to clipboard
Create Python ChatApp example for AI configuration
This PR adds a Python ChatApp example that mirrors the functionality of the .NET Core ChatApp sample for AI configuration.
Key Features
- Implemented using Python and Flask as required
- Uses
azure-appconfiguration-providerfor configuration management - Configured to load and refresh settings from Azure App Configuration
- Integrates with Azure OpenAI for chat completions
- Supports both web interface and console-like views
- Leverages modern Python practices and the latest stable packages
Implementation Details
- Created a Python application that mirrors the functionality of the .NET Core ChatApp example
- Implemented model classes equivalent to the .NET
MessageandModelConfigurationclasses - Added support for dynamically refreshing configuration from Azure App Configuration
- Built a web UI for chatting with the AI, as well as a console-like mode
Files Added
app.py- Main Flask application with Azure OpenAI integrationmodels.py- Contains data model classes for Message and ModelConfigurationrequirements.txt- Dependencies with latest stable versionsREADME.md- Setup and usage documentationtemplates/- HTML templates for the web interface
Fixes #1064.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
I've updated the description, this should be a console app, so Flask isn't needed.
I've updated the description, this should be a console app, so Flask isn't needed.
I've converted the app from a Flask web application to a console app similar to the .NET Core implementation. The changes include removing Flask dependencies, implementing a console-based interface with a continuous loop, and updating the documentation. All templates have been removed since they're not needed for a console app. See commit caf9cd0.
I've fixed the auth and model issues. But the app doesn't actually take in user input to chat.
I've fixed the auth and model issues. But the app doesn't actually take in user input to chat.
I've implemented user input functionality for the chat application in 00136bd. Now the app allows users to have a continuous conversation with the AI model. The app displays the initial messages from the configuration, gets an AI response, and then prompts the user for input. The conversation history is maintained throughout the session while still refreshing configuration parameters at the beginning of each cycle.
@mrm9084 the .NET ChatApp has been updated (#1075). Can you please update the python example accordingly?