From 8b694bb0f4578c07ab50da06d80bc7276a470e7c Mon Sep 17 00:00:00 2001 From: Denis Shulyaka Date: Mon, 29 Jul 2024 20:39:09 +0300 Subject: [PATCH] Update `Message` annotations to support tool calls (#227) --- ollama/_types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ollama/_types.py b/ollama/_types.py index 243b27b..7bdcbe4 100644 --- a/ollama/_types.py +++ b/ollama/_types.py @@ -79,10 +79,10 @@ class Message(TypedDict): Chat message. """ - role: Literal['user', 'assistant', 'system'] - "Assumed role of the message. Response messages always has role 'assistant'." + role: Literal['user', 'assistant', 'system', 'tool'] + "Assumed role of the message. Response messages always has role 'assistant' or 'tool'." - content: str + content: NotRequired[str] 'Content of the message. Response messages contains message fragments when streaming.' images: NotRequired[Sequence[Any]]