作者 lyh

gx脚本

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