国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

workerman/http-client響應(yīng)亂碼

島嶼可以找到海

程序代碼或配置

public function test(){

    $http=new Client();
    $http->request($this->api_url, [
        'method' => 'POST',
        'headers' => ["Content-Type"=>"application/json",
            "Authorization"=>"Bearer ".$this->token,
            "Connection"=>"keep-alive",
            "Accept-Encoding"=>"gzip, deflate,br",
            "Accept"=>"*/*"],
        'data' => json_encode([
            "model"=>"gpt-3.5-turbo-0613",
            "messages"=>[
                [
                    'role' => 'system',
                    'content' => 'You are a helpful assistant.',
                ],
                [
                    'role' => 'user',
                    'content' => '你好',
                ]
            ],
            "temperature"=> 0.6
        ]),
        'success' => function ($response) {
            //echo $response->getBody();
            print_r((string)$response->getBody());

        },
        'error' => function ($exception) {
           // echo $exception;
        }
    ]);
}

重現(xiàn)問(wèn)題的步驟


我對(duì)接chatgpt接口時(shí)chatgpt響應(yīng)亂碼,沒(méi)使用流式返回,
但我測(cè)試自己寫(xiě)的接口數(shù)據(jù)是可以正常返回的,這就奇怪了

操作系統(tǒng)環(huán)境及workerman/webman等具體版本

Windows11
php7.4
workerman v4.1.13

1077 1 0
1個(gè)回答

walkor 打賞

"Accept-Encoding"=>"gzip, deflate,br", 去掉

  • 暫無(wú)評(píng)論
年代過(guò)于久遠(yuǎn),無(wú)法發(fā)表回答
??