MoviePilot-Plugins icon indicating copy to clipboard operation
MoviePilot-Plugins copied to clipboard

需要获取答案的签到处理方式

Open liheji opened this issue 9 months ago • 0 comments

需要获取答案的签到,比如 tjupt.org ,是否可以通过chatgpt, 使用代理请求得到,比如

1. 使用 OPENAI 接口

curl https://api.openai.com/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $API_KEY" \
 -d '{
     "model": "gpt-4-vision-preview",
     "messages": [{"role": "user", "content": [
        {"type": "text", "text": "图片描述的电影或电视是以下哪一个,仅给出答案:\\n\"\"\"\\n你好,星期六\\n斗破苍穹年番\\n亏成首富从游戏开始\\n我和春天约在清溪\\n唐人街探案2\\n故乡,别来无恙\\n\"\"\""},
        {
          "type": "image_url",
          "image_url": {
            "url": "https://tjupt.org/pic/attend/2024-05-14/9tGE8CCTe4QcjWexn46aqHJ7Q4kzISgbKHv3Sk-H7o4.jpg"
          }
        }
     ]}],
     "temperature": 0.7
 }'
  • 结果如下
 {
     ...
     "choices": [
         {
             "index": 0,
             "message": {
                 "role": "assistant",
                 "content": " 斗破苍穹年番"
             },
             "finish_reason": "stop"
         }
     ],
     ...
 }

2. 使用 Gemini 接口

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=$API_KEY \
-H 'Content-Type: application/json' \
-d '{
  "contents":[
    {
      "parts":[
        {"text": "图片描述的电影或电视是以下哪一个,仅给出答案:\\n\"\"\"\\n你好,星期六\\n斗破苍穹年番\\n亏成首富从游戏开始\\n我和春天约在清溪\\n唐人街探案2\\n故乡,别来无恙\\n\"\"\""},
        {
          "inline_data": {
            "mime_type":"image/jpeg",
            "data": "图片的base64编码"
          }
        }
      ]
    }
  ]
}'
  • 结果如下
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": " 斗破苍穹年番"
          }
        ],
        "role": "model"
      },
      ...
    }
  ],
  ...
}

liheji avatar May 14 '24 12:05 liheji