How can I set my endpoint after upgrade openAI from 0.28.1 to 1.33.0

Hi,
I have to use one specific endpoint to access ChatGPT, until last week I was using the depricated version 0.28.1 of openAI in which I have to set the variables:
openai.api_type = “azure”
openai.api_base = “.openai.azure.com/”
openai.api_version =
openai.api_key =
and them I called:
def prompting (prompt):
messages = [{‘role’:‘system’, ‘content’:‘’’ You are a helpfull assistant
‘’'},
{‘role’:‘user’, ‘content’: prompt},
]
response = openai.ChatCompletion.create(
engine=,
messages = messages,
temperature=0,
)

Now I updated to the 1.33.0 (because I need to use a library to do RAG),
And try this:

import os
from openai import OpenAI
client = openai.AzureOpenAI(
base_url=f"{endpoint}/openai/deployments/{deployment}/extensions",
api_key=api_key,
api_version=“2023-09-01-preview”
)

and this
client = OpenAI( api_key= )
response = openai.chat.completions.create(
model=“gpt-35-turbo”,
messages=[
{“role”: “system”, “content”: “You are a helpful research assistant.”},
{“role”: “user”, “content”: “Just say hi”}
],
max_tokens=200,
temperature=1.2,
top_p=1,
frequency_penalty=0,
presence_penalty=0.7,
stop=[‘Human:’, ‘AI:’]
)
But I have no success

Does anyone knows how can I tell to the model to reach the right endpoint when it is a dedicated ChatGPT?

Welcome to the dev forum.

The model endpoint compatibility page might help?

What error are you getting?

1 Like

Hi, thank you!

Actually I found a solution in the link (that is not letting me share in the learn dot microsoft … called: Migrando para a biblioteca de API de OpenAI do Python 1.x)
It is something specific from azureOpenAI

But many thanks in advance, I was facing password problem, but I coundn’t say where my endpoint was (so I new I was pointing to the wrong page)

1 Like