initial commit

This commit is contained in:
Michael Yang
2023-12-14 11:21:40 -08:00
commit 4fb93dcb0c
11 changed files with 1143 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from ollama import chat
messages = [
{
'role': 'user',
'content': 'Why is the sky blue?',
},
]
for message in chat('mistral', messages=messages, stream=True):
if message := message.get('message'):
if message.get('role') == 'assistant':
print(message.get('content', ''), end='', flush=True)
# end with a newline
print()