You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Ensure you have set your OpenAI API key as an environment variable
openai.api_key = os.getenv("OPENAI_API_KEY")
client = openai.OpenAI()
def get_command(cmd, task_description):
# Call the OpenAI API with the task description
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role":"system", "content":"You are an expert in {cmd} commands on a Linux system. Given the following English description of a task, you respond with the correct {cmd} command. Do not include any other information in your response except for the command only."},