|
1 |
| -# Welcome to MkDocs |
| 1 | +# workshop-azure-openai |
2 | 2 |
|
3 |
| -For full documentation visit [mkdocs.org](https://www.mkdocs.org). |
| 3 | +This repository is for a workshop using Azure OpenAI Service. |
4 | 4 |
|
5 |
| -## Commands |
| 5 | +## Prerequisites |
6 | 6 |
|
7 |
| -* `mkdocs new [dir-name]` - Create a new project. |
8 |
| -* `mkdocs serve` - Start the live-reloading docs server. |
9 |
| -* `mkdocs build` - Build the documentation site. |
10 |
| -* `mkdocs -h` - Print help message and exit. |
| 7 | +To run all the projects in this repository, you need the followings. |
11 | 8 |
|
12 |
| -## Project layout |
| 9 | +- [Python 3.10+](https://www.python.org/downloads/) |
| 10 | +- [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/ai-services/openai-service) |
| 11 | +- [Azure Cosmos DB](https://azure.microsoft.com/en-us/products/cosmos-db/) |
| 12 | +- [Azure AI Search](https://azure.microsoft.com/en-us/products/ai-services/ai-search) |
| 13 | +- [Azure AI Document Intelligence](https://azure.microsoft.com/en-us/products/ai-services/ai-document-intelligence) |
13 | 14 |
|
14 |
| - mkdocs.yml # The configuration file. |
15 |
| - docs/ |
16 |
| - index.md # The documentation homepage. |
17 |
| - ... # Other markdown pages, images and other files. |
| 15 | +Here are the preferred tools for development. |
| 16 | + |
| 17 | +- [Poetry](https://python-poetry.org/docs/#installation) |
| 18 | +- [GNU Make](https://www.gnu.org/software/make/) |
| 19 | + |
| 20 | +## Projects |
| 21 | + |
| 22 | +| Project | Description | Image | |
| 23 | +| --------------------------------------------------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | |
| 24 | +| [1_call_azure_openai_chat](apps/1_call_azure_openai_chat) | Call Azure OpenAI Service API from Python | No Image | |
| 25 | +| [2_streamlit_chat](apps/2_streamlit_chat) | Create an Azure OpenAI Chat app using Streamlit |  | |
| 26 | +| [3_call_azure_cosmos_db](apps/3_call_azure_cosmos_db) | Call Azure Cosmos DB from Python | No Image | |
| 27 | +| [4_streamlit_chat_history](apps/4_streamlit_chat_history) | Add feature to store chat history using Azure Cosmos DB |  | |
| 28 | +| [5_streamlit_query_chat_history](apps/5_streamlit_query_chat_history) | Search Chat History |  | |
| 29 | +| [6_call_azure_ai_search](apps/6_call_azure_ai_search) | Call Azure AI Search from Python | No Image | |
| 30 | +| [7_streamlit_chat_rag](apps/7_streamlit_chat_rag) | Add RAG feature to Streamlit chat app |  | |
| 31 | +| [8_streamlit_azure_openai_batch](apps/8_streamlit_azure_openai_batch) | Call Azure OpenAI Batch API with Streamlit |  | |
| 32 | +| [9_streamlit_azure_document_intelligence](apps/9_streamlit_azure_document_intelligence) | Call Azure AI Document Intelligence API with Streamlit |  | |
| 33 | +| [10_streamlit_batch_transcription](apps/10_streamlit_batch_transcription) | Call Batch Transcription API with Streamlit |  | |
| 34 | +| [11_promptflow](apps/11_promptflow) | Get started with Prompt flow | No Image | |
| 35 | +| [12_langgraph_agent](apps/12_langgraph_agent) | Create agents with LangGraph | No Image | |
| 36 | +| [99_streamlit_examples](apps/99_streamlit_examples) | Code samples for Streamlit |  | |
| 37 | + |
| 38 | +## How to run |
| 39 | + |
| 40 | +Referring to the [.env.template](.env.template) file, create a `.env` file in the same directory and set the required credentials. |
| 41 | + |
| 42 | +### Local environment |
| 43 | + |
| 44 | +```shell |
| 45 | +# Create a virtual environment |
| 46 | +$ python -m venv .venv |
| 47 | + |
| 48 | +# Activate the virtual environment |
| 49 | +$ source .venv/bin/activate |
| 50 | + |
| 51 | +# Install dependencies |
| 52 | +$ pip install -r requirements.txt |
| 53 | + |
| 54 | +# Run the script (e.g. run 2_streamlit_chat) |
| 55 | +$ python -m streamlit run apps/2_streamlit_chat/main.py |
| 56 | +``` |
| 57 | + |
| 58 | +### Docker container |
| 59 | + |
| 60 | +```shell |
| 61 | +# Set Docker image name |
| 62 | +## GitHub Container Registry |
| 63 | +$ IMAGE=ghcr.io/ks6088ts-labs/workshop-azure-openai:latest |
| 64 | +## Docker Hub |
| 65 | +$ IMAGE=ks6088ts/workshop-azure-openai:latest |
| 66 | + |
| 67 | +# run 2_streamlit_chat |
| 68 | +$ docker run --rm \ |
| 69 | + -p 8501:8501 \ |
| 70 | + -v ${PWD}/.env:/app/.env \ |
| 71 | + ${IMAGE} \ |
| 72 | + python -m streamlit run /apps/2_streamlit_chat/main.py |
| 73 | +``` |
0 commit comments