{"record":{"id":"59213a3cd162d0f4","repo":"binary-husky/gpt_academic","slug":"response-item-result-value-response","errorCode":null,"errorMessage":"{response['item']['result']['value']}: {response['item']['result']['message']}","messagePattern":"\\{response\\['item'\\]\\['result'\\]\\['value'\\]\\}: \\{response\\['item'\\]\\['result'\\]\\['message'\\]\\}","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"request_llms/edge_gpt_free.py","lineNumber":582,"sourceCode":"                                    resp_txt\n                                    + response[\"arguments\"][0][\"messages\"][0][\n                                        \"adaptiveCards\"\n                                    ][0][\"body\"][0][\"inlines\"][0].get(\"text\")\n                                    + \"\\n\"\n                                )\n                                result_text = (\n                                    result_text\n                                    + response[\"arguments\"][0][\"messages\"][0][\n                                        \"adaptiveCards\"\n                                    ][0][\"body\"][0][\"inlines\"][0].get(\"text\")\n                                    + \"\\n\"\n                                )\n                        yield False, resp_txt\n\n                elif response.get(\"type\") == 2:\n                    if response[\"item\"][\"result\"].get(\"error\"):\n                        await self.close()\n                        raise Exception(\n                            f\"{response['item']['result']['value']}: {response['item']['result']['message']}\",\n                        )\n                    if draw:\n                        cache = response[\"item\"][\"messages\"][1][\"adaptiveCards\"][0][\n                            \"body\"\n                        ][0][\"text\"]\n                        response[\"item\"][\"messages\"][1][\"adaptiveCards\"][0][\"body\"][0][\n                            \"text\"\n                        ] = (cache + resp_txt)\n                    if (\n                        response[\"item\"][\"messages\"][-1][\"contentOrigin\"] == \"Apology\"\n                        and resp_txt\n                    ):\n                        response[\"item\"][\"messages\"][-1][\"text\"] = resp_txt_no_link\n                        response[\"item\"][\"messages\"][-1][\"adaptiveCards\"][0][\"body\"][0][\n                            \"text\"\n                        ] = resp_txt\n                        print(","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/binary-husky/gpt_academic/blob/d6bde0fa54373309bd05823a49bda8da019d2c77/request_llms/edge_gpt_free.py#L564-L600","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nraise Exception(f\"{response['item']['result']['value']}: {response['item']['result']['message']}\")\n\n// after (add diagnostics before raising)\nerr = response['item']['result']['error']\nlogger.error(f\"EdgeGPT final error: {err}\")\nraise Exception(f\"{response['item']['result']['value']}: {response['item']['result']['message']}\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    for ok, txt in edge_gpt_stream(...):\n        ...\nexcept Exception as e:\n    msg = str(e)\n    if 'InvalidConversationSignature' in msg:\n        refresh_cookies_and_retry()  # new cookies, max 1 retry\n    else:\n        raise","preventionTips":["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."],"tags":["edge-gpt","bing","streaming","unofficial-api","cookies"],"backgroundTag":null,"analyzedSha":"d6bde0fa54373309bd05823a49bda8da019d2c77","analyzedAt":"2026-08-14T22:48:35.038Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}