import sys
import requests
import json

prompt = sys.argv[1]


ollama_url = "http://127.0.0.1:11434/api/generate"
headers = {"Content-Type": "application/json"}

payload = {
        "model": "qwen2.5:3b",
        "prompt": f"{prompt}",
        "stream": False
        }

try:
    response = requests.post(ollama_url, headers=headers, json=payload)
    response.raise_for_status()
    print(response.json()["response"])
except Exception as e:
    print(e)
