你好呀 👋
onekb / chatgpt Goto Github PK
View Code? Open in Web Editor NEWChatGPT for PHP,和简易终端实现。Using OpenAI GPT3.5 model API.
Home Page: https://packagist.org/packages/onekb/chat-gpt
License: MIT License
ChatGPT for PHP,和简易终端实现。Using OpenAI GPT3.5 model API.
Home Page: https://packagist.org/packages/onekb/chat-gpt
License: MIT License
你好呀 👋
'answer' => $answer,
'conversationID' => $conversationID,
'parentMessageId' => $parentID,
应该全部 conversationID parentMessageID 或者 全部 conversationId parentMessageId
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
[GuzzleHttp\Exception\RequestException]
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://chat.openai.com/api/auth/session
使用 onekb/chat-gpt: 1.0.3
折腾了两三个小时,openai 一直返回 403
对比 https://github.com/acheong08/ChatGPT/blob/45659c12aeac12bbee48a9fa6c6b026371433ad0/config.json.example#L1-L5
发现少了 User-Agent
和 cf_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"
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.