openai-php / laravel

⚡️ OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with OpenAI API
MIT License
2.68k stars 183 forks source link

Completions also request moderation #14

Closed eddybrando closed 1 year ago

eddybrando commented 1 year ago

I'm using the completions method like this:

use OpenAI\Laravel\Facades\OpenAI;

...

$result = OpenAI::completions()->create([
    'model' => 'text-davinci-003',
    'prompt' => $prompt,
    'max_tokens' => 250,
    'temperature' => 0.2,
]);

For some reason, moderation requests are also being send:

Screenshot 2023-02-12 at 18 40 54

This is the only call that I've done in the past 30 minutes to the OpenAI API, so it shouldn't be merging various usages.

Could it be that we're automatically making moderation requests when making completion requests?

eddybrando commented 1 year ago

Interestingly, for each completion request, twice as many moderation requests are send.

Screenshot 2023-02-12 at 18 43 29

eddybrando commented 1 year ago

I believe I confused the request I indeed did in the playground with the ones I did to the API with this package. Sorry...