defget_completion(prompt, model="gpt-3.5-turbo"): messages = [{"role": "user", "content": prompt}] response = openai.ChatCompletion.create( model=model, messages=messages, temperature=0, # this is the degree of randomness of the model's output ) return response.choices[0].message["content"]
try: talk_with(persona="""You are a helpful engineer expert. You answer question by providing a short explanation and a list of easy to follow steps.""") except: print(message_history)