def explain_helper(prev_command, command, prompt):
    """Generates explanation for either the previous command or a user query

    Params:
    prev_command (str): previous command
    command (str): user query
    prompt (str): prompt to use for explanation
    """
    question = prompt + prev_command if command == "" else command
    data = {"model": get_model(),
            "messages": [{"role": "user",
                          "content": question}]}
    body, response = make_request(URL, HEADERS, data=bytes(json.dumps(data),
                                                           encoding="utf-8"))
    body = json.loads(body)
    explanation = body['choices'][0]['message']['content']
    print(explanation)
Generates explanation for either the previous command or a user query

    Params:
    prev_command (str): previous command
    command (str): user query
    prompt (str): prompt to use for explanation
    
chatgdb/utils.py