|
...
|
...
|
@@ -22,6 +22,10 @@ class AiCommandService |
|
|
|
|
|
|
|
public $api_key = 'nnLsyr3IhPNsJt5OvTtD9SVCLEixMntg';
|
|
|
|
|
|
|
|
public $model = 'gemini-2.0-flash-lite';
|
|
|
|
|
|
|
|
public $supplier = 'google';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :Ai一键排版
|
|
|
|
* @name :ai_click_layout
|
|
...
|
...
|
@@ -29,29 +33,23 @@ class AiCommandService |
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 17:03
|
|
|
|
*/
|
|
|
|
public function ai_click_layout(){
|
|
|
|
public function send_layout_design($content){
|
|
|
|
$param = [
|
|
|
|
'messages'=>[
|
|
|
|
'content'=>'',
|
|
|
|
'content'=>$content,
|
|
|
|
'role'=>'user',
|
|
|
|
],
|
|
|
|
'model'=> 'gemini-2.0-flash-lite',
|
|
|
|
'supplier'=> 'google',
|
|
|
|
'model'=> $this->model,
|
|
|
|
'supplier'=> $this->supplier,
|
|
|
|
'security_check'=> false
|
|
|
|
];
|
|
|
|
$header = [
|
|
|
|
'accept'=>'application/json',
|
|
|
|
'X-CmerApi-Host'=>'llm-chat.p.cmer.com',
|
|
|
|
'apikey'=>$this->api_key,
|
|
|
|
'Content-Type'=>'application/json'
|
|
|
|
];
|
|
|
|
$header = array(
|
|
|
|
"Accept: application/json",
|
|
|
|
"X-CmerApi-Host: llm-chat.p.cmer.com",
|
|
|
|
"apikey: $this->api_key",
|
|
|
|
"Content-Type:application/json;charset=utf-8",
|
|
|
|
);
|
|
|
|
$result = http_post($this->url,$param,$header);
|
|
|
|
$result = http_post($this->url,json_encode($param,true),$header);
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|