Skip to content

Proxy doesn't work #137

@Tipo-4ek

Description

@Tipo-4ek

Describe the bug

Hi!
I am trying to use

$open_ai->setProxy("https://134.000.000.000", 0000, "login", "password"); for my proxy but always get curl_error(): supplied resource is not a valid cURL handle resource in

What am I doing wrong? The proxy is definitely working

To Reproduce

$open_ai_key = getenv('OPENAI_API_KEY');
$open_ai = new OpenAi($open_ai_key);
$open_ai->setProxy("http://134.195.154.147", 9290, "utvTFg", "uyFYRa");
$chat = $open_ai->chat([
    "model" => "mymodel",
    "temperature" => 0.1,
    "top_p" => 0.8,
    "messages" => [
        ["role" => "system", "content" => "test"],
        ["role" => "user", "content" => "question"]
    ]
]);

Code snippets

No response

OS

linux

PHP version

PHP 7.4

Library version

latest (5.1?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions