Closed nugen closed 3 months ago
Hi! Thanks for your issue, we will deal with your issue as soon as possible.
Hi !
I've been able to make it work again editing hugchat.py at Line 682 in order to set tools value (hardcoded for testing):
req_json = {
"id": message_id,
"inputs": text,
"is_continue": False,
"is_retry": is_retry,
"web_search": web_search,
"tools": {"fetch_url": True,"websearch": False}
Maybe adding a tools parameter to the chat method could help choosing the tools ?
We use Hugchat with the cohere model and the URL fetcher tool. We were able to run queries using tool URL fetcher and retrieve used urls with tools_used. But recently this is broken: tools_used no longer contains anything. When looking at the Hugging Face chat interface, no Call tool url fetcher is mentioned. However, if we create a new chat directly in the Hugging Face interface with exactly the same system and user prompt, the call to the URL Fetcher tool is triggered correctly, and leads to a correct answer.
To Reproduce 1/ Use Hugchat library to query Cohere Model passing (an) url(s) to retrieve an answer and fetched Url(s) No urls are fetched and the answer clearly shows that the url were not used. 2/ Use huggingface chat directly (manually), set the system prompt for the cohere model same as the one used in point 1/. And ask the same question. This time the call to the URL Fetcher tool is triggered correctly, and leads to a correct answer Here's our test code in python :
Expected behavior We should be able to trigger URL fetch Tool via Hugchat query call.
Screenshot of our code result
Screenshot of huggingface/chat of the conversation created with Hugchat and our code
The answer is not from the provided URL. And no tool are mentionned.
Screenshot of huggingface/chat of the conversation created manually with same prompts
The answer is taken from the provided URL. And the URL fetched tool is mentionned.
Additional context Python 3.9 The issue happens in both Hugchat 0.4.10 and 0.4.8
Thanks for your coool work !