Soulter / hugging-chat-api

HuggingChat Python API🤗
GNU Affero General Public License v3.0
859 stars 123 forks source link

Implemented tool capabilities #232

Closed Whitelisted1 closed 5 months ago

Whitelisted1 commented 5 months ago

General Changes

Refactoring Changes

Incomplete Features

Downloading image file example:

out = chatbot.query("Make an image of a computer")
print(out)

file = out.get_files_created()[0]

f = open(f"out.{file.mime.split('/')[1]}", "bw")
f.write(file.download_file(chatbot))
f.close()
Whitelisted1 commented 5 months ago

When streaming the content, we now remove the repeated '\u0000' characters that were at the end of each token. This is more of a temporary solution, as we do not know what is causing this, but it should work for now

Solution for #230