0:00 create python file
0:10 start ollama in terminal and check if its running
0:22 paste python code
0:38 run python file
0:45 read answer
import requests
# API-Endpunkt
url = "http://localhost:11434/api/generate"
# Prompt und Modell
payload = {
"model": "mistral-small3.1", # Modellname anpassen
"prompt": "Hello, what is AI?", # Prompt
"stream": False # kein Streaming
}
# Anfrage senden
response = requests.post(url, json=payload)
# Antwort ausgeben
print(response.json()['response'])