Soulter / hugging-chat-api

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

Add an ability to use tools in prompts #261

Open AsDeep opened 1 month ago

AsDeep commented 1 month ago

Is your feature request related to a problem? Please describe. Since tools argument of request is hardcoded in _stream_query, there's no chance of any tool being used during prompt through this api.

Describe the solution you'd like Add new optional argument to hugchat.chat which will override tools in _stream_query

Describe alternatives you've considered Add new function to be used as tool generation, which will require tool ids passed in dict as argument

Additional context I know tools without GUI are hard to use, but it would be great to have at least an opportunity to use their hardcoded ids. I tried hardcoding default tools' ids into _stream_query and it works fine.

P. S. Also, I've got your API rewritten with async support. Since I'm new in python, it is being used only by me, but if you are interested I can share my work.

github-actions[bot] commented 1 month ago

Hi! Thanks for your issue, we will deal with your issue as soon as possible.

Soulter commented 1 month ago

Hello, sorry for the late reply. For the personal reasons I cannot implement the latest features into this api in time. Welcome any helpful contributions!