open-ai
open-ai copied to clipboard
Sorry, you have been blocked
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
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")
$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
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:[email protected]/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
You can use the following format: https://username:password@URL https://admin:[email protected]/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
Salim, did you test the proxy?
Maybe you can use
https://superuser.com/a/1179759