From 3eb5ca744fb5a43d4376888a1aa591810d791c8c Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Tue, 24 Jun 2025 15:50:27 -0400 Subject: [PATCH] Add 'think' argument to response generation methods in Client and AsyncClient --- ollama/_client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ollama/_client.py b/ollama/_client.py index 4555a93..cbd608f 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -237,6 +237,11 @@ def generate( """ Create a response using the requested model. + Args: + stream: Whether to stream the response. + think: Whether to think before generating a response. + format: The format of the response. + Raises `RequestError` if a model is not provided. Raises `ResponseError` if the request could not be fulfilled. @@ -315,6 +320,7 @@ def chat( Python functions need to follow Google style docstrings to be converted to an Ollama Tool. For more information, see: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings stream: Whether to stream the response. + think: Whether to think before generating a response. format: The format of the response. Example: @@ -749,6 +755,11 @@ async def generate( """ Create a response using the requested model. + Args: + stream: Whether to stream the response. + think: Whether to think before generating a response. + format: The format of the response. + Raises `RequestError` if a model is not provided. Raises `ResponseError` if the request could not be fulfilled. @@ -826,6 +837,7 @@ async def chat( Python functions need to follow Google style docstrings to be converted to an Ollama Tool. For more information, see: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings stream: Whether to stream the response. + think: Whether to think before generating a response. format: The format of the response. Example: