Closed jsinoti closed 5 months ago
When I define to use the OpenAI::threads()->createAndRun with stream true, I'm getting a error with de result parse.
`OpenAI\Exceptions\UnserializableResponse {#1453 ▼ // app/Helper/OpenIAHelper.php:43
/xxxxxxx/vendor/openai-php/client/src/Transporters/HttpTransporter.php"
-previous: JsonException {#1416 ▼
#code: 4 #file: "
/xxxxxxx/vendor/openai-php/client/ src/Transporters/HttpTransporter.php"
trace: {▼
/xxxxxxx/vendor/openai-php/client/ src/Transporters/HttpTransporter.php:61 {▼ OpenAI\Transporters\HttpTransporter->requestObject(Payload $payload): Response … › /* @var array{error?: array{message: string, type: string, code: string}} $data / › $data = json_decode($contents, true, flags: JSON_THROW_ON_ERROR); › } catch (JsonException $jsonException) { arguments: {▼ $json: """ event: thread.created data: {"id":"thread_rICWuyxxxxxxxxxxaj","object":"thread","created_at":1712078109,"metadata":{}} .... `
This is because assistant V2 must be used. The library needs to be updated to pass v2 here: ->withHttpHeader('OpenAI-Beta', 'assistants=v2')
Stream support has been added (no need for API v2).
https://github.com/openai-php/laravel/releases/tag/v0.9.0
When I define to use the OpenAI::threads()->createAndRun with stream true, I'm getting a error with de result parse.
`OpenAI\Exceptions\UnserializableResponse {#1453 ▼ // app/Helper/OpenIAHelper.php:43
message: "Syntax error"
code: 0
file: "
/xxxxxxx/vendor/openai-php/client/src/Transporters/HttpTransporter.php"
line: 63
-previous: JsonException {#1416 ▼
message: "Syntax error"
/xxxxxxx/vendor/openai-php/client/ src/Transporters/HttpTransporter.php"
line: 61
/xxxxxxx/vendor/openai-php/client/ src/Transporters/HttpTransporter.php:61 {▼ OpenAI\Transporters\HttpTransporter->requestObject(Payload $payload): Response … › /* @var array{error?: array{message: string, type: string, code: string}} $data / › $data = json_decode($contents, true, flags: JSON_THROW_ON_ERROR); › } catch (JsonException $jsonException) { arguments: {▼ $json: """ event: thread.created data: {"id":"thread_rICWuyxxxxxxxxxxaj","object":"thread","created_at":1712078109,"metadata":{}} ....
`