jeromeleong / poe2openai

MIT License
45 stars 4 forks source link

curl http://127.0.0.1:8080/v1/chat/completions 请求失败 #1

Open skyroot opened 1 month ago

skyroot commented 1 month ago

{"error":"HTTP 請求失敗: error sending request for url (https://poe.com/api/gql_POST)"}

jeromeleong commented 1 month ago

確定是chat/completion? poe.com/api/gpl_POST是請求models 列表用的,可能是官方更新了,改了hash值。 我明晚看看是什麼問題,再更新一下

skyroot commented 1 month ago

两种请求都是错误信息,请帮忙解决一下,非常感谢! 一、curl --location 'http://127.0.0.1:8080/v1/chat/completions' \

--header 'Content-Type: application/json' \ --header 'Authorization: Bearer xxx' \ --data '{ "model": "claude", "messages": [{"role": "user", "content": "Hello"}], "stream": true }' {"error":"HTTP 請求失敗: error sending request for url (https://api.poe.com/bot/claude)"} 二、GET http://127.0.0.1:8080/api/models 返回"error": "HTTP 請求失敗: error sending request for url (https://poe.com/api/gql_POST)"

jeromeleong commented 1 month ago

因为我重现不了这个问题 所以可不可以帮我试试下面的两个curl 命令

  1. models list 用的
    curl -X POST 'https://poe.com/api/gql_POST' \
    -H 'Content-Type: application/json' \
    -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' \
    -H 'poegraphql: 1' \
    -H 'Cookie: Poe-Language-Code=zh-Hant;' \
    -d '{
    "queryName": "ExploreBotsListPaginationQuery",
    "variables": {
    "categoryName": "defaultCategory",
    "count": 150
    },
    "extensions": {
    "hash": "b24b2f2f6da147b3345eec1a433ed17b6e1332df97dea47622868f41078a40cc"
    }
    }'
  2. 聊天機械人用的
    curl -X POST https://api.poe.com/bot/GPT-4o-Mini \
    -H "Authorization: Bearer poe-api-token" \
    -H "Content-Type: application/json" \
    -d '{
    "version": "1.0",
    "type": "query",
    "query": [
    {
      "role": "user",
      "content": "hello?"
    }
    ],
    "user_id": "",
    "conversation_id": "",
    "message_id": ""
    }'
skyroot commented 1 month ago

这两个curl POST命令可以的