from groq import Groq

client = Groq(api_key="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")

MODEL = "openai/gpt-oss-20b"


def get1(prompt):
    response = client.chat.completions.create(
        model=MODEL,
        messages=[
            {
                "role": "system",
                "content": (
                    "You are a teaching assistant for Python and Machine Learning. "
                    "Return responses in clean plain text with proper indentation and line breaks. "
                    "If you provide code, return ONLY runnable Python code without markdown blocks."
                )
            },
            {"role": "user", "content": prompt}
        ]
    )

    return response.choices[0].message.content


if __name__ == "__main__":
    user_prompt = input("You: ")
    answer = get1(user_prompt)

    print("\n===== LLM RESPONSE =====\n")
    print(answer)



