Closed DSLstandard closed 2 months ago
In chat() in Client and AsyncClient, if message['content'] is "",
chat()
Client
AsyncClient
message['content']
""
the following would raise an error since bool("") also returns False like bool(None):
bool("")
False
bool(None)
if not message.get('content'): raise RequestError('messages must contain content')
Doing the following would fix it:
if 'content' not in message: raise RequestError('messages must contain content')
As far as I know ollama does not explicitly prohibit empty content in messages.
Thanks!
In
chat()
inClient
andAsyncClient
, ifmessage['content']
is""
,the following would raise an error since
bool("")
also returnsFalse
likebool(None)
:Doing the following would fix it:
As far as I know ollama does not explicitly prohibit empty content in messages.