Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ucloud/services/uai_modelverse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def create_um_infer_api_key(
- **GrantAllModels** (bool) - 全部模型访问开关,开启不受 GrantedModels 参数控制,关闭只能访问 GrantedModels 中添加模型
- **GrantedModels** (str) - 授权模型,内容为数组格式。当 GrantAllModels 为false时 当前key只可访问数组中模型。例:["deepseek-ai/DeepSeek-V3.2-Think"]
- **IPWhitelist** (str) - ip白名单,换行分割的多组ip。支持IPv4和网段,输入后回车生效,最多100个, 示例:192.168.1.1192.168.1.10-192.168.1.100192.168.1.10/24
- **InferenceLogEnabled** (int) - 是否开启推理日志
- **ModelverseDisabled** (int) - 是否modelverse可用 0: 启用 1: 禁用
- **MonthlyLimitAmount** (str) - 月限额,单位随用户所在渠道。126渠道单位为美元
- **SandBoxDisabled** (int) - 是否沙盒可用 0: 启用 1: 禁用(astraflow 沙盒控制未上线,暂时无效)
Expand All @@ -43,14 +44,17 @@ def create_um_infer_api_key(
- **ChannelId** (int) - 渠道id
- **CreateTime** (int) - 创建时间
- **DailyLimitAmount** (str) - 日限额,单位随用户所在渠道。126渠道单位为美元
- **DailyUsedAmount** (str) - 日已使用额,单位随用户所在渠道。126渠道单位为美元
- **ExpireTime** (int) - 过期时间的unix时间戳,-1 用不过期
- **GrantAllModels** (bool) - 全部模型访问开关,开启不受 GrantedModels 参数控制,关闭只能访问 GrantedModels 中添加模型
- **GrantedModels** (list) - 授权的模型,英文逗号分隔,all表示所有模型都有权限
- **IPWhitelist** (str) - ip白名单,换行分割的多组ip。支持IPv4和网段,输入后回车生效,最多100个, 示例:  192.168.1.1 192.168.1.10-192.168.1.100 192.168.1.10/24
- **InferenceLogEnabled** (int) - 是否开启推理日志
- **Key** (str) - 密钥值
- **KeyId** (str) - 资源ID
- **ModelverseDisabled** (int) - 是否modelverse可用 0: 启用 1: 禁用
- **MonthlyLimitAmount** (str) - 月限额,单位随用户所在渠道。126渠道单位为美元
- **MonthlyUsedAmount** (str) - 月已使用额,单位随用户所在渠道。126渠道单位为美元
- **Name** (str) - 名称
- **OrganizationId** (int) - 项目id
- **SandBoxDisabled** (int) - 是否沙盒可用 0: 启用 1: 禁用(astraflow 沙盒控制未上线,暂时无效)
Expand Down Expand Up @@ -757,9 +761,11 @@ def list_uf_square_model(

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **Capabilities** (list) - 模型特性,可选值来源于ListUFSquareModelFilters枚举接口。可多选
- **Keyword** (str) - 关键字
- **Language** (list) - 语言,数组类型,可选值 ["chinese", "english"]
- **Limit** (int) - 每页数量
- **Manufacturer** (list) - 制造商,可选值来源于ListUFSquareModelFilters枚举接口。可多选
- **MaxModelLen** (list) - 上下文长度,数组类型,可选值 [0,4096,16384,32768,131072,256000,262144,1048576]
- **ModelType** (str) - 模型类型
- **Offset** (int) - 偏移量
Expand All @@ -779,21 +785,46 @@ def list_uf_square_model(
- **Currency** (str) - 币种
- **Image** (float) - 生图定价
- **Prompt** (float) - 提示词定价
- **Unit** (str) - 单位(中文),如“次” “百万”
- **UnitEn** (str) - 单位(English),如“Time” “Million”
- **Video** (str) - 生视频定价


**PriceRate**
- **ChargeItem** (str) - 收费项:input/output/thinking/tool...
- **ChargeItemDescription** (str) - 收费项描述
- **ChargeItemDescriptionEn** (str) - 收费项描述英文描述
- **Currency** (str) - 货币单位
- **Price** (str) - 价格
- **Unit** (str) - 计价单位
- **UnitEn** (str) - 计价单位英文


**PriceTier**
- **Condition** (str) - 档位/条件(例如 "32k"、"128k")
- **Description** (str) - 档位描述(例如 "标准上下文 32k")
- **DescriptionEn** (str) - 档位描述(例如 "标准上下文 32k")
- **Rates** (list) - 见 **PriceRate** 模型定义


**SquareModel**
- **BatchName** (str) - 关联的 batch 模型名称
- **BatchSquareModelId** (str) - 关联的 batch 模型广场id
- **CreateAt** (int) - 创建时间
- **Describe** (str) - 详细描述
- **HfUpdateTime** (int) - HuggingFace 更新时间
- **Icon** (str) - 图标
- **Id** (str) - 主键
- **IsHasBatch** (bool) - 是否关联有可用 batch 模型
- **Language** (list) - 语言
- **Manufacturer** (str) - 制造商
- **MaxModelLen** (int) - 模型长度
- **ModelType** (str) - 模型类型
- **Name** (str) - 名称
- **Pricing** (dict) - 见 **Pricing** 模型定义
- **SimpleDescribe** (str) - 简要描述
- **SupportedCapabilities** (list) - 模型能力
- **Tiers** (list) - 见 **PriceTier** 模型定义
- **UpdateAt** (int) - 更新时间


Expand Down Expand Up @@ -1133,6 +1164,7 @@ def update_um_infer_api_key(
- **GrantAllModels** (bool) - 全部模型访问开关,开启不受 GrantedModels 参数控制,关闭只能访问 GrantedModels 中添加模型
- **GrantedModels** (str) - 授权模型,内容为数组格式。当 GrantAllModels 为false时 当前key只可访问数组中模型。例:["deepseek-ai/DeepSeek-V3.2-Think"]
- **IPWhitelist** (str) - ip白名单,换行分割的多组ip。支持IPv4和网段,输入后回车生效,最多100个, 示例:  192.168.1.1 192.168.1.10-192.168.1.100 192.168.1.10/24
- **InferenceLogEnabled** (int) - 是否开启推理日志
- **ModelverseDisabled** (int) - 是否modelverse可用 0: 启用 1: 禁用
- **MonthlyLimitAmount** (str) - 月限额,单位随用户所在渠道。126渠道单位为美元
- **Name** (str) - 更新的名称
Expand Down
8 changes: 8 additions & 0 deletions ucloud/services/uai_modelverse/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class CreateUMInferAPIKeyRequestSchema(schema.RequestSchema):
"GrantAllModels": fields.Bool(required=False, dump_to="GrantAllModels"),
"GrantedModels": fields.Str(required=False, dump_to="GrantedModels"),
"IPWhitelist": fields.Str(required=False, dump_to="IPWhitelist"),
"InferenceLogEnabled": fields.Int(
required=False, dump_to="InferenceLogEnabled"
),
"ModelverseDisabled": fields.Int(
required=False, dump_to="ModelverseDisabled"
),
Expand Down Expand Up @@ -534,9 +537,11 @@ class ListUFSquareModelRequestSchema(schema.RequestSchema):
"""ListUFSquareModel - 查询模型广场数据"""

fields = {
"Capabilities": fields.List(fields.Str()),
"Keyword": fields.Str(required=False, dump_to="Keyword"),
"Language": fields.List(fields.Str()),
"Limit": fields.Int(required=False, dump_to="Limit"),
"Manufacturer": fields.List(fields.Str()),
"MaxModelLen": fields.List(fields.Int()),
"ModelType": fields.Str(required=False, dump_to="ModelType"),
"Offset": fields.Int(required=False, dump_to="Offset"),
Expand Down Expand Up @@ -760,6 +765,9 @@ class UpdateUMInferAPIKeyRequestSchema(schema.RequestSchema):
"GrantAllModels": fields.Bool(required=False, dump_to="GrantAllModels"),
"GrantedModels": fields.Str(required=False, dump_to="GrantedModels"),
"IPWhitelist": fields.Str(required=False, dump_to="IPWhitelist"),
"InferenceLogEnabled": fields.Int(
required=False, dump_to="InferenceLogEnabled"
),
"KeyId": fields.Str(required=True, dump_to="KeyId"),
"ModelverseDisabled": fields.Int(
required=False, dump_to="ModelverseDisabled"
Expand Down
10 changes: 10 additions & 0 deletions ucloud/services/uai_modelverse/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,28 @@ class PricingSchema(schema.ResponseSchema):
"Currency": fields.Str(required=False, load_from="Currency"),
"Image": fields.Float(required=False, load_from="Image"),
"Prompt": fields.Float(required=False, load_from="Prompt"),
"Unit": fields.Str(required=False, load_from="Unit"),
"UnitEn": fields.Str(required=False, load_from="UnitEn"),
"Video": fields.Str(required=False, load_from="Video"),
}


class SquareModelSchema(schema.ResponseSchema):
"""SquareModel - 广场模型"""

fields = {
"BatchName": fields.Str(required=False, load_from="BatchName"),
"BatchSquareModelId": fields.Str(
required=True, load_from="BatchSquareModelId"
),
"CreateAt": fields.Int(required=False, load_from="CreateAt"),
"Describe": fields.Str(required=False, load_from="Describe"),
"HfUpdateTime": fields.Int(required=False, load_from="HfUpdateTime"),
"Icon": fields.Str(required=False, load_from="Icon"),
"Id": fields.Str(required=False, load_from="Id"),
"IsHasBatch": fields.Bool(required=False, load_from="IsHasBatch"),
"Language": fields.List(fields.Str()),
"Manufacturer": fields.Str(required=False, load_from="Manufacturer"),
"MaxModelLen": fields.Int(required=False, load_from="MaxModelLen"),
"ModelType": fields.Str(required=False, load_from="ModelType"),
"Name": fields.Str(required=False, load_from="Name"),
Expand All @@ -132,6 +141,7 @@ class SquareModelSchema(schema.ResponseSchema):
required=False, load_from="SimpleDescribe"
),
"SupportedCapabilities": fields.List(fields.Str()),
"Tiers": fields.List(PriceTierSchema()),
"UpdateAt": fields.Int(required=False, load_from="UpdateAt"),
}

Expand Down
Loading