GeoService.php 1.1 KB
<?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;
    }
}