binary-husky/gpt_academic · error · Exception
{response['item']['result']['value']}: {response['item']['re
Error message
{response['item']['result']['value']}: {response['item']['result']['message']} What it means
Raised inside the Chatbot (Sydney/Edge-GPT) streaming loop when the final websocket frame (response type 2, the closing message of a New-Bing conversation turn) carries a non-empty item.result.error object. The code closes the websocket and re-raises the upstream error code and message verbatim as '{value}: {message}'. Common upstream values are 'InvalidConversationSignature' or captcha/region blocks, since this client talks to Bing's undocumented endpoint.
Source
Thrown at request_llms/edge_gpt_free.py:582
resp_txt
+ response["arguments"][0]["messages"][0][
"adaptiveCards"
][0]["body"][0]["inlines"][0].get("text")
+ "\n"
)
result_text = (
result_text
+ response["arguments"][0]["messages"][0][
"adaptiveCards"
][0]["body"][0]["inlines"][0].get("text")
+ "\n"
)
yield False, resp_txt
elif response.get("type") == 2:
if response["item"]["result"].get("error"):
await self.close()
raise Exception(
f"{response['item']['result']['value']}: {response['item']['result']['message']}",
)
if draw:
cache = response["item"]["messages"][1]["adaptiveCards"][0][
"body"
][0]["text"]
response["item"]["messages"][1]["adaptiveCards"][0]["body"][0][
"text"
] = (cache + resp_txt)
if (
response["item"]["messages"][-1]["contentOrigin"] == "Apology"
and resp_txt
):
response["item"]["messages"][-1]["text"] = resp_txt_no_link
response["item"]["messages"][-1]["adaptiveCards"][0]["body"][0][
"text"
] = resp_txt
print(View on GitHub (pinned to d6bde0fa54)
Solutions
- Regenerate Bing cookies (fresh curl-generated Cookies.txt for bing.com) and restart the program so a new conversation signature is negotiated.
- Switch the LLM model to a standard OpenAI-compatible provider (config.py -> LLM_MODEL) since the New-Bing free endpoint is unofficial and unstable.
- Retry from a different network/residential IP; datacenter IPs are frequently blocked by Bing.
- If patching the repo, log the full response['item']['result'] payload to see the exact value/message pair before deciding.
Example fix
// before
raise Exception(f"{response['item']['result']['value']}: {response['item']['result']['message']}")
// after (add diagnostics before raising)
err = response['item']['result']['error']
logger.error(f"EdgeGPT final error: {err}")
raise Exception(f"{response['item']['result']['value']}: {response['item']['result']['message']}") Defensive patterns
Strategy: try-catch
Try / catch
try:
for ok, txt in edge_gpt_stream(...):
...
except Exception as e:
msg = str(e)
if 'InvalidConversationSignature' in msg:
refresh_cookies_and_retry() # new cookies, max 1 retry
else:
raise Prevention
- Keep Bing cookies fresh and store them where the client expects before starting.
- Avoid datacenter IPs for the free New-Bing endpoint.
- Have a fallback LLM_MODEL configured so a switch is one config change.
When it happens
Trigger: Calling the Edge-GPT free model's stream generator and receiving a type-2 closing frame where response['item']['result']['error'] is truthy: expired or never-acquired conversation signature, blocked region/IP (Bing returns an error instead of content), malformed cookies, or Bing changing its private protocol payload shape.
Common situations: Running gpt_academic with EDGE_GPT_FREE models without valid Bing cookies, from a datacenter IP that Bing challenges, after Bing updates its internal message schema (breaking the assumption that 'error' is absent on success), or reusing a conversation id/signature after it expired.
Related errors
AI-assisted analysis of binary-husky/gpt_academic@d6bde0fa54 (2026-08-14).
Data as JSON: /api/errors/59213a3cd162d0f4.
Report an issue: GitHub.