帮你快速理解、总结文档立即下载

基于源版本创建 Agent 版本

最近更新时间:2026-09-22 11:08:53
我的收藏

1. 接口描述

接口请求域名: workbuddyenterprise.tencentcloudapi.com 。

基于源版本创建新版本:Manifest / Model / Description 传入即整体覆盖,未传则沿用源版本。

默认接口请求频率限制:20次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:CreateAgentVersionFromSource。
Version String 公共参数,本接口取值:2026-07-09。
Region String 公共参数,本接口不需要传递此参数。
AgentId String

Agent 业务 ID


示例值:01M2YYX05YE46QG88E1SEPMZ9J
SourceVersionId String

源版本 ID,同 Agent 下未 DISABLED 的任意版本


示例值:2101589342229893121
IsTest Boolean

新版本类型:true=TEST,false=PROD


示例值:true
Model String

可选,覆盖源版本的 Model


示例值:glm-5.2
Description String

可选,覆盖源版本的 Description


示例值:测试版本
Manifest String

可选,完整 v2.0 manifest JSON 字符串;传入则整体覆盖源版本 manifest


示例值:{"id":"01M30YW815BNECBMPQ5Z3Z7V9Q","metadata":{"agentName":"py-e2e-1789960003182","model":"deepseek-v4-pro"},"system_prompt":"你是一个测试助手,请用一个词回答问题。","version":"2.0"}
SandboxTemplateId String

沙箱模板 ID。可选,patch 语义:null 沿用源版本绑定的模板;空串解绑(恢复系统默认模板);非空时模板须属于当前企业且可用(未删除、状态正常)。


示例值:test1

3. 输出参数

参数名称 类型 描述
VersionId String

版本 ID


示例值:2101976040663908352
AgentId String

Agent 业务 ID


示例值:01M2YYX05YE46QG88E1SEPMZ9J
VersionName String

版本名称


示例值:test-3
VersionType String

版本类型:DEFAULT / TEST / PROD


示例值:TEST
Description String

版本变更说明


示例值:init from source default
Model String

模型标识


示例值:glm-5.2
Manifest String

Manifest v2.0 精简 manifest 原文(JSON 字符串)


示例值:{"id":"01M30YW815BNECBMPQ5Z3Z7V9Q","metadata":{"agentName":"py-e2e-1789960003182","model":"deepseek-v4-pro"},"system_prompt":"你是一个测试助手,请用一个词回答问题。","version":"2.0"}
Status String

版本状态:DRAFT / ENABLED / DISABLED


示例值:ENABLED
CreatedTime String

创建时间


示例值:2006-01-02T15:04:05Z07:00
ModifiedTime String

更新时间


示例值:2006-01-02T15:04:05Z07:00
SandboxTemplateId String

绑定的沙箱模板 ID;未绑定时为空,创建会话沙箱使用系统默认模板。


示例值:test1
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 基于源版本创建 Agent 版本

输入示例

POST / HTTP/1.1
Host: workbuddyenterprise.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateAgentVersionFromSource
<公共请求参数>

{
    "AgentId": "736918300000000001",
    "SourceVersionId": "2087791755109965825",
    "IsTest": true,
    "Model": "hunyuan-turbos-latest",
    "Description": "在 prod-3 基础上调整系统提示词"
}

输出示例

{
    "Response": {
        "VersionId": "2087791755109965826",
        "AgentId": "736918300000000001",
        "VersionName": "test-3",
        "VersionType": "TEST",
        "Description": "在 prod-3 基础上调整系统提示词",
        "Model": "hunyuan-turbos-latest",
        "Manifest": "{\"version\":\"2.0\",\"system_prompt\":\"你是数据分析助手,负责汇总运营数据。\"}",
        "Status": "ENABLED",
        "CreatedTime": "2026-08-12T08:20:00Z",
        "ModifiedTime": "2026-08-12T08:20:00Z",
        "RequestId": "3c6d138e-1234-5678-9abc-def012345678"
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
AuthFailure.IdentityNotFound AuthFailure.IdentityNotFound
AuthFailure.IdentityResolutionFailed AuthFailure.IdentityResolutionFailed
FailedOperation.EntitlementNotFound FailedOperation.EntitlementNotFound
InternalError.EntitlementCheckFailed InternalError.EntitlementCheckFailed
InternalError.MarshalFailed InternalError.MarshalFailed
InternalError.NoResolver InternalError.NoResolver
InternalError.Panic InternalError.Panic
InternalError.ReadBodyFailed InternalError.ReadBodyFailed
InternalError.ResolveEnterpriseFailed InternalError.ResolveEnterpriseFailed
InternalError.TenantResolveFailed InternalError.TenantResolveFailed
InternalError.Unknown InternalError.Unknown
InternalError.VersionOperationFailed InternalError.VersionOperationFailed
InvalidParameter.ActionNotFound InvalidParameter.ActionNotFound
InvalidParameter.ActionRequired InvalidParameter.ActionRequired
InvalidParameter.AgentIDRequired InvalidParameter.AgentIDRequired
InvalidParameter.EmptyBody InvalidParameter.EmptyBody
InvalidParameter.InvalidJSON InvalidParameter.InvalidJSON
InvalidParameter.InvalidRequestBody InvalidParameter.InvalidRequestBody
InvalidParameter.ManifestRequired InvalidParameter.ManifestRequired
InvalidParameter.VersionIDRequired InvalidParameter.VersionIDRequired
MissingParameter.UinRequired MissingParameter.UinRequired
ResourceNotFound.Agent ResourceNotFound.Agent
ResourceNotFound.Version ResourceNotFound.Version
UnauthorizedOperation.UnprovisionedTenant UnauthorizedOperation.UnprovisionedTenant