Azure OpenAI
Orate supports Azure's OpenAI services.
Azure OpenAI is a cloud-based AI platform that provides a range of OpenAI models on their cloud computing platform.
Setup
The Azure OpenAI provider is available by default in Orate. To import it, you can use the following code:
Configuration
You can use Azure OpenAI by creating a new instance of the AzureOpenAI
class:
This will use the AZURE_OPENAI_API_KEY
, AZURE_OPENAI_TTS_ENDPOINT
, AZURE_OPENAI_STT_ENDPOINT
and AZURE_OPENAI_API_VERSION
environment variables. If you don't have these variables set, you can pass your keys as an argument to the constructor.
Usage
The Azure OpenAI provider provides a single interface for all of Azure's OpenAI services.
Text to Speech
The Azure OpenAI provider provides a tts
function that allows you to create a text-to-speech synthesis function using Azure OpenAI TTS.
You can specify the voice to use by passing it as an argument to the tts
function.
You can also specify specific OpenAI properties by passing them as an argument to the tts
function.
Speech to Text
The Azure OpenAI provider provides a stt
function that allows you to create a speech-to-text transcription function using Azure OpenAI Whisper.
You can also specify specific OpenAI properties by passing them as an argument to the stt
function.
You can also stream the transcription.