Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_CONVERSATION_LIMIT #17

Open
h9052300 opened this issue Aug 26, 2024 · 15 comments
Open

ERR_CONVERSATION_LIMIT #17

h9052300 opened this issue Aug 26, 2024 · 15 comments

Comments

@h9052300
Copy link

I'll always be in trouble.
{“action”: “error”, “status”:429, “type”: “ERR_CONVERSATION_LIMIT”}

@k-aito
Copy link
Contributor

k-aito commented Aug 26, 2024

I think it could be a proper error display, but I don't think it can be bypassed. You can reset the chat, and sometimes it helps, but it also stops working after a time. I think it's a limit on the DDG side.

@Troptrap
Copy link
Contributor

Troptrap commented Aug 26, 2024

Proxies and maybe changing the user agent randomly in duck_chat could help. Somehow DDG identifies the device sending too many requests and throttles it.
For me it happens only when I abuse it too much.

Fake user agent is there, I just noticed it. So, only proxies.

@mrgick
Copy link
Owner

mrgick commented Aug 26, 2024

@h9052300
Try to open https://duck.ai in browser - if there is error too, so you need some proxy

@k-aito
Copy link
Contributor

k-aito commented Aug 26, 2024

I think it's related that when you use it too much, they just force you to reset the chat. It would not really help to use a proxy or something else, in my opinion.

@Troptrap
Copy link
Contributor

I think it's related that when you use it too much, they just force you to reset the chat. It would not really help to use a proxy or something else, in my opinion.

I'm using it programmatically, changing the model on each completion and I'm still getting throttled. I assume this is what you mean by reset

@k-aito
Copy link
Contributor

k-aito commented Aug 26, 2024

Yes, when I use it for long conversation after something like 10 messages, it forces making another conversation. But it's done too much, it just blocks you for some time.

I don't know if it was also like that on the browser, but I could no more use the application for a bit of time.

@lunaticsm
Copy link
Contributor

I guess that's because DDC issue, You can make each question are one session.

@Troptrap
Copy link
Contributor

I guess that's because DDC issue, You can make each question are one session.

async def DDG(self,model: str, prompt: str) -> str:
    ddg_chat = DuckChat(model)
    resp = await ddg_chat.ask_question(prompt)
    await ddg_chat._session.close()
    print(resp)
    return resp

This is how I'm using it and still get limited. This function's argument 'model' comes from another function that randomizes the models, so it also resets history from DDG. So, there is some other pattern that DDG uses to identify same user.

@Troptrap
Copy link
Contributor

@mrgick it's possible that history sent from previous model to trigger some red flag when switching models? I don't know, but I assume they have some bot detection in place

@mrgick
Copy link
Owner

mrgick commented Aug 29, 2024

Hello, sorry for long answer


import asyncio
from duck_chat import DuckChat

async def DDG(model, prompt)
    async with DuckChat(model=model) as chat:
          resp = await ddg_chat.ask_question(prompt)
          print(resp)
    return resp


async def test():
  await DDG("gpt-4o-mini","2+2?")
  await DDG("gpt-4o-mini","Tell answer")

asyncio.run(test())

About bot detection, I think duck.ai start to detect aiohttp connection (maybe bad cookies/tcp timings) or maybe they see that we don't send country.json and status requests.


I think library need to migrate from aiohttp to curl_cffi with more simulating request (maybe this will help)


Also needed more research and for now I don't have much time to migrate library =(

@k-aito
Copy link
Contributor

k-aito commented Sep 1, 2024

I think I only got 1 time an issue. Even now, I didn't get the ERR_CONVERSATION_LIMIT yet, but it's true I only use it for a few questions, and then I close the session.

That's why I guess it's not really the library, but just the limitation that DDG choose to apply.

@Troptrap
Copy link
Contributor

I have abused a little bit Duckduckgo's servers lately. I am getting a different error, not the CONVERSATION LIMIT, but ERR_UPSTREAM. I am quite confident it's an IP issue, because as soon as I switch network, it's working again.
It could be also fingerprints, but I think bot fingerprinting would persist after IP changing.
I will be trying with proxies ASAP and will report here.

@Dalveral Dalveral mentioned this issue Oct 5, 2024
@Dalveral
Copy link

Dalveral commented Oct 5, 2024

await ddg_chat._session.close()

Thank you. Its work!

@Dalveral
Copy link

Hello. I am getting a 429 error again. However, "await ddg_chat._session.close()" is not working now.

@Dalveral
Copy link

I used the method text.replace('\n', '') before sending requests; there were probably too many line breaks in my text. Now there are no errors. I didn't think to check this earlier because I was receiving a 429 error and thought the problem was that the service had restricted access from my device.

Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants