snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
953 stars 111 forks source link

SendMessageMutation request fails starting 2 hours ago #179

Closed PMajesty closed 4 months ago

PMajesty commented 4 months ago
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\poe_api_wrapper\api.py", line 798, in send_message
    message_data = self.send_request(apiPath, 'SendMessageMutation', variables, file_form)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\poe_api_wrapper\api.py", line 183, in send_request
    raise Exception(
Exception: Sending request SendMessageMutation failed. status_code:200,  Error log: RuntimeError("Server Error. Raw response data: {'data': None, 'errors': [{'message': 'Server Error'}], 'extensions': {'is_final': True}}")

IDK what happened, I didn't change anything in my script, but all requests just started failing. Funny thing is - it returns status_code: 200 for some reason...

tslearn commented 4 months ago

i have the same bug, i guess poe change something in server.

veloper commented 4 months ago

Screen Shot 2024-07-24 at 3 51 06 PM

Seems like they might have actually lower-cased the first S in the path:

-SendMessageMutation
+sendMessageMutation

Protocol Inspection:

{
  "queryName": "sendMessageMutation",
  "variables": {
    "chatId": null,
    "bot": "claude_3_igloo",
    "query": "hi again",
    "source": {
      "sourceType": "chat_input",
      "chatInputMetadata": {
        "useVoiceRecord": false
      }
    },
    "clientNonce": "<...>",
    "sdid": "<...>",
    "attachments": [],
    "existingMessageAttachmentsIds": [],
    "shouldFetchChat": true,
    "messagePointsDisplayPrice": 200
  },
  "extensions": {
    "hash": "b5694554bb2d91d0226fed35139f1d038fdd0fa30148be02546d0e2afa3e72a4"
  }
}

with the hash differing from:

https://github.com/snowby666/poe-api-wrapper/blob/7fef4814d2445aba0a3faf7b9c978735eac36d19/poe_api_wrapper/queries.py#L123

Confirmed a change worked, making a PR now.

https://github.com/snowby666/poe-api-wrapper/pull/180

FaTal-error1 commented 4 months ago

The problem persists even after changing the "S" in SendMessageMutation to lowercase in the three mentioned files. { "error": "Error getting response from Poe: Sending request sendMessageMutation failed. status_code: 200, Error log: RuntimeError(\"Server Error. Raw response data: {'data': None, 'errors': [{'message': 'Server Error'}], 'extensions': {'is_final': True}}\")" }

BeetleBobsai79 commented 4 months ago

change the hash to "SendMessageMutation": "b4aff2855bc876361737bcbf5f9310b5da4d3250923894ecb8f339de4c2e3fa3",

it fixes the problem

owlsan49 commented 4 months ago

Screen Shot 2024-07-24 at 3 51 06 PM

Seems like they might have actually lower-cased the first S in the path:

-SendMessageMutation
+sendMessageMutation

Protocol Inspection:

{
  "queryName": "sendMessageMutation",
  "variables": {
    "chatId": null,
    "bot": "claude_3_igloo",
    "query": "hi again",
    "source": {
      "sourceType": "chat_input",
      "chatInputMetadata": {
        "useVoiceRecord": false
      }
    },
    "clientNonce": "<...>",
    "sdid": "<...>",
    "attachments": [],
    "existingMessageAttachmentsIds": [],
    "shouldFetchChat": true,
    "messagePointsDisplayPrice": 200
  },
  "extensions": {
    "hash": "b5694554bb2d91d0226fed35139f1d038fdd0fa30148be02546d0e2afa3e72a4"
  }
}

with the hash differing from:

https://github.com/snowby666/poe-api-wrapper/blob/7fef4814d2445aba0a3faf7b9c978735eac36d19/poe_api_wrapper/queries.py#L123

Confirmed a change worked, making a PR now.

180

It doesn't work for me. After doing this fix, I get the same error. image

PMajesty commented 4 months ago

Screen Shot 2024-07-24 at 3 51 06 PM Seems like they might have actually lower-cased the first S in the path:

-SendMessageMutation
+sendMessageMutation

Protocol Inspection:

{
  "queryName": "sendMessageMutation",
  "variables": {
    "chatId": null,
    "bot": "claude_3_igloo",
    "query": "hi again",
    "source": {
      "sourceType": "chat_input",
      "chatInputMetadata": {
        "useVoiceRecord": false
      }
    },
    "clientNonce": "<...>",
    "sdid": "<...>",
    "attachments": [],
    "existingMessageAttachmentsIds": [],
    "shouldFetchChat": true,
    "messagePointsDisplayPrice": 200
  },
  "extensions": {
    "hash": "b5694554bb2d91d0226fed35139f1d038fdd0fa30148be02546d0e2afa3e72a4"
  }
}

with the hash differing from: https://github.com/snowby666/poe-api-wrapper/blob/7fef4814d2445aba0a3faf7b9c978735eac36d19/poe_api_wrapper/queries.py#L123

Confirmed a change worked, making a PR now.

180

It doesn't work for me. After doing this fix, I get the same error. image

Try to reinstall the package from the pull request https://github.com/snowby666/poe-api-wrapper/pull/180

snowby666 commented 4 months ago

This is fixed in the new version. Poe's just changed some of their hashes.