Hello Shafeeq Niyas,
I believe you are currently utilizing OpenAI rather than Azure OpenAI. Please consider modifying the initial part of the code as follows. Additionally, it is advisable to consult the Quickstart provided.
import os
from openai import AzureOpenAI
client = AzureOpenAI(
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
api_version="YOUR_API_VERSION"
)
Best regards,
Charlie
If you find my response helpful, please consider accepting this answer and voting 'yes' to support the community. Thank you!