作者 赵彬吉

update

@@ -65,19 +65,19 @@ class Gpt @@ -65,19 +65,19 @@ class Gpt
65 65
66 $time = time(); 66 $time = time();
67 try { 67 try {
68 -// $result = Http::withHeaders($this->header)->withOptions(['verify' => false])->acceptJson()  
69 -// ->withBody(json_encode($data, JSON_UNESCAPED_UNICODE), 'application/json')  
70 -// ->post($url);  
71 -// $json = $result->json(); 68 + $result = Http::withHeaders($this->header)->withOptions(['verify' => false])->acceptJson()
  69 + ->withBody(json_encode($data, JSON_UNESCAPED_UNICODE), 'application/json')
  70 + ->post($url);
  71 + $json = $result->json();
72 72
73 - $client = new \GuzzleHttp\Client();  
74 - $result = $client->request('POST', $url, [  
75 - 'proxy' => 'http://104.255.171.237:51395', // 代理服务器地址和端口号  
76 - 'headers' => $this->header,  
77 - 'json' => $data,  
78 - 'verify' => false,  
79 - ])->getBody()->getContents();  
80 - $json = json_decode($result, true); 73 +// $client = new \GuzzleHttp\Client();
  74 +// $result = $client->request('POST', $url, [
  75 +// 'proxy' => 'http://104.255.171.237:51395', // 代理服务器地址和端口号
  76 +// 'headers' => $this->header,
  77 +// 'json' => $data,
  78 +// 'verify' => false,
  79 +// ])->getBody()->getContents();
  80 +// $json = json_decode($result, true);
81 81
82 if (!isset($json['text']) || $json['code'] !==200) { 82 if (!isset($json['text']) || $json['code'] !==200) {
83 Log::error('openai_chat_qqs data:', $data); 83 Log::error('openai_chat_qqs data:', $data);