Skip to content

Too Many Message Exception Error #275

@Aravind4525

Description

@Aravind4525

hugchat.exceptions.ChatError: Failed to parse response: {"message":"You are sending too many messages. Try again later."}

Now hugchat Model is receiving this error

Activity

Aravind4525

Aravind4525 commented on Jan 21, 2025

@Aravind4525
Author

Every Model is getting this error

Image

helqasem

helqasem commented on Jan 21, 2025

@helqasem

@Soulter Looks like there has been a server-side issue and HC isn't closing off the event streams with "finalAnswer". I tested in the HC UI and it's the same:

{"type":"stream","token":"1\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}
{"type":"status","status":"keepAlive"}
{"type":"stream","token":"!\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"}

I created a convo in the REPL and sent a simple "Hello Again". The result:

>>> for res in msg:
...     print(res)  # Process each streamed response
... else:
...     if msg.done() == MessageStatus.REJECTED:
...         raise msg.error
...
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}
{'type': 'stream', 'token': ' I'}
{'type': 'stream', 'token': ' can'}
{'type': 'stream', 'token': ' help'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' with'}
{'type': 'stream', 'token': ' or'}
{'type': 'stream', 'token': ' would'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' like'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' chat'}
{'type': 'stream', 'token': '?'}
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}
{'type': 'stream', 'token': ' I'}
{'type': 'stream', 'token': ' can'}
{'type': 'stream', 'token': ' help'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' with'}
{'type': 'stream', 'token': ' or'}
{'type': 'stream', 'token': ' would'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' like'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' chat'}
{'type': 'stream', 'token': '?'}
{'type': 'stream', 'token': 'It'}
{'type': 'stream', 'token': "'s"}
{'type': 'stream', 'token': ' nice'}
{'type': 'stream', 'token': ' to'}
{'type': 'stream', 'token': ' see'}
{'type': 'stream', 'token': ' you'}
{'type': 'stream', 'token': ' again'}
{'type': 'stream', 'token': '.'}
{'type': 'stream', 'token': ' Is'}
{'type': 'stream', 'token': ' there'}
{'type': 'stream', 'token': ' something'}

...etc...

As there is no "finalAnswer" event in the stream.. the Message generator re-sends "Hello Again" and it loops until message limit thresholds are hit. Hence.. "You are sending too many messages" Error.

Not sure there is an easy fix for this unless HC fix the event stream closures.

Aravind4525

Aravind4525 commented on Jan 22, 2025

@Aravind4525
Author

When it will be fixed

Soulter

Soulter commented on Jan 22, 2025

@Soulter
Owner

Thanks for sharing the solution! @helqasem I will fix it soon..

Soulter

Soulter commented on Jan 22, 2025

@Soulter
Owner

I feel like they used the time difference between two data returns to determine whether SSE should be disconnected... wrong

Image

Image

And there is reason to speculate that HF changed this rule to introduce real-time capability like Google Gemini 🤔 I'm not sure

Soulter

Soulter commented on Jan 22, 2025

@Soulter
Owner

Pushed a patch that can fix this error.

Aravind4525

Aravind4525 commented on Jan 22, 2025

@Aravind4525
Author

But still receives same error

Aravind4525

Aravind4525 commented on Jan 22, 2025

@Aravind4525
Author

Thanks, Now it is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @helqasem@Soulter@Aravind4525

        Issue actions

          Too Many Message Exception Error · Issue #275 · Soulter/hugging-chat-api