Closed muzilong closed 1 year ago
I found this too,any solution??
Could you please try the same request using the official OpenAI Python library? If there are no issues with Python and an issue exists with the PHP library, please reopen the ticket.
Py code should be like this:
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo-16k",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)
@orhanerday Hello, has this problem been resolved,
@pingfuwei did you try on Python package with the same request?
The project is for PHP development, and I need to find a solution for PHP
------------------ 原始邮件 ------------------ 发件人: "orhanerday/open-ai" @.>; 发送时间: 2023年11月9日(星期四) 下午4:14 @.>; @.**@.>; 主题: Re: [orhanerday/open-ai] The data returned is confusing when use stream (Issue #109)
@pingfuwei did you try on Python package with the same request?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
If you got the same issue on python package, it is OpenAI related issue.
I'm sorry for not giving timely feedback.
Yeah, it is OpenAI related issue.
When I reported the problem, openai was in trouble.
When openai fixed the problem everything was resolved.
thank you all the same
This bug still not resolved yet by OpenAi
For now, I have resolved it using regex, I'm extracting content directly from respone.
// Define the pattern to match
$pattern = '/"choices":\[\{"index":0,"delta":\{"content":"(.*?)"\}/';
// Use preg_match_all to find all matches
preg_match_all($pattern, $inputData, $matches);
// Extract content from the matches
$contents = $matches[1];
Hi @iamaz007 Did you contact OpenAI?
Nope, they don't even reply for hours.
I tested libraries, in Flutter, that issue is happening there too. so, for now we have to solve it on our own.
Could you please ask this question on the OpenAI form? Maybe we can get better help from the community.
Please drop the post link over here. Thank you!
Describe the bug
when i Log::info $data like this
Sometimes it is correct:
Sometimes it is trouble:
Very confused
To Reproduce
null
Code snippets
No response
OS
Ubuntu 20.04.5 LTS x86_64
PHP version
8.1.19
Library version
4.8