Skip to content

An easy Python example to chat with Azure OpenAI Service

License

Notifications You must be signed in to change notification settings

YufengXin/azure-sample-chat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Sample Chat

An easy Python example to chat with Azure OpenAI Service, based on the Code section from the Chat playground on Azure OpenAI Service.

Setup and prerequisites

Create a Python virtual environment (virtualenv) and install the requirements:

python3 -m venv .venv
source .venv/bin/activate

Install the requirements:

pip install -r requirements.txt

Review the requirements.txt file to see the dependencies.

Export the environment variables

export OPENAI_API_BASE="https://RESOURCE_NAME.openai.azure.com/"
export OPENAI_API_KEY="API_KEY"

Replace both RESOURCE_NAME and API_KEY with the values from the Azure OpenAI Service resource.

Run the sample

python chat.py

About

An easy Python example to chat with Azure OpenAI Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%