hugging-chat-api icon indicating copy to clipboard operation
hugging-chat-api copied to clipboard

web search results giving buggy response

Open mian312 opened this issue 1 year ago • 3 comments

Describe the bug The model is working fine, but not when the web search is enabled. until the web_search is enabled false or not mentioned the response is coming, but the point when the web search is enabled the response is buggy. It probably throws a bunch of tokens though I am not a expertise of this field so I cannot say how the response it gives.

Issue Code

assistant = chatbot.search_assistant(assistant_name="Real Human")
chatbot.new_conversation(assistant=assistant, switch_to=True)

query_result = chatbot.query("hi", web_search=True)
print(query_result)

Expected behavior It should give response like : "Hello! How are you feeling today?" as it gives response when web_search=False

Screenshots Screenshot 2024-05-15 173245 Screenshot 2024-05-15 173245 01 Screenshot 2024-05-15 173245 02

mian312 avatar May 15 '24 12:05 mian312

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

github-actions[bot] avatar May 15 '24 12:05 github-actions[bot]

Hello there I may be doing a report again but i might have spotted the error line

Screenshot 2024-05-15 173245 001

in the following snippet the "hostname"

 # wss.hostname = source["hostname"]

it is the line providing the error, now i have manually commented the code and the web search facility is working, as you are the creator you may be able to comlplete the error in a dynamic way and how it should be

THANK YOU for support ❤❤

mian312 avatar May 15 '24 15:05 mian312

Hi,

I confirm the issue mentioned in the latest message. Upon analyzing the returned JSON, it's clear that the hostname property no longer exists. Here's an example of the returned JSON object:

{
  "title": "M-theory",
  "link": "https://en.wikipedia.org/wiki/M-theory",
  "snippet": "A theory of strings that incorporates the idea of supersymmetry is called a superstring theory. There are several different versions of superstring theory ...",
  "position": 1
  // other properties...
}

As you can see, there is no hostname property, which explains the error. Thank you for the proposed fix.

Committed fix can be reviewed here: https://github.com/Soulter/hugging-chat-api/compare/master...TribSTox:hugging-chat-api:patch-1

Best regards,

TribSTox avatar May 16 '24 15:05 TribSTox

I hope this PR will be merged.

Mrxyy avatar May 20 '24 09:05 Mrxyy

Hi,

I confirm the issue mentioned in the latest message. Upon analyzing the returned JSON, it's clear that the hostname property no longer exists. Here's an example of the returned JSON object:

{
  "title": "M-theory",
  "link": "https://en.wikipedia.org/wiki/M-theory",
  "snippet": "A theory of strings that incorporates the idea of supersymmetry is called a superstring theory. There are several different versions of superstring theory ...",
  "position": 1
  // other properties...
}

As you can see, there is no hostname property, which explains the error. Thank you for the proposed fix.

Committed fix can be reviewed here: master...TribSTox:hugging-chat-api:patch-1

Best regards,

Thanks you for your feedback, there was hostname property before, it should be huggingface deleted it. You can create a PR and I'll merge it.

Soulter avatar May 20 '24 11:05 Soulter

Hi, I have created the PR as recommended.

Best regards,

TribSTox avatar May 22 '24 03:05 TribSTox

Hi, I have created the PR as recommended.

Best regards,

Hello, I have merged the PR and released a new version. Thanks.

You can use pip install -U hugchat to update.

Soulter avatar May 22 '24 03:05 Soulter