Untitled

 avatar
unknown
plain_text
9 months ago
511 B
6
Indexable
import os
from openai import AzureOpenAI

client = AzureOpenAI(
    api_key=os.getenv("AZURE_OPENAI_API_KEY"),  
    api_version="2024-02-01",
    azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT")
)

deployment_id = "YOUR-DEPLOYMENT-NAME-HERE"  # This will correspond to the custom name you chose for your deployment when you deployed a model.
audio_test_file = "./wikipediaOcelot.wav"

result = client.audio.transcriptions.create(
    file=open(audio_test_file, "rb"),
    model=deployment_id
)

print(result)
Editor is loading...
Leave a Comment