Skip to content

Add 'think' argument to response generation methods in Client and Asy… #534

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ollama/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down