Git Product home page Git Product logo

Comments (11)

iamaz007 avatar iamaz007 commented on June 11, 2024 1

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];

from open-ai.

xing61 avatar xing61 commented on June 11, 2024

I found this too,any solution??

from open-ai.

orhanerday avatar orhanerday commented on June 11, 2024

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?"}
    ]
)

from open-ai.

pingfuwei avatar pingfuwei commented on June 11, 2024

@orhanerday Hello, has this problem been resolved,

from open-ai.

orhanerday avatar orhanerday commented on June 11, 2024

@pingfuwei did you try on Python package with the same request?

from open-ai.

pingfuwei avatar pingfuwei commented on June 11, 2024

from open-ai.

orhanerday avatar orhanerday commented on June 11, 2024

If you got the same issue on python package, it is OpenAI related issue.

from open-ai.

muzilong avatar muzilong commented on June 11, 2024

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

from open-ai.

orhanerday avatar orhanerday commented on June 11, 2024

Hi @iamaz007
Did you contact OpenAI?

from open-ai.

iamaz007 avatar iamaz007 commented on June 11, 2024

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.

from open-ai.

orhanerday avatar orhanerday commented on June 11, 2024

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!

from open-ai.

Related Issues (20)

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.