mirror of
https://github.com/ollama/ollama-python.git
synced 2026-09-30 14:17:27 +00:00
* Examples and README updates --------- Co-authored-by: fujitatomoya <[email protected]> Co-authored-by: Michael Yang <[email protected]>
15 lines
237 B
Python
15 lines
237 B
Python
from ollama import chat
|
|
|
|
|
|
messages = [
|
|
{
|
|
'role': 'user',
|
|
'content': 'Why is the sky blue?',
|
|
},
|
|
]
|
|
|
|
for part in chat('llama3.2', messages=messages, stream=True):
|
|
print(part['message']['content'], end='', flush=True)
|
|
|
|
print()
|