diff --git a/ollama/_client.py b/ollama/_client.py index 35f6f2c..14608ba 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -149,7 +149,7 @@ class Client(BaseClient): for message in messages or []: if not isinstance(message, dict): - raise TypeError('messages must be a list of strings') + raise TypeError('messages must be a list of Message or dict-like objects') if not (role := message.get('role')) or role not in ['system', 'user', 'assistant']: raise RequestError('messages must contain a role and it must be one of "system", "user", or "assistant"') if not message.get('content'):