mirror of
https://github.com/ollama/ollama-python.git
synced 2026-08-19 03:09:51 +00:00
fully add thinking support to generate()
https://github.com/ollama/ollama-python/pull/521 missed some calls
This commit is contained in:
@@ -65,3 +65,6 @@ Requirement: `pip install tqdm`
|
||||
|
||||
### Thinking - Enable thinking mode for a model
|
||||
- [thinking.py](thinking.py)
|
||||
|
||||
### Thinking (generate) - Enable thinking mode for a model
|
||||
- [thinking-generate.py](thinking-generate.py)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from ollama import generate
|
||||
|
||||
messages = [
|
||||
{
|
||||
'role': 'user',
|
||||
'content': 'What is 10 + 23?',
|
||||
},
|
||||
]
|
||||
|
||||
response = generate('deepseek-r1', 'why is the sky blue', think=True)
|
||||
|
||||
print('Thinking:\n========\n\n' + response.thinking)
|
||||
print('\nResponse:\n========\n\n' + response.response)
|
||||
Reference in New Issue
Block a user