GeoService.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @remark :
* @name :GeoService.php
* @author :lyh
* @method :post
* @time :2025/7/3 14:21
*/
namespace App\Services\Geo;
class GeoService
{
public $api_key = '7yn!We6$&NnVA38bpGy*A@4TQ5iYLJcW';
public $api_url = 'https://api.cmer.com/';
/**
* @remark :请求的方法
* @name :requestAction
* @author :lyh
* @method :post
* @time :2025/7/3 14:26
*/
public function setWebSearchChatAction($content,$platform){
$route = 'v1/websearch_chat';
$url = $this->api_url.$route;
$header = [
'accept: application/json',
'X-CmerApi-Host: llm-chat.p.cmer.com',
'apikey: '.$this->api_key,
'Content-Type: application/json'
];
$message = [
'messages'=>[
[
'content'=>$content,
'role'=>'user'
],
],
'platform'=>$platform,
'security_check'=>true
];
$data = http_post($url,json_encode($message,true),$header);
return $data;
}
}