#!/usr/bin/python3
import openai
import subprocess

API_KEY = ""

CHATGPT_NAME = "ChatGPT"
CHATGPT_MODEL = "gpt-4o-mini"
# In the ChatCompletion scheme, the system role determins the style in which questions are answered.
CHATGPT_ROLE = "You are a friendly and helpful assistant."

if __name__ == '__main__':
    openai.api_key = API_KEY
    print("\033c")
    while True:
        completion = openai.chat.completions.create(max_tokens=800, temperature=0.5, model=CHATGPT_MODEL, messages = [{"role": "system", "content": CHATGPT_ROLE}, {"role": "user", "content": input("ChatGPT> ")}])
        response = completion.choices[0].message.content.strip()
        print(response)
