Coder Social home page Coder Social logo

chatgpt's Introduction

chatgpt's People

Contributors

onekb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chatgpt's Issues

403 Forbidden

How to fix this error? I'm running locally with the same IP address as in the browser. Proxy also has the same problem.

PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://chat.openai.com/backend-api/conversation` resulted in a `403 Forbidden` response:
error code: 1020
 in /Users/nomax/Desktop/openaiphp/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

需要新增 User-Agent 和 cf_clearance 才能正常使用

使用 onekb/chat-gpt: 1.0.3 折腾了两三个小时,openai 一直返回 403
对比 https://github.com/acheong08/ChatGPT/blob/45659c12aeac12bbee48a9fa6c6b026371433ad0/config.json.example#L1-L5
发现少了 User-Agentcf_clearance,加上之后就正常了

失败返回如下

$ php chatgpt.php
🐚 问问神奇海螺:dd
让我想想。
^ """
Client error: `POST https://chat.openai.com/backend-api/conversation` resulted in a `403 Forbidden` response:\n
<!DOCTYPE html>\n
<html lang="en-US">\n
<head>\n
    <title>Just a moment...</title>\n
    <meta http-equiv="Content-Type" conte (truncated...)\n
"""
^ "可能是因为网络原因,请求中断,你可以再问一次。"

成功返回如下

$ php chatgpt.php
🐚 问问神奇海螺:abc
让我想想。
^ array:3 [
  "answer" => "I'm sorry, but I'm not sure what you're asking. Could you please provide more information or context? I'm a large language model trained by OpenAI and I don't have access to the internet, so I can only provide information based on what I've been trained on"
  "conversationID" => "387e41d9-7afd-4b8d-b1a0-2de93736e655"
  "parentMessageId" => "7708dd76-d53c-46de-958a-e5c96c87a714"
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.