This project implements an AI-driven assistant powered by Azure OpenAI’s GPT-4 and deployable via Azure Functions . It uses Azure serverless architecture to invoke GPT-4 for tasks like answering queries, executing specific functions, and providing intelligent assistance through REST APIs.
- GPT-4 Integration : Leverage GPT-4 to handle a variety of AI-powered tasks.
- Azure Functions : Serverless function calls for on-demand execution of AI logic.
- Function Calling : Integrate function calling within the assistant to handle specific tasks based on user input.
- Configuration Management : Store API keys and other sensitive configurations securely.
- Interactive Notebooks : Use Jupyter notebooks for prototyping and experimentation.
Here’s a breakdown of the key files in the project:
├── .gitignore
├── assistant_with_function_calling.ipynb
├── assistants.py
├── config.json
├── config.py
├── core.py
├── dark_sine.png
├── main.py
├── README.md
├── scratchpad
assistant_with_function_calling.ipynb
: This Jupyter Notebook allows you to prototype and experiment with your assistant and test function-calling capabilities.assistants.py
: This file defines the various assistants you are building using GPT-4. It may include logic for text generation, conversation flows, or specific assistant behaviors.config.json
: Theconfig.json
holds sensitive data like API keys, endpoint URLs, and other configurations required to connect to Azure OpenAI and other Azure services.config.py
: Python file responsible for loading and handling configurations fromconfig.json
, ensuring secure and flexible configuration management.core.py
: Core functionality of the assistant and business logic resides in this file, possibly including the handling of requests and calling the GPT-4 API.main.py
: The entry point of the project. This script could be used to initialize the Azure Functions or run the assistant service locally for testing.dark_sine.png
: A supporting image, possibly used for the project’s documentation, branding, or UI.scratchpad
: A file or directory used for temporary notes, code snippets, or experimental ideas during development.
- Azure Subscription : Ensure you have access to Azure OpenAI and Azure Functions.
- Python 3.x : Install Python and necessary packages.
- Jupyter Notebook : Required for running the notebook files.
- Clone the Repository :
git clone (https://github.com/mphomathabathe/AGENTS)
cd azure-gpt4-assistants
- Install Dependencies: Install the necessary Python packages using pip :
pip install -r requirements.txt
- Configure API Keys: Update the config.json file with your Azure OpenAI API key and any other necessary configurations.
pip install -r requirements.txt
- Run Locally: Run main.py to test the assistant locally before deploying it :
python main.py
- Open the assistant_with_function_calling.ipynb file in Jupyter Notebook to interactively test and develop assistant functionality. This is useful for debugging and prototyping.
To deploy your assistants on Azure Functions :
- Deploy to Azure : Use the Azure CLI or Visual Studio Code to deploy the functions:
func azure functionapp publish <APP_NAME>
- Monitor Performance : Use Azure Monitor to track usage, errors, and performance for your deployed functions.
Once deployed, you can access your assistant via an HTTP endpoint. For example, using curl:
curl -X POST https://`<your-function-url>`
-H "Content-Type: application/json"
-d '{"prompt": "Tell me about Azure GPT-4"}'
This project is licensed under the MIT License.