All code is written using Jupyter Notebooks, you will need to install the Jupyter Notebooks extension in VS Code
Example code from MS docs Quickstarts on how to use Azure Cognitive Services APIs.
-
aoai code
- image generation using DALL-E 3 Azure Open AI Model --- must have Azure Open AI and DALL-E model deployed
- Document App allows for document summary and translation using gpt-4o (or other models). You upload a txt or PDF file, once content is read you can build a summary by choosing the language and clicking Summarize. Or you can translate the content to other languages by choosing a language and click Translate.
- Graphrag is a Langchain test project that builds relationships within a document using gpt-4o and LangChain framework. It stores the data into a Neo4j Graph Database. Once in Database you use LangChain framework to perform RAG on the graph DB to gather information.
-
Asynchronous API
- Document Translator (both Async and Sync in notebook)
- Synchronized API will read all documents in a container, within a storage account, translate them and save them to a different container.
- Async will create a button, when clicked you can "Upload" a document, it will read document, translate and return the translated text to the output. It does not save a translated copy to anything. At this time (Jan 2025) it is only reading .txt files.
- Text to Speech
- Speech to Text
- Document Translator (both Async and Sync in notebook)
-
Synchronous API
- Text analysis Keywords
- Text analysis Sentiment Analysis
In Azure you will need the following services
-
Azure Open AI
-
Azure AI Services | Azure AI services multi-service account Used for Text_Sentiment and Text_Keywords notebooks
-
Azure AI Services | Speech Service Used for Speech_to_text and Text_to_Speech notebooks
-
Azure AI Services | Translatator Used for Document_Translation notebook
Make sure to create your Pyton environment and .env files. env_example.env.txt is a sample .env file. Rename to .env and enter your Azure service information.
To create, activate and update python virtual environment
- Open new Terminal
- Execute the following in terminal:
virtualenv venv- If virtualenv is not installed you may have to pip install it
pip install virtualenv
- If virtualenv is not installed you may have to pip install it
- Activate environment by executing the following:
- In Windows:
.\venv\Scripts\activate - In Linux or Mac:
source venv/bin/activate
- In Windows:
- Install Required Packages:
pip install -r requirements.txt
