更新时间:2024-08-29 GMT+08:00
分享

准备工作

使用盘古大模型Java SDK时,需要在代码中配置以下信息,请提前收集。

表1 资源列表

类型

资源

是否必选

依赖信息

参考文档

备注

大语言模型

华为云盘古

是(大语言模型至少选一个)

  • 盘古模型API调用URL。
  • 华为云IAM账号认证信息。
  • 盘古大模型API参考文档:

    申请资源时,可联系客户支持获取。

  • IAM帮助文档:

    https://support.huaweicloud.com/api-identitycenter/iic_04_0032.html

  • 模型API调用文档中完整url。

    格式示例为:https://{endpoint}/v1/{project_id}/deployments/{deployment_id}/chat/completions

    SDK配置:https://{endpoint}/v1/{project_id}/deployments/{deployment_id} (/chat/completions在SDK代码中已经进行了设置)。

  • IAM endpoint需要根据服务所在的区域正确配置,参考帮助文档“终端节点”章节查找。
  • 参考IAM帮助文档,获取账号相关信息。

华为云Gallery托管三方模型

  • Gallery三方托管模型API调用URL。
  • 华为云IAM账号认证信息。
  • 三方大模型API参考文档:

    申请资源时,可联系客户支持获取。

  • IAM帮助文档:

    https://support.huaweicloud.com/api-identitycenter/iic_04_0032.html

  • 参考三方大模型API参考文档“API”章节,获取URL信息。

    格式示例:https://{endpoint}/v1/infers/{deployment_id}

  • 参考IAM帮助文档,获取账号相关信息。

Embedding模型

华为云CSS

  • CSS Embedding模型API调用URL。
  • 华为云IAM账号认证信息。
  • CSS Embedding模型API参考文档:

    申请资源时,可联系客户支持获取。

  • IAM帮助文档:

    https://support.huaweicloud.com/api-identitycenter/iic_04_0032.html

  • 参考CSS Embedding模型API参考文档,获取URL信息。

    格式示例:https://{endpoint}/v1/{project_id}/applications/{app_id}/{model_version}

  • 参考IAM帮助文档,获取账号相关信息。

文档加载

华为云CSS

  • CSS文档解析服务API调用URL。
  • 华为云IAM账号认证信息。
  • CSS文档解析服务API参考文档:

    申请资源时,可联系客户支持获取。

  • IAM帮助文档:

    https://support.huaweicloud.com/api-identitycenter/iic_04_0032.html

  • 参考CSS Embedding模型API参考文档,获取URL信息。

    格式示例:https://{endpoint}/v1/{project_id}/applications/{app_id}

  • 参考IAM帮助文档,获取账号相关信息。

向量记忆

华为云CSS

  • 集群host信息。
  • 用户认证信息。
  • 云搜索服务CSS:

    https://support.huaweicloud.com/css/index.html

  • 参考CSS服务“快速入门”章节创建机器后,在集群信息中获取hosts信息。

    示例: https://10.0.0.1:9200,https://10.0.0.2:9200

  • 用户认证信息就是创建集群时设置的用户/密码。

华为云CSS(集成Embedding)

  • 集群host信息。
  • 用户认证信息。
  • 云搜索服务CSS:

    https://support.huaweicloud.com/css/index.html

  • 参考CSS服务“快速入门”章节创建机器后,在集群信息中获取hosts信息。

    示例: https://10.0.0.1:9200,https://10.0.0.2:9200

  • 用户认证信息就是创建集群时设置的用户/密码。

Elastic Search

  • 集群host信息。
  • 用户认证信息。
  • ES官网:

    https://www.elastic.co/cn/elasticsearch/

hosts示例:https://10.0.0.1:9200,https://10.0.0.2:9200

标量存储

华为云DCS

  • host信息。
  • 用户认证信息。
  • 分布式缓存DCS:

    https://support.huaweicloud.com/dcs/index.html

host示例:redis://10.0.0.1:6379

Redis

  • host信息。
  • 用户认证信息。
  • Redis官网:

    https://redis.io/

host示例:redis://10.0.0.1:6379

华为云RDS

  • host信息。
  • 用户认证信息。
  • 云数据库RDS:

    https://support.huaweicloud.com/rds/index.html

-

Mysql

  • host信息。
  • 用户认证信息。
  • Mysql官网:

    https://www.mysql.com/

-

iam认证与SDK配置项的映射关系如下:

POST https://iam.cn-southwest-2.myhuaweicloud.com/v3/auth/tokens

{ 
    "auth": { 
        "identity": { 
            "methods": [ 
                "password" 
            ], 
            "password": { 
                "user": { 
                    "name": "username", //IAM用户名
                    "password": "********", //华为云账号密码
                    "domain": { 
                        "name": "domainname" //账号名
                    } 
                } 
            } 
        }, 
        "scope": { 
            "project": { 
                "name": "cn-southwest-2" //服务当前部署在“西南-贵阳一”区域,取值为cn-southwest-2
            } 
        } 
    } 
}

相关文档