workshop-azure-openai
This repository is for a workshop using Azure OpenAI Service.
Prerequisites
To run all the projects in this repository, you need the followings.
Here are the preferred tools for development.
Setup
Infrastructure
Click the button below to deploy the infrastructure to Azure.
Projects
Project | Description | Image |
---|---|---|
1_call_azure_openai_chat | Call Azure OpenAI Service API from Python | No Image |
2_streamlit_chat | Create an Azure OpenAI Chat app using Streamlit | |
3_call_azure_cosmos_db | Call Azure Cosmos DB from Python | No Image |
4_streamlit_chat_history | Add feature to store chat history using Azure Cosmos DB | |
5_streamlit_query_chat_history | Search Chat History | |
6_call_azure_ai_search | Call Azure AI Search from Python | No Image |
7_streamlit_chat_rag | Add RAG feature to Streamlit chat app | |
8_streamlit_azure_openai_batch | Call Azure OpenAI Batch API with Streamlit | |
9_streamlit_azure_document_intelligence | Call Azure AI Document Intelligence API with Streamlit | |
10_streamlit_batch_transcription | Call Batch Transcription API with Streamlit | |
11_promptflow | Get started with Prompt flow | No Image |
12_langgraph_agent | Create agents with LangGraph | No Image |
99_streamlit_examples | Code samples for Streamlit |
How to run
Referring to the .env.template file, create a .env
file in the same directory and set the required credentials.
Local environment
# Create a virtual environment
$ python -m venv .venv
# Activate the virtual environment
$ source .venv/bin/activate
# Install dependencies
$ pip install -r requirements.txt
# Run the script (e.g. run 2_streamlit_chat)
$ python -m streamlit run apps/2_streamlit_chat/main.py
Docker container
# Set Docker image name
## GitHub Container Registry
$ IMAGE=ghcr.io/ks6088ts-labs/workshop-azure-openai:latest
## Docker Hub
$ IMAGE=ks6088ts/workshop-azure-openai:latest
# run 2_streamlit_chat
$ docker run --rm \
-p 8501:8501 \
-v ${PWD}/.env:/app/.env \
${IMAGE} \
python -m streamlit run /apps/2_streamlit_chat/main.py