作者 lyh

gx脚本

... ... @@ -129,8 +129,8 @@ class AiCommandController extends BaseController
'ai.required' => '场景不能为空',
]);
$aiCommandService = new AiCommandService();
$info['ai'] = '请根据这个 {​海外展会与独立站数字营销的结合:线下资源如何助力线上推广} 文章标题帮我生成一个更有吸引力、引发读者兴趣的新标题,只需要给我标题内容,不要回复我别的内容(比如序号、你的提示、寒暄、代码解释、总结之类的)';
$result = $aiCommandService->send_layout_design($info['ai']);
$this->param['ai'] = '请根据这个 {​海外展会与独立站数字营销的结合:线下资源如何助力线上推广} 文章标题帮我生成一个更有吸引力、引发读者兴趣的新标题,只需要给我标题内容,不要回复我别的内容(比如序号、你的提示、寒暄、代码解释、总结之类的)';
$result = $aiCommandService->send_layout_design($this->param['ai']);
$this->response('success', Code::SUCCESS, $result);
}
}
... ...
... ... @@ -36,8 +36,7 @@ class AiCommandService
public function send_layout_design($content){
$param = [
'messages'=>[
'content'=>$content,
'role'=>'user',
['content'=>$content, 'role'=>'user'],
],
'model'=> $this->model,
'supplier'=> $this->supplier,
... ... @@ -49,7 +48,8 @@ class AiCommandService
"apikey: $this->api_key",
"Content-Type:application/json;charset=utf-8",
);
$result = http_post($this->url,json_encode($param,true),$header);
$result = $this->http_post($this->url,json_encode($param,true),$header);
return $result;
}
}
... ...