mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
[PR #118] [MERGED] fix 'content' check on messages in chat() #366
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ollama/ollama-python/pull/118
Author: @DSLstandard
Created: 4/15/2024
Status: ✅ Merged
Merged: 4/24/2024
Merged by: @mxyng
Base:
main← Head:fix-content-check📝 Commits (1)
dc9543bfix 'content' check on messages in chat()📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
ollama/_client.py(+2 -2)📄 Description
In
chat()inClientandAsyncClient, ifmessage['content']is"",the following would raise an error since
bool("")also returnsFalselikebool(None):Doing the following would fix it:
As far as I know ollama does not explicitly prohibit empty content in messages.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.