作者 lyh

gx

... ... @@ -34,7 +34,7 @@ class GptService
$apikey = env('AI_CREATE_KEY')??'7yn!We6$&NnVA38bpGy*A@4TQ5iYLJcW';
$client = new CmerClient($apikey);
// 修改超时时间,默认60秒
$client->timeout=300;
$client->timeout = 300;
$payload = new ChatModel($data['message']);
// 修改模型名称,豆包,Gpt,Claude
$payload->model = env('CHAT_GTP_MODEL','gpt-4o-mini');;
... ... @@ -42,7 +42,8 @@ class GptService
//发送请求
if($type == 1){//返回数据
$response = $client->chat($payload);
$result=$response->getBody()->getContents();
$result = $response->getBody()->getContents();
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
if(!$result){
Log::info('ai接口返回错误信息:'.$result. PHP_EOL);
return false;
... ...