<?php
/**
 * link: https://www.netbcloud.com/
 * copyright: Copyright (c) 2024 深圳网商天下科技有限公司
 * author: wstianxia
 */

namespace app\forms\common\volcengine\sdk;

trait Config
{
    /** @var string 地域 */
    private $region = "";

    /** @var string 产品服务名 */
    private $service;

    /** @var string api版本号 */
    private $version;

    /** @var string 请求地址 */
    private $host = 'open.volcengineapi.com';

    /** @var string 请求方法 */
    private $method = 'POST';

    /** @var string 方法名 */
    private $action;

    /** @var string 请求内容类型 */
    private $content_type = 'application/json';

    /** @var integer 1：国内站；2：国际站 */
    private $type;

    // 语音技术
    public function speech(): void
    {
        $this->service = 'speech_saas_prod';
        $this->version = '2023-11-07';
        $this->region = 'cn-north-1';
        if($this->type == 2) { // 国际站信息
            $this->host = "open.byteplusapi.com";
            $this->region = 'ap-southeast-1';
        }
    }

    // 方舟大模型
    public function ark(): void
    {
        $this->service = 'ark';
        $this->version = '2024-01-01';
        $this->region = 'ap-southeast-1';
//        $this->region = 'cn-beijing';
    }

    // 智能视觉
    public function visual(): void
    {
        $this->host = 'visual.volcengineapi.com';
        $this->service = 'cv';
        $this->version = '2022-08-31';
        $this->region = 'cn-north-1';
    }
}