Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,170 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
import os
from openai import AzureOpenAI
api_type = "azure"
api_endpoint = 'https://---.openai.azure.com/'
api_version = "2023-05-15"
#openai.api_version = '2023-12-01-preview'
openai.api_key = 'c-----'
client = AzureOpenAI(
api_key= api_key,
api_version= api_version,
azure_endpoint= api_endpoint
)
OpenAIError Traceback (most recent call last)
try the below.
Note:- Your API key is visible in the error message you posted. If it is actual, edit your question and hide it.
import os
from openai import AzureOpenAI
api_type = "azure"
api_endpoint = 'https://---.openai.azure.com/'
api_version = "2023-05-15"
api_key = 'c-----'
client = AzureOpenAI(
api_key= api_key,
api_version= api_version,
azure_endpoint= api_endpoint
)
another question that i have is:
my following code has this error:
TypeError Traceback (most recent call last)
<ipython-input-35-442464444aeb>
TypeError: Transcriptions.create() got an unexpected keyword argument 'deployment_id'
model_name = "whisper-1"
deployment_id = "whisper"
audio_language="en"
audio_test_file = "/content/english.mp3"
result = client.audio.transcriptions.create(
file=open(audio_test_file, "rb"),
model=model_name,
deployment_id=deployment_id
)
print(result.text)