- Azure OpenAI
- Embedding Model (text-embedding-ada-002)
- Chat Model (gpt-35-turbo)
- Azure Cognitive Search
- Clone the repository.
- Create a Python virtual environment
python3 -m venv env
. - Install Python depencies
pip install -r requirements.txt
. - Rename
config.ini.template
toconfig.ini
. - Update the variables within
config.ini
based on your values from the Azure portal. - Rename
documents.json.template
todocuments.json
. Update the contents of the JSON file withcategory
andcontent
pairs to pre-populate the vector database. - Create a chat API messages template beneath a folder called
messages
. Note: Seemessages.json
as an example structure.
populate_vector_index.py
- Running this script will drop/create a vector search index in Azure Cognitive Search based on the documents withindocuments.json
.query_vector_index.py --query "YOUR_QUERY"
- Running this script will query the populated vector database for the nearest neighbors.classify_text_snippet.py --snippet "YOUR_SNIPPET"
- Running this script will use the chat completion API to classify the snippet.