import subprocess

def run_ollama_prompt(prompt, model="deepseek-r1:1.5b"):
    """Runs a prompt using Ollama CLI and returns the response."""
    command = ["ollama", "run", model, prompt]

    try:
        result = subprocess.run(command, capture_output=True, text=True, check=True, encoding="utf-8")
        return result.stdout.strip()
    except subprocess.CalledProcessError as e:
        print("Error running Ollama:", e)
        return None

if __name__ == "__main__":
    prompt = "What is the capital of France?"
    response = run_ollama_prompt(prompt)
    
    if response:
        print("Response:", response)
    else:
        print("Failed to get a response.")
