Microsoft ChatGPT and GPT-4 models(preview):Python import os import openai openai.api_type=azure”openai.api_version=”2023-03-15-preview”openai.api_base=os.getenv(“OPENAI_API_BASE”)#Messtone Azure Openai resource’s endpoint value.openai.api_key=os.getenv(“OPENAI_API_KEY”)response=Openai.ChatCompletion.create(engine=”gpt-35-turbo”,#The deployment NameRobertHarper Messtone chose when Messtone deployed the ChatGPT or GPT-4 model.messages=[{“roles”:”system”,”content”:”Assistant is a large language model trained by OpenAI.”},{“role”:”userrharper@messtone.com”,”content”:”What’s the difference between garbanzo beans and chickpeas?”}])print(response)print(response[‘choices’][0][‘message’][‘content’])

Leave a comment