orhanerday / open-ai

OpenAI PHP SDK : Most downloaded, forked, contributed, huge community supported, and used PHP (Laravel , Symfony, Yii, Cake PHP or any PHP framework) SDK for OpenAI GPT-3 and DALL-E. It also supports chatGPT-like streaming. (ChatGPT AI is supported)
https://orhanerday.gitbook.io/openai-php-api-1/
MIT License
2.22k stars 286 forks source link

Sorry, you have been blocked #124

Open artickc opened 9 months ago

artickc commented 9 months ago

Describe the bug

Please enable cookies. Sorry, you have been blocked

To Reproduce

    $prompt = json_encode($textObj)."\nTranslate to: ".$lagnString.".\nRetun all translations in JSON with this structure: \n".$jsonString;
    $result = $open_ai->chat([
        'model' => 'gpt-3.5-turbo',
        'messages' => [
            [
                "role" => "user",
                "content" => $prompt
            ]
        ],
        'temperature' => 0,
        'max_tokens' => 2000,
        'frequency_penalty' => 0,
        'presence_penalty' => 0,
    ]);

    print_r($result);

Code snippets

No response

OS

linux

PHP version

PHP 7.4

Library version

4.9

NDanilov2015 commented 9 months ago

Possibly, in your country chatGPT API can't more be using in usual way due to politics of OpenAI company. But you can try find normal proxy and try use $open_ai->setProxy("https://address:port")

SalimF commented 8 months ago

$open_ai->setProxy("https://address:port")

Hello, how can I add proxy user and password? I notice $curl_info class property didn't have option for proxy password

orhanerday commented 8 months ago

Hi SalimF,

Thank you for reaching out. Have you tried using basic authentication to add the proxy user and password? You can use the following format:

https://username:password@URL https://admin:admin@the-internet.herokuapp.com/basic_auth

Let me know if this works for you or if you have any further questions.

Best regards, Orhan

On Tue, Dec 12, 2023 at 10:35 PM SalimF @.***> wrote:

$open_ai->setProxy("https://address:port")

Hello, how can I add proxy user and password?

— Reply to this email directly, view it on GitHub https://github.com/orhanerday/open-ai/issues/124#issuecomment-1852682722, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFKFT6SND34CJTLV5HEVDL3YJCWWLAVCNFSM6AAAAAA7OAPTLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGY4DENZSGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Orhan ERDAY Software Engineer

SalimF commented 8 months ago

You can use the following format: https://username:password@URL https://admin:admin@the-internet.herokuapp.com/basic_auth Let me know if this works for you or if you have any further questions.

Hi thanks for reply, I added proxy like this

$open_ai->setProxy( "myuser:mypass@http://192.168.10.1:9999") ;

But still I got this error.

Unsupported proxy syntax in 'myuser:mypass@http://192.168.10.1:9999': Port number was not a decimal number between 0 and 65535

orhanerday commented 8 months ago

Salim, did you test the proxy?

Maybe you can use

https://superuser.com/a/1179759