Welcome to Azure-OpenAI-integration-with-db! This project utilizes Flask and Azure OpenAI to provide an interactive query system.
These instructions will guide you through setting up and running the project locally.
- Azure OPENAI key, base_url etc
- Python 3.8 or higher
- Clone this repository:
git clone https://github.com/SP4RKiOP/Azure-OpenAI-integration-with-db.git cd your-project
- Install the required packages: pip install -r requirements.txt
-
Set your Azure OpenAI API key, base_url, and your deployment name in
utils.py
:os.environ["OPENAI_API_KEY"] = "change with your key" os.environ["OPENAI_API_BASE"] = "change with your base url" os.environ["OPENAI_API_VERSION"] = "change with your version" deployment_name = "change with your model name" # (in llm connection string)
-
Set your database connection string:
db = SQLDatabase.from_uri("mssql+pymssql://dbServerName:Password@dbServerName.database.windows.net:1433/dbName")
-
Start the server using waitress-serve:
waitress-serve --call wsgi:create_app
-
The application will be accessible at http://localhost:8080.
If you'd like to contribute to this project, feel free to do.
This project is licensed under the MIT License.