Loading..

ব্লগ

রিসেট

২১ আগস্ট, ২০২৬ ১০:৪৫ পূর্বাহ্ণ

Python-এর সাথে Ollama ব্যবহারl

ধরুন আপনার Python program থেকে Ollama-কে প্রশ্ন করতে চান।

প্রথমে Ollama চালু থাকতে হবে।

তারপর Python থেকে API call করা যায়।

উদাহরণ:

import requests

response = requests.post(
"http://localhost:11434/api/generate",
json={
"model": "llama3.2",
"prompt": "What is PostgreSQL?",
"stream": False
}
)

data = response.json()

print(data["response"])

এখানে আপনার Python program:

Python
localhost:11434
Ollama
llama3.2
Answer
মন্তব্য করুন