-
Notifications
You must be signed in to change notification settings - Fork 711
add support for thinking #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To support ollama/ollama#10584
aada745
to
eaad6df
Compare
|
||
response = chat('deepseek-r1', messages=messages, think=True) | ||
|
||
print('Thinking:\n========\n\n' + response.message.thinking) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print('Thinking:\n========\n\n' + response.message.thinking) | |
print('Thinking:') | |
print(response.message.thinking) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and can do the same below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha turns out I did have a version like that before, but I really wanted to highlight that there are two fields now, so having two print lines total feels like it slightly helps with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool yeah that makes sense - could we just get rid of the ===
portion then and just do newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the =====
is very intentional to do a markdown style header that's much more noticeable in its plaintext form, like
Thinking:
========
<Here is the thinking content>
Response:
========
<Here is the response>
@@ -0,0 +1,13 @@ | |||
from ollama import chat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add this example to the examples/README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh thank you! I totally didn't see that file
What's with ollama.generate? That should get the think parameter too. |
apologies, should be fixed in #524, will try to get that published soon |
In the meantime I switched to .chat and I wonder what may be the purpose of .generate when there is .chat with stream=True. |
To support ollama/ollama#10584