You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
680 B
27 lines
680 B
import ollama |
|
|
|
# response = ollama.chat( |
|
# model="qwen3_4b_32k", |
|
# messages=[ |
|
# {"role": "system", "content": "You are a helpful assistant."}, |
|
# {"role": "user", "content": "What is the capital of France?"}], |
|
# think=True |
|
# ) |
|
|
|
# print(response) |
|
|
|
import requests |
|
|
|
response = requests.post( |
|
"http://localhost:11434/api/chat", |
|
json={ |
|
"model": "qwen3_4b_32k", |
|
"messages": [ |
|
{"role": "system", "content": "You are a helpful assistant."}, |
|
{"role": "user", "content": "What is the capital of France?"} |
|
], |
|
"think": True, |
|
"stream": False |
|
} |
|
) |
|
print(response.content.decode('utf-8')) |