cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Fetch Azure OpenAI api_version and engine Dynamically After Resource Creation via Python?

Sudheer2
New Contributor III

Hello,

I am using Python to automate the creation of Azure OpenAI resources via the Azure Management API. I am successfully able to create the resource, but I need to dynamically fetch the following details after the resource is created:

  1. API Version (api_version)
  2. Engine (such as text-davinci-003, gpt-3.5-turbo, etc.)

Here are the steps I have taken so far:

  1. Created Resource: I use the Azure Management API to create the OpenAI resource (PUT request).
  2. Fetch API Keys: After the resource is created, I fetch the API keys by calling listKeys.

However, when the resource is created, I am unable to dynamically retrieve the API version and engine directly from the resource.

Problem:

  • The api_version returned is showing as Unknown even though I know there is a specific version associated with the OpenAI resource.
  • I am unable to retrieve the engine types dynamically (like text-davinci-003, gpt-3.5-turbo, etc.) after the resource creation.

What I’ve Tried:

  • I tried using the exportTemplate API, but it only gives me a template and not the specific api_version and engine I need.
  • I also tried checking the resource properties, but the api_version field remains Unknown.
  • I even tried making an API call to https://<resource_name>.openai.azure.com/v1/engines, but I receive DNS resolution issues.

My Goal:

I would like to automate the process of retrieving the API version and engine dynamically after the resource is created, using Python and Azure API.

Is there a way to retrieve this information directly after the resource creation or via a different API endpoint?

Any help or guidance would be greatly appreciated!

Thank you!

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group