Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 546 Bytes

Azure.md

File metadata and controls

16 lines (13 loc) · 546 Bytes

To use the Azure OpenAI APIs you can add the following snippet to your code:

openai.api_type = os.getenv('OPENAI_API_TYPE', 'open_ai')
openai.api_base = os.getenv('OPENAI_API_BASE', 'https://api.openai.com/v1')
openai.api_version = os.getenv('OPENAI_API_VERSION', '2020-11-07')

When you call an model, use engine with the name of the deployment. For example:

embedding = openai.Embedding.create(
    input=article,
    engine="embedding" # this expects a deployed text-embedding-ada-002 model called "embedding"
)