mirror of
https://github.com/ollama/ollama-python.git
synced 2026-02-21 10:04:38 +08:00
wording
This commit is contained in:
parent
d2ea72ae07
commit
1f68bae483
@ -149,7 +149,7 @@ class Client(BaseClient):
|
|||||||
|
|
||||||
for message in messages or []:
|
for message in messages or []:
|
||||||
if not isinstance(message, dict):
|
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']:
|
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"')
|
raise RequestError('messages must contain a role and it must be one of "system", "user", or "assistant"')
|
||||||
if not message.get('content'):
|
if not message.get('content'):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user