Pueden solucionar el error del sdk instalando la ultima version de OpenAI 1.8.0 y ejecutar esta otra forma de API REST.
<import osfrom openai import AzureOpenAI client = AzureOpenAI( azure\_endpoint = "TU END POINT", api\_key= "2TU APPI KEY", api\_version="2023-05-15") response = client.chat.completions.create( model="gpt35", # model = "deployment\_name". messages=\[ {"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "assistant", "content": "How can I help you?"}, {"role": "user", "content": "What is the capital of Spain?"} ]) print(response.choices\[0].message.content)>
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?