Comments (8)
updated the Openal Client version 0.8.0
But the error remained
from client.
Hi @TitorovD
Can you please send an updated stacktrace from the current version?
And if possible, the prompt you are using or the raw http response content?
from client.
{
"message": "Syntax error",
"exception": "OpenAI\\Exceptions\\UnserializableResponse",
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/openai-php/client/src/Transporters/HttpTransporter.php",
"line": 63,
"trace": [
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/openai-php/client/src/Resources/Completions.php",
"line": 33,
"function": "requestObject",
"class": "OpenAI\\Transporters\\HttpTransporter",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/app/Http/Controllers/staff/StaffAjaxController.php",
"line": 342,
"function": "create",
"class": "OpenAI\\Resources\\Completions",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/app/Http/Controllers/staff/StaffAjaxController.php",
"line": 59,
"function": "report_ai",
"class": "App\\Http\\Controllers\\staff\\StaffAjaxController",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
"line": 54,
"function": "router",
"class": "App\\Http\\Controllers\\staff\\StaffAjaxController",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
"line": 43,
"function": "callAction",
"class": "Illuminate\\Routing\\Controller",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 260,
"function": "dispatch",
"class": "Illuminate\\Routing\\ControllerDispatcher",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 205,
"function": "runController",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 798,
"function": "run",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 141,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/app/Http/Middleware/NucleusUser.php",
"line": 38,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "App\\Http\\Middleware\\NucleusUser",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
"line": 50,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
"line": 78,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
"line": 49,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 121,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
"line": 64,
"function": "handleStatefulRequest",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
"line": 37,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
"line": 67,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 116,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 799,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 776,
"function": "runRouteWithinStack",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 740,
"function": "runRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 729,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 190,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 141,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php",
"line": 66,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
"line": 31,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
"line": 40,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
"line": 86,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php",
"line": 49,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Illuminate\\Http\\Middleware\\HandleCors",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 180,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 116,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 165,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 134,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/var/www/www-root/data/www/demo.mojo.education/public/index.php",
"line": 52,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
}
]
}
from client.
standard test promt
$response = $client->completions()->create([
'model' => 'gpt-3.5-turbo-instruct',
'prompt' => 'Say this is a test',
'max_tokens' => 6,
'temperature' => 0
]);
from client.
This is strange. If I execute exactly the same request, it works fine.
Could you please send the body of the response?
To do so, you can add dd($contents);
on line 60 of the HttpTransporter.
from client.
I took your advice, added dd($contents);
Judging by what the server returns, this is a problem with Cloudflare, which we use for additional protection of our service. I don't know yet what rule needs to be set in Cloudflare for Openair to start working
from client.
The administrator wrote to me that api.openai.com cloudflare is also protected and for some reason blocks requests from your client. How can this be fixed?
from client.
Hi @TitorovD
Thanks for clarification.
I don't think, this is related to our client. Looking into the OpenAI forum I found this thread: https://community.openai.com/t/api-access-failed-showing-cloudflare-block-page/506015/37
Didn't read it, but you may find a solution for your problem there.
If there is anything we can improve in our client to mitigate this issue, please let me know. But as I said before, I don't think that there is anything we can do from our side.
from client.
Related Issues (20)
- [Bug]: /vendor/openai-php/client/src/Transporters/HttpTransporter.php(61): json_decode()
- [Bug]: Wrong type RetrieveJobResponseError constructor
- [Support]: How to modify to adapt a locally-deployed OpenAI API compatible embedding service?
- [Bug]: GPT-3 Model Being Used Despite Specifying GPT-4 in Client Request HOT 1
- Azure Chat with Custom Data problem HOT 1
- [Bug]: ThreadRunResponse missing step_details information HOT 1
- [Bug]: getErrorCode(): Return value must be of type ?string, int returned HOT 1
- [Bug]: all runs result with failure code: "server_error", message: "Sorry, something went wrong." HOT 1
- 提问我该如何结束发起的http请求呢
- Constant HTTP 500 Server errors HOT 2
- [Enhancement] streaming support for assistant api HOT 6
- [Bug]: Images (Dall-e 3) method not working with Azure HOT 1
- How to set the frequency_penalty? HOT 1
- [Bug]: Warning: Undefined array key "code" in Responses/FineTuning/RetrieveJobResponseError.php on line 42 HOT 2
- [Bug]: local.ERROR: 'json_object' is not of type 'object' - 'response_format' {"exception":"[object] (OpenAI\Exceptions\ErrorException(code: 0): 'json_object' is not of type 'object' - 'response_format' at /app/vendor/openai-php/client/src/Transporters/HttpTransporter.php:131) HOT 6
- [Bug]: JSON format is not supported
- [Improvement]: `dd` is not a PHP function, the first image of readme.md needs to be changed. use `var_dump` or `print_r` HOT 1
- [Bug]: HOT 1
- Fatal error: Cannot declare class OpenAI, because the name is already in use in E:\Xampp_8.2\htdocs\ia\vendor\openai-php\client\src\OpenAI.php on line 8 [Bug]: HOT 1
- [Feature]: Compatibility with assistants v2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client.