From acd2ec296479481b7ef294bba2a4cece8ece2f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 9 Sep 2025 14:04:24 +0800 Subject: [PATCH 001/100] fix Change-Id: I28e9043d7fc92be8a5967f99308d84e8920ecf26 --- .../coze.loop.evaluation.spi.thrift | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift new file mode 100644 index 000000000..e3631caf6 --- /dev/null +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift @@ -0,0 +1,100 @@ +namespace go coze.loop.evaluation.spi +include "../../../base.thrift" + +struct SearchEvalTargetRequest { + 1: optional i64 workspace_id // 空间id + 2: optional string keyword // 搜索关键字,如需使用请用户自行实现 + + 20: optional map ext // 扩展字段:目前会透传regoin和空间id信息,key名如下:search_region、search_space_id + + 100: optional i32 page_size + 101: optional string page_token + + 255: optional base.Base Base +} + +struct SearchEvalTargetResponse { + 1: optional list custom_eval_targets + + 100: optional string next_page_token + 101: optional bool has_more + + 255: base.BaseResp BaseResp (api.none="true") +} + +// fornax会展示在平台,并在运行时透传 +struct CustomEvalTarget { + 1: optional string id // 唯一键,平台不消费,仅做透传 + 2: optional string name // 名称,平台用于展示在对象搜索下拉列表 + 3: optional string avatar_url // 头像url,平台用于展示在对象搜索下拉列表 +} + +struct InvokeEvalTargetRequest { + 1: optional i64 workspace_id // 空间id + 2: optional InvokeEvalTargetInput input // 输入信息 + 3: optional CustomEvalTarget custom_eval_target // 如果创建实验时选了二级对象,则会透传search接口返回的二级对象信息 + + 255: optional base.Base Base (api.none="true"); +} + +struct InvokeEvalTargetResponse { + 1: optional InvokeEvalTargetOutput output // 输出 + 2: optional InvokeEvalTargetUsage usage // 消耗 + + 255: base.BaseResp BaseResp (api.none="true") +} + +struct InvokeEvalTargetInput { + 1: optional map eval_set_fields // 评测集字段信息,key=评测集列名,value=评测集列值 + + 20: optional map ext // 扩展字段,动态参数会通过ext字段传递 +} + +// 新增 +struct InvokeEvalTargetOutput { + 1: optional Content actual_output // 实际输出 + + 20: optional map ext // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 +} + +struct Content { + 1: optional ContentType content_type // 类型 + 10: optional string text // 当content_type=text,则从此字段中取值 + 11: optional Image image // 当content_type=image,则从此字段中取图片信息 + 12: optional list multi_part // 当content_type=multi_part,则从此字段遍历获取多模态的值 +} + +typedef string ContentType(ts.enum="true") +const ContentType ContentType_Text = "text" // 文本类型:string、integer、float、boolean、object、array都属于文本类型 +const ContentType ContentType_Image = "image" +const ContentType ContentType_MultiPart = "multi_part" // 多模态,例如图+文 + +struct Image { + 1: optional string url +} + +struct InvokeEvalTargetUsage { + 1: optional i64 input_tokens // 输入token消耗 + 2: optional i64 output_tokens // 输出token消耗 +} + +struct AsyncInvokeEvalTargetRequest { + 1: optional i64 space_id + 2: optional i64 invoke_id // 执行id,传递给自定义对象,在回传结果时透传 + 3: optional string token // 根据invoke_id签发的token,在回传结果时透传 + 4: optional InvokeEvalTargetInput input // 执行输入信息 + 5: optional CustomEvalTarget custom_eval_target // 如果创建实验时选了二级对象,则会透传二级对象信息 + + 255: optional base.Base Base (api.none="true"); +} + +struct AsyncInvokeEvalTargetResponse { + 255: base.BaseResp BaseResp (api.none="true") +} + + +service EvaluationSPIService { + SearchEvalTargetResponse SearchEvalTarget(1: SearchEvalTargetRequest req) // 搜索评测对象 + InvokeEvalTargetResponse InvokeEvalTarget(1: InvokeEvalTargetRequest req) // 执行 + AsyncInvokeEvalTargetResponse AsyncInvokeEvalTarget(1: AsyncInvokeEvalTargetRequest req) // 异步执行 +} \ No newline at end of file From c6569cfae3ac27cfb944fb535e1f53405d8a8420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 9 Sep 2025 14:15:19 +0800 Subject: [PATCH 002/100] fix Change-Id: Icfaa097086770b4272d17451da1793662fdb8e66 --- .../loop/evaluation/domain/eval_target.thrift | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 5335cd117..104c27426 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -42,6 +42,8 @@ struct EvalTargetContent { 103: optional CozeWorkflow coze_workflow // EvalTargetType=5 时,传参此字段。 评测对象为 VolcengineAgent 时, 需要设置 VolcengineAgent 信息 104: optional VolcengineAgent volcengine_agent + // EvalTargetType=6 时,传参此字段。 评测对象为 CustomPSM 时, 需要设置 CustomPSM 信息 + 105: optional CustomPSM custom_psm } enum EvalTargetType { @@ -50,8 +52,58 @@ enum EvalTargetType { Trace = 3 // Trace CozeWorkflow = 4 VolcengineAgent = 5 // 火山智能体 + CustomPSM = 6 // 自定义psm for内场 } +struct CustomPSM { + 1: optional string id // 应用ID + + 2: optional string name // DTO使用,不存数据库 + 3: optional string description // DTO使用,不存数据库 + + // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 + 10: optional string psm + 11: optional AccessProtocol access_protocol // 接入协议 + 12: optional list regions + 13: optional string cluster + 14: optional HttpInfo invoke_http_info // 执行http信息 + 15: optional HttpInfo async_invoke_http_info // 异步执行http信息,如果用户选了异步就传入这个字段 + 16: optional bool need_search_target // 是否需要搜索对象 + 17: optional HttpInfo search_http_info // 搜索对象http信息 + 18: optional bool is_async // 是否异步 + 19: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 +} + +struct CustomEvalTarget { + 1: optional string id // 唯一键,平台不消费,仅做透传 + 2: optional string name // 名称,平台用于展示在对象搜索下拉列表 + 3: optional string avatar_url // 头像url,平台用于展示在对象搜索下拉列表 + + 10: optional map ext // 扩展字段,目前主要存储旧版协议response中的额外字段:object_type(旧版ID)、object_meta、space_id +} + +struct HttpInfo { + 1: optional HttpMethod method + 2: optional string path + 4: optional i64 timeout // ms,默认5000,最大800,000 +} + +typedef string Region (ts.enum="true") +const Region Region_BOE = "boe" +const Region Region_CN = "cn" +const Region Region_I18N = "i18n" + +typedef string AccessProtocol (ts.enum="true") +const AccessProtocol AccessProtocol_RPC = "rpc" +const AccessProtocol AccessProtocol_RPCOld = "rpc_old" +const AccessProtocol AccessProtocol_BytefaasHTTP = "bytefaas_http" +const AccessProtocol AccessProtocol_BytefaasHTTPOld = "bytefaas_http_old" + +typedef string HttpMethod (ts.enum="true") +const HttpMethod HttpMethod_Get = "get" +const HttpMethod HttpMethod_Post = "post" + + struct VolcengineAgent { 1: optional i64 id (api.js_conv='true', go.tag='json:"id"') // 罗盘应用ID From 8eb3cd7066e14f9448fbaf8635cd6cda49f6919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 9 Sep 2025 14:42:15 +0800 Subject: [PATCH 003/100] fix Change-Id: I7bfa075fb27ff072cd88a839ea34a9e376158455 --- .../coze.loop.evaluation.eval_target.thrift | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index f8b7bef97..e7b014096 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -3,6 +3,7 @@ namespace go coze.loop.evaluation.eval_target include "../../../base.thrift" include "domain/common.thrift" include "./domain/eval_target.thrift" +include "coze.loop.evaluation.spi.thrift" struct CreateEvalTargetRequest { 1: required i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') @@ -17,6 +18,7 @@ struct CreateEvalTargetParam { 3: optional eval_target.EvalTargetType eval_target_type 4: optional eval_target.CozeBotInfoType bot_info_type 5: optional string bot_publish_version // 如果是发布版本则需要填充这个字段 + 6: optional eval_target.CustomEvalTarget custom_eval_target // type=6,并且有搜索对象,搜索结果信息通过这个字段透传 } struct CreateEvalTargetResponse { @@ -179,6 +181,79 @@ struct ListSourceEvalTargetVersionsResponse { 255: base.BaseResp BaseResp } +struct SearchCustomEvalTargetRequest { + 1: optional i64 workspace_id // fornax平台ID + 2: optional string keyword // 透传spi接口 + 3: optional i64 application_id // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 + 4: optional eval_target.CustomPSM custom_psm, // 自定义PSM详情,非必填,应用注册调试时传 + 5: optional eval_target.Region region // 必填 + + 100: optional i32 page_size + 101: optional string page_token + + 255: optional base.Base Base +} + +struct SearchCustomEvalTargetResponse { + 1: list custom_eval_targets + + 100: optional string next_page_token + 101: optional bool has_more + + 255: base.BaseResp BaseResp (api.none="true") +} + +struct DebugEvalTargetRequest { + 1: optional i64 workspace_id + 2: optional eval_target.EvalTargetType eval_target_type // 类型 + + 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 + 11: optional common.RuntimeParam target_runtime_param // 动态参数 + + 50: optional eval_target.CustomPSM custom_psm // 如果type=6,需要前端传入自定义psm相关信息 + + 255: optional base.Base Base +} + +struct DebugEvalTargetResponse { + 1: optional eval_target.EvalTargetRecord eval_target_record + + 255: base.BaseResp BaseResp +} + +struct AsyncDebugEvalTargetRequest { + 1: optional i64 workspace_id + 2: optional eval_target.EvalTargetType eval_target_type // 类型 + + 10: optional common.RuntimeParam target_runtime_param // 动态参数 + + 50: optional eval_target.CustomPSM custom_psm // 如果type=6,需要前端传入自定义psm相关信息 + 51: optional string custom_psm_spi_param // 执行参数:如果type=6,则传spi request json序列化结果 + + 255: optional base.Base Base +} + +struct AsyncDebugEvalTargetResponse { + 1: required i64 invoke_id + + 255: base.BaseResp BaseResp +} + +struct PassbackEvalTargetInvokeResultRequest { + 1: optional i64 workspace_id + 2: optional i64 invoke_id + 3: optional string token + + 10: optional coze.loop.evaluation.spi.InvokeEvalTargetOutput output // 输出 + 11: optional coze.loop.evaluation.spi.InvokeEvalTargetUsage usage // 消耗 + + 255: optional base.Base Base (api.none="true"); +} + +struct PassbackEvalTargetInvokeResultResponse { + 255: base.BaseResp BaseResp (api.none="true") +} + service EvalTargetService { // 创建评测对象 CreateEvalTargetResponse CreateEvalTarget(1: CreateEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets") @@ -193,9 +268,19 @@ service EvalTargetService { // Source评测对象版本列表 ListSourceEvalTargetVersionsResponse ListSourceEvalTargetVersions(1: ListSourceEvalTargetVersionsRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/list_source_version") BatchGetSourceEvalTargetsResponse BatchGetSourceEvalTargets (1: BatchGetSourceEvalTargetsRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/batch_get_source") + // 搜索自定义评测对象 + SearchCustomEvalTargetResponse SearchCustomEvalTarget(1: SearchCustomEvalTargetRequest req) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/search_custom") + // 执行 ExecuteEvalTargetResponse ExecuteEvalTarget(1: ExecuteEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/:eval_target_id/versions/:eval_target_version_id/execute") GetEvalTargetRecordResponse GetEvalTargetRecord(1: GetEvalTargetRecordRequest request) (api.category="eval_target", api.get = "/api/evaluation/v1/eval_target_records/:eval_target_record_id") BatchGetEvalTargetRecordsResponse BatchGetEvalTargetRecords(1: BatchGetEvalTargetRecordsRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_target_records/batch_get") + // debug + DebugEvalTargetResponse DebugEvalTarget(1: DebugEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/debug") + AsyncDebugEvalTargetResponse AsyncDebugEvalTarget(1: AsyncDebugEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/async_debug") + + // 回传执行结果 + PassbackEvalTargetInvokeResultResponse PassbackEvalTargetInvokeResult(1: PassbackEvalTargetInvokeResultRequest req) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/passback_result") + } (api.js_conv="true" ) From 2aa0e897fec37983b2f7a23fb766641dd7f55c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 9 Sep 2025 14:52:32 +0800 Subject: [PATCH 004/100] fix Change-Id: I8a707cf43498ee967cfdba57ef86efeffc1030cf --- .../coze.loop.evaluation.eval_target.thrift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index e7b014096..4e9385d47 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -182,9 +182,9 @@ struct ListSourceEvalTargetVersionsResponse { } struct SearchCustomEvalTargetRequest { - 1: optional i64 workspace_id // fornax平台ID + 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') // 空间ID 2: optional string keyword // 透传spi接口 - 3: optional i64 application_id // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 + 3: optional i64 application_id (api.js_conv="true", go.tag = 'json:"application_id"') // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 4: optional eval_target.CustomPSM custom_psm, // 自定义PSM详情,非必填,应用注册调试时传 5: optional eval_target.Region region // 必填 @@ -204,7 +204,7 @@ struct SearchCustomEvalTargetResponse { } struct DebugEvalTargetRequest { - 1: optional i64 workspace_id + 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') 2: optional eval_target.EvalTargetType eval_target_type // 类型 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 @@ -222,7 +222,7 @@ struct DebugEvalTargetResponse { } struct AsyncDebugEvalTargetRequest { - 1: optional i64 workspace_id + 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') 2: optional eval_target.EvalTargetType eval_target_type // 类型 10: optional common.RuntimeParam target_runtime_param // 动态参数 @@ -234,14 +234,14 @@ struct AsyncDebugEvalTargetRequest { } struct AsyncDebugEvalTargetResponse { - 1: required i64 invoke_id + 1: required i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') 255: base.BaseResp BaseResp } struct PassbackEvalTargetInvokeResultRequest { - 1: optional i64 workspace_id - 2: optional i64 invoke_id + 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') + 2: optional i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') 3: optional string token 10: optional coze.loop.evaluation.spi.InvokeEvalTargetOutput output // 输出 From dfb66c18129632f1eb38f7d29694eef3839df1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 9 Sep 2025 17:14:48 +0800 Subject: [PATCH 005/100] fix Change-Id: Ieefca2bbaa98ba7232a47ef6a66d378cb1f03e00 --- .../coze/loop/evaluation/coze.loop.evaluation.spi.thrift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift index e3631caf6..0ca4241a7 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift @@ -22,7 +22,6 @@ struct SearchEvalTargetResponse { 255: base.BaseResp BaseResp (api.none="true") } -// fornax会展示在平台,并在运行时透传 struct CustomEvalTarget { 1: optional string id // 唯一键,平台不消费,仅做透传 2: optional string name // 名称,平台用于展示在对象搜索下拉列表 @@ -79,7 +78,7 @@ struct InvokeEvalTargetUsage { } struct AsyncInvokeEvalTargetRequest { - 1: optional i64 space_id + 1: optional i64 workspace_id 2: optional i64 invoke_id // 执行id,传递给自定义对象,在回传结果时透传 3: optional string token // 根据invoke_id签发的token,在回传结果时透传 4: optional InvokeEvalTargetInput input // 执行输入信息 From ffd5ad43415ea8f13566d7f346257c65fab89383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 20:01:23 +0800 Subject: [PATCH 006/100] fix Change-Id: Ia6915b5f07839436d00d0c1ef372fa1e08cb01ef --- idl/thrift/coze/loop/evaluation/domain/eval_target.thrift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 104c27426..e527e5f74 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -70,8 +70,9 @@ struct CustomPSM { 15: optional HttpInfo async_invoke_http_info // 异步执行http信息,如果用户选了异步就传入这个字段 16: optional bool need_search_target // 是否需要搜索对象 17: optional HttpInfo search_http_info // 搜索对象http信息 - 18: optional bool is_async // 是否异步 - 19: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 + 18: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 + 19: optional bool is_async // 是否异步 + } struct CustomEvalTarget { From 8f4dc69543461dfc8871452e42e92f6b5bd7609b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 20:13:39 +0800 Subject: [PATCH 007/100] fi Change-Id: I93dab02d49da4ef4344a3a24bf2494bb712e9106 --- .../coze/loop/apis/eval_target_service.go | 64 + .../router/coze/loop/apis/coze.loop.apis.go | 4 + .../api/router/coze/loop/apis/middleware.go | 20 + .../loop/apis/evaltargetservice/client.go | 24 + .../evaltargetservice/evaltargetservice.go | 144 + .../domain/eval_target/eval_target.go | 1989 +++++ .../eval_target/eval_target_validator.go | 34 + .../domain/eval_target/k-eval_target.go | 1411 ++++ .../coze.loop.evaluation.eval_target.go | 7094 ++++++++++++++--- ...e.loop.evaluation.eval_target_validator.go | 109 + .../eval_target/evaltargetservice/client.go | 24 + .../evaltargetservice/evaltargetservice.go | 144 + .../k-coze.loop.evaluation.eval_target.go | 4021 +++++++++- .../evaluation/evaltargetservice/client.go | 24 + .../evaltargetservice/evaltargetservice.go | 144 + .../observability/domain/trace/k-trace.go | 24 +- .../loop/observability/domain/trace/trace.go | 56 +- .../loeval_target/local_evaltargetservice.go | 90 + .../evaluation/application/eval_target_app.go | 20 + .../evaluation/domain/entity/target.go | 5 + .../entity/target_builtin_custom_psm.go | 73 + .../loop/evaluation/domain/eval_target.thrift | 2 +- 22 files changed, 14200 insertions(+), 1320 deletions(-) create mode 100644 backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go diff --git a/backend/api/handler/coze/loop/apis/eval_target_service.go b/backend/api/handler/coze/loop/apis/eval_target_service.go index 1628bc7e3..660dbf5bb 100644 --- a/backend/api/handler/coze/loop/apis/eval_target_service.go +++ b/backend/api/handler/coze/loop/apis/eval_target_service.go @@ -106,3 +106,67 @@ func BatchGetEvalTargetRecords(ctx context.Context, c *app.RequestContext) { func BatchGetSourceEvalTargets(ctx context.Context, c *app.RequestContext) { invokeAndRender(ctx, c, localEvalTargetSvc.BatchGetSourceEvalTargets) } + +// SearchCustomEvalTarget . +// @router /api/evaluation/v1/eval_targets/search_custom [POST] +func SearchCustomEvalTarget(ctx context.Context, c *app.RequestContext) { + var err error + var req eval_target.SearchCustomEvalTargetRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(eval_target.SearchCustomEvalTargetResponse) + + c.JSON(consts.StatusOK, resp) +} + +// DebugEvalTarget . +// @router /api/evaluation/v1/eval_targets/debug [POST] +func DebugEvalTarget(ctx context.Context, c *app.RequestContext) { + var err error + var req eval_target.DebugEvalTargetRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(eval_target.DebugEvalTargetResponse) + + c.JSON(consts.StatusOK, resp) +} + +// AsyncDebugEvalTarget . +// @router /api/evaluation/v1/eval_targets/async_debug [POST] +func AsyncDebugEvalTarget(ctx context.Context, c *app.RequestContext) { + var err error + var req eval_target.AsyncDebugEvalTargetRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(eval_target.AsyncDebugEvalTargetResponse) + + c.JSON(consts.StatusOK, resp) +} + +// PassbackEvalTargetInvokeResult . +// @router /api/evaluation/v1/eval_targets/passback_result [POST] +func PassbackEvalTargetInvokeResult(ctx context.Context, c *app.RequestContext) { + var err error + var req eval_target.PassbackEvalTargetInvokeResultRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(eval_target.PassbackEvalTargetInvokeResultResponse) + + c.JSON(consts.StatusOK, resp) +} diff --git a/backend/api/router/coze/loop/apis/coze.loop.apis.go b/backend/api/router/coze/loop/apis/coze.loop.apis.go index 8213999a1..4f8a10a97 100644 --- a/backend/api/router/coze/loop/apis/coze.loop.apis.go +++ b/backend/api/router/coze/loop/apis/coze.loop.apis.go @@ -101,10 +101,14 @@ func Register(r *server.Hertz, handler *apis.APIHandler) { _v11 := _evaluation.Group("/v1", _v11Mw(handler)...) _v11.POST("/eval_targets", append(_eval_targetsMw(handler), apis.CreateEvalTarget)...) _eval_targets := _v11.Group("/eval_targets", _eval_targetsMw(handler)...) + _eval_targets.POST("/async_debug", append(_asyncdebugevaltargetMw(handler), apis.AsyncDebugEvalTarget)...) _eval_targets.POST("/batch_get_by_source", append(_batchgetevaltargetsbysourceMw(handler), apis.BatchGetEvalTargetsBySource)...) _eval_targets.POST("/batch_get_source", append(_batchgetsourceevaltargetsMw(handler), apis.BatchGetSourceEvalTargets)...) + _eval_targets.POST("/debug", append(_debugevaltargetMw(handler), apis.DebugEvalTarget)...) _eval_targets.POST("/list_source", append(_listsourceevaltargetsMw(handler), apis.ListSourceEvalTargets)...) _eval_targets.POST("/list_source_version", append(_listsourceevaltargetversionsMw(handler), apis.ListSourceEvalTargetVersions)...) + _eval_targets.POST("/passback_result", append(_passbackevaltargetinvokeresultMw(handler), apis.PassbackEvalTargetInvokeResult)...) + _eval_targets.POST("/search_custom", append(_searchcustomevaltargetMw(handler), apis.SearchCustomEvalTarget)...) { _eval_target_id := _eval_targets.Group("/:eval_target_id", _eval_target_idMw(handler)...) { diff --git a/backend/api/router/coze/loop/apis/middleware.go b/backend/api/router/coze/loop/apis/middleware.go index 3c3bfcf32..f282e05cb 100644 --- a/backend/api/router/coze/loop/apis/middleware.go +++ b/backend/api/router/coze/loop/apis/middleware.go @@ -1260,3 +1260,23 @@ func _listtracesoapiMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil } + +func _asyncdebugevaltargetMw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} + +func _debugevaltargetMw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} + +func _passbackevaltargetinvokeresultMw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} + +func _searchcustomevaltargetMw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go index b8db17c0c..44ac06dc5 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go @@ -18,9 +18,13 @@ type Client interface { ListSourceEvalTargets(ctx context.Context, request *eval_target.ListSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetsResponse, err error) ListSourceEvalTargetVersions(ctx context.Context, request *eval_target.ListSourceEvalTargetVersionsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetVersionsResponse, err error) BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) + SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) + DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) + AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) + PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -87,6 +91,11 @@ func (p *kEvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context return p.kClient.BatchGetSourceEvalTargets(ctx, request) } +func (p *kEvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchCustomEvalTarget(ctx, req) +} + func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.ExecuteEvalTarget(ctx, request) @@ -101,3 +110,18 @@ func (p *kEvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.BatchGetEvalTargetRecords(ctx, request) } + +func (p *kEvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncDebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go index 7457927a2..fe0824733 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go @@ -63,6 +63,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "SearchCustomEvalTarget": kitex.NewMethodInfo( + searchCustomEvalTargetHandler, + newEvalTargetServiceSearchCustomEvalTargetArgs, + newEvalTargetServiceSearchCustomEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "ExecuteEvalTarget": kitex.NewMethodInfo( executeEvalTargetHandler, newEvalTargetServiceExecuteEvalTargetArgs, @@ -84,6 +91,27 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "DebugEvalTarget": kitex.NewMethodInfo( + debugEvalTargetHandler, + newEvalTargetServiceDebugEvalTargetArgs, + newEvalTargetServiceDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncDebugEvalTarget": kitex.NewMethodInfo( + asyncDebugEvalTargetHandler, + newEvalTargetServiceAsyncDebugEvalTargetArgs, + newEvalTargetServiceAsyncDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( + passbackEvalTargetInvokeResult_Handler, + newEvalTargetServicePassbackEvalTargetInvokeResultArgs, + newEvalTargetServicePassbackEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -250,6 +278,25 @@ func newEvalTargetServiceBatchGetSourceEvalTargetsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetSourceEvalTargetsResult() } +func searchCustomEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceSearchCustomEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceSearchCustomEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).SearchCustomEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceSearchCustomEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetArgs() +} + +func newEvalTargetServiceSearchCustomEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetResult() +} + func executeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceExecuteEvalTargetArgs) realResult := result.(*eval_target.EvalTargetServiceExecuteEvalTargetResult) @@ -307,6 +354,63 @@ func newEvalTargetServiceBatchGetEvalTargetRecordsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetEvalTargetRecordsResult() } +func debugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).DebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetArgs() +} + +func newEvalTargetServiceDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetResult() +} + +func asyncDebugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncDebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetArgs() +} + +func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() +} + +func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) + realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) + success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() +} + type kClient struct { c client.Client sc client.Streaming @@ -389,6 +493,16 @@ func (p *kClient) BatchGetSourceEvalTargets(ctx context.Context, request *eval_t return _result.GetSuccess(), nil } +func (p *kClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceSearchCustomEvalTargetArgs + _args.Req = req + var _result eval_target.EvalTargetServiceSearchCustomEvalTargetResult + if err = p.c.Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest) (r *eval_target.ExecuteEvalTargetResponse, err error) { var _args eval_target.EvalTargetServiceExecuteEvalTargetArgs _args.Request = request @@ -418,3 +532,33 @@ func (p *kClient) BatchGetEvalTargetRecords(ctx context.Context, request *eval_t } return _result.GetSuccess(), nil } + +func (p *kClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceDebugEvalTargetResult + if err = p.c.Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncDebugEvalTargetResult + if err = p.c.Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs + _args.Req = req + var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index e8f9ac560..0beba7170 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -11,6 +11,26 @@ import ( "strings" ) +const ( + RegionBOE = "boe" + + RegionCN = "cn" + + RegionI18N = "i18n" + + AccessProtocolRPC = "rpc" + + AccessProtocolRPCOld = "rpc_old" + + AccessProtocolBytefaasHTTP = "bytefaas_http" + + AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" + + HttpMethodGet = "get" + + HttpMethodPost = "post" +) + type EvalTargetType int64 const ( @@ -23,6 +43,8 @@ const ( EvalTargetType_CozeWorkflow EvalTargetType = 4 // 火山智能体 EvalTargetType_VolcengineAgent EvalTargetType = 5 + // 自定义psm服务 for内场 + EvalTargetType_CustomPSM EvalTargetType = 6 ) func (p EvalTargetType) String() string { @@ -37,6 +59,8 @@ func (p EvalTargetType) String() string { return "CozeWorkflow" case EvalTargetType_VolcengineAgent: return "VolcengineAgent" + case EvalTargetType_CustomPSM: + return "CustomPSM" } return "" } @@ -53,6 +77,8 @@ func EvalTargetTypeFromString(s string) (EvalTargetType, error) { return EvalTargetType_CozeWorkflow, nil case "VolcengineAgent": return EvalTargetType_VolcengineAgent, nil + case "CustomPSM": + return EvalTargetType_CustomPSM, nil } return EvalTargetType(0), fmt.Errorf("not a valid EvalTargetType string") } @@ -259,6 +285,12 @@ func (p *EvalTargetRunStatus) Value() (driver.Value, error) { return int64(*p), nil } +type Region = string + +type AccessProtocol = string + +type HttpMethod = string + type EvalTarget struct { // 基本信息 ID *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" json:"id" form:"id" query:"id"` @@ -1387,6 +1419,8 @@ type EvalTargetContent struct { CozeWorkflow *CozeWorkflow `thrift:"coze_workflow,103,optional" frugal:"103,optional,CozeWorkflow" form:"coze_workflow" json:"coze_workflow,omitempty" query:"coze_workflow"` // EvalTargetType=5 时,传参此字段。 评测对象为 VolcengineAgent 时, 需要设置 VolcengineAgent 信息 VolcengineAgent *VolcengineAgent `thrift:"volcengine_agent,104,optional" frugal:"104,optional,VolcengineAgent" form:"volcengine_agent" json:"volcengine_agent,omitempty" query:"volcengine_agent"` + // EvalTargetType=6 时,传参此字段。 评测对象为 CustomPSM 时, 需要设置 CustomPSM 信息 + CustomPsm *CustomPSM `thrift:"custom_psm,105,optional" frugal:"105,optional,CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` } func NewEvalTargetContent() *EvalTargetContent { @@ -1479,6 +1513,18 @@ func (p *EvalTargetContent) GetVolcengineAgent() (v *VolcengineAgent) { } return p.VolcengineAgent } + +var EvalTargetContent_CustomPsm_DEFAULT *CustomPSM + +func (p *EvalTargetContent) GetCustomPsm() (v *CustomPSM) { + if p == nil { + return + } + if !p.IsSetCustomPsm() { + return EvalTargetContent_CustomPsm_DEFAULT + } + return p.CustomPsm +} func (p *EvalTargetContent) SetInputSchemas(val []*common.ArgsSchema) { p.InputSchemas = val } @@ -1500,6 +1546,9 @@ func (p *EvalTargetContent) SetCozeWorkflow(val *CozeWorkflow) { func (p *EvalTargetContent) SetVolcengineAgent(val *VolcengineAgent) { p.VolcengineAgent = val } +func (p *EvalTargetContent) SetCustomPsm(val *CustomPSM) { + p.CustomPsm = val +} var fieldIDToName_EvalTargetContent = map[int16]string{ 1: "input_schemas", @@ -1509,6 +1558,7 @@ var fieldIDToName_EvalTargetContent = map[int16]string{ 102: "prompt", 103: "coze_workflow", 104: "volcengine_agent", + 105: "custom_psm", } func (p *EvalTargetContent) IsSetInputSchemas() bool { @@ -1539,6 +1589,10 @@ func (p *EvalTargetContent) IsSetVolcengineAgent() bool { return p.VolcengineAgent != nil } +func (p *EvalTargetContent) IsSetCustomPsm() bool { + return p.CustomPsm != nil +} + func (p *EvalTargetContent) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1613,6 +1667,14 @@ func (p *EvalTargetContent) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 105: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField105(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -1731,6 +1793,14 @@ func (p *EvalTargetContent) ReadField104(iprot thrift.TProtocol) error { p.VolcengineAgent = _field return nil } +func (p *EvalTargetContent) ReadField105(iprot thrift.TProtocol) error { + _field := NewCustomPSM() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomPsm = _field + return nil +} func (p *EvalTargetContent) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -1766,6 +1836,10 @@ func (p *EvalTargetContent) Write(oprot thrift.TProtocol) (err error) { fieldId = 104 goto WriteFieldError } + if err = p.writeField105(oprot); err != nil { + fieldId = 105 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -1926,6 +2000,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 104 end error: ", p), err) } +func (p *EvalTargetContent) writeField105(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomPsm() { + if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 105); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomPsm.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 105 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 105 end error: ", p), err) +} func (p *EvalTargetContent) String() string { if p == nil { @@ -1962,6 +2054,9 @@ func (p *EvalTargetContent) DeepEqual(ano *EvalTargetContent) bool { if !p.Field104DeepEqual(ano.VolcengineAgent) { return false } + if !p.Field105DeepEqual(ano.CustomPsm) { + return false + } return true } @@ -2031,6 +2126,1900 @@ func (p *EvalTargetContent) Field104DeepEqual(src *VolcengineAgent) bool { } return true } +func (p *EvalTargetContent) Field105DeepEqual(src *CustomPSM) bool { + + if !p.CustomPsm.DeepEqual(src) { + return false + } + return true +} + +type CustomPSM struct { + // 应用ID + ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` + // DTO使用,不存数据库 + Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` + // DTO使用,不存数据库 + Description *string `thrift:"description,3,optional" frugal:"3,optional,string" form:"description" json:"description,omitempty" query:"description"` + // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 + Psm *string `thrift:"psm,10,optional" frugal:"10,optional,string" form:"psm" json:"psm,omitempty" query:"psm"` + // 接入协议 + AccessProtocol *AccessProtocol `thrift:"access_protocol,11,optional" frugal:"11,optional,string" form:"access_protocol" json:"access_protocol,omitempty" query:"access_protocol"` + Regions []Region `thrift:"regions,12,optional" frugal:"12,optional,list" form:"regions" json:"regions,omitempty" query:"regions"` + Cluster *string `thrift:"cluster,13,optional" frugal:"13,optional,string" form:"cluster" json:"cluster,omitempty" query:"cluster"` + // 执行http信息 + InvokeHTTPInfo *HttpInfo `thrift:"invoke_http_info,14,optional" frugal:"14,optional,HttpInfo" form:"invoke_http_info" json:"invoke_http_info,omitempty" query:"invoke_http_info"` + // 异步执行http信息,如果用户选了异步就传入这个字段 + AsyncInvokeHTTPInfo *HttpInfo `thrift:"async_invoke_http_info,15,optional" frugal:"15,optional,HttpInfo" form:"async_invoke_http_info" json:"async_invoke_http_info,omitempty" query:"async_invoke_http_info"` + // 是否需要搜索对象 + NeedSearchTarget *bool `thrift:"need_search_target,16,optional" frugal:"16,optional,bool" form:"need_search_target" json:"need_search_target,omitempty" query:"need_search_target"` + // 搜索对象http信息 + SearchHTTPInfo *HttpInfo `thrift:"search_http_info,17,optional" frugal:"17,optional,HttpInfo" form:"search_http_info" json:"search_http_info,omitempty" query:"search_http_info"` + // 搜索对象返回的信息 + CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,18,optional" frugal:"18,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + // 是否异步 + IsAsync *bool `thrift:"is_async,19,optional" frugal:"19,optional,bool" form:"is_async" json:"is_async,omitempty" query:"is_async"` +} + +func NewCustomPSM() *CustomPSM { + return &CustomPSM{} +} + +func (p *CustomPSM) InitDefault() { +} + +var CustomPSM_ID_DEFAULT string + +func (p *CustomPSM) GetID() (v string) { + if p == nil { + return + } + if !p.IsSetID() { + return CustomPSM_ID_DEFAULT + } + return *p.ID +} + +var CustomPSM_Name_DEFAULT string + +func (p *CustomPSM) GetName() (v string) { + if p == nil { + return + } + if !p.IsSetName() { + return CustomPSM_Name_DEFAULT + } + return *p.Name +} + +var CustomPSM_Description_DEFAULT string + +func (p *CustomPSM) GetDescription() (v string) { + if p == nil { + return + } + if !p.IsSetDescription() { + return CustomPSM_Description_DEFAULT + } + return *p.Description +} + +var CustomPSM_Psm_DEFAULT string + +func (p *CustomPSM) GetPsm() (v string) { + if p == nil { + return + } + if !p.IsSetPsm() { + return CustomPSM_Psm_DEFAULT + } + return *p.Psm +} + +var CustomPSM_AccessProtocol_DEFAULT AccessProtocol + +func (p *CustomPSM) GetAccessProtocol() (v AccessProtocol) { + if p == nil { + return + } + if !p.IsSetAccessProtocol() { + return CustomPSM_AccessProtocol_DEFAULT + } + return *p.AccessProtocol +} + +var CustomPSM_Regions_DEFAULT []Region + +func (p *CustomPSM) GetRegions() (v []Region) { + if p == nil { + return + } + if !p.IsSetRegions() { + return CustomPSM_Regions_DEFAULT + } + return p.Regions +} + +var CustomPSM_Cluster_DEFAULT string + +func (p *CustomPSM) GetCluster() (v string) { + if p == nil { + return + } + if !p.IsSetCluster() { + return CustomPSM_Cluster_DEFAULT + } + return *p.Cluster +} + +var CustomPSM_InvokeHTTPInfo_DEFAULT *HttpInfo + +func (p *CustomPSM) GetInvokeHTTPInfo() (v *HttpInfo) { + if p == nil { + return + } + if !p.IsSetInvokeHTTPInfo() { + return CustomPSM_InvokeHTTPInfo_DEFAULT + } + return p.InvokeHTTPInfo +} + +var CustomPSM_AsyncInvokeHTTPInfo_DEFAULT *HttpInfo + +func (p *CustomPSM) GetAsyncInvokeHTTPInfo() (v *HttpInfo) { + if p == nil { + return + } + if !p.IsSetAsyncInvokeHTTPInfo() { + return CustomPSM_AsyncInvokeHTTPInfo_DEFAULT + } + return p.AsyncInvokeHTTPInfo +} + +var CustomPSM_NeedSearchTarget_DEFAULT bool + +func (p *CustomPSM) GetNeedSearchTarget() (v bool) { + if p == nil { + return + } + if !p.IsSetNeedSearchTarget() { + return CustomPSM_NeedSearchTarget_DEFAULT + } + return *p.NeedSearchTarget +} + +var CustomPSM_SearchHTTPInfo_DEFAULT *HttpInfo + +func (p *CustomPSM) GetSearchHTTPInfo() (v *HttpInfo) { + if p == nil { + return + } + if !p.IsSetSearchHTTPInfo() { + return CustomPSM_SearchHTTPInfo_DEFAULT + } + return p.SearchHTTPInfo +} + +var CustomPSM_CustomEvalTarget_DEFAULT *CustomEvalTarget + +func (p *CustomPSM) GetCustomEvalTarget() (v *CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return CustomPSM_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} + +var CustomPSM_IsAsync_DEFAULT bool + +func (p *CustomPSM) GetIsAsync() (v bool) { + if p == nil { + return + } + if !p.IsSetIsAsync() { + return CustomPSM_IsAsync_DEFAULT + } + return *p.IsAsync +} +func (p *CustomPSM) SetID(val *string) { + p.ID = val +} +func (p *CustomPSM) SetName(val *string) { + p.Name = val +} +func (p *CustomPSM) SetDescription(val *string) { + p.Description = val +} +func (p *CustomPSM) SetPsm(val *string) { + p.Psm = val +} +func (p *CustomPSM) SetAccessProtocol(val *AccessProtocol) { + p.AccessProtocol = val +} +func (p *CustomPSM) SetRegions(val []Region) { + p.Regions = val +} +func (p *CustomPSM) SetCluster(val *string) { + p.Cluster = val +} +func (p *CustomPSM) SetInvokeHTTPInfo(val *HttpInfo) { + p.InvokeHTTPInfo = val +} +func (p *CustomPSM) SetAsyncInvokeHTTPInfo(val *HttpInfo) { + p.AsyncInvokeHTTPInfo = val +} +func (p *CustomPSM) SetNeedSearchTarget(val *bool) { + p.NeedSearchTarget = val +} +func (p *CustomPSM) SetSearchHTTPInfo(val *HttpInfo) { + p.SearchHTTPInfo = val +} +func (p *CustomPSM) SetCustomEvalTarget(val *CustomEvalTarget) { + p.CustomEvalTarget = val +} +func (p *CustomPSM) SetIsAsync(val *bool) { + p.IsAsync = val +} + +var fieldIDToName_CustomPSM = map[int16]string{ + 1: "id", + 2: "name", + 3: "description", + 10: "psm", + 11: "access_protocol", + 12: "regions", + 13: "cluster", + 14: "invoke_http_info", + 15: "async_invoke_http_info", + 16: "need_search_target", + 17: "search_http_info", + 18: "custom_eval_target", + 19: "is_async", +} + +func (p *CustomPSM) IsSetID() bool { + return p.ID != nil +} + +func (p *CustomPSM) IsSetName() bool { + return p.Name != nil +} + +func (p *CustomPSM) IsSetDescription() bool { + return p.Description != nil +} + +func (p *CustomPSM) IsSetPsm() bool { + return p.Psm != nil +} + +func (p *CustomPSM) IsSetAccessProtocol() bool { + return p.AccessProtocol != nil +} + +func (p *CustomPSM) IsSetRegions() bool { + return p.Regions != nil +} + +func (p *CustomPSM) IsSetCluster() bool { + return p.Cluster != nil +} + +func (p *CustomPSM) IsSetInvokeHTTPInfo() bool { + return p.InvokeHTTPInfo != nil +} + +func (p *CustomPSM) IsSetAsyncInvokeHTTPInfo() bool { + return p.AsyncInvokeHTTPInfo != nil +} + +func (p *CustomPSM) IsSetNeedSearchTarget() bool { + return p.NeedSearchTarget != nil +} + +func (p *CustomPSM) IsSetSearchHTTPInfo() bool { + return p.SearchHTTPInfo != nil +} + +func (p *CustomPSM) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + +func (p *CustomPSM) IsSetIsAsync() bool { + return p.IsAsync != nil +} + +func (p *CustomPSM) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.STRING { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 15: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField15(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 16: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField16(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 17: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField17(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 18: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField18(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 19: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField19(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomPSM[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CustomPSM) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ID = _field + return nil +} +func (p *CustomPSM) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Name = _field + return nil +} +func (p *CustomPSM) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Description = _field + return nil +} +func (p *CustomPSM) ReadField10(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Psm = _field + return nil +} +func (p *CustomPSM) ReadField11(iprot thrift.TProtocol) error { + + var _field *AccessProtocol + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.AccessProtocol = _field + return nil +} +func (p *CustomPSM) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]Region, 0, size) + for i := 0; i < size; i++ { + + var _elem Region + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Regions = _field + return nil +} +func (p *CustomPSM) ReadField13(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Cluster = _field + return nil +} +func (p *CustomPSM) ReadField14(iprot thrift.TProtocol) error { + _field := NewHttpInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.InvokeHTTPInfo = _field + return nil +} +func (p *CustomPSM) ReadField15(iprot thrift.TProtocol) error { + _field := NewHttpInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.AsyncInvokeHTTPInfo = _field + return nil +} +func (p *CustomPSM) ReadField16(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.NeedSearchTarget = _field + return nil +} +func (p *CustomPSM) ReadField17(iprot thrift.TProtocol) error { + _field := NewHttpInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.SearchHTTPInfo = _field + return nil +} +func (p *CustomPSM) ReadField18(iprot thrift.TProtocol) error { + _field := NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} +func (p *CustomPSM) ReadField19(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsAsync = _field + return nil +} + +func (p *CustomPSM) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CustomPSM"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + if err = p.writeField15(oprot); err != nil { + fieldId = 15 + goto WriteFieldError + } + if err = p.writeField16(oprot); err != nil { + fieldId = 16 + goto WriteFieldError + } + if err = p.writeField17(oprot); err != nil { + fieldId = 17 + goto WriteFieldError + } + if err = p.writeField18(oprot); err != nil { + fieldId = 18 + goto WriteFieldError + } + if err = p.writeField19(oprot); err != nil { + fieldId = 19 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CustomPSM) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetID() { + if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *CustomPSM) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *CustomPSM) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetDescription() { + if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Description); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *CustomPSM) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetPsm() { + if err = oprot.WriteFieldBegin("psm", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Psm); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *CustomPSM) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetAccessProtocol() { + if err = oprot.WriteFieldBegin("access_protocol", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.AccessProtocol); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *CustomPSM) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetRegions() { + if err = oprot.WriteFieldBegin("regions", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Regions)); err != nil { + return err + } + for _, v := range p.Regions { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} +func (p *CustomPSM) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetCluster() { + if err = oprot.WriteFieldBegin("cluster", thrift.STRING, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Cluster); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} +func (p *CustomPSM) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeHTTPInfo() { + if err = oprot.WriteFieldBegin("invoke_http_info", thrift.STRUCT, 14); err != nil { + goto WriteFieldBeginError + } + if err := p.InvokeHTTPInfo.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} +func (p *CustomPSM) writeField15(oprot thrift.TProtocol) (err error) { + if p.IsSetAsyncInvokeHTTPInfo() { + if err = oprot.WriteFieldBegin("async_invoke_http_info", thrift.STRUCT, 15); err != nil { + goto WriteFieldBeginError + } + if err := p.AsyncInvokeHTTPInfo.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) +} +func (p *CustomPSM) writeField16(oprot thrift.TProtocol) (err error) { + if p.IsSetNeedSearchTarget() { + if err = oprot.WriteFieldBegin("need_search_target", thrift.BOOL, 16); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.NeedSearchTarget); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 16 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) +} +func (p *CustomPSM) writeField17(oprot thrift.TProtocol) (err error) { + if p.IsSetSearchHTTPInfo() { + if err = oprot.WriteFieldBegin("search_http_info", thrift.STRUCT, 17); err != nil { + goto WriteFieldBeginError + } + if err := p.SearchHTTPInfo.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) +} +func (p *CustomPSM) writeField18(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 18); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) +} +func (p *CustomPSM) writeField19(oprot thrift.TProtocol) (err error) { + if p.IsSetIsAsync() { + if err = oprot.WriteFieldBegin("is_async", thrift.BOOL, 19); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsAsync); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) +} + +func (p *CustomPSM) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CustomPSM(%+v)", *p) + +} + +func (p *CustomPSM) DeepEqual(ano *CustomPSM) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ID) { + return false + } + if !p.Field2DeepEqual(ano.Name) { + return false + } + if !p.Field3DeepEqual(ano.Description) { + return false + } + if !p.Field10DeepEqual(ano.Psm) { + return false + } + if !p.Field11DeepEqual(ano.AccessProtocol) { + return false + } + if !p.Field12DeepEqual(ano.Regions) { + return false + } + if !p.Field13DeepEqual(ano.Cluster) { + return false + } + if !p.Field14DeepEqual(ano.InvokeHTTPInfo) { + return false + } + if !p.Field15DeepEqual(ano.AsyncInvokeHTTPInfo) { + return false + } + if !p.Field16DeepEqual(ano.NeedSearchTarget) { + return false + } + if !p.Field17DeepEqual(ano.SearchHTTPInfo) { + return false + } + if !p.Field18DeepEqual(ano.CustomEvalTarget) { + return false + } + if !p.Field19DeepEqual(ano.IsAsync) { + return false + } + return true +} + +func (p *CustomPSM) Field1DeepEqual(src *string) bool { + + if p.ID == src { + return true + } else if p.ID == nil || src == nil { + return false + } + if strings.Compare(*p.ID, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field2DeepEqual(src *string) bool { + + if p.Name == src { + return true + } else if p.Name == nil || src == nil { + return false + } + if strings.Compare(*p.Name, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field3DeepEqual(src *string) bool { + + if p.Description == src { + return true + } else if p.Description == nil || src == nil { + return false + } + if strings.Compare(*p.Description, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field10DeepEqual(src *string) bool { + + if p.Psm == src { + return true + } else if p.Psm == nil || src == nil { + return false + } + if strings.Compare(*p.Psm, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field11DeepEqual(src *AccessProtocol) bool { + + if p.AccessProtocol == src { + return true + } else if p.AccessProtocol == nil || src == nil { + return false + } + if strings.Compare(*p.AccessProtocol, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field12DeepEqual(src []Region) bool { + + if len(p.Regions) != len(src) { + return false + } + for i, v := range p.Regions { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *CustomPSM) Field13DeepEqual(src *string) bool { + + if p.Cluster == src { + return true + } else if p.Cluster == nil || src == nil { + return false + } + if strings.Compare(*p.Cluster, *src) != 0 { + return false + } + return true +} +func (p *CustomPSM) Field14DeepEqual(src *HttpInfo) bool { + + if !p.InvokeHTTPInfo.DeepEqual(src) { + return false + } + return true +} +func (p *CustomPSM) Field15DeepEqual(src *HttpInfo) bool { + + if !p.AsyncInvokeHTTPInfo.DeepEqual(src) { + return false + } + return true +} +func (p *CustomPSM) Field16DeepEqual(src *bool) bool { + + if p.NeedSearchTarget == src { + return true + } else if p.NeedSearchTarget == nil || src == nil { + return false + } + if *p.NeedSearchTarget != *src { + return false + } + return true +} +func (p *CustomPSM) Field17DeepEqual(src *HttpInfo) bool { + + if !p.SearchHTTPInfo.DeepEqual(src) { + return false + } + return true +} +func (p *CustomPSM) Field18DeepEqual(src *CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} +func (p *CustomPSM) Field19DeepEqual(src *bool) bool { + + if p.IsAsync == src { + return true + } else if p.IsAsync == nil || src == nil { + return false + } + if *p.IsAsync != *src { + return false + } + return true +} + +type CustomEvalTarget struct { + // 唯一键,平台不消费,仅做透传 + ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` + // 名称,平台用于展示在对象搜索下拉列表 + Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` + // 头像url,平台用于展示在对象搜索下拉列表 + AvatarURL *string `thrift:"avatar_url,3,optional" frugal:"3,optional,string" form:"avatar_url" json:"avatar_url,omitempty" query:"avatar_url"` + // 扩展字段,目前主要存储旧版协议response中的额外字段:object_type(旧版ID)、object_meta、space_id + Ext map[string]string `thrift:"ext,10,optional" frugal:"10,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` +} + +func NewCustomEvalTarget() *CustomEvalTarget { + return &CustomEvalTarget{} +} + +func (p *CustomEvalTarget) InitDefault() { +} + +var CustomEvalTarget_ID_DEFAULT string + +func (p *CustomEvalTarget) GetID() (v string) { + if p == nil { + return + } + if !p.IsSetID() { + return CustomEvalTarget_ID_DEFAULT + } + return *p.ID +} + +var CustomEvalTarget_Name_DEFAULT string + +func (p *CustomEvalTarget) GetName() (v string) { + if p == nil { + return + } + if !p.IsSetName() { + return CustomEvalTarget_Name_DEFAULT + } + return *p.Name +} + +var CustomEvalTarget_AvatarURL_DEFAULT string + +func (p *CustomEvalTarget) GetAvatarURL() (v string) { + if p == nil { + return + } + if !p.IsSetAvatarURL() { + return CustomEvalTarget_AvatarURL_DEFAULT + } + return *p.AvatarURL +} + +var CustomEvalTarget_Ext_DEFAULT map[string]string + +func (p *CustomEvalTarget) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return CustomEvalTarget_Ext_DEFAULT + } + return p.Ext +} +func (p *CustomEvalTarget) SetID(val *string) { + p.ID = val +} +func (p *CustomEvalTarget) SetName(val *string) { + p.Name = val +} +func (p *CustomEvalTarget) SetAvatarURL(val *string) { + p.AvatarURL = val +} +func (p *CustomEvalTarget) SetExt(val map[string]string) { + p.Ext = val +} + +var fieldIDToName_CustomEvalTarget = map[int16]string{ + 1: "id", + 2: "name", + 3: "avatar_url", + 10: "ext", +} + +func (p *CustomEvalTarget) IsSetID() bool { + return p.ID != nil +} + +func (p *CustomEvalTarget) IsSetName() bool { + return p.Name != nil +} + +func (p *CustomEvalTarget) IsSetAvatarURL() bool { + return p.AvatarURL != nil +} + +func (p *CustomEvalTarget) IsSetExt() bool { + return p.Ext != nil +} + +func (p *CustomEvalTarget) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.MAP { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CustomEvalTarget) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ID = _field + return nil +} +func (p *CustomEvalTarget) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Name = _field + return nil +} +func (p *CustomEvalTarget) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.AvatarURL = _field + return nil +} +func (p *CustomEvalTarget) ReadField10(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} + +func (p *CustomEvalTarget) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CustomEvalTarget"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CustomEvalTarget) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetID() { + if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAvatarURL() { + if err = oprot.WriteFieldBegin("avatar_url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.AvatarURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *CustomEvalTarget) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CustomEvalTarget(%+v)", *p) + +} + +func (p *CustomEvalTarget) DeepEqual(ano *CustomEvalTarget) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ID) { + return false + } + if !p.Field2DeepEqual(ano.Name) { + return false + } + if !p.Field3DeepEqual(ano.AvatarURL) { + return false + } + if !p.Field10DeepEqual(ano.Ext) { + return false + } + return true +} + +func (p *CustomEvalTarget) Field1DeepEqual(src *string) bool { + + if p.ID == src { + return true + } else if p.ID == nil || src == nil { + return false + } + if strings.Compare(*p.ID, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field2DeepEqual(src *string) bool { + + if p.Name == src { + return true + } else if p.Name == nil || src == nil { + return false + } + if strings.Compare(*p.Name, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field3DeepEqual(src *string) bool { + + if p.AvatarURL == src { + return true + } else if p.AvatarURL == nil || src == nil { + return false + } + if strings.Compare(*p.AvatarURL, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field10DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +type HttpInfo struct { + Method *HttpMethod `thrift:"method,1,optional" frugal:"1,optional,string" form:"method" json:"method,omitempty" query:"method"` + Path *string `thrift:"path,2,optional" frugal:"2,optional,string" form:"path" json:"path,omitempty" query:"path"` + // ms,默认5000,最大800,000 + Timeout *int64 `thrift:"timeout,4,optional" frugal:"4,optional,i64" form:"timeout" json:"timeout,omitempty" query:"timeout"` +} + +func NewHttpInfo() *HttpInfo { + return &HttpInfo{} +} + +func (p *HttpInfo) InitDefault() { +} + +var HttpInfo_Method_DEFAULT HttpMethod + +func (p *HttpInfo) GetMethod() (v HttpMethod) { + if p == nil { + return + } + if !p.IsSetMethod() { + return HttpInfo_Method_DEFAULT + } + return *p.Method +} + +var HttpInfo_Path_DEFAULT string + +func (p *HttpInfo) GetPath() (v string) { + if p == nil { + return + } + if !p.IsSetPath() { + return HttpInfo_Path_DEFAULT + } + return *p.Path +} + +var HttpInfo_Timeout_DEFAULT int64 + +func (p *HttpInfo) GetTimeout() (v int64) { + if p == nil { + return + } + if !p.IsSetTimeout() { + return HttpInfo_Timeout_DEFAULT + } + return *p.Timeout +} +func (p *HttpInfo) SetMethod(val *HttpMethod) { + p.Method = val +} +func (p *HttpInfo) SetPath(val *string) { + p.Path = val +} +func (p *HttpInfo) SetTimeout(val *int64) { + p.Timeout = val +} + +var fieldIDToName_HttpInfo = map[int16]string{ + 1: "method", + 2: "path", + 4: "timeout", +} + +func (p *HttpInfo) IsSetMethod() bool { + return p.Method != nil +} + +func (p *HttpInfo) IsSetPath() bool { + return p.Path != nil +} + +func (p *HttpInfo) IsSetTimeout() bool { + return p.Timeout != nil +} + +func (p *HttpInfo) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HttpInfo[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *HttpInfo) ReadField1(iprot thrift.TProtocol) error { + + var _field *HttpMethod + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Method = _field + return nil +} +func (p *HttpInfo) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Path = _field + return nil +} +func (p *HttpInfo) ReadField4(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Timeout = _field + return nil +} + +func (p *HttpInfo) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("HttpInfo"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *HttpInfo) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetMethod() { + if err = oprot.WriteFieldBegin("method", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Method); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *HttpInfo) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPath() { + if err = oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Path); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *HttpInfo) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTimeout() { + if err = oprot.WriteFieldBegin("timeout", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Timeout); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *HttpInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HttpInfo(%+v)", *p) + +} + +func (p *HttpInfo) DeepEqual(ano *HttpInfo) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Method) { + return false + } + if !p.Field2DeepEqual(ano.Path) { + return false + } + if !p.Field4DeepEqual(ano.Timeout) { + return false + } + return true +} + +func (p *HttpInfo) Field1DeepEqual(src *HttpMethod) bool { + + if p.Method == src { + return true + } else if p.Method == nil || src == nil { + return false + } + if strings.Compare(*p.Method, *src) != 0 { + return false + } + return true +} +func (p *HttpInfo) Field2DeepEqual(src *string) bool { + + if p.Path == src { + return true + } else if p.Path == nil || src == nil { + return false + } + if strings.Compare(*p.Path, *src) != 0 { + return false + } + return true +} +func (p *HttpInfo) Field4DeepEqual(src *int64) bool { + + if p.Timeout == src { + return true + } else if p.Timeout == nil || src == nil { + return false + } + if *p.Timeout != *src { + return false + } + return true +} type VolcengineAgent struct { // 罗盘应用ID diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go index 2ffb3cd7d..68fe03469 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go @@ -68,6 +68,40 @@ func (p *EvalTargetContent) IsValid() error { return fmt.Errorf("field VolcengineAgent not valid, %w", err) } } + if p.CustomPsm != nil { + if err := p.CustomPsm.IsValid(); err != nil { + return fmt.Errorf("field CustomPsm not valid, %w", err) + } + } + return nil +} +func (p *CustomPSM) IsValid() error { + if p.InvokeHTTPInfo != nil { + if err := p.InvokeHTTPInfo.IsValid(); err != nil { + return fmt.Errorf("field InvokeHTTPInfo not valid, %w", err) + } + } + if p.AsyncInvokeHTTPInfo != nil { + if err := p.AsyncInvokeHTTPInfo.IsValid(); err != nil { + return fmt.Errorf("field AsyncInvokeHTTPInfo not valid, %w", err) + } + } + if p.SearchHTTPInfo != nil { + if err := p.SearchHTTPInfo.IsValid(); err != nil { + return fmt.Errorf("field SearchHTTPInfo not valid, %w", err) + } + } + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } + return nil +} +func (p *CustomEvalTarget) IsValid() error { + return nil +} +func (p *HTTPInfo) IsValid() error { return nil } func (p *VolcengineAgent) IsValid() error { diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 50ca9cc6c..50e7bd816 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -922,6 +922,20 @@ func (p *EvalTargetContent) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 105: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField105(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1052,6 +1066,18 @@ func (p *EvalTargetContent) FastReadField104(buf []byte) (int, error) { return offset, nil } +func (p *EvalTargetContent) FastReadField105(buf []byte) (int, error) { + offset := 0 + _field := NewCustomPSM() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomPsm = _field + return offset, nil +} + func (p *EvalTargetContent) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -1066,6 +1092,7 @@ func (p *EvalTargetContent) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) i offset += p.fastWriteField102(buf[offset:], w) offset += p.fastWriteField103(buf[offset:], w) offset += p.fastWriteField104(buf[offset:], w) + offset += p.fastWriteField105(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -1081,6 +1108,7 @@ func (p *EvalTargetContent) BLength() int { l += p.field102Length() l += p.field103Length() l += p.field104Length() + l += p.field105Length() } l += thrift.Binary.FieldStopLength() return l @@ -1163,6 +1191,15 @@ func (p *EvalTargetContent) fastWriteField104(buf []byte, w thrift.NocopyWriter) return offset } +func (p *EvalTargetContent) fastWriteField105(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomPsm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 105) + offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + } + return offset +} + func (p *EvalTargetContent) field1Length() int { l := 0 if p.IsSetInputSchemas() { @@ -1234,6 +1271,15 @@ func (p *EvalTargetContent) field104Length() int { return l } +func (p *EvalTargetContent) field105Length() int { + l := 0 + if p.IsSetCustomPsm() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomPsm.BLength() + } + return l +} + func (p *EvalTargetContent) DeepCopy(s interface{}) error { src, ok := s.(*EvalTargetContent) if !ok { @@ -1314,6 +1360,1371 @@ func (p *EvalTargetContent) DeepCopy(s interface{}) error { } p.VolcengineAgent = _volcengineAgent + var _customPsm *CustomPSM + if src.CustomPsm != nil { + _customPsm = &CustomPSM{} + if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + return err + } + } + p.CustomPsm = _customPsm + + return nil +} + +func (p *CustomPSM) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 13: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 14: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 15: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField15(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 16: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField16(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 17: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField17(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 18: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField18(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 19: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField19(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomPSM[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CustomPSM) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ID = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Name = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Description = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Psm = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField11(buf []byte) (int, error) { + offset := 0 + + var _field *AccessProtocol + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.AccessProtocol = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField12(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]Region, 0, size) + for i := 0; i < size; i++ { + var _elem Region + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Regions = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField13(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Cluster = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField14(buf []byte) (int, error) { + offset := 0 + _field := NewHTTPInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.InvokeHTTPInfo = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField15(buf []byte) (int, error) { + offset := 0 + _field := NewHTTPInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.AsyncInvokeHTTPInfo = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField16(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.NeedSearchTarget = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField17(buf []byte) (int, error) { + offset := 0 + _field := NewHTTPInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.SearchHTTPInfo = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField18(buf []byte) (int, error) { + offset := 0 + _field := NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + +func (p *CustomPSM) FastReadField19(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.IsAsync = _field + return offset, nil +} + +func (p *CustomPSM) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *CustomPSM) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField16(buf[offset:], w) + offset += p.fastWriteField19(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) + offset += p.fastWriteField13(buf[offset:], w) + offset += p.fastWriteField14(buf[offset:], w) + offset += p.fastWriteField15(buf[offset:], w) + offset += p.fastWriteField17(buf[offset:], w) + offset += p.fastWriteField18(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CustomPSM) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + l += p.field14Length() + l += p.field15Length() + l += p.field16Length() + l += p.field17Length() + l += p.field18Length() + l += p.field19Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CustomPSM) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) + } + return offset +} + +func (p *CustomPSM) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *CustomPSM) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetDescription() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Description) + } + return offset +} + +func (p *CustomPSM) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPsm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Psm) + } + return offset +} + +func (p *CustomPSM) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAccessProtocol() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 11) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.AccessProtocol) + } + return offset +} + +func (p *CustomPSM) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetRegions() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 12) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Regions { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } + return offset +} + +func (p *CustomPSM) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCluster() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 13) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Cluster) + } + return offset +} + +func (p *CustomPSM) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeHTTPInfo() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 14) + offset += p.InvokeHTTPInfo.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CustomPSM) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAsyncInvokeHTTPInfo() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 15) + offset += p.AsyncInvokeHTTPInfo.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CustomPSM) fastWriteField16(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetNeedSearchTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 16) + offset += thrift.Binary.WriteBool(buf[offset:], *p.NeedSearchTarget) + } + return offset +} + +func (p *CustomPSM) fastWriteField17(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSearchHTTPInfo() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 17) + offset += p.SearchHTTPInfo.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CustomPSM) fastWriteField18(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 18) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CustomPSM) fastWriteField19(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIsAsync() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 19) + offset += thrift.Binary.WriteBool(buf[offset:], *p.IsAsync) + } + return offset +} + +func (p *CustomPSM) field1Length() int { + l := 0 + if p.IsSetID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ID) + } + return l +} + +func (p *CustomPSM) field2Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *CustomPSM) field3Length() int { + l := 0 + if p.IsSetDescription() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Description) + } + return l +} + +func (p *CustomPSM) field10Length() int { + l := 0 + if p.IsSetPsm() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Psm) + } + return l +} + +func (p *CustomPSM) field11Length() int { + l := 0 + if p.IsSetAccessProtocol() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.AccessProtocol) + } + return l +} + +func (p *CustomPSM) field12Length() int { + l := 0 + if p.IsSetRegions() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Regions { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *CustomPSM) field13Length() int { + l := 0 + if p.IsSetCluster() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Cluster) + } + return l +} + +func (p *CustomPSM) field14Length() int { + l := 0 + if p.IsSetInvokeHTTPInfo() { + l += thrift.Binary.FieldBeginLength() + l += p.InvokeHTTPInfo.BLength() + } + return l +} + +func (p *CustomPSM) field15Length() int { + l := 0 + if p.IsSetAsyncInvokeHTTPInfo() { + l += thrift.Binary.FieldBeginLength() + l += p.AsyncInvokeHTTPInfo.BLength() + } + return l +} + +func (p *CustomPSM) field16Length() int { + l := 0 + if p.IsSetNeedSearchTarget() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *CustomPSM) field17Length() int { + l := 0 + if p.IsSetSearchHTTPInfo() { + l += thrift.Binary.FieldBeginLength() + l += p.SearchHTTPInfo.BLength() + } + return l +} + +func (p *CustomPSM) field18Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + +func (p *CustomPSM) field19Length() int { + l := 0 + if p.IsSetIsAsync() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *CustomPSM) DeepCopy(s interface{}) error { + src, ok := s.(*CustomPSM) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ID != nil { + var tmp string + if *src.ID != "" { + tmp = kutils.StringDeepCopy(*src.ID) + } + p.ID = &tmp + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.Description != nil { + var tmp string + if *src.Description != "" { + tmp = kutils.StringDeepCopy(*src.Description) + } + p.Description = &tmp + } + + if src.Psm != nil { + var tmp string + if *src.Psm != "" { + tmp = kutils.StringDeepCopy(*src.Psm) + } + p.Psm = &tmp + } + + if src.AccessProtocol != nil { + tmp := *src.AccessProtocol + p.AccessProtocol = &tmp + } + + if src.Regions != nil { + p.Regions = make([]Region, 0, len(src.Regions)) + for _, elem := range src.Regions { + var _elem Region + _elem = elem + p.Regions = append(p.Regions, _elem) + } + } + + if src.Cluster != nil { + var tmp string + if *src.Cluster != "" { + tmp = kutils.StringDeepCopy(*src.Cluster) + } + p.Cluster = &tmp + } + + var _invokeHTTPInfo *HTTPInfo + if src.InvokeHTTPInfo != nil { + _invokeHTTPInfo = &HTTPInfo{} + if err := _invokeHTTPInfo.DeepCopy(src.InvokeHTTPInfo); err != nil { + return err + } + } + p.InvokeHTTPInfo = _invokeHTTPInfo + + var _asyncInvokeHTTPInfo *HTTPInfo + if src.AsyncInvokeHTTPInfo != nil { + _asyncInvokeHTTPInfo = &HTTPInfo{} + if err := _asyncInvokeHTTPInfo.DeepCopy(src.AsyncInvokeHTTPInfo); err != nil { + return err + } + } + p.AsyncInvokeHTTPInfo = _asyncInvokeHTTPInfo + + if src.NeedSearchTarget != nil { + tmp := *src.NeedSearchTarget + p.NeedSearchTarget = &tmp + } + + var _searchHTTPInfo *HTTPInfo + if src.SearchHTTPInfo != nil { + _searchHTTPInfo = &HTTPInfo{} + if err := _searchHTTPInfo.DeepCopy(src.SearchHTTPInfo); err != nil { + return err + } + } + p.SearchHTTPInfo = _searchHTTPInfo + + var _customEvalTarget *CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + + if src.IsAsync != nil { + tmp := *src.IsAsync + p.IsAsync = &tmp + } + + return nil +} + +func (p *CustomEvalTarget) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CustomEvalTarget) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ID = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Name = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.AvatarURL = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField10(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *CustomEvalTarget) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CustomEvalTarget) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field10Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CustomEvalTarget) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAvatarURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.AvatarURL) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 10) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *CustomEvalTarget) field1Length() int { + l := 0 + if p.IsSetID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ID) + } + return l +} + +func (p *CustomEvalTarget) field2Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *CustomEvalTarget) field3Length() int { + l := 0 + if p.IsSetAvatarURL() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.AvatarURL) + } + return l +} + +func (p *CustomEvalTarget) field10Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *CustomEvalTarget) DeepCopy(s interface{}) error { + src, ok := s.(*CustomEvalTarget) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ID != nil { + var tmp string + if *src.ID != "" { + tmp = kutils.StringDeepCopy(*src.ID) + } + p.ID = &tmp + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.AvatarURL != nil { + var tmp string + if *src.AvatarURL != "" { + tmp = kutils.StringDeepCopy(*src.AvatarURL) + } + p.AvatarURL = &tmp + } + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + return nil +} + +func (p *HTTPInfo) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HTTPInfo[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *HTTPInfo) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *HTTPMethod + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Method = _field + return offset, nil +} + +func (p *HTTPInfo) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Path = _field + return offset, nil +} + +func (p *HTTPInfo) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Timeout = _field + return offset, nil +} + +func (p *HTTPInfo) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *HTTPInfo) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *HTTPInfo) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field4Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *HTTPInfo) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetMethod() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Method) + } + return offset +} + +func (p *HTTPInfo) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPath() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Path) + } + return offset +} + +func (p *HTTPInfo) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTimeout() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 4) + offset += thrift.Binary.WriteI64(buf[offset:], *p.Timeout) + } + return offset +} + +func (p *HTTPInfo) field1Length() int { + l := 0 + if p.IsSetMethod() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Method) + } + return l +} + +func (p *HTTPInfo) field2Length() int { + l := 0 + if p.IsSetPath() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Path) + } + return l +} + +func (p *HTTPInfo) field4Length() int { + l := 0 + if p.IsSetTimeout() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *HTTPInfo) DeepCopy(s interface{}) error { + src, ok := s.(*HTTPInfo) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.Method != nil { + tmp := *src.Method + p.Method = &tmp + } + + if src.Path != nil { + var tmp string + if *src.Path != "" { + tmp = kutils.StringDeepCopy(*src.Path) + } + p.Path = &tmp + } + + if src.Timeout != nil { + tmp := *src.Timeout + p.Timeout = &tmp + } + return nil } diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 251f9cb67..2a1ece81c 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -7,7 +7,9 @@ import ( "fmt" "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" "strings" ) @@ -329,6 +331,8 @@ type CreateEvalTargetParam struct { BotInfoType *eval_target.CozeBotInfoType `thrift:"bot_info_type,4,optional" frugal:"4,optional,CozeBotInfoType" form:"bot_info_type" json:"bot_info_type,omitempty" query:"bot_info_type"` // 如果是发布版本则需要填充这个字段 BotPublishVersion *string `thrift:"bot_publish_version,5,optional" frugal:"5,optional,string" form:"bot_publish_version" json:"bot_publish_version,omitempty" query:"bot_publish_version"` + // type=6,并且有搜索对象,搜索结果信息通过这个字段透传 + CustomEvalTarget *eval_target.CustomEvalTarget `thrift:"custom_eval_target,6,optional" frugal:"6,optional,eval_target.CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` } func NewCreateEvalTargetParam() *CreateEvalTargetParam { @@ -397,6 +401,18 @@ func (p *CreateEvalTargetParam) GetBotPublishVersion() (v string) { } return *p.BotPublishVersion } + +var CreateEvalTargetParam_CustomEvalTarget_DEFAULT *eval_target.CustomEvalTarget + +func (p *CreateEvalTargetParam) GetCustomEvalTarget() (v *eval_target.CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return CreateEvalTargetParam_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} func (p *CreateEvalTargetParam) SetSourceTargetID(val *string) { p.SourceTargetID = val } @@ -412,6 +428,9 @@ func (p *CreateEvalTargetParam) SetBotInfoType(val *eval_target.CozeBotInfoType) func (p *CreateEvalTargetParam) SetBotPublishVersion(val *string) { p.BotPublishVersion = val } +func (p *CreateEvalTargetParam) SetCustomEvalTarget(val *eval_target.CustomEvalTarget) { + p.CustomEvalTarget = val +} var fieldIDToName_CreateEvalTargetParam = map[int16]string{ 1: "source_target_id", @@ -419,6 +438,7 @@ var fieldIDToName_CreateEvalTargetParam = map[int16]string{ 3: "eval_target_type", 4: "bot_info_type", 5: "bot_publish_version", + 6: "custom_eval_target", } func (p *CreateEvalTargetParam) IsSetSourceTargetID() bool { @@ -441,6 +461,10 @@ func (p *CreateEvalTargetParam) IsSetBotPublishVersion() bool { return p.BotPublishVersion != nil } +func (p *CreateEvalTargetParam) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + func (p *CreateEvalTargetParam) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -499,6 +523,14 @@ func (p *CreateEvalTargetParam) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 6: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -585,6 +617,14 @@ func (p *CreateEvalTargetParam) ReadField5(iprot thrift.TProtocol) error { p.BotPublishVersion = _field return nil } +func (p *CreateEvalTargetParam) ReadField6(iprot thrift.TProtocol) error { + _field := eval_target.NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} func (p *CreateEvalTargetParam) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -612,6 +652,10 @@ func (p *CreateEvalTargetParam) Write(oprot thrift.TProtocol) (err error) { fieldId = 5 goto WriteFieldError } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -720,6 +764,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } +func (p *CreateEvalTargetParam) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 6); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} func (p *CreateEvalTargetParam) String() string { if p == nil { @@ -750,6 +812,9 @@ func (p *CreateEvalTargetParam) DeepEqual(ano *CreateEvalTargetParam) bool { if !p.Field5DeepEqual(ano.BotPublishVersion) { return false } + if !p.Field6DeepEqual(ano.CustomEvalTarget) { + return false + } return true } @@ -813,6 +878,13 @@ func (p *CreateEvalTargetParam) Field5DeepEqual(src *string) bool { } return true } +func (p *CreateEvalTargetParam) Field6DeepEqual(src *eval_target.CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} type CreateEvalTargetResponse struct { ID *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" json:"id" form:"id" query:"id"` @@ -8380,711 +8452,5737 @@ func (p *ListSourceEvalTargetVersionsResponse) Field255DeepEqual(src *base.BaseR return true } -type EvalTargetService interface { - // 创建评测对象 - CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) - // 根据source target获取评测对象信息 - BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) - // 获取评测对象+版本 - GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) - // 批量获取+版本 - BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) - // Source评测对象列表 - ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) - // Source评测对象版本列表 - ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) - - BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) - // 执行 - ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) - - GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) - - BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) +type SearchCustomEvalTargetRequest struct { + // 空间ID + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + // 透传spi接口 + Keyword *string `thrift:"keyword,2,optional" frugal:"2,optional,string" form:"keyword" json:"keyword,omitempty" query:"keyword"` + // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 + ApplicationID *int64 `thrift:"application_id,3,optional" frugal:"3,optional,i64" json:"application_id" form:"application_id" query:"application_id"` + // 自定义PSM详情,非必填,应用注册调试时传 + CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,4,optional" frugal:"4,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` + // 必填 + Region *eval_target.Region `thrift:"region,5,optional" frugal:"5,optional,string" form:"region" json:"region,omitempty" query:"region"` + PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` + PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } -type EvalTargetServiceClient struct { - c thrift.TClient +func NewSearchCustomEvalTargetRequest() *SearchCustomEvalTargetRequest { + return &SearchCustomEvalTargetRequest{} } -func NewEvalTargetServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *SearchCustomEvalTargetRequest) InitDefault() { } -func NewEvalTargetServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} +var SearchCustomEvalTargetRequest_WorkspaceID_DEFAULT int64 -func NewEvalTargetServiceClient(c thrift.TClient) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: c, +func (p *SearchCustomEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return SearchCustomEvalTargetRequest_WorkspaceID_DEFAULT } + return *p.WorkspaceID } -func (p *EvalTargetServiceClient) Client_() thrift.TClient { - return p.c -} +var SearchCustomEvalTargetRequest_Keyword_DEFAULT string -func (p *EvalTargetServiceClient) CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) { - var _args EvalTargetServiceCreateEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceCreateEvalTargetResult - if err = p.Client_().Call(ctx, "CreateEvalTarget", &_args, &_result); err != nil { +func (p *SearchCustomEvalTargetRequest) GetKeyword() (v string) { + if p == nil { return } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetsBySourceArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetsBySourceResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetsBySource", &_args, &_result); err != nil { - return + if !p.IsSetKeyword() { + return SearchCustomEvalTargetRequest_Keyword_DEFAULT } - return _result.GetSuccess(), nil + return *p.Keyword } -func (p *EvalTargetServiceClient) GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) { - var _args EvalTargetServiceGetEvalTargetVersionArgs - _args.Request = request - var _result EvalTargetServiceGetEvalTargetVersionResult - if err = p.Client_().Call(ctx, "GetEvalTargetVersion", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_ApplicationID_DEFAULT int64 + +func (p *SearchCustomEvalTargetRequest) GetApplicationID() (v int64) { + if p == nil { return } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetVersionsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetVersionsResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetVersions", &_args, &_result); err != nil { - return + if !p.IsSetApplicationID() { + return SearchCustomEvalTargetRequest_ApplicationID_DEFAULT } - return _result.GetSuccess(), nil + return *p.ApplicationID } -func (p *EvalTargetServiceClient) ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) { - var _args EvalTargetServiceListSourceEvalTargetsArgs - _args.Request = request - var _result EvalTargetServiceListSourceEvalTargetsResult - if err = p.Client_().Call(ctx, "ListSourceEvalTargets", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM + +func (p *SearchCustomEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { + if p == nil { return } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) { - var _args EvalTargetServiceListSourceEvalTargetVersionsArgs - _args.Request = request - var _result EvalTargetServiceListSourceEvalTargetVersionsResult - if err = p.Client_().Call(ctx, "ListSourceEvalTargetVersions", &_args, &_result); err != nil { - return + if !p.IsSetCustomPsm() { + return SearchCustomEvalTargetRequest_CustomPsm_DEFAULT } - return _result.GetSuccess(), nil + return p.CustomPsm } -func (p *EvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) { - var _args EvalTargetServiceBatchGetSourceEvalTargetsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetSourceEvalTargetsResult - if err = p.Client_().Call(ctx, "BatchGetSourceEvalTargets", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_Region_DEFAULT eval_target.Region + +func (p *SearchCustomEvalTargetRequest) GetRegion() (v eval_target.Region) { + if p == nil { return } - return _result.GetSuccess(), nil + if !p.IsSetRegion() { + return SearchCustomEvalTargetRequest_Region_DEFAULT + } + return *p.Region } -func (p *EvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) { - var _args EvalTargetServiceExecuteEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceExecuteEvalTargetResult - if err = p.Client_().Call(ctx, "ExecuteEvalTarget", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_PageSize_DEFAULT int32 + +func (p *SearchCustomEvalTargetRequest) GetPageSize() (v int32) { + if p == nil { return } - return _result.GetSuccess(), nil + if !p.IsSetPageSize() { + return SearchCustomEvalTargetRequest_PageSize_DEFAULT + } + return *p.PageSize } -func (p *EvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) { - var _args EvalTargetServiceGetEvalTargetRecordArgs - _args.Request = request - var _result EvalTargetServiceGetEvalTargetRecordResult - if err = p.Client_().Call(ctx, "GetEvalTargetRecord", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_PageToken_DEFAULT string + +func (p *SearchCustomEvalTargetRequest) GetPageToken() (v string) { + if p == nil { return } - return _result.GetSuccess(), nil + if !p.IsSetPageToken() { + return SearchCustomEvalTargetRequest_PageToken_DEFAULT + } + return *p.PageToken } -func (p *EvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetRecordsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetRecordsResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetRecords", &_args, &_result); err != nil { + +var SearchCustomEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *SearchCustomEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { return } - return _result.GetSuccess(), nil + if !p.IsSetBase() { + return SearchCustomEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *SearchCustomEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *SearchCustomEvalTargetRequest) SetKeyword(val *string) { + p.Keyword = val +} +func (p *SearchCustomEvalTargetRequest) SetApplicationID(val *int64) { + p.ApplicationID = val +} +func (p *SearchCustomEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { + p.CustomPsm = val +} +func (p *SearchCustomEvalTargetRequest) SetRegion(val *eval_target.Region) { + p.Region = val +} +func (p *SearchCustomEvalTargetRequest) SetPageSize(val *int32) { + p.PageSize = val +} +func (p *SearchCustomEvalTargetRequest) SetPageToken(val *string) { + p.PageToken = val +} +func (p *SearchCustomEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val } -type EvalTargetServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler EvalTargetService +var fieldIDToName_SearchCustomEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "keyword", + 3: "application_id", + 4: "custom_psm", + 5: "region", + 100: "page_size", + 101: "page_token", + 255: "Base", } -func (p *EvalTargetServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func (p *SearchCustomEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil } -func (p *EvalTargetServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *SearchCustomEvalTargetRequest) IsSetKeyword() bool { + return p.Keyword != nil } -func (p *EvalTargetServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap +func (p *SearchCustomEvalTargetRequest) IsSetApplicationID() bool { + return p.ApplicationID != nil } -func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetServiceProcessor { - self := &EvalTargetServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("CreateEvalTarget", &evalTargetServiceProcessorCreateEvalTarget{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetsBySource", &evalTargetServiceProcessorBatchGetEvalTargetsBySource{handler: handler}) - self.AddToProcessorMap("GetEvalTargetVersion", &evalTargetServiceProcessorGetEvalTargetVersion{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetVersions", &evalTargetServiceProcessorBatchGetEvalTargetVersions{handler: handler}) - self.AddToProcessorMap("ListSourceEvalTargets", &evalTargetServiceProcessorListSourceEvalTargets{handler: handler}) - self.AddToProcessorMap("ListSourceEvalTargetVersions", &evalTargetServiceProcessorListSourceEvalTargetVersions{handler: handler}) - self.AddToProcessorMap("BatchGetSourceEvalTargets", &evalTargetServiceProcessorBatchGetSourceEvalTargets{handler: handler}) - self.AddToProcessorMap("ExecuteEvalTarget", &evalTargetServiceProcessorExecuteEvalTarget{handler: handler}) - self.AddToProcessorMap("GetEvalTargetRecord", &evalTargetServiceProcessorGetEvalTargetRecord{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetRecords", &evalTargetServiceProcessorBatchGetEvalTargetRecords{handler: handler}) - return self +func (p *SearchCustomEvalTargetRequest) IsSetCustomPsm() bool { + return p.CustomPsm != nil } -func (p *EvalTargetServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x + +func (p *SearchCustomEvalTargetRequest) IsSetRegion() bool { + return p.Region != nil } -type evalTargetServiceProcessorCreateEvalTarget struct { - handler EvalTargetService +func (p *SearchCustomEvalTargetRequest) IsSetPageSize() bool { + return p.PageSize != nil } -func (p *evalTargetServiceProcessorCreateEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceCreateEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *SearchCustomEvalTargetRequest) IsSetPageToken() bool { + return p.PageToken != nil +} - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceCreateEvalTargetResult{} - var retval *CreateEvalTargetResponse - if retval, err2 = p.handler.CreateEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 +func (p *SearchCustomEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *SearchCustomEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.I32 { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.STRING { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchCustomEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchCustomEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err } else { - result.Success = retval + _field = &v } - if err2 = oprot.WriteMessageBegin("CreateEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 + p.WorkspaceID = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + p.Keyword = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + p.ApplicationID = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { + _field := eval_target.NewCustomPSM() + if err := _field.Read(iprot); err != nil { + return err } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + p.CustomPsm = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *eval_target.Region + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Region = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField100(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.PageSize = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField101(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.PageToken = _field + return nil +} +func (p *SearchCustomEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *SearchCustomEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchCustomEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchCustomEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetKeyword() { + if err = oprot.WriteFieldBegin("keyword", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Keyword); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetApplicationID() { + if err = oprot.WriteFieldBegin("application_id", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.ApplicationID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomPsm() { + if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomPsm.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetRegion() { + if err = oprot.WriteFieldBegin("region", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Region); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetPageSize() { + if err = oprot.WriteFieldBegin("page_size", thrift.I32, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.PageSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetPageToken() { + if err = oprot.WriteFieldBegin("page_token", thrift.STRING, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.PageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchCustomEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchCustomEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchCustomEvalTargetRequest(%+v)", *p) + +} + +func (p *SearchCustomEvalTargetRequest) DeepEqual(ano *SearchCustomEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.Keyword) { + return false + } + if !p.Field3DeepEqual(ano.ApplicationID) { + return false + } + if !p.Field4DeepEqual(ano.CustomPsm) { + return false + } + if !p.Field5DeepEqual(ano.Region) { + return false + } + if !p.Field100DeepEqual(ano.PageSize) { + return false + } + if !p.Field101DeepEqual(ano.PageToken) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *SearchCustomEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field2DeepEqual(src *string) bool { + + if p.Keyword == src { + return true + } else if p.Keyword == nil || src == nil { + return false + } + if strings.Compare(*p.Keyword, *src) != 0 { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field3DeepEqual(src *int64) bool { + + if p.ApplicationID == src { + return true + } else if p.ApplicationID == nil || src == nil { + return false + } + if *p.ApplicationID != *src { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field4DeepEqual(src *eval_target.CustomPSM) bool { + + if !p.CustomPsm.DeepEqual(src) { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field5DeepEqual(src *eval_target.Region) bool { + + if p.Region == src { + return true + } else if p.Region == nil || src == nil { + return false + } + if strings.Compare(*p.Region, *src) != 0 { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field100DeepEqual(src *int32) bool { + + if p.PageSize == src { + return true + } else if p.PageSize == nil || src == nil { + return false + } + if *p.PageSize != *src { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field101DeepEqual(src *string) bool { + + if p.PageToken == src { + return true + } else if p.PageToken == nil || src == nil { + return false + } + if strings.Compare(*p.PageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchCustomEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type SearchCustomEvalTargetResponse struct { + CustomEvalTargets []*eval_target.CustomEvalTarget `thrift:"custom_eval_targets,1" frugal:"1,default,list" form:"custom_eval_targets" json:"custom_eval_targets" query:"custom_eval_targets"` + NextPageToken *string `thrift:"next_page_token,100,optional" frugal:"100,optional,string" form:"next_page_token" json:"next_page_token,omitempty" query:"next_page_token"` + HasMore *bool `thrift:"has_more,101,optional" frugal:"101,optional,bool" form:"has_more" json:"has_more,omitempty" query:"has_more"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewSearchCustomEvalTargetResponse() *SearchCustomEvalTargetResponse { + return &SearchCustomEvalTargetResponse{} +} + +func (p *SearchCustomEvalTargetResponse) InitDefault() { +} + +func (p *SearchCustomEvalTargetResponse) GetCustomEvalTargets() (v []*eval_target.CustomEvalTarget) { + if p != nil { + return p.CustomEvalTargets + } + return +} + +var SearchCustomEvalTargetResponse_NextPageToken_DEFAULT string + +func (p *SearchCustomEvalTargetResponse) GetNextPageToken() (v string) { + if p == nil { + return + } + if !p.IsSetNextPageToken() { + return SearchCustomEvalTargetResponse_NextPageToken_DEFAULT + } + return *p.NextPageToken +} + +var SearchCustomEvalTargetResponse_HasMore_DEFAULT bool + +func (p *SearchCustomEvalTargetResponse) GetHasMore() (v bool) { + if p == nil { + return + } + if !p.IsSetHasMore() { + return SearchCustomEvalTargetResponse_HasMore_DEFAULT + } + return *p.HasMore +} + +var SearchCustomEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *SearchCustomEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return SearchCustomEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *SearchCustomEvalTargetResponse) SetCustomEvalTargets(val []*eval_target.CustomEvalTarget) { + p.CustomEvalTargets = val +} +func (p *SearchCustomEvalTargetResponse) SetNextPageToken(val *string) { + p.NextPageToken = val +} +func (p *SearchCustomEvalTargetResponse) SetHasMore(val *bool) { + p.HasMore = val +} +func (p *SearchCustomEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_SearchCustomEvalTargetResponse = map[int16]string{ + 1: "custom_eval_targets", + 100: "next_page_token", + 101: "has_more", + 255: "BaseResp", +} + +func (p *SearchCustomEvalTargetResponse) IsSetNextPageToken() bool { + return p.NextPageToken != nil +} + +func (p *SearchCustomEvalTargetResponse) IsSetHasMore() bool { + return p.HasMore != nil +} + +func (p *SearchCustomEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *SearchCustomEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.STRING { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchCustomEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchCustomEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*eval_target.CustomEvalTarget, 0, size) + values := make([]eval_target.CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.CustomEvalTargets = _field + return nil +} +func (p *SearchCustomEvalTargetResponse) ReadField100(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.NextPageToken = _field + return nil +} +func (p *SearchCustomEvalTargetResponse) ReadField101(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.HasMore = _field + return nil +} +func (p *SearchCustomEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *SearchCustomEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchCustomEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchCustomEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("custom_eval_targets", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CustomEvalTargets)); err != nil { + return err + } + for _, v := range p.CustomEvalTargets { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchCustomEvalTargetResponse) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetNextPageToken() { + if err = oprot.WriteFieldBegin("next_page_token", thrift.STRING, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.NextPageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchCustomEvalTargetResponse) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetHasMore() { + if err = oprot.WriteFieldBegin("has_more", thrift.BOOL, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.HasMore); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchCustomEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchCustomEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchCustomEvalTargetResponse(%+v)", *p) + +} + +func (p *SearchCustomEvalTargetResponse) DeepEqual(ano *SearchCustomEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.CustomEvalTargets) { + return false + } + if !p.Field100DeepEqual(ano.NextPageToken) { + return false + } + if !p.Field101DeepEqual(ano.HasMore) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *SearchCustomEvalTargetResponse) Field1DeepEqual(src []*eval_target.CustomEvalTarget) bool { + + if len(p.CustomEvalTargets) != len(src) { + return false + } + for i, v := range p.CustomEvalTargets { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *SearchCustomEvalTargetResponse) Field100DeepEqual(src *string) bool { + + if p.NextPageToken == src { + return true + } else if p.NextPageToken == nil || src == nil { + return false + } + if strings.Compare(*p.NextPageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchCustomEvalTargetResponse) Field101DeepEqual(src *bool) bool { + + if p.HasMore == src { + return true + } else if p.HasMore == nil || src == nil { + return false + } + if *p.HasMore != *src { + return false + } + return true +} +func (p *SearchCustomEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type DebugEvalTargetRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + // 类型 + EvalTargetType *eval_target.EvalTargetType `thrift:"eval_target_type,2,optional" frugal:"2,optional,EvalTargetType" form:"eval_target_type" json:"eval_target_type,omitempty" query:"eval_target_type"` + // 执行参数:如果type=6,则传spi request json序列化结果 + Param *string `thrift:"param,10,optional" frugal:"10,optional,string" form:"param" json:"param,omitempty" query:"param"` + // 动态参数 + TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` + // 如果type=6,需要前端传入自定义psm相关信息 + CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,50,optional" frugal:"50,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewDebugEvalTargetRequest() *DebugEvalTargetRequest { + return &DebugEvalTargetRequest{} +} + +func (p *DebugEvalTargetRequest) InitDefault() { +} + +var DebugEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *DebugEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return DebugEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var DebugEvalTargetRequest_EvalTargetType_DEFAULT eval_target.EvalTargetType + +func (p *DebugEvalTargetRequest) GetEvalTargetType() (v eval_target.EvalTargetType) { + if p == nil { + return + } + if !p.IsSetEvalTargetType() { + return DebugEvalTargetRequest_EvalTargetType_DEFAULT + } + return *p.EvalTargetType +} + +var DebugEvalTargetRequest_Param_DEFAULT string + +func (p *DebugEvalTargetRequest) GetParam() (v string) { + if p == nil { + return + } + if !p.IsSetParam() { + return DebugEvalTargetRequest_Param_DEFAULT + } + return *p.Param +} + +var DebugEvalTargetRequest_TargetRuntimeParam_DEFAULT *common.RuntimeParam + +func (p *DebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam) { + if p == nil { + return + } + if !p.IsSetTargetRuntimeParam() { + return DebugEvalTargetRequest_TargetRuntimeParam_DEFAULT + } + return p.TargetRuntimeParam +} + +var DebugEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM + +func (p *DebugEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { + if p == nil { + return + } + if !p.IsSetCustomPsm() { + return DebugEvalTargetRequest_CustomPsm_DEFAULT + } + return p.CustomPsm +} + +var DebugEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *DebugEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return DebugEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *DebugEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *DebugEvalTargetRequest) SetEvalTargetType(val *eval_target.EvalTargetType) { + p.EvalTargetType = val +} +func (p *DebugEvalTargetRequest) SetParam(val *string) { + p.Param = val +} +func (p *DebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { + p.TargetRuntimeParam = val +} +func (p *DebugEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { + p.CustomPsm = val +} +func (p *DebugEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_DebugEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "eval_target_type", + 10: "param", + 11: "target_runtime_param", + 50: "custom_psm", + 255: "Base", +} + +func (p *DebugEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *DebugEvalTargetRequest) IsSetEvalTargetType() bool { + return p.EvalTargetType != nil +} + +func (p *DebugEvalTargetRequest) IsSetParam() bool { + return p.Param != nil +} + +func (p *DebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { + return p.TargetRuntimeParam != nil +} + +func (p *DebugEvalTargetRequest) IsSetCustomPsm() bool { + return p.CustomPsm != nil +} + +func (p *DebugEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *DebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I32 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 50: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField50(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DebugEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DebugEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *DebugEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *eval_target.EvalTargetType + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := eval_target.EvalTargetType(v) + _field = &tmp + } + p.EvalTargetType = _field + return nil +} +func (p *DebugEvalTargetRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Param = _field + return nil +} +func (p *DebugEvalTargetRequest) ReadField11(iprot thrift.TProtocol) error { + _field := common.NewRuntimeParam() + if err := _field.Read(iprot); err != nil { + return err + } + p.TargetRuntimeParam = _field + return nil +} +func (p *DebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { + _field := eval_target.NewCustomPSM() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomPsm = _field + return nil +} +func (p *DebugEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *DebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DebugEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField50(oprot); err != nil { + fieldId = 50 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DebugEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *DebugEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalTargetType() { + if err = oprot.WriteFieldBegin("eval_target_type", thrift.I32, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.EvalTargetType)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *DebugEvalTargetRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetParam() { + if err = oprot.WriteFieldBegin("param", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Param); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *DebugEvalTargetRequest) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetTargetRuntimeParam() { + if err = oprot.WriteFieldBegin("target_runtime_param", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.TargetRuntimeParam.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *DebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomPsm() { + if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 50); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomPsm.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 end error: ", p), err) +} +func (p *DebugEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *DebugEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DebugEvalTargetRequest(%+v)", *p) + +} + +func (p *DebugEvalTargetRequest) DeepEqual(ano *DebugEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.EvalTargetType) { + return false + } + if !p.Field10DeepEqual(ano.Param) { + return false + } + if !p.Field11DeepEqual(ano.TargetRuntimeParam) { + return false + } + if !p.Field50DeepEqual(ano.CustomPsm) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *DebugEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *DebugEvalTargetRequest) Field2DeepEqual(src *eval_target.EvalTargetType) bool { + + if p.EvalTargetType == src { + return true + } else if p.EvalTargetType == nil || src == nil { + return false + } + if *p.EvalTargetType != *src { + return false + } + return true +} +func (p *DebugEvalTargetRequest) Field10DeepEqual(src *string) bool { + + if p.Param == src { + return true + } else if p.Param == nil || src == nil { + return false + } + if strings.Compare(*p.Param, *src) != 0 { + return false + } + return true +} +func (p *DebugEvalTargetRequest) Field11DeepEqual(src *common.RuntimeParam) bool { + + if !p.TargetRuntimeParam.DeepEqual(src) { + return false + } + return true +} +func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomPSM) bool { + + if !p.CustomPsm.DeepEqual(src) { + return false + } + return true +} +func (p *DebugEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type DebugEvalTargetResponse struct { + EvalTargetRecord *eval_target.EvalTargetRecord `thrift:"eval_target_record,1,optional" frugal:"1,optional,eval_target.EvalTargetRecord" form:"eval_target_record" json:"eval_target_record,omitempty" query:"eval_target_record"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` +} + +func NewDebugEvalTargetResponse() *DebugEvalTargetResponse { + return &DebugEvalTargetResponse{} +} + +func (p *DebugEvalTargetResponse) InitDefault() { +} + +var DebugEvalTargetResponse_EvalTargetRecord_DEFAULT *eval_target.EvalTargetRecord + +func (p *DebugEvalTargetResponse) GetEvalTargetRecord() (v *eval_target.EvalTargetRecord) { + if p == nil { + return + } + if !p.IsSetEvalTargetRecord() { + return DebugEvalTargetResponse_EvalTargetRecord_DEFAULT + } + return p.EvalTargetRecord +} + +var DebugEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *DebugEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return DebugEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *DebugEvalTargetResponse) SetEvalTargetRecord(val *eval_target.EvalTargetRecord) { + p.EvalTargetRecord = val +} +func (p *DebugEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_DebugEvalTargetResponse = map[int16]string{ + 1: "eval_target_record", + 255: "BaseResp", +} + +func (p *DebugEvalTargetResponse) IsSetEvalTargetRecord() bool { + return p.EvalTargetRecord != nil +} + +func (p *DebugEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *DebugEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DebugEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DebugEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _field := eval_target.NewEvalTargetRecord() + if err := _field.Read(iprot); err != nil { + return err + } + p.EvalTargetRecord = _field + return nil +} +func (p *DebugEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *DebugEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DebugEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DebugEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalTargetRecord() { + if err = oprot.WriteFieldBegin("eval_target_record", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.EvalTargetRecord.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *DebugEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *DebugEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DebugEvalTargetResponse(%+v)", *p) + +} + +func (p *DebugEvalTargetResponse) DeepEqual(ano *DebugEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.EvalTargetRecord) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *DebugEvalTargetResponse) Field1DeepEqual(src *eval_target.EvalTargetRecord) bool { + + if !p.EvalTargetRecord.DeepEqual(src) { + return false + } + return true +} +func (p *DebugEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type AsyncDebugEvalTargetRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + // 类型 + EvalTargetType *eval_target.EvalTargetType `thrift:"eval_target_type,2,optional" frugal:"2,optional,EvalTargetType" form:"eval_target_type" json:"eval_target_type,omitempty" query:"eval_target_type"` + // 动态参数 + TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,10,optional" frugal:"10,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` + // 如果type=6,需要前端传入自定义psm相关信息 + CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,50,optional" frugal:"50,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` + // 执行参数:如果type=6,则传spi request json序列化结果 + CustomPsmSpiParam *string `thrift:"custom_psm_spi_param,51,optional" frugal:"51,optional,string" form:"custom_psm_spi_param" json:"custom_psm_spi_param,omitempty" query:"custom_psm_spi_param"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewAsyncDebugEvalTargetRequest() *AsyncDebugEvalTargetRequest { + return &AsyncDebugEvalTargetRequest{} +} + +func (p *AsyncDebugEvalTargetRequest) InitDefault() { +} + +var AsyncDebugEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *AsyncDebugEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return AsyncDebugEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var AsyncDebugEvalTargetRequest_EvalTargetType_DEFAULT eval_target.EvalTargetType + +func (p *AsyncDebugEvalTargetRequest) GetEvalTargetType() (v eval_target.EvalTargetType) { + if p == nil { + return + } + if !p.IsSetEvalTargetType() { + return AsyncDebugEvalTargetRequest_EvalTargetType_DEFAULT + } + return *p.EvalTargetType +} + +var AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT *common.RuntimeParam + +func (p *AsyncDebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam) { + if p == nil { + return + } + if !p.IsSetTargetRuntimeParam() { + return AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT + } + return p.TargetRuntimeParam +} + +var AsyncDebugEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM + +func (p *AsyncDebugEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { + if p == nil { + return + } + if !p.IsSetCustomPsm() { + return AsyncDebugEvalTargetRequest_CustomPsm_DEFAULT + } + return p.CustomPsm +} + +var AsyncDebugEvalTargetRequest_CustomPsmSpiParam_DEFAULT string + +func (p *AsyncDebugEvalTargetRequest) GetCustomPsmSpiParam() (v string) { + if p == nil { + return + } + if !p.IsSetCustomPsmSpiParam() { + return AsyncDebugEvalTargetRequest_CustomPsmSpiParam_DEFAULT + } + return *p.CustomPsmSpiParam +} + +var AsyncDebugEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *AsyncDebugEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return AsyncDebugEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *AsyncDebugEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *AsyncDebugEvalTargetRequest) SetEvalTargetType(val *eval_target.EvalTargetType) { + p.EvalTargetType = val +} +func (p *AsyncDebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { + p.TargetRuntimeParam = val +} +func (p *AsyncDebugEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { + p.CustomPsm = val +} +func (p *AsyncDebugEvalTargetRequest) SetCustomPsmSpiParam(val *string) { + p.CustomPsmSpiParam = val +} +func (p *AsyncDebugEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_AsyncDebugEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "eval_target_type", + 10: "target_runtime_param", + 50: "custom_psm", + 51: "custom_psm_spi_param", + 255: "Base", +} + +func (p *AsyncDebugEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *AsyncDebugEvalTargetRequest) IsSetEvalTargetType() bool { + return p.EvalTargetType != nil +} + +func (p *AsyncDebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { + return p.TargetRuntimeParam != nil +} + +func (p *AsyncDebugEvalTargetRequest) IsSetCustomPsm() bool { + return p.CustomPsm != nil +} + +func (p *AsyncDebugEvalTargetRequest) IsSetCustomPsmSpiParam() bool { + return p.CustomPsmSpiParam != nil +} + +func (p *AsyncDebugEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *AsyncDebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I32 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 50: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField50(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 51: + if fieldTypeId == thrift.STRING { + if err = p.ReadField51(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncDebugEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncDebugEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *AsyncDebugEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *eval_target.EvalTargetType + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := eval_target.EvalTargetType(v) + _field = &tmp + } + p.EvalTargetType = _field + return nil +} +func (p *AsyncDebugEvalTargetRequest) ReadField10(iprot thrift.TProtocol) error { + _field := common.NewRuntimeParam() + if err := _field.Read(iprot); err != nil { + return err + } + p.TargetRuntimeParam = _field + return nil +} +func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { + _field := eval_target.NewCustomPSM() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomPsm = _field + return nil +} +func (p *AsyncDebugEvalTargetRequest) ReadField51(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.CustomPsmSpiParam = _field + return nil +} +func (p *AsyncDebugEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *AsyncDebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncDebugEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField50(oprot); err != nil { + fieldId = 50 + goto WriteFieldError + } + if err = p.writeField51(oprot); err != nil { + fieldId = 51 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncDebugEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalTargetType() { + if err = oprot.WriteFieldBegin("eval_target_type", thrift.I32, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.EvalTargetType)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetTargetRuntimeParam() { + if err = oprot.WriteFieldBegin("target_runtime_param", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.TargetRuntimeParam.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomPsm() { + if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 50); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomPsm.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetRequest) writeField51(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomPsmSpiParam() { + if err = oprot.WriteFieldBegin("custom_psm_spi_param", thrift.STRING, 51); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.CustomPsmSpiParam); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 51 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 51 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncDebugEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncDebugEvalTargetRequest(%+v)", *p) + +} + +func (p *AsyncDebugEvalTargetRequest) DeepEqual(ano *AsyncDebugEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.EvalTargetType) { + return false + } + if !p.Field10DeepEqual(ano.TargetRuntimeParam) { + return false + } + if !p.Field50DeepEqual(ano.CustomPsm) { + return false + } + if !p.Field51DeepEqual(ano.CustomPsmSpiParam) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *AsyncDebugEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *AsyncDebugEvalTargetRequest) Field2DeepEqual(src *eval_target.EvalTargetType) bool { + + if p.EvalTargetType == src { + return true + } else if p.EvalTargetType == nil || src == nil { + return false + } + if *p.EvalTargetType != *src { + return false + } + return true +} +func (p *AsyncDebugEvalTargetRequest) Field10DeepEqual(src *common.RuntimeParam) bool { + + if !p.TargetRuntimeParam.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomPSM) bool { + + if !p.CustomPsm.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncDebugEvalTargetRequest) Field51DeepEqual(src *string) bool { + + if p.CustomPsmSpiParam == src { + return true + } else if p.CustomPsmSpiParam == nil || src == nil { + return false + } + if strings.Compare(*p.CustomPsmSpiParam, *src) != 0 { + return false + } + return true +} +func (p *AsyncDebugEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type AsyncDebugEvalTargetResponse struct { + InvokeID int64 `thrift:"invoke_id,1,required" frugal:"1,required,i64" json:"invoke_id" form:"invoke_id,required" query:"invoke_id,required"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` +} + +func NewAsyncDebugEvalTargetResponse() *AsyncDebugEvalTargetResponse { + return &AsyncDebugEvalTargetResponse{} +} + +func (p *AsyncDebugEvalTargetResponse) InitDefault() { +} + +func (p *AsyncDebugEvalTargetResponse) GetInvokeID() (v int64) { + if p != nil { + return p.InvokeID + } + return +} + +var AsyncDebugEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *AsyncDebugEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return AsyncDebugEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *AsyncDebugEvalTargetResponse) SetInvokeID(val int64) { + p.InvokeID = val +} +func (p *AsyncDebugEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_AsyncDebugEvalTargetResponse = map[int16]string{ + 1: "invoke_id", + 255: "BaseResp", +} + +func (p *AsyncDebugEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *AsyncDebugEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + var issetInvokeID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetInvokeID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetInvokeID { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncDebugEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_AsyncDebugEvalTargetResponse[fieldId])) +} + +func (p *AsyncDebugEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.InvokeID = _field + return nil +} +func (p *AsyncDebugEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *AsyncDebugEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncDebugEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncDebugEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *AsyncDebugEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncDebugEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncDebugEvalTargetResponse(%+v)", *p) + +} + +func (p *AsyncDebugEvalTargetResponse) DeepEqual(ano *AsyncDebugEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.InvokeID) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *AsyncDebugEvalTargetResponse) Field1DeepEqual(src int64) bool { + + if p.InvokeID != src { + return false + } + return true +} +func (p *AsyncDebugEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type PassbackEvalTargetInvokeResultRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" json:"invoke_id" form:"invoke_id" query:"invoke_id"` + Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` + // 输出 + Output *spi.InvokeEvalTargetOutput `thrift:"output,10,optional" frugal:"10,optional,spi.InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` + // 消耗 + Usage *spi.InvokeEvalTargetUsage `thrift:"usage,11,optional" frugal:"11,optional,spi.InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` +} + +func NewPassbackEvalTargetInvokeResultRequest() *PassbackEvalTargetInvokeResultRequest { + return &PassbackEvalTargetInvokeResultRequest{} +} + +func (p *PassbackEvalTargetInvokeResultRequest) InitDefault() { +} + +var PassbackEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT int64 + +func (p *PassbackEvalTargetInvokeResultRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return PassbackEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var PassbackEvalTargetInvokeResultRequest_InvokeID_DEFAULT int64 + +func (p *PassbackEvalTargetInvokeResultRequest) GetInvokeID() (v int64) { + if p == nil { + return + } + if !p.IsSetInvokeID() { + return PassbackEvalTargetInvokeResultRequest_InvokeID_DEFAULT + } + return *p.InvokeID +} + +var PassbackEvalTargetInvokeResultRequest_Token_DEFAULT string + +func (p *PassbackEvalTargetInvokeResultRequest) GetToken() (v string) { + if p == nil { + return + } + if !p.IsSetToken() { + return PassbackEvalTargetInvokeResultRequest_Token_DEFAULT + } + return *p.Token +} + +var PassbackEvalTargetInvokeResultRequest_Output_DEFAULT *spi.InvokeEvalTargetOutput + +func (p *PassbackEvalTargetInvokeResultRequest) GetOutput() (v *spi.InvokeEvalTargetOutput) { + if p == nil { + return + } + if !p.IsSetOutput() { + return PassbackEvalTargetInvokeResultRequest_Output_DEFAULT + } + return p.Output +} + +var PassbackEvalTargetInvokeResultRequest_Usage_DEFAULT *spi.InvokeEvalTargetUsage + +func (p *PassbackEvalTargetInvokeResultRequest) GetUsage() (v *spi.InvokeEvalTargetUsage) { + if p == nil { + return + } + if !p.IsSetUsage() { + return PassbackEvalTargetInvokeResultRequest_Usage_DEFAULT + } + return p.Usage +} + +var PassbackEvalTargetInvokeResultRequest_Base_DEFAULT *base.Base + +func (p *PassbackEvalTargetInvokeResultRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return PassbackEvalTargetInvokeResultRequest_Base_DEFAULT + } + return p.Base +} +func (p *PassbackEvalTargetInvokeResultRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *PassbackEvalTargetInvokeResultRequest) SetInvokeID(val *int64) { + p.InvokeID = val +} +func (p *PassbackEvalTargetInvokeResultRequest) SetToken(val *string) { + p.Token = val +} +func (p *PassbackEvalTargetInvokeResultRequest) SetOutput(val *spi.InvokeEvalTargetOutput) { + p.Output = val +} +func (p *PassbackEvalTargetInvokeResultRequest) SetUsage(val *spi.InvokeEvalTargetUsage) { + p.Usage = val +} +func (p *PassbackEvalTargetInvokeResultRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_PassbackEvalTargetInvokeResultRequest = map[int16]string{ + 1: "workspace_id", + 2: "invoke_id", + 3: "token", + 10: "output", + 11: "usage", + 255: "Base", +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetInvokeID() bool { + return p.InvokeID != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetToken() bool { + return p.Token != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetOutput() bool { + return p.Output != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetUsage() bool { + return p.Usage != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InvokeID = _field + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _field + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) ReadField10(iprot thrift.TProtocol) error { + _field := spi.NewInvokeEvalTargetOutput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Output = _field + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) ReadField11(iprot thrift.TProtocol) error { + _field := spi.NewInvokeEvalTargetUsage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Usage = _field + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResultRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *PassbackEvalTargetInvokeResultRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeID() { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *PassbackEvalTargetInvokeResultRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *PassbackEvalTargetInvokeResultRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetOutput() { + if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.Output.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *PassbackEvalTargetInvokeResultRequest) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetUsage() { + if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Usage.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *PassbackEvalTargetInvokeResultRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PassbackEvalTargetInvokeResultRequest(%+v)", *p) + +} + +func (p *PassbackEvalTargetInvokeResultRequest) DeepEqual(ano *PassbackEvalTargetInvokeResultRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.InvokeID) { + return false + } + if !p.Field3DeepEqual(ano.Token) { + return false + } + if !p.Field10DeepEqual(ano.Output) { + return false + } + if !p.Field11DeepEqual(ano.Usage) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *PassbackEvalTargetInvokeResultRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *PassbackEvalTargetInvokeResultRequest) Field2DeepEqual(src *int64) bool { + + if p.InvokeID == src { + return true + } else if p.InvokeID == nil || src == nil { + return false + } + if *p.InvokeID != *src { + return false + } + return true +} +func (p *PassbackEvalTargetInvokeResultRequest) Field3DeepEqual(src *string) bool { + + if p.Token == src { + return true + } else if p.Token == nil || src == nil { + return false + } + if strings.Compare(*p.Token, *src) != 0 { + return false + } + return true +} +func (p *PassbackEvalTargetInvokeResultRequest) Field10DeepEqual(src *spi.InvokeEvalTargetOutput) bool { + + if !p.Output.DeepEqual(src) { + return false + } + return true +} +func (p *PassbackEvalTargetInvokeResultRequest) Field11DeepEqual(src *spi.InvokeEvalTargetUsage) bool { + + if !p.Usage.DeepEqual(src) { + return false + } + return true +} +func (p *PassbackEvalTargetInvokeResultRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type PassbackEvalTargetInvokeResultResponse struct { + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewPassbackEvalTargetInvokeResultResponse() *PassbackEvalTargetInvokeResultResponse { + return &PassbackEvalTargetInvokeResultResponse{} +} + +func (p *PassbackEvalTargetInvokeResultResponse) InitDefault() { +} + +var PassbackEvalTargetInvokeResultResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *PassbackEvalTargetInvokeResultResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return PassbackEvalTargetInvokeResultResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *PassbackEvalTargetInvokeResultResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_PassbackEvalTargetInvokeResultResponse = map[int16]string{ + 255: "BaseResp", +} + +func (p *PassbackEvalTargetInvokeResultResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *PassbackEvalTargetInvokeResultResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *PassbackEvalTargetInvokeResultResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResultResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *PassbackEvalTargetInvokeResultResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PassbackEvalTargetInvokeResultResponse(%+v)", *p) + +} + +func (p *PassbackEvalTargetInvokeResultResponse) DeepEqual(ano *PassbackEvalTargetInvokeResultResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *PassbackEvalTargetInvokeResultResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetService interface { + // 创建评测对象 + CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) + // 根据source target获取评测对象信息 + BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) + // 获取评测对象+版本 + GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) + // 批量获取+版本 + BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) + // Source评测对象列表 + ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) + // Source评测对象版本列表 + ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) + + BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) + // 搜索自定义评测对象 + SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) + // 执行 + ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) + + GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) + + BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) + // debug + DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) + + AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) + // 回传执行结果 + PassbackEvalTargetInvokeResult_(ctx context.Context, req *PassbackEvalTargetInvokeResultRequest) (r *PassbackEvalTargetInvokeResultResponse, err error) +} + +type EvalTargetServiceClient struct { + c thrift.TClient +} + +func NewEvalTargetServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewEvalTargetServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewEvalTargetServiceClient(c thrift.TClient) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: c, + } +} + +func (p *EvalTargetServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *EvalTargetServiceClient) CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) { + var _args EvalTargetServiceCreateEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceCreateEvalTargetResult + if err = p.Client_().Call(ctx, "CreateEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetsBySourceArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetsBySourceResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetsBySource", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) { + var _args EvalTargetServiceGetEvalTargetVersionArgs + _args.Request = request + var _result EvalTargetServiceGetEvalTargetVersionResult + if err = p.Client_().Call(ctx, "GetEvalTargetVersion", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetVersionsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetVersionsResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetVersions", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) { + var _args EvalTargetServiceListSourceEvalTargetsArgs + _args.Request = request + var _result EvalTargetServiceListSourceEvalTargetsResult + if err = p.Client_().Call(ctx, "ListSourceEvalTargets", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) { + var _args EvalTargetServiceListSourceEvalTargetVersionsArgs + _args.Request = request + var _result EvalTargetServiceListSourceEvalTargetVersionsResult + if err = p.Client_().Call(ctx, "ListSourceEvalTargetVersions", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) { + var _args EvalTargetServiceBatchGetSourceEvalTargetsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetSourceEvalTargetsResult + if err = p.Client_().Call(ctx, "BatchGetSourceEvalTargets", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) { + var _args EvalTargetServiceSearchCustomEvalTargetArgs + _args.Req = req + var _result EvalTargetServiceSearchCustomEvalTargetResult + if err = p.Client_().Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) { + var _args EvalTargetServiceExecuteEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceExecuteEvalTargetResult + if err = p.Client_().Call(ctx, "ExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) { + var _args EvalTargetServiceGetEvalTargetRecordArgs + _args.Request = request + var _result EvalTargetServiceGetEvalTargetRecordResult + if err = p.Client_().Call(ctx, "GetEvalTargetRecord", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetRecordsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetRecordsResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetRecords", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) { + var _args EvalTargetServiceDebugEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceDebugEvalTargetResult + if err = p.Client_().Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) { + var _args EvalTargetServiceAsyncDebugEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceAsyncDebugEvalTargetResult + if err = p.Client_().Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *PassbackEvalTargetInvokeResultRequest) (r *PassbackEvalTargetInvokeResultResponse, err error) { + var _args EvalTargetServicePassbackEvalTargetInvokeResultArgs + _args.Req = req + var _result EvalTargetServicePassbackEvalTargetInvokeResultResult + if err = p.Client_().Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type EvalTargetServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler EvalTargetService +} + +func (p *EvalTargetServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *EvalTargetServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *EvalTargetServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetServiceProcessor { + self := &EvalTargetServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateEvalTarget", &evalTargetServiceProcessorCreateEvalTarget{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetsBySource", &evalTargetServiceProcessorBatchGetEvalTargetsBySource{handler: handler}) + self.AddToProcessorMap("GetEvalTargetVersion", &evalTargetServiceProcessorGetEvalTargetVersion{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetVersions", &evalTargetServiceProcessorBatchGetEvalTargetVersions{handler: handler}) + self.AddToProcessorMap("ListSourceEvalTargets", &evalTargetServiceProcessorListSourceEvalTargets{handler: handler}) + self.AddToProcessorMap("ListSourceEvalTargetVersions", &evalTargetServiceProcessorListSourceEvalTargetVersions{handler: handler}) + self.AddToProcessorMap("BatchGetSourceEvalTargets", &evalTargetServiceProcessorBatchGetSourceEvalTargets{handler: handler}) + self.AddToProcessorMap("SearchCustomEvalTarget", &evalTargetServiceProcessorSearchCustomEvalTarget{handler: handler}) + self.AddToProcessorMap("ExecuteEvalTarget", &evalTargetServiceProcessorExecuteEvalTarget{handler: handler}) + self.AddToProcessorMap("GetEvalTargetRecord", &evalTargetServiceProcessorGetEvalTargetRecord{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetRecords", &evalTargetServiceProcessorBatchGetEvalTargetRecords{handler: handler}) + self.AddToProcessorMap("DebugEvalTarget", &evalTargetServiceProcessorDebugEvalTarget{handler: handler}) + self.AddToProcessorMap("AsyncDebugEvalTarget", &evalTargetServiceProcessorAsyncDebugEvalTarget{handler: handler}) + self.AddToProcessorMap("PassbackEvalTargetInvokeResult", &evalTargetServiceProcessorPassbackEvalTargetInvokeResult_{handler: handler}) + return self +} +func (p *EvalTargetServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type evalTargetServiceProcessorCreateEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorCreateEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceCreateEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceCreateEvalTargetResult{} + var retval *CreateEvalTargetResponse + if retval, err2 = p.handler.CreateEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("CreateEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorBatchGetEvalTargetsBySource struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorBatchGetEvalTargetsBySource) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetEvalTargetsBySourceResult{} + var retval *BatchGetEvalTargetsBySourceResponse + if retval, err2 = p.handler.BatchGetEvalTargetsBySource(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetsBySource: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorGetEvalTargetVersion struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorGetEvalTargetVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceGetEvalTargetVersionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceGetEvalTargetVersionResult{} + var retval *GetEvalTargetVersionResponse + if retval, err2 = p.handler.GetEvalTargetVersion(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetVersion: "+err2.Error()) + oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorBatchGetEvalTargetVersions struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorBatchGetEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetVersionsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetEvalTargetVersionsResult{} + var retval *BatchGetEvalTargetVersionsResponse + if retval, err2 = p.handler.BatchGetEvalTargetVersions(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetVersions: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorListSourceEvalTargets struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorListSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceListSourceEvalTargetsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceListSourceEvalTargetsResult{} + var retval *ListSourceEvalTargetsResponse + if retval, err2 = p.handler.ListSourceEvalTargets(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargets: "+err2.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorListSourceEvalTargetVersions struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorListSourceEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceListSourceEvalTargetVersionsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceListSourceEvalTargetVersionsResult{} + var retval *ListSourceEvalTargetVersionsResponse + if retval, err2 = p.handler.ListSourceEvalTargetVersions(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargetVersions: "+err2.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorBatchGetSourceEvalTargets struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetSourceEvalTargetsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetSourceEvalTargetsResult{} + var retval *BatchGetSourceEvalTargetsResponse + if retval, err2 = p.handler.BatchGetSourceEvalTargets(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetSourceEvalTargets: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorSearchCustomEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceSearchCustomEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceSearchCustomEvalTargetResult{} + var retval *SearchCustomEvalTargetResponse + if retval, err2 = p.handler.SearchCustomEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchCustomEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorExecuteEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceExecuteEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceExecuteEvalTargetResult{} + var retval *ExecuteEvalTargetResponse + if retval, err2 = p.handler.ExecuteEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorGetEvalTargetRecord struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceGetEvalTargetRecordArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceGetEvalTargetRecordResult{} + var retval *GetEvalTargetRecordResponse + if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} + var retval *BatchGetEvalTargetRecordsResponse + if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorDebugEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceDebugEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceDebugEvalTargetResult{} + var retval *DebugEvalTargetResponse + if retval, err2 = p.handler.DebugEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DebugEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorAsyncDebugEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceAsyncDebugEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceAsyncDebugEvalTargetResult{} + var retval *AsyncDebugEvalTargetResponse + if retval, err2 = p.handler.AsyncDebugEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncDebugEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorPassbackEvalTargetInvokeResult_ struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorPassbackEvalTargetInvokeResult_) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServicePassbackEvalTargetInvokeResultArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServicePassbackEvalTargetInvokeResultResult{} + var retval *PassbackEvalTargetInvokeResultResponse + if retval, err2 = p.handler.PassbackEvalTargetInvokeResult_(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PassbackEvalTargetInvokeResult: "+err2.Error()) + oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type EvalTargetServiceCreateEvalTargetArgs struct { + Request *CreateEvalTargetRequest `thrift:"request,1" frugal:"1,default,CreateEvalTargetRequest"` +} + +func NewEvalTargetServiceCreateEvalTargetArgs() *EvalTargetServiceCreateEvalTargetArgs { + return &EvalTargetServiceCreateEvalTargetArgs{} +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) InitDefault() { +} + +var EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT *CreateEvalTargetRequest + +func (p *EvalTargetServiceCreateEvalTargetArgs) GetRequest() (v *CreateEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetRequest() { + return EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT + } + return p.Request +} +func (p *EvalTargetServiceCreateEvalTargetArgs) SetRequest(val *CreateEvalTargetRequest) { + p.Request = val +} + +var fieldIDToName_EvalTargetServiceCreateEvalTargetArgs = map[int16]string{ + 1: "request", +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceCreateEvalTargetArgs(%+v)", *p) + +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) DeepEqual(ano *EvalTargetServiceCreateEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) Field1DeepEqual(src *CreateEvalTargetRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetServiceCreateEvalTargetResult struct { + Success *CreateEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,CreateEvalTargetResponse"` +} + +func NewEvalTargetServiceCreateEvalTargetResult() *EvalTargetServiceCreateEvalTargetResult { + return &EvalTargetServiceCreateEvalTargetResult{} +} + +func (p *EvalTargetServiceCreateEvalTargetResult) InitDefault() { +} + +var EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT *CreateEvalTargetResponse + +func (p *EvalTargetServiceCreateEvalTargetResult) GetSuccess() (v *CreateEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvalTargetServiceCreateEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*CreateEvalTargetResponse) +} + +var fieldIDToName_EvalTargetServiceCreateEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvalTargetServiceCreateEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvalTargetServiceCreateEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvalTargetServiceCreateEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvalTargetServiceCreateEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceCreateEvalTargetResult(%+v)", *p) + +} + +func (p *EvalTargetServiceCreateEvalTargetResult) DeepEqual(ano *EvalTargetServiceCreateEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvalTargetServiceCreateEvalTargetResult) Field0DeepEqual(src *CreateEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetServiceBatchGetEvalTargetsBySourceArgs struct { + Request *BatchGetEvalTargetsBySourceRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetsBySourceRequest"` +} + +func NewEvalTargetServiceBatchGetEvalTargetsBySourceArgs() *EvalTargetServiceBatchGetEvalTargetsBySourceArgs { + return &EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) InitDefault() { +} + +var EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT *BatchGetEvalTargetsBySourceRequest + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) GetRequest() (v *BatchGetEvalTargetsBySourceRequest) { + if p == nil { + return + } + if !p.IsSetRequest() { + return EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT + } + return p.Request +} +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) SetRequest(val *BatchGetEvalTargetsBySourceRequest) { + p.Request = val +} + +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs = map[int16]string{ + 1: "request", +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetsBySourceRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceArgs(%+v)", *p) + +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src *BatchGetEvalTargetsBySourceRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetServiceBatchGetEvalTargetsBySourceResult struct { + Success *BatchGetEvalTargetsBySourceResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetsBySourceResponse"` +} + +func NewEvalTargetServiceBatchGetEvalTargetsBySourceResult() *EvalTargetServiceBatchGetEvalTargetsBySourceResult { + return &EvalTargetServiceBatchGetEvalTargetsBySourceResult{} +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) InitDefault() { +} + +var EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT *BatchGetEvalTargetsBySourceResponse + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) GetSuccess() (v *BatchGetEvalTargetsBySourceResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT + } + return p.Success +} +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetsBySourceResponse) +} + +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult = map[int16]string{ + 0: "success", +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetsBySourceResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceResult(%+v)", *p) + +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src *BatchGetEvalTargetsBySourceResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetServiceGetEvalTargetVersionArgs struct { + Request *GetEvalTargetVersionRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetVersionRequest"` +} + +func NewEvalTargetServiceGetEvalTargetVersionArgs() *EvalTargetServiceGetEvalTargetVersionArgs { + return &EvalTargetServiceGetEvalTargetVersionArgs{} +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) InitDefault() { +} + +var EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT *GetEvalTargetVersionRequest + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) GetRequest() (v *GetEvalTargetVersionRequest) { + if p == nil { + return + } + if !p.IsSetRequest() { + return EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT + } + return p.Request +} +func (p *EvalTargetServiceGetEvalTargetVersionArgs) SetRequest(val *GetEvalTargetVersionRequest) { + p.Request = val +} + +var fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs = map[int16]string{ + 1: "request", +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetVersionRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetEvalTargetVersion_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionArgs(%+v)", *p) + +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false } - if err != nil { - return + return true +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEvalTargetVersionRequest) bool { + + if !p.Request.DeepEqual(src) { + return false } - return true, err + return true } -type evalTargetServiceProcessorBatchGetEvalTargetsBySource struct { - handler EvalTargetService +type EvalTargetServiceGetEvalTargetVersionResult struct { + Success *GetEvalTargetVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetVersionResponse"` } -func (p *evalTargetServiceProcessorBatchGetEvalTargetsBySource) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func NewEvalTargetServiceGetEvalTargetVersionResult() *EvalTargetServiceGetEvalTargetVersionResult { + return &EvalTargetServiceGetEvalTargetVersionResult{} +} - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetEvalTargetsBySourceResult{} - var retval *BatchGetEvalTargetsBySourceResponse - if retval, err2 = p.handler.BatchGetEvalTargetsBySource(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetsBySource: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { +func (p *EvalTargetServiceGetEvalTargetVersionResult) InitDefault() { +} + +var EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT *GetEvalTargetVersionResponse + +func (p *EvalTargetServiceGetEvalTargetVersionResult) GetSuccess() (v *GetEvalTargetVersionResponse) { + if p == nil { return } - return true, err + if !p.IsSetSuccess() { + return EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT + } + return p.Success +} +func (p *EvalTargetServiceGetEvalTargetVersionResult) SetSuccess(x interface{}) { + p.Success = x.(*GetEvalTargetVersionResponse) } -type evalTargetServiceProcessorGetEvalTargetVersion struct { - handler EvalTargetService +var fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult = map[int16]string{ + 0: "success", } -func (p *evalTargetServiceProcessorGetEvalTargetVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceGetEvalTargetVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceGetEvalTargetVersionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceGetEvalTargetVersionResult{} - var retval *GetEvalTargetVersionResponse - if retval, err2 = p.handler.GetEvalTargetVersion(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetVersion: "+err2.Error()) - oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } } - if err2 = oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetVersionResponse() + if err := _field.Read(iprot); err != nil { + return err } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + p.Success = _field + return nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetEvalTargetVersion_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return true, err + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -type evalTargetServiceProcessorBatchGetEvalTargetVersions struct { - handler EvalTargetService +func (p *EvalTargetServiceGetEvalTargetVersionResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *evalTargetServiceProcessorBatchGetEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetVersionsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceGetEvalTargetVersionResult) String() string { + if p == nil { + return "" } + return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetEvalTargetVersionsResult{} - var retval *BatchGetEvalTargetVersionsResponse - if retval, err2 = p.handler.BatchGetEvalTargetVersions(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetVersions: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if !p.Field0DeepEqual(ano.Success) { + return false } - if err != nil { - return + return true +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEvalTargetVersionResponse) bool { + + if !p.Success.DeepEqual(src) { + return false } - return true, err + return true } -type evalTargetServiceProcessorListSourceEvalTargets struct { - handler EvalTargetService +type EvalTargetServiceBatchGetEvalTargetVersionsArgs struct { + Request *BatchGetEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetVersionsRequest"` } -func (p *evalTargetServiceProcessorListSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceListSourceEvalTargetsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func NewEvalTargetServiceBatchGetEvalTargetVersionsArgs() *EvalTargetServiceBatchGetEvalTargetVersionsArgs { + return &EvalTargetServiceBatchGetEvalTargetVersionsArgs{} +} - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceListSourceEvalTargetsResult{} - var retval *ListSourceEvalTargetsResponse - if retval, err2 = p.handler.ListSourceEvalTargets(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargets: "+err2.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) InitDefault() { +} + +var EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT *BatchGetEvalTargetVersionsRequest + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) GetRequest() (v *BatchGetEvalTargetVersionsRequest) { + if p == nil { return } - return true, err + if !p.IsSetRequest() { + return EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT + } + return p.Request +} +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) SetRequest(val *BatchGetEvalTargetVersionsRequest) { + p.Request = val } -type evalTargetServiceProcessorListSourceEvalTargetVersions struct { - handler EvalTargetService +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs = map[int16]string{ + 1: "request", } -func (p *evalTargetServiceProcessorListSourceEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceListSourceEvalTargetVersionsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceListSourceEvalTargetVersionsResult{} - var retval *ListSourceEvalTargetVersionsResponse - if retval, err2 = p.handler.ListSourceEvalTargetVersions(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargetVersions: "+err2.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } } - if err2 = oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetVersionsRequest() + if err := _field.Read(iprot); err != nil { + return err } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + p.Request = _field + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_args"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } - if err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return true, err -} - -type evalTargetServiceProcessorBatchGetSourceEvalTargets struct { - handler EvalTargetService + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetSourceEvalTargetsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetSourceEvalTargetsResult{} - var retval *BatchGetSourceEvalTargetsResponse - if retval, err2 = p.handler.BatchGetSourceEvalTargets(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetSourceEvalTargets: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + if err := p.Request.Write(oprot); err != nil { + return err } - if err2 = oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) String() string { + if p == nil { + return "" } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsArgs(%+v)", *p) + +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if !p.Field1DeepEqual(ano.Request) { + return false } - if err != nil { - return + return true +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Field1DeepEqual(src *BatchGetEvalTargetVersionsRequest) bool { + + if !p.Request.DeepEqual(src) { + return false } - return true, err + return true } -type evalTargetServiceProcessorExecuteEvalTarget struct { - handler EvalTargetService +type EvalTargetServiceBatchGetEvalTargetVersionsResult struct { + Success *BatchGetEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetVersionsResponse"` } -func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceExecuteEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func NewEvalTargetServiceBatchGetEvalTargetVersionsResult() *EvalTargetServiceBatchGetEvalTargetVersionsResult { + return &EvalTargetServiceBatchGetEvalTargetVersionsResult{} +} - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceExecuteEvalTargetResult{} - var retval *ExecuteEvalTargetResponse - if retval, err2 = p.handler.ExecuteEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) InitDefault() { +} + +var EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT *BatchGetEvalTargetVersionsResponse + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) GetSuccess() (v *BatchGetEvalTargetVersionsResponse) { + if p == nil { return } - return true, err + if !p.IsSetSuccess() { + return EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT + } + return p.Success +} +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetVersionsResponse) } -type evalTargetServiceProcessorGetEvalTargetRecord struct { - handler EvalTargetService +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult = map[int16]string{ + 0: "success", } -func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceGetEvalTargetRecordArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceGetEvalTargetRecordResult{} - var retval *GetEvalTargetRecordResponse - if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } } - if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetVersionsResponse() + if err := _field.Read(iprot); err != nil { + return err } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + p.Success = _field + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return true, err -} - -type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { - handler EvalTargetService + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} - var retval *BatchGetEvalTargetRecordsResponse - if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) String() string { + if p == nil { + return "" } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsResult(%+v)", *p) + +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if !p.Field0DeepEqual(ano.Success) { + return false } - if err != nil { - return + return true +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src *BatchGetEvalTargetVersionsResponse) bool { + + if !p.Success.DeepEqual(src) { + return false } - return true, err + return true } -type EvalTargetServiceCreateEvalTargetArgs struct { - Request *CreateEvalTargetRequest `thrift:"request,1" frugal:"1,default,CreateEvalTargetRequest"` +type EvalTargetServiceListSourceEvalTargetsArgs struct { + Request *ListSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetsRequest"` } -func NewEvalTargetServiceCreateEvalTargetArgs() *EvalTargetServiceCreateEvalTargetArgs { - return &EvalTargetServiceCreateEvalTargetArgs{} +func NewEvalTargetServiceListSourceEvalTargetsArgs() *EvalTargetServiceListSourceEvalTargetsArgs { + return &EvalTargetServiceListSourceEvalTargetsArgs{} } -func (p *EvalTargetServiceCreateEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) InitDefault() { } -var EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT *CreateEvalTargetRequest +var EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT *ListSourceEvalTargetsRequest -func (p *EvalTargetServiceCreateEvalTargetArgs) GetRequest() (v *CreateEvalTargetRequest) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) GetRequest() (v *ListSourceEvalTargetsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT + return EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceCreateEvalTargetArgs) SetRequest(val *CreateEvalTargetRequest) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) SetRequest(val *ListSourceEvalTargetsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceCreateEvalTargetArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceCreateEvalTargetArgs) IsSetRequest() bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceCreateEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9129,7 +14227,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9139,8 +14237,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCreateEvalTargetRequest() +func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -9148,9 +14246,9 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *EvalTargetServiceCreateEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargets_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9176,7 +14274,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -9193,15 +14291,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetArgs) String() string { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceCreateEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsArgs(%+v)", *p) } -func (p *EvalTargetServiceCreateEvalTargetArgs) DeepEqual(ano *EvalTargetServiceCreateEvalTargetArgs) bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -9213,7 +14311,7 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) DeepEqual(ano *EvalTargetService return true } -func (p *EvalTargetServiceCreateEvalTargetArgs) Field1DeepEqual(src *CreateEvalTargetRequest) bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSourceEvalTargetsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -9221,41 +14319,41 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) Field1DeepEqual(src *CreateEvalT return true } -type EvalTargetServiceCreateEvalTargetResult struct { - Success *CreateEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,CreateEvalTargetResponse"` +type EvalTargetServiceListSourceEvalTargetsResult struct { + Success *ListSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetsResponse"` } -func NewEvalTargetServiceCreateEvalTargetResult() *EvalTargetServiceCreateEvalTargetResult { - return &EvalTargetServiceCreateEvalTargetResult{} +func NewEvalTargetServiceListSourceEvalTargetsResult() *EvalTargetServiceListSourceEvalTargetsResult { + return &EvalTargetServiceListSourceEvalTargetsResult{} } -func (p *EvalTargetServiceCreateEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetsResult) InitDefault() { } -var EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT *CreateEvalTargetResponse +var EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT *ListSourceEvalTargetsResponse -func (p *EvalTargetServiceCreateEvalTargetResult) GetSuccess() (v *CreateEvalTargetResponse) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) GetSuccess() (v *ListSourceEvalTargetsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT + return EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceCreateEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*CreateEvalTargetResponse) +func (p *EvalTargetServiceListSourceEvalTargetsResult) SetSuccess(x interface{}) { + p.Success = x.(*ListSourceEvalTargetsResponse) } -var fieldIDToName_EvalTargetServiceCreateEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceCreateEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceCreateEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9300,7 +14398,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9310,8 +14408,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCreateEvalTargetResponse() +func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -9319,9 +14417,9 @@ func (p *EvalTargetServiceCreateEvalTargetResult) ReadField0(iprot thrift.TProto return nil } -func (p *EvalTargetServiceCreateEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargets_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9347,7 +14445,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -9366,15 +14464,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceCreateEvalTargetResult) String() string { +func (p *EvalTargetServiceListSourceEvalTargetsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceCreateEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsResult(%+v)", *p) } -func (p *EvalTargetServiceCreateEvalTargetResult) DeepEqual(ano *EvalTargetServiceCreateEvalTargetResult) bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -9386,7 +14484,7 @@ func (p *EvalTargetServiceCreateEvalTargetResult) DeepEqual(ano *EvalTargetServi return true } -func (p *EvalTargetServiceCreateEvalTargetResult) Field0DeepEqual(src *CreateEvalTargetResponse) bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *ListSourceEvalTargetsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -9394,41 +14492,41 @@ func (p *EvalTargetServiceCreateEvalTargetResult) Field0DeepEqual(src *CreateEva return true } -type EvalTargetServiceBatchGetEvalTargetsBySourceArgs struct { - Request *BatchGetEvalTargetsBySourceRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetsBySourceRequest"` +type EvalTargetServiceListSourceEvalTargetVersionsArgs struct { + Request *ListSourceEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetVersionsRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetsBySourceArgs() *EvalTargetServiceBatchGetEvalTargetsBySourceArgs { - return &EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} +func NewEvalTargetServiceListSourceEvalTargetVersionsArgs() *EvalTargetServiceListSourceEvalTargetVersionsArgs { + return &EvalTargetServiceListSourceEvalTargetVersionsArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT *BatchGetEvalTargetsBySourceRequest +var EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT *ListSourceEvalTargetVersionsRequest -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) GetRequest() (v *BatchGetEvalTargetsBySourceRequest) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) GetRequest() (v *ListSourceEvalTargetVersionsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT + return EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) SetRequest(val *BatchGetEvalTargetsBySourceRequest) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) SetRequest(val *ListSourceEvalTargetVersionsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) IsSetRequest() bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9473,7 +14571,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9483,8 +14581,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetsBySourceRequest() +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetVersionsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -9492,9 +14590,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thri return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_args"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9520,7 +14618,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -9537,15 +14635,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) String() string { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -9557,7 +14655,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src *BatchGetEvalTargetsBySourceRequest) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src *ListSourceEvalTargetVersionsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -9565,41 +14663,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src * return true } -type EvalTargetServiceBatchGetEvalTargetsBySourceResult struct { - Success *BatchGetEvalTargetsBySourceResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetsBySourceResponse"` +type EvalTargetServiceListSourceEvalTargetVersionsResult struct { + Success *ListSourceEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetVersionsResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetsBySourceResult() *EvalTargetServiceBatchGetEvalTargetsBySourceResult { - return &EvalTargetServiceBatchGetEvalTargetsBySourceResult{} +func NewEvalTargetServiceListSourceEvalTargetVersionsResult() *EvalTargetServiceListSourceEvalTargetVersionsResult { + return &EvalTargetServiceListSourceEvalTargetVersionsResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT *BatchGetEvalTargetsBySourceResponse +var EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT *ListSourceEvalTargetVersionsResponse -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) GetSuccess() (v *BatchGetEvalTargetsBySourceResponse) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) GetSuccess() (v *ListSourceEvalTargetVersionsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT + return EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetsBySourceResponse) +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) SetSuccess(x interface{}) { + p.Success = x.(*ListSourceEvalTargetVersionsResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) IsSetSuccess() bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9644,7 +14742,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9654,8 +14752,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetsBySourceResponse() +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetVersionsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -9663,9 +14761,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot th return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_result"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9691,7 +14789,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -9710,15 +14808,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) String() string { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceResult) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -9730,7 +14828,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *Eval return true } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src *BatchGetEvalTargetsBySourceResponse) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(src *ListSourceEvalTargetVersionsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -9738,41 +14836,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src return true } -type EvalTargetServiceGetEvalTargetVersionArgs struct { - Request *GetEvalTargetVersionRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetVersionRequest"` +type EvalTargetServiceBatchGetSourceEvalTargetsArgs struct { + Request *BatchGetSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,BatchGetSourceEvalTargetsRequest"` } -func NewEvalTargetServiceGetEvalTargetVersionArgs() *EvalTargetServiceGetEvalTargetVersionArgs { - return &EvalTargetServiceGetEvalTargetVersionArgs{} +func NewEvalTargetServiceBatchGetSourceEvalTargetsArgs() *EvalTargetServiceBatchGetSourceEvalTargetsArgs { + return &EvalTargetServiceBatchGetSourceEvalTargetsArgs{} } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) InitDefault() { } -var EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT *GetEvalTargetVersionRequest +var EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT *BatchGetSourceEvalTargetsRequest -func (p *EvalTargetServiceGetEvalTargetVersionArgs) GetRequest() (v *GetEvalTargetVersionRequest) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) GetRequest() (v *BatchGetSourceEvalTargetsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT + return EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) SetRequest(val *GetEvalTargetVersionRequest) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) SetRequest(val *BatchGetSourceEvalTargetsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) IsSetRequest() bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9817,7 +14915,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9827,8 +14925,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetVersionRequest() +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetSourceEvalTargetsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -9836,9 +14934,9 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TPro return nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetVersion_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9864,7 +14962,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -9881,15 +14979,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) String() string { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsArgs(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionArgs) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -9901,7 +14999,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetSer return true } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEvalTargetVersionRequest) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *BatchGetSourceEvalTargetsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -9909,41 +15007,41 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEval return true } -type EvalTargetServiceGetEvalTargetVersionResult struct { - Success *GetEvalTargetVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetVersionResponse"` +type EvalTargetServiceBatchGetSourceEvalTargetsResult struct { + Success *BatchGetSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetSourceEvalTargetsResponse"` } -func NewEvalTargetServiceGetEvalTargetVersionResult() *EvalTargetServiceGetEvalTargetVersionResult { - return &EvalTargetServiceGetEvalTargetVersionResult{} +func NewEvalTargetServiceBatchGetSourceEvalTargetsResult() *EvalTargetServiceBatchGetSourceEvalTargetsResult { + return &EvalTargetServiceBatchGetSourceEvalTargetsResult{} } -func (p *EvalTargetServiceGetEvalTargetVersionResult) InitDefault() { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) InitDefault() { } -var EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT *GetEvalTargetVersionResponse +var EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT *BatchGetSourceEvalTargetsResponse -func (p *EvalTargetServiceGetEvalTargetVersionResult) GetSuccess() (v *GetEvalTargetVersionResponse) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) GetSuccess() (v *BatchGetSourceEvalTargetsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT + return EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceGetEvalTargetVersionResult) SetSuccess(x interface{}) { - p.Success = x.(*GetEvalTargetVersionResponse) +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetSourceEvalTargetsResponse) } -var fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceGetEvalTargetVersionResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9988,7 +15086,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9998,8 +15096,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetVersionResponse() +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetSourceEvalTargetsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -10007,9 +15105,9 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TP return nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetVersion_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10035,7 +15133,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -10054,15 +15152,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) String() string { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsResult(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionResult) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -10074,7 +15172,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetS return true } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEvalTargetVersionResponse) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src *BatchGetSourceEvalTargetsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -10082,41 +15180,41 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEv return true } -type EvalTargetServiceBatchGetEvalTargetVersionsArgs struct { - Request *BatchGetEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetVersionsRequest"` +type EvalTargetServiceSearchCustomEvalTargetArgs struct { + Req *SearchCustomEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchCustomEvalTargetRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetVersionsArgs() *EvalTargetServiceBatchGetEvalTargetVersionsArgs { - return &EvalTargetServiceBatchGetEvalTargetVersionsArgs{} +func NewEvalTargetServiceSearchCustomEvalTargetArgs() *EvalTargetServiceSearchCustomEvalTargetArgs { + return &EvalTargetServiceSearchCustomEvalTargetArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) InitDefault() { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT *BatchGetEvalTargetVersionsRequest +var EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT *SearchCustomEvalTargetRequest -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) GetRequest() (v *BatchGetEvalTargetVersionsRequest) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) GetReq() (v *SearchCustomEvalTargetRequest) { if p == nil { return } - if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT + if !p.IsSetReq() { + return EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT } - return p.Request + return p.Req } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) SetRequest(val *BatchGetEvalTargetVersionsRequest) { - p.Request = val +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) SetReq(val *SearchCustomEvalTargetRequest) { + p.Req = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs = map[int16]string{ - 1: "request", +var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs = map[int16]string{ + 1: "req", } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) IsSetRequest() bool { - return p.Request != nil +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) IsSetReq() bool { + return p.Req != nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10161,7 +15259,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10171,18 +15269,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetVersionsRequest() +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSearchCustomEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } - p.Request = _field + p.Req = _field return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_args"); err != nil { + if err = oprot.WriteStructBegin("SearchCustomEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10208,11 +15306,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Request.Write(oprot); err != nil { + if err := p.Req.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10225,69 +15323,69 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) String() string { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsArgs) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Request) { + if !p.Field1DeepEqual(ano.Req) { return false } return true } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Field1DeepEqual(src *BatchGetEvalTargetVersionsRequest) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Field1DeepEqual(src *SearchCustomEvalTargetRequest) bool { - if !p.Request.DeepEqual(src) { + if !p.Req.DeepEqual(src) { return false } return true } -type EvalTargetServiceBatchGetEvalTargetVersionsResult struct { - Success *BatchGetEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetVersionsResponse"` +type EvalTargetServiceSearchCustomEvalTargetResult struct { + Success *SearchCustomEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchCustomEvalTargetResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetVersionsResult() *EvalTargetServiceBatchGetEvalTargetVersionsResult { - return &EvalTargetServiceBatchGetEvalTargetVersionsResult{} +func NewEvalTargetServiceSearchCustomEvalTargetResult() *EvalTargetServiceSearchCustomEvalTargetResult { + return &EvalTargetServiceSearchCustomEvalTargetResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) InitDefault() { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT *BatchGetEvalTargetVersionsResponse +var EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT *SearchCustomEvalTargetResponse -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) GetSuccess() (v *BatchGetEvalTargetVersionsResponse) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) GetSuccess() (v *SearchCustomEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT + return EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetVersionsResponse) +func (p *EvalTargetServiceSearchCustomEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*SearchCustomEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10332,7 +15430,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10342,8 +15440,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetVersionsResponse() +func (p *EvalTargetServiceSearchCustomEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSearchCustomEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -10351,9 +15449,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thr return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_result"); err != nil { + if err = oprot.WriteStructBegin("SearchCustomEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10379,7 +15477,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -10398,15 +15496,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) String() string { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsResult) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -10418,7 +15516,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalT return true } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src *BatchGetEvalTargetVersionsResponse) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Field0DeepEqual(src *SearchCustomEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -10426,41 +15524,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src return true } -type EvalTargetServiceListSourceEvalTargetsArgs struct { - Request *ListSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetsRequest"` +type EvalTargetServiceExecuteEvalTargetArgs struct { + Request *ExecuteEvalTargetRequest `thrift:"request,1" frugal:"1,default,ExecuteEvalTargetRequest"` } -func NewEvalTargetServiceListSourceEvalTargetsArgs() *EvalTargetServiceListSourceEvalTargetsArgs { - return &EvalTargetServiceListSourceEvalTargetsArgs{} +func NewEvalTargetServiceExecuteEvalTargetArgs() *EvalTargetServiceExecuteEvalTargetArgs { + return &EvalTargetServiceExecuteEvalTargetArgs{} } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) InitDefault() { +func (p *EvalTargetServiceExecuteEvalTargetArgs) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT *ListSourceEvalTargetsRequest +var EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT *ExecuteEvalTargetRequest -func (p *EvalTargetServiceListSourceEvalTargetsArgs) GetRequest() (v *ListSourceEvalTargetsRequest) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) GetRequest() (v *ExecuteEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT + return EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) SetRequest(val *ListSourceEvalTargetsRequest) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) SetRequest(val *ExecuteEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10505,7 +15603,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10515,8 +15613,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetsRequest() +func (p *EvalTargetServiceExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewExecuteEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -10524,9 +15622,9 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TPr return nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargets_args"); err != nil { + if err = oprot.WriteStructBegin("ExecuteEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10552,7 +15650,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -10569,15 +15667,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) String() string { +func (p *EvalTargetServiceExecuteEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsArgs) bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -10589,7 +15687,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetSe return true } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSourceEvalTargetsRequest) bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Field1DeepEqual(src *ExecuteEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -10597,41 +15695,41 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSo return true } -type EvalTargetServiceListSourceEvalTargetsResult struct { - Success *ListSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetsResponse"` +type EvalTargetServiceExecuteEvalTargetResult struct { + Success *ExecuteEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,ExecuteEvalTargetResponse"` } -func NewEvalTargetServiceListSourceEvalTargetsResult() *EvalTargetServiceListSourceEvalTargetsResult { - return &EvalTargetServiceListSourceEvalTargetsResult{} +func NewEvalTargetServiceExecuteEvalTargetResult() *EvalTargetServiceExecuteEvalTargetResult { + return &EvalTargetServiceExecuteEvalTargetResult{} } -func (p *EvalTargetServiceListSourceEvalTargetsResult) InitDefault() { +func (p *EvalTargetServiceExecuteEvalTargetResult) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT *ListSourceEvalTargetsResponse +var EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT *ExecuteEvalTargetResponse -func (p *EvalTargetServiceListSourceEvalTargetsResult) GetSuccess() (v *ListSourceEvalTargetsResponse) { +func (p *EvalTargetServiceExecuteEvalTargetResult) GetSuccess() (v *ExecuteEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT + return EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceListSourceEvalTargetsResult) SetSuccess(x interface{}) { - p.Success = x.(*ListSourceEvalTargetsResponse) +func (p *EvalTargetServiceExecuteEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*ExecuteEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceExecuteEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceListSourceEvalTargetsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10676,7 +15774,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10686,8 +15784,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetsResponse() +func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewExecuteEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -10695,9 +15793,9 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.T return nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargets_result"); err != nil { + if err = oprot.WriteStructBegin("ExecuteEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10723,7 +15821,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -10742,15 +15840,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) String() string { +func (p *EvalTargetServiceExecuteEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsResult) bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -10762,7 +15860,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTarget return true } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *ListSourceEvalTargetsResponse) bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -10770,41 +15868,41 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *List return true } -type EvalTargetServiceListSourceEvalTargetVersionsArgs struct { - Request *ListSourceEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetVersionsRequest"` +type EvalTargetServiceGetEvalTargetRecordArgs struct { + Request *GetEvalTargetRecordRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetRecordRequest"` } -func NewEvalTargetServiceListSourceEvalTargetVersionsArgs() *EvalTargetServiceListSourceEvalTargetVersionsArgs { - return &EvalTargetServiceListSourceEvalTargetVersionsArgs{} +func NewEvalTargetServiceGetEvalTargetRecordArgs() *EvalTargetServiceGetEvalTargetRecordArgs { + return &EvalTargetServiceGetEvalTargetRecordArgs{} } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT *ListSourceEvalTargetVersionsRequest +var EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT *GetEvalTargetRecordRequest -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) GetRequest() (v *ListSourceEvalTargetVersionsRequest) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) GetRequest() (v *GetEvalTargetRecordRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT + return EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) SetRequest(val *ListSourceEvalTargetVersionsRequest) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) SetRequest(val *GetEvalTargetRecordRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10849,7 +15947,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10859,8 +15957,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetVersionsRequest() +func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetRecordRequest() if err := _field.Read(iprot); err != nil { return err } @@ -10868,9 +15966,9 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thr return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_args"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetRecord_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10896,7 +15994,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -10913,15 +16011,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) String() string { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordArgs(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsArgs) bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -10933,7 +16031,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalT return true } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src *ListSourceEvalTargetVersionsRequest) bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalTargetRecordRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -10941,41 +16039,41 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src return true } -type EvalTargetServiceListSourceEvalTargetVersionsResult struct { - Success *ListSourceEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetVersionsResponse"` +type EvalTargetServiceGetEvalTargetRecordResult struct { + Success *GetEvalTargetRecordResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetRecordResponse"` } -func NewEvalTargetServiceListSourceEvalTargetVersionsResult() *EvalTargetServiceListSourceEvalTargetVersionsResult { - return &EvalTargetServiceListSourceEvalTargetVersionsResult{} +func NewEvalTargetServiceGetEvalTargetRecordResult() *EvalTargetServiceGetEvalTargetRecordResult { + return &EvalTargetServiceGetEvalTargetRecordResult{} } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetRecordResult) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT *ListSourceEvalTargetVersionsResponse +var EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT *GetEvalTargetRecordResponse -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) GetSuccess() (v *ListSourceEvalTargetVersionsResponse) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) GetSuccess() (v *GetEvalTargetRecordResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT + return EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) SetSuccess(x interface{}) { - p.Success = x.(*ListSourceEvalTargetVersionsResponse) +func (p *EvalTargetServiceGetEvalTargetRecordResult) SetSuccess(x interface{}) { + p.Success = x.(*GetEvalTargetRecordResponse) } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11020,7 +16118,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11030,8 +16128,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetVersionsResponse() +func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetRecordResponse() if err := _field.Read(iprot); err != nil { return err } @@ -11039,9 +16137,9 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot t return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_result"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetRecord_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11067,7 +16165,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -11086,15 +16184,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) String() string { +func (p *EvalTargetServiceGetEvalTargetRecordResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordResult(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsResult) bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11106,7 +16204,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *Eva return true } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(src *ListSourceEvalTargetVersionsResponse) bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEvalTargetRecordResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -11114,41 +16212,41 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(sr return true } -type EvalTargetServiceBatchGetSourceEvalTargetsArgs struct { - Request *BatchGetSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,BatchGetSourceEvalTargetsRequest"` +type EvalTargetServiceBatchGetEvalTargetRecordsArgs struct { + Request *BatchGetEvalTargetRecordsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetRecordsRequest"` } -func NewEvalTargetServiceBatchGetSourceEvalTargetsArgs() *EvalTargetServiceBatchGetSourceEvalTargetsArgs { - return &EvalTargetServiceBatchGetSourceEvalTargetsArgs{} +func NewEvalTargetServiceBatchGetEvalTargetRecordsArgs() *EvalTargetServiceBatchGetEvalTargetRecordsArgs { + return &EvalTargetServiceBatchGetEvalTargetRecordsArgs{} } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) InitDefault() { } -var EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT *BatchGetSourceEvalTargetsRequest +var EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT *BatchGetEvalTargetRecordsRequest -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) GetRequest() (v *BatchGetSourceEvalTargetsRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) GetRequest() (v *BatchGetEvalTargetRecordsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT + return EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) SetRequest(val *BatchGetSourceEvalTargetsRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) SetRequest(val *BatchGetEvalTargetRecordsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11193,7 +16291,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11203,8 +16301,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetSourceEvalTargetsRequest() +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetRecordsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -11212,9 +16310,9 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11240,7 +16338,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -11257,15 +16355,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsArgs) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11277,7 +16375,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTarg return true } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *BatchGetSourceEvalTargetsRequest) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Field1DeepEqual(src *BatchGetEvalTargetRecordsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -11285,41 +16383,41 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *Ba return true } -type EvalTargetServiceBatchGetSourceEvalTargetsResult struct { - Success *BatchGetSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetSourceEvalTargetsResponse"` +type EvalTargetServiceBatchGetEvalTargetRecordsResult struct { + Success *BatchGetEvalTargetRecordsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetRecordsResponse"` } -func NewEvalTargetServiceBatchGetSourceEvalTargetsResult() *EvalTargetServiceBatchGetSourceEvalTargetsResult { - return &EvalTargetServiceBatchGetSourceEvalTargetsResult{} +func NewEvalTargetServiceBatchGetEvalTargetRecordsResult() *EvalTargetServiceBatchGetEvalTargetRecordsResult { + return &EvalTargetServiceBatchGetEvalTargetRecordsResult{} } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) InitDefault() { } -var EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT *BatchGetSourceEvalTargetsResponse +var EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT *BatchGetEvalTargetRecordsResponse -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) GetSuccess() (v *BatchGetSourceEvalTargetsResponse) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) GetSuccess() (v *BatchGetEvalTargetRecordsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT + return EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetSourceEvalTargetsResponse) +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetRecordsResponse) } -var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11364,7 +16462,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11374,8 +16472,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetSourceEvalTargetsResponse() +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetRecordsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -11383,9 +16481,9 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thri return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11411,7 +16509,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -11430,15 +16528,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsResult) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11450,7 +16548,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src *BatchGetSourceEvalTargetsResponse) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Field0DeepEqual(src *BatchGetEvalTargetRecordsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -11458,41 +16556,41 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src * return true } -type EvalTargetServiceExecuteEvalTargetArgs struct { - Request *ExecuteEvalTargetRequest `thrift:"request,1" frugal:"1,default,ExecuteEvalTargetRequest"` +type EvalTargetServiceDebugEvalTargetArgs struct { + Request *DebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,DebugEvalTargetRequest"` } -func NewEvalTargetServiceExecuteEvalTargetArgs() *EvalTargetServiceExecuteEvalTargetArgs { - return &EvalTargetServiceExecuteEvalTargetArgs{} +func NewEvalTargetServiceDebugEvalTargetArgs() *EvalTargetServiceDebugEvalTargetArgs { + return &EvalTargetServiceDebugEvalTargetArgs{} } -func (p *EvalTargetServiceExecuteEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceDebugEvalTargetArgs) InitDefault() { } -var EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT *ExecuteEvalTargetRequest +var EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT *DebugEvalTargetRequest -func (p *EvalTargetServiceExecuteEvalTargetArgs) GetRequest() (v *ExecuteEvalTargetRequest) { +func (p *EvalTargetServiceDebugEvalTargetArgs) GetRequest() (v *DebugEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT + return EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceExecuteEvalTargetArgs) SetRequest(val *ExecuteEvalTargetRequest) { +func (p *EvalTargetServiceDebugEvalTargetArgs) SetRequest(val *DebugEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceDebugEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceExecuteEvalTargetArgs) IsSetRequest() bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11537,7 +16635,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11547,8 +16645,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewExecuteEvalTargetRequest() +func (p *EvalTargetServiceDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDebugEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -11556,9 +16654,9 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtoc return nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ExecuteEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("DebugEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11584,7 +16682,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -11601,15 +16699,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) String() string { +func (p *EvalTargetServiceDebugEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceDebugEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetArgs) bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceDebugEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11621,7 +16719,7 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServic return true } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Field1DeepEqual(src *ExecuteEvalTargetRequest) bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) Field1DeepEqual(src *DebugEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -11629,41 +16727,41 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) Field1DeepEqual(src *ExecuteEva return true } -type EvalTargetServiceExecuteEvalTargetResult struct { - Success *ExecuteEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,ExecuteEvalTargetResponse"` +type EvalTargetServiceDebugEvalTargetResult struct { + Success *DebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,DebugEvalTargetResponse"` } -func NewEvalTargetServiceExecuteEvalTargetResult() *EvalTargetServiceExecuteEvalTargetResult { - return &EvalTargetServiceExecuteEvalTargetResult{} +func NewEvalTargetServiceDebugEvalTargetResult() *EvalTargetServiceDebugEvalTargetResult { + return &EvalTargetServiceDebugEvalTargetResult{} } -func (p *EvalTargetServiceExecuteEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceDebugEvalTargetResult) InitDefault() { } -var EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT *ExecuteEvalTargetResponse +var EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT *DebugEvalTargetResponse -func (p *EvalTargetServiceExecuteEvalTargetResult) GetSuccess() (v *ExecuteEvalTargetResponse) { +func (p *EvalTargetServiceDebugEvalTargetResult) GetSuccess() (v *DebugEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT + return EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceExecuteEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*ExecuteEvalTargetResponse) +func (p *EvalTargetServiceDebugEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*DebugEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceExecuteEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceDebugEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceExecuteEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceDebugEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11708,7 +16806,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11718,8 +16816,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewExecuteEvalTargetResponse() +func (p *EvalTargetServiceDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDebugEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -11727,9 +16825,9 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProt return nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ExecuteEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("DebugEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11755,7 +16853,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -11774,15 +16872,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) String() string { +func (p *EvalTargetServiceDebugEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceDebugEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetResult) bool { +func (p *EvalTargetServiceDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceDebugEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11794,7 +16892,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServ return true } -func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteEvalTargetResponse) bool { +func (p *EvalTargetServiceDebugEvalTargetResult) Field0DeepEqual(src *DebugEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -11802,41 +16900,41 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteE return true } -type EvalTargetServiceGetEvalTargetRecordArgs struct { - Request *GetEvalTargetRecordRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetRecordRequest"` +type EvalTargetServiceAsyncDebugEvalTargetArgs struct { + Request *AsyncDebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,AsyncDebugEvalTargetRequest"` } -func NewEvalTargetServiceGetEvalTargetRecordArgs() *EvalTargetServiceGetEvalTargetRecordArgs { - return &EvalTargetServiceGetEvalTargetRecordArgs{} +func NewEvalTargetServiceAsyncDebugEvalTargetArgs() *EvalTargetServiceAsyncDebugEvalTargetArgs { + return &EvalTargetServiceAsyncDebugEvalTargetArgs{} } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) InitDefault() { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) InitDefault() { } -var EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT *GetEvalTargetRecordRequest +var EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT *AsyncDebugEvalTargetRequest -func (p *EvalTargetServiceGetEvalTargetRecordArgs) GetRequest() (v *GetEvalTargetRecordRequest) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) GetRequest() (v *AsyncDebugEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT + return EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) SetRequest(val *GetEvalTargetRecordRequest) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) SetRequest(val *AsyncDebugEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) IsSetRequest() bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11881,7 +16979,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11891,8 +16989,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetRecordRequest() +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAsyncDebugEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -11900,9 +16998,9 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProt return nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetRecord_args"); err != nil { + if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11928,7 +17026,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -11945,15 +17043,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) String() string { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordArgs) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -11965,7 +17063,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServ return true } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalTargetRecordRequest) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Field1DeepEqual(src *AsyncDebugEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -11973,41 +17071,41 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalT return true } -type EvalTargetServiceGetEvalTargetRecordResult struct { - Success *GetEvalTargetRecordResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetRecordResponse"` +type EvalTargetServiceAsyncDebugEvalTargetResult struct { + Success *AsyncDebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncDebugEvalTargetResponse"` } -func NewEvalTargetServiceGetEvalTargetRecordResult() *EvalTargetServiceGetEvalTargetRecordResult { - return &EvalTargetServiceGetEvalTargetRecordResult{} +func NewEvalTargetServiceAsyncDebugEvalTargetResult() *EvalTargetServiceAsyncDebugEvalTargetResult { + return &EvalTargetServiceAsyncDebugEvalTargetResult{} } -func (p *EvalTargetServiceGetEvalTargetRecordResult) InitDefault() { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) InitDefault() { } -var EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT *GetEvalTargetRecordResponse +var EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT *AsyncDebugEvalTargetResponse -func (p *EvalTargetServiceGetEvalTargetRecordResult) GetSuccess() (v *GetEvalTargetRecordResponse) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) GetSuccess() (v *AsyncDebugEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT + return EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceGetEvalTargetRecordResult) SetSuccess(x interface{}) { - p.Success = x.(*GetEvalTargetRecordResponse) +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*AsyncDebugEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceGetEvalTargetRecordResult) IsSetSuccess() bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12052,7 +17150,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12062,8 +17160,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetRecordResponse() +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAsyncDebugEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -12071,9 +17169,9 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TPr return nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetRecord_result"); err != nil { + if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12099,7 +17197,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -12118,15 +17216,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) String() string { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordResult) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -12138,7 +17236,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetSe return true } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEvalTargetRecordResponse) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Field0DeepEqual(src *AsyncDebugEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -12146,41 +17244,41 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEva return true } -type EvalTargetServiceBatchGetEvalTargetRecordsArgs struct { - Request *BatchGetEvalTargetRecordsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetRecordsRequest"` +type EvalTargetServicePassbackEvalTargetInvokeResultArgs struct { + Req *PassbackEvalTargetInvokeResultRequest `thrift:"req,1" frugal:"1,default,PassbackEvalTargetInvokeResultRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetRecordsArgs() *EvalTargetServiceBatchGetEvalTargetRecordsArgs { - return &EvalTargetServiceBatchGetEvalTargetRecordsArgs{} +func NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() *EvalTargetServicePassbackEvalTargetInvokeResultArgs { + return &EvalTargetServicePassbackEvalTargetInvokeResultArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) InitDefault() { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT *BatchGetEvalTargetRecordsRequest +var EvalTargetServicePassbackEvalTargetInvokeResultArgs_Req_DEFAULT *PassbackEvalTargetInvokeResultRequest -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) GetRequest() (v *BatchGetEvalTargetRecordsRequest) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) GetReq() (v *PassbackEvalTargetInvokeResultRequest) { if p == nil { return } - if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT + if !p.IsSetReq() { + return EvalTargetServicePassbackEvalTargetInvokeResultArgs_Req_DEFAULT } - return p.Request + return p.Req } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) SetRequest(val *BatchGetEvalTargetRecordsRequest) { - p.Request = val +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) SetReq(val *PassbackEvalTargetInvokeResultRequest) { + p.Req = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs = map[int16]string{ - 1: "request", +var fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs = map[int16]string{ + 1: "req", } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) IsSetRequest() bool { - return p.Request != nil +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) IsSetReq() bool { + return p.Req != nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12225,7 +17323,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12235,18 +17333,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetRecordsRequest() +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewPassbackEvalTargetInvokeResultRequest() if err := _field.Read(iprot); err != nil { return err } - p.Request = _field + p.Req = _field return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_args"); err != nil { + if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResult_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12272,11 +17370,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Request.Write(oprot); err != nil { + if err := p.Req.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12289,69 +17387,69 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) String() string { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServicePassbackEvalTargetInvokeResultArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsArgs) bool { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) DeepEqual(ano *EvalTargetServicePassbackEvalTargetInvokeResultArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Request) { + if !p.Field1DeepEqual(ano.Req) { return false } return true } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Field1DeepEqual(src *BatchGetEvalTargetRecordsRequest) bool { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Field1DeepEqual(src *PassbackEvalTargetInvokeResultRequest) bool { - if !p.Request.DeepEqual(src) { + if !p.Req.DeepEqual(src) { return false } return true } -type EvalTargetServiceBatchGetEvalTargetRecordsResult struct { - Success *BatchGetEvalTargetRecordsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetRecordsResponse"` +type EvalTargetServicePassbackEvalTargetInvokeResultResult struct { + Success *PassbackEvalTargetInvokeResultResponse `thrift:"success,0,optional" frugal:"0,optional,PassbackEvalTargetInvokeResultResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetRecordsResult() *EvalTargetServiceBatchGetEvalTargetRecordsResult { - return &EvalTargetServiceBatchGetEvalTargetRecordsResult{} +func NewEvalTargetServicePassbackEvalTargetInvokeResultResult() *EvalTargetServicePassbackEvalTargetInvokeResultResult { + return &EvalTargetServicePassbackEvalTargetInvokeResultResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) InitDefault() { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT *BatchGetEvalTargetRecordsResponse +var EvalTargetServicePassbackEvalTargetInvokeResultResult_Success_DEFAULT *PassbackEvalTargetInvokeResultResponse -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) GetSuccess() (v *BatchGetEvalTargetRecordsResponse) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) GetSuccess() (v *PassbackEvalTargetInvokeResultResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT + return EvalTargetServicePassbackEvalTargetInvokeResultResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetRecordsResponse) +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) SetSuccess(x interface{}) { + p.Success = x.(*PassbackEvalTargetInvokeResultResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult = map[int16]string{ +var fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) IsSetSuccess() bool { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12396,7 +17494,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12406,8 +17504,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetRecordsResponse() +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewPassbackEvalTargetInvokeResultResponse() if err := _field.Read(iprot); err != nil { return err } @@ -12415,9 +17513,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thri return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_result"); err != nil { + if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResult_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12443,7 +17541,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -12462,15 +17560,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) String() string { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServicePassbackEvalTargetInvokeResultResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsResult) bool { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) DeepEqual(ano *EvalTargetServicePassbackEvalTargetInvokeResultResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -12482,7 +17580,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Field0DeepEqual(src *BatchGetEvalTargetRecordsResponse) bool { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Field0DeepEqual(src *PassbackEvalTargetInvokeResultResponse) bool { if !p.Success.DeepEqual(src) { return false diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go index eb10f9c89..a53899ff4 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go @@ -35,6 +35,11 @@ func (p *CreateEvalTargetRequest) IsValid() error { return nil } func (p *CreateEvalTargetParam) IsValid() error { + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } return nil } func (p *CreateEvalTargetResponse) IsValid() error { @@ -230,3 +235,107 @@ func (p *ListSourceEvalTargetVersionsResponse) IsValid() error { } return nil } +func (p *SearchCustomEvalTargetRequest) IsValid() error { + if p.CustomPsm != nil { + if err := p.CustomPsm.IsValid(); err != nil { + return fmt.Errorf("field CustomPsm not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *SearchCustomEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *DebugEvalTargetRequest) IsValid() error { + if p.TargetRuntimeParam != nil { + if err := p.TargetRuntimeParam.IsValid(); err != nil { + return fmt.Errorf("field TargetRuntimeParam not valid, %w", err) + } + } + if p.CustomPsm != nil { + if err := p.CustomPsm.IsValid(); err != nil { + return fmt.Errorf("field CustomPsm not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *DebugEvalTargetResponse) IsValid() error { + if p.EvalTargetRecord != nil { + if err := p.EvalTargetRecord.IsValid(); err != nil { + return fmt.Errorf("field EvalTargetRecord not valid, %w", err) + } + } + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *AsyncDebugEvalTargetRequest) IsValid() error { + if p.TargetRuntimeParam != nil { + if err := p.TargetRuntimeParam.IsValid(); err != nil { + return fmt.Errorf("field TargetRuntimeParam not valid, %w", err) + } + } + if p.CustomPsm != nil { + if err := p.CustomPsm.IsValid(); err != nil { + return fmt.Errorf("field CustomPsm not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *AsyncDebugEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *PassbackEvalTargetInvokeResultRequest) IsValid() error { + if p.Output != nil { + if err := p.Output.IsValid(); err != nil { + return fmt.Errorf("field Output not valid, %w", err) + } + } + if p.Usage != nil { + if err := p.Usage.IsValid(); err != nil { + return fmt.Errorf("field Usage not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *PassbackEvalTargetInvokeResultResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go index b8db17c0c..44ac06dc5 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go @@ -18,9 +18,13 @@ type Client interface { ListSourceEvalTargets(ctx context.Context, request *eval_target.ListSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetsResponse, err error) ListSourceEvalTargetVersions(ctx context.Context, request *eval_target.ListSourceEvalTargetVersionsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetVersionsResponse, err error) BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) + SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) + DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) + AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) + PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -87,6 +91,11 @@ func (p *kEvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context return p.kClient.BatchGetSourceEvalTargets(ctx, request) } +func (p *kEvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchCustomEvalTarget(ctx, req) +} + func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.ExecuteEvalTarget(ctx, request) @@ -101,3 +110,18 @@ func (p *kEvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.BatchGetEvalTargetRecords(ctx, request) } + +func (p *kEvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncDebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go index 2f7c122c9..926b77bb0 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go @@ -62,6 +62,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "SearchCustomEvalTarget": kitex.NewMethodInfo( + searchCustomEvalTargetHandler, + newEvalTargetServiceSearchCustomEvalTargetArgs, + newEvalTargetServiceSearchCustomEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "ExecuteEvalTarget": kitex.NewMethodInfo( executeEvalTargetHandler, newEvalTargetServiceExecuteEvalTargetArgs, @@ -83,6 +90,27 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "DebugEvalTarget": kitex.NewMethodInfo( + debugEvalTargetHandler, + newEvalTargetServiceDebugEvalTargetArgs, + newEvalTargetServiceDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncDebugEvalTarget": kitex.NewMethodInfo( + asyncDebugEvalTargetHandler, + newEvalTargetServiceAsyncDebugEvalTargetArgs, + newEvalTargetServiceAsyncDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( + passbackEvalTargetInvokeResult_Handler, + newEvalTargetServicePassbackEvalTargetInvokeResultArgs, + newEvalTargetServicePassbackEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -249,6 +277,25 @@ func newEvalTargetServiceBatchGetSourceEvalTargetsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetSourceEvalTargetsResult() } +func searchCustomEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceSearchCustomEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceSearchCustomEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).SearchCustomEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceSearchCustomEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetArgs() +} + +func newEvalTargetServiceSearchCustomEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetResult() +} + func executeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceExecuteEvalTargetArgs) realResult := result.(*eval_target.EvalTargetServiceExecuteEvalTargetResult) @@ -306,6 +353,63 @@ func newEvalTargetServiceBatchGetEvalTargetRecordsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetEvalTargetRecordsResult() } +func debugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).DebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetArgs() +} + +func newEvalTargetServiceDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetResult() +} + +func asyncDebugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncDebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetArgs() +} + +func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() +} + +func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) + realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) + success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() +} + type kClient struct { c client.Client sc client.Streaming @@ -388,6 +492,16 @@ func (p *kClient) BatchGetSourceEvalTargets(ctx context.Context, request *eval_t return _result.GetSuccess(), nil } +func (p *kClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceSearchCustomEvalTargetArgs + _args.Req = req + var _result eval_target.EvalTargetServiceSearchCustomEvalTargetResult + if err = p.c.Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest) (r *eval_target.ExecuteEvalTargetResponse, err error) { var _args eval_target.EvalTargetServiceExecuteEvalTargetArgs _args.Request = request @@ -417,3 +531,33 @@ func (p *kClient) BatchGetEvalTargetRecords(ctx context.Context, request *eval_t } return _result.GetSuccess(), nil } + +func (p *kClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceDebugEvalTargetResult + if err = p.c.Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncDebugEvalTargetResult + if err = p.c.Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs + _args.Req = req + var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 0a2629e36..23ebe1891 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -14,12 +14,14 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/base" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) var ( _ = base.KitexUnusedProtection _ = common.KitexUnusedProtection _ = eval_target.KitexUnusedProtection + _ = spi.KitexUnusedProtection ) // unused protection @@ -346,6 +348,20 @@ func (p *CreateEvalTargetParam) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 6: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -438,6 +454,18 @@ func (p *CreateEvalTargetParam) FastReadField5(buf []byte) (int, error) { return offset, nil } +func (p *CreateEvalTargetParam) FastReadField6(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + func (p *CreateEvalTargetParam) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -450,6 +478,7 @@ func (p *CreateEvalTargetParam) FastWriteNocopy(buf []byte, w thrift.NocopyWrite offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -463,6 +492,7 @@ func (p *CreateEvalTargetParam) BLength() int { l += p.field3Length() l += p.field4Length() l += p.field5Length() + l += p.field6Length() } l += thrift.Binary.FieldStopLength() return l @@ -513,6 +543,15 @@ func (p *CreateEvalTargetParam) fastWriteField5(buf []byte, w thrift.NocopyWrite return offset } +func (p *CreateEvalTargetParam) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 6) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + func (p *CreateEvalTargetParam) field1Length() int { l := 0 if p.IsSetSourceTargetID() { @@ -558,6 +597,15 @@ func (p *CreateEvalTargetParam) field5Length() int { return l } +func (p *CreateEvalTargetParam) field6Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + func (p *CreateEvalTargetParam) DeepCopy(s interface{}) error { src, ok := s.(*CreateEvalTargetParam) if !ok { @@ -598,6 +646,15 @@ func (p *CreateEvalTargetParam) DeepCopy(s interface{}) error { p.BotPublishVersion = &tmp } + var _customEvalTarget *eval_target.CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &eval_target.CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + return nil } @@ -6111,7 +6168,7 @@ func (p *ListSourceEvalTargetVersionsResponse) DeepCopy(s interface{}) error { return nil } -func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error) { +func (p *SearchCustomEvalTargetRequest) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6129,7 +6186,7 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -6142,6 +6199,104 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error goto SkipFieldError } } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6155,68 +6310,3340 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchCustomEvalTargetRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceCreateEvalTargetArgs) FastReadField1(buf []byte) (int, error) { +func (p *SearchCustomEvalTargetRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewCreateEvalTargetRequest() + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Keyword = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ApplicationID = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewCustomPSM() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.Request = _field + p.CustomPsm = _field return offset, nil } -func (p *EvalTargetServiceCreateEvalTargetArgs) FastWrite(buf []byte) int { +func (p *SearchCustomEvalTargetRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *eval_target.Region + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Region = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *int32 + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageSize = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageToken = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetRequest) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceCreateEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *SearchCustomEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset } -func (p *EvalTargetServiceCreateEvalTargetArgs) BLength() int { +func (p *SearchCustomEvalTargetRequest) BLength() int { l := 0 if p != nil { l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() } l += thrift.Binary.FieldStopLength() return l } -func (p *EvalTargetServiceCreateEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *SearchCustomEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Request.FastWriteNocopy(buf[offset:], w) + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } return offset } -func (p *EvalTargetServiceCreateEvalTargetArgs) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.Request.BLength() - return l -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) DeepCopy(s interface{}) error { +func (p *SearchCustomEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetKeyword() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Keyword) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetApplicationID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 3) + offset += thrift.Binary.WriteI64(buf[offset:], *p.ApplicationID) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomPsm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 4) + offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetRegion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Region) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageSize() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 100) + offset += thrift.Binary.WriteI32(buf[offset:], *p.PageSize) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 101) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.PageToken) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *SearchCustomEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetKeyword() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Keyword) + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field3Length() int { + l := 0 + if p.IsSetApplicationID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field4Length() int { + l := 0 + if p.IsSetCustomPsm() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomPsm.BLength() + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field5Length() int { + l := 0 + if p.IsSetRegion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Region) + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field100Length() int { + l := 0 + if p.IsSetPageSize() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field101Length() int { + l := 0 + if p.IsSetPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.PageToken) + } + return l +} + +func (p *SearchCustomEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *SearchCustomEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*SearchCustomEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.Keyword != nil { + var tmp string + if *src.Keyword != "" { + tmp = kutils.StringDeepCopy(*src.Keyword) + } + p.Keyword = &tmp + } + + if src.ApplicationID != nil { + tmp := *src.ApplicationID + p.ApplicationID = &tmp + } + + var _customPsm *eval_target.CustomPSM + if src.CustomPsm != nil { + _customPsm = &eval_target.CustomPSM{} + if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + return err + } + } + p.CustomPsm = _customPsm + + if src.Region != nil { + tmp := *src.Region + p.Region = &tmp + } + + if src.PageSize != nil { + tmp := *src.PageSize + p.PageSize = &tmp + } + + if src.PageToken != nil { + var tmp string + if *src.PageToken != "" { + tmp = kutils.StringDeepCopy(*src.PageToken) + } + p.PageToken = &tmp + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *SearchCustomEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchCustomEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SearchCustomEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*eval_target.CustomEvalTarget, 0, size) + values := make([]eval_target.CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.CustomEvalTargets = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetResponse) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.NextPageToken = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetResponse) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.HasMore = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *SearchCustomEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *SearchCustomEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SearchCustomEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SearchCustomEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 1) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.CustomEvalTargets { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + return offset +} + +func (p *SearchCustomEvalTargetResponse) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetNextPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.NextPageToken) + } + return offset +} + +func (p *SearchCustomEvalTargetResponse) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetHasMore() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 101) + offset += thrift.Binary.WriteBool(buf[offset:], *p.HasMore) + } + return offset +} + +func (p *SearchCustomEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *SearchCustomEvalTargetResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.CustomEvalTargets { + _ = v + l += v.BLength() + } + return l +} + +func (p *SearchCustomEvalTargetResponse) field100Length() int { + l := 0 + if p.IsSetNextPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.NextPageToken) + } + return l +} + +func (p *SearchCustomEvalTargetResponse) field101Length() int { + l := 0 + if p.IsSetHasMore() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *SearchCustomEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *SearchCustomEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*SearchCustomEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.CustomEvalTargets != nil { + p.CustomEvalTargets = make([]*eval_target.CustomEvalTarget, 0, len(src.CustomEvalTargets)) + for _, elem := range src.CustomEvalTargets { + var _elem *eval_target.CustomEvalTarget + if elem != nil { + _elem = &eval_target.CustomEvalTarget{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.CustomEvalTargets = append(p.CustomEvalTargets, _elem) + } + } + + if src.NextPageToken != nil { + var tmp string + if *src.NextPageToken != "" { + tmp = kutils.StringDeepCopy(*src.NextPageToken) + } + p.NextPageToken = &tmp + } + + if src.HasMore != nil { + tmp := *src.HasMore + p.HasMore = &tmp + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *DebugEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 50: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField50(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DebugEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *DebugEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *eval_target.EvalTargetType + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := eval_target.EvalTargetType(v) + _field = &tmp + } + p.EvalTargetType = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Param = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := common.NewRuntimeParam() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.TargetRuntimeParam = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewCustomPSM() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomPsm = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *DebugEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *DebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField50(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DebugEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field10Length() + l += p.field11Length() + l += p.field50Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DebugEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *DebugEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalTargetType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 2) + offset += thrift.Binary.WriteI32(buf[offset:], int32(*p.EvalTargetType)) + } + return offset +} + +func (p *DebugEvalTargetRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Param) + } + return offset +} + +func (p *DebugEvalTargetRequest) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTargetRuntimeParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.TargetRuntimeParam.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *DebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomPsm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 50) + offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *DebugEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *DebugEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *DebugEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetEvalTargetType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *DebugEvalTargetRequest) field10Length() int { + l := 0 + if p.IsSetParam() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Param) + } + return l +} + +func (p *DebugEvalTargetRequest) field11Length() int { + l := 0 + if p.IsSetTargetRuntimeParam() { + l += thrift.Binary.FieldBeginLength() + l += p.TargetRuntimeParam.BLength() + } + return l +} + +func (p *DebugEvalTargetRequest) field50Length() int { + l := 0 + if p.IsSetCustomPsm() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomPsm.BLength() + } + return l +} + +func (p *DebugEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *DebugEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*DebugEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.EvalTargetType != nil { + tmp := *src.EvalTargetType + p.EvalTargetType = &tmp + } + + if src.Param != nil { + var tmp string + if *src.Param != "" { + tmp = kutils.StringDeepCopy(*src.Param) + } + p.Param = &tmp + } + + var _targetRuntimeParam *common.RuntimeParam + if src.TargetRuntimeParam != nil { + _targetRuntimeParam = &common.RuntimeParam{} + if err := _targetRuntimeParam.DeepCopy(src.TargetRuntimeParam); err != nil { + return err + } + } + p.TargetRuntimeParam = _targetRuntimeParam + + var _customPsm *eval_target.CustomPSM + if src.CustomPsm != nil { + _customPsm = &eval_target.CustomPSM{} + if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + return err + } + } + p.CustomPsm = _customPsm + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *DebugEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DebugEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *DebugEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewEvalTargetRecord() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.EvalTargetRecord = _field + return offset, nil +} + +func (p *DebugEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *DebugEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *DebugEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DebugEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DebugEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalTargetRecord() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.EvalTargetRecord.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *DebugEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *DebugEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetEvalTargetRecord() { + l += thrift.Binary.FieldBeginLength() + l += p.EvalTargetRecord.BLength() + } + return l +} + +func (p *DebugEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *DebugEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*DebugEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _evalTargetRecord *eval_target.EvalTargetRecord + if src.EvalTargetRecord != nil { + _evalTargetRecord = &eval_target.EvalTargetRecord{} + if err := _evalTargetRecord.DeepCopy(src.EvalTargetRecord); err != nil { + return err + } + } + p.EvalTargetRecord = _evalTargetRecord + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 50: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField50(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 51: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField51(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncDebugEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *eval_target.EvalTargetType + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := eval_target.EvalTargetType(v) + _field = &tmp + } + p.EvalTargetType = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + _field := common.NewRuntimeParam() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.TargetRuntimeParam = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewCustomPSM() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomPsm = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField51(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.CustomPsmSpiParam = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncDebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField50(buf[offset:], w) + offset += p.fastWriteField51(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncDebugEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field10Length() + l += p.field50Length() + l += p.field51Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalTargetType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 2) + offset += thrift.Binary.WriteI32(buf[offset:], int32(*p.EvalTargetType)) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTargetRuntimeParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) + offset += p.TargetRuntimeParam.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomPsm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 50) + offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField51(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomPsmSpiParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 51) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.CustomPsmSpiParam) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncDebugEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetEvalTargetType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) field10Length() int { + l := 0 + if p.IsSetTargetRuntimeParam() { + l += thrift.Binary.FieldBeginLength() + l += p.TargetRuntimeParam.BLength() + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) field50Length() int { + l := 0 + if p.IsSetCustomPsm() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomPsm.BLength() + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) field51Length() int { + l := 0 + if p.IsSetCustomPsmSpiParam() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.CustomPsmSpiParam) + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncDebugEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.EvalTargetType != nil { + tmp := *src.EvalTargetType + p.EvalTargetType = &tmp + } + + var _targetRuntimeParam *common.RuntimeParam + if src.TargetRuntimeParam != nil { + _targetRuntimeParam = &common.RuntimeParam{} + if err := _targetRuntimeParam.DeepCopy(src.TargetRuntimeParam); err != nil { + return err + } + } + p.TargetRuntimeParam = _targetRuntimeParam + + var _customPsm *eval_target.CustomPSM + if src.CustomPsm != nil { + _customPsm = &eval_target.CustomPSM{} + if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + return err + } + } + p.CustomPsm = _customPsm + + if src.CustomPsmSpiParam != nil { + var tmp string + if *src.CustomPsmSpiParam != "" { + tmp = kutils.StringDeepCopy(*src.CustomPsmSpiParam) + } + p.CustomPsmSpiParam = &tmp + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *AsyncDebugEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetInvokeID bool = false + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetInvokeID = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetInvokeID { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncDebugEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_AsyncDebugEvalTargetResponse[fieldId])) +} + +func (p *AsyncDebugEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.InvokeID = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *AsyncDebugEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncDebugEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncDebugEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncDebugEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], p.InvokeID) + return offset +} + +func (p *AsyncDebugEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *AsyncDebugEvalTargetResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + return l +} + +func (p *AsyncDebugEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *AsyncDebugEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncDebugEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + p.InvokeID = src.InvokeID + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InvokeID = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Token = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + _field := spi.NewInvokeEvalTargetOutput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Output = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := spi.NewInvokeEvalTargetUsage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Usage = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *PassbackEvalTargetInvokeResultRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field10Length() + l += p.field11Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) + offset += p.Output.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUsage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.Usage.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *PassbackEvalTargetInvokeResultRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) field2Length() int { + l := 0 + if p.IsSetInvokeID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) field3Length() int { + l := 0 + if p.IsSetToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Token) + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) field10Length() int { + l := 0 + if p.IsSetOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.Output.BLength() + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) field11Length() int { + l := 0 + if p.IsSetUsage() { + l += thrift.Binary.FieldBeginLength() + l += p.Usage.BLength() + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *PassbackEvalTargetInvokeResultRequest) DeepCopy(s interface{}) error { + src, ok := s.(*PassbackEvalTargetInvokeResultRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.InvokeID != nil { + tmp := *src.InvokeID + p.InvokeID = &tmp + } + + if src.Token != nil { + var tmp string + if *src.Token != "" { + tmp = kutils.StringDeepCopy(*src.Token) + } + p.Token = &tmp + } + + var _output *spi.InvokeEvalTargetOutput + if src.Output != nil { + _output = &spi.InvokeEvalTargetOutput{} + if err := _output.DeepCopy(src.Output); err != nil { + return err + } + } + p.Output = _output + + var _usage *spi.InvokeEvalTargetUsage + if src.Usage != nil { + _usage = &spi.InvokeEvalTargetUsage{} + if err := _usage.DeepCopy(src.Usage); err != nil { + return err + } + } + p.Usage = _usage + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *PassbackEvalTargetInvokeResultResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *PassbackEvalTargetInvokeResultResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *PassbackEvalTargetInvokeResultResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *PassbackEvalTargetInvokeResultResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PassbackEvalTargetInvokeResultResponse) BLength() int { + l := 0 + if p != nil { + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PassbackEvalTargetInvokeResultResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *PassbackEvalTargetInvokeResultResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *PassbackEvalTargetInvokeResultResponse) DeepCopy(s interface{}) error { + src, ok := s.(*PassbackEvalTargetInvokeResultResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewCreateEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceCreateEvalTargetArgs) DeepCopy(s interface{}) error { src, ok := s.(*EvalTargetServiceCreateEvalTargetArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *CreateEvalTargetRequest + var _request *CreateEvalTargetRequest + if src.Request != nil { + _request = &CreateEvalTargetRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *EvalTargetServiceCreateEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceCreateEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewCreateEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvalTargetServiceCreateEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceCreateEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceCreateEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceCreateEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvalTargetServiceCreateEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvalTargetServiceCreateEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceCreateEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *CreateEvalTargetResponse + if src.Success != nil { + _success = &CreateEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetEvalTargetsBySourceRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetsBySourceArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *BatchGetEvalTargetsBySourceRequest + if src.Request != nil { + _request = &BatchGetEvalTargetsBySourceRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetEvalTargetsBySourceResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetsBySourceResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *BatchGetEvalTargetsBySourceResponse + if src.Success != nil { + _success = &BatchGetEvalTargetsBySourceResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetEvalTargetVersionRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceGetEvalTargetVersionArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *GetEvalTargetVersionRequest + if src.Request != nil { + _request = &GetEvalTargetVersionRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetEvalTargetVersionResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceGetEvalTargetVersionResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *GetEvalTargetVersionResponse + if src.Success != nil { + _success = &GetEvalTargetVersionResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetEvalTargetVersionsRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetVersionsArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *BatchGetEvalTargetVersionsRequest + if src.Request != nil { + _request = &BatchGetEvalTargetVersionsRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewBatchGetEvalTargetVersionsResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetVersionsResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *BatchGetEvalTargetVersionsResponse + if src.Success != nil { + _success = &BatchGetEvalTargetVersionsResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewListSourceEvalTargetsRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceListSourceEvalTargetsArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *ListSourceEvalTargetsRequest if src.Request != nil { - _request = &CreateEvalTargetRequest{} + _request = &ListSourceEvalTargetsRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -6226,7 +9653,7 @@ func (p *EvalTargetServiceCreateEvalTargetArgs) DeepCopy(s interface{}) error { return nil } -func (p *EvalTargetServiceCreateEvalTargetResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6270,14 +9697,14 @@ func (p *EvalTargetServiceCreateEvalTargetResult) FastRead(buf []byte) (int, err ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceCreateEvalTargetResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewCreateEvalTargetResponse() + _field := NewListSourceEvalTargetsResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6287,11 +9714,11 @@ func (p *EvalTargetServiceCreateEvalTargetResult) FastReadField0(buf []byte) (in return offset, nil } -func (p *EvalTargetServiceCreateEvalTargetResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceListSourceEvalTargetsResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceCreateEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -6300,7 +9727,7 @@ func (p *EvalTargetServiceCreateEvalTargetResult) FastWriteNocopy(buf []byte, w return offset } -func (p *EvalTargetServiceCreateEvalTargetResult) BLength() int { +func (p *EvalTargetServiceListSourceEvalTargetsResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -6309,7 +9736,7 @@ func (p *EvalTargetServiceCreateEvalTargetResult) BLength() int { return l } -func (p *EvalTargetServiceCreateEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -6318,7 +9745,7 @@ func (p *EvalTargetServiceCreateEvalTargetResult) fastWriteField0(buf []byte, w return offset } -func (p *EvalTargetServiceCreateEvalTargetResult) field0Length() int { +func (p *EvalTargetServiceListSourceEvalTargetsResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -6327,15 +9754,15 @@ func (p *EvalTargetServiceCreateEvalTargetResult) field0Length() int { return l } -func (p *EvalTargetServiceCreateEvalTargetResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceCreateEvalTargetResult) +func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceListSourceEvalTargetsResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *CreateEvalTargetResponse + var _success *ListSourceEvalTargetsResponse if src.Success != nil { - _success = &CreateEvalTargetResponse{} + _success = &ListSourceEvalTargetsResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -6345,7 +9772,7 @@ func (p *EvalTargetServiceCreateEvalTargetResult) DeepCopy(s interface{}) error return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6389,14 +9816,14 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastRead(buf []byte) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetsBySourceRequest() + _field := NewListSourceEvalTargetVersionsRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6406,11 +9833,11 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastReadField1(buf [] return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -6419,7 +9846,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) FastWriteNocopy(buf [ return offset } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) BLength() int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -6428,29 +9855,29 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) field1Length() int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetsBySourceArgs) +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceListSourceEvalTargetVersionsArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *BatchGetEvalTargetsBySourceRequest + var _request *ListSourceEvalTargetVersionsRequest if src.Request != nil { - _request = &BatchGetEvalTargetsBySourceRequest{} + _request = &ListSourceEvalTargetVersionsRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -6460,7 +9887,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepCopy(s interface{ return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6504,14 +9931,14 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastRead(buf []byte ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetsBySourceResponse() + _field := NewListSourceEvalTargetVersionsResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6521,11 +9948,11 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastReadField0(buf return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -6534,7 +9961,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) FastWriteNocopy(buf return offset } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) BLength() int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -6543,7 +9970,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -6552,7 +9979,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) fastWriteField0(buf return offset } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) field0Length() int { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -6561,15 +9988,15 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) field0Length() int return l } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetsBySourceResult) +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceListSourceEvalTargetVersionsResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *BatchGetEvalTargetsBySourceResponse + var _success *ListSourceEvalTargetVersionsResponse if src.Success != nil { - _success = &BatchGetEvalTargetsBySourceResponse{} + _success = &ListSourceEvalTargetVersionsResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -6579,7 +10006,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepCopy(s interfac return nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6623,14 +10050,14 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastRead(buf []byte) (int, e ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewGetEvalTargetVersionRequest() + _field := NewBatchGetSourceEvalTargetsRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6640,11 +10067,11 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastReadField1(buf []byte) ( return offset, nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -6653,7 +10080,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) FastWriteNocopy(buf []byte, return offset } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) BLength() int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -6662,29 +10089,29 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) BLength() int { return l } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) field1Length() int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceGetEvalTargetVersionArgs) +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetSourceEvalTargetsArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *GetEvalTargetVersionRequest + var _request *BatchGetSourceEvalTargetsRequest if src.Request != nil { - _request = &GetEvalTargetVersionRequest{} + _request = &BatchGetSourceEvalTargetsRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -6694,7 +10121,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepCopy(s interface{}) erro return nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6738,14 +10165,14 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) FastRead(buf []byte) (int, ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewGetEvalTargetVersionResponse() + _field := NewBatchGetSourceEvalTargetsResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6755,11 +10182,11 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) FastReadField0(buf []byte) return offset, nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -6768,7 +10195,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) FastWriteNocopy(buf []byte return offset } -func (p *EvalTargetServiceGetEvalTargetVersionResult) BLength() int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -6777,7 +10204,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) BLength() int { return l } -func (p *EvalTargetServiceGetEvalTargetVersionResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -6786,7 +10213,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) fastWriteField0(buf []byte return offset } -func (p *EvalTargetServiceGetEvalTargetVersionResult) field0Length() int { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -6795,15 +10222,15 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) field0Length() int { return l } -func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceGetEvalTargetVersionResult) +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetSourceEvalTargetsResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *GetEvalTargetVersionResponse + var _success *BatchGetSourceEvalTargetsResponse if src.Success != nil { - _success = &GetEvalTargetVersionResponse{} + _success = &BatchGetSourceEvalTargetsResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -6813,7 +10240,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepCopy(s interface{}) er return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6857,28 +10284,28 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastRead(buf []byte) ( ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetVersionsRequest() + _field := NewSearchCustomEvalTargetRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.Request = _field + p.Req = _field return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -6887,7 +10314,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) FastWriteNocopy(buf [] return offset } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) BLength() int { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -6896,39 +10323,39 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Request.FastWriteNocopy(buf[offset:], w) + offset += p.Req.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) field1Length() int { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() - l += p.Request.BLength() + l += p.Req.BLength() return l } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetVersionsArgs) +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceSearchCustomEvalTargetArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *BatchGetEvalTargetVersionsRequest - if src.Request != nil { - _request = &BatchGetEvalTargetVersionsRequest{} - if err := _request.DeepCopy(src.Request); err != nil { + var _req *SearchCustomEvalTargetRequest + if src.Req != nil { + _req = &SearchCustomEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { return err } } - p.Request = _request + p.Req = _req return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -6972,14 +10399,14 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastRead(buf []byte) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetVersionsResponse() + _field := NewSearchCustomEvalTargetResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -6989,11 +10416,11 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastReadField0(buf [ return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -7002,7 +10429,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) FastWriteNocopy(buf return offset } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) BLength() int { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -7011,7 +10438,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -7020,7 +10447,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) fastWriteField0(buf return offset } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) field0Length() int { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -7029,15 +10456,15 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) field0Length() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetVersionsResult) +func (p *EvalTargetServiceSearchCustomEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceSearchCustomEvalTargetResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *BatchGetEvalTargetVersionsResponse + var _success *SearchCustomEvalTargetResponse if src.Success != nil { - _success = &BatchGetEvalTargetVersionsResponse{} + _success = &SearchCustomEvalTargetResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -7047,7 +10474,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepCopy(s interface return nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7091,14 +10518,14 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastRead(buf []byte) (int, ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewListSourceEvalTargetsRequest() + _field := NewExecuteEvalTargetRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7108,11 +10535,11 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastReadField1(buf []byte) return offset, nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceExecuteEvalTargetArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceExecuteEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -7121,7 +10548,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) FastWriteNocopy(buf []byte, return offset } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) BLength() int { +func (p *EvalTargetServiceExecuteEvalTargetArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -7130,29 +10557,29 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) BLength() int { return l } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceExecuteEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) field1Length() int { +func (p *EvalTargetServiceExecuteEvalTargetArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceListSourceEvalTargetsArgs) +func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceExecuteEvalTargetArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *ListSourceEvalTargetsRequest + var _request *ExecuteEvalTargetRequest if src.Request != nil { - _request = &ListSourceEvalTargetsRequest{} + _request = &ExecuteEvalTargetRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -7162,7 +10589,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepCopy(s interface{}) err return nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7206,14 +10633,14 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) FastRead(buf []byte) (int ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewListSourceEvalTargetsResponse() + _field := NewExecuteEvalTargetResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7223,11 +10650,11 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) FastReadField0(buf []byte return offset, nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceExecuteEvalTargetResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceExecuteEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -7236,7 +10663,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) FastWriteNocopy(buf []byt return offset } -func (p *EvalTargetServiceListSourceEvalTargetsResult) BLength() int { +func (p *EvalTargetServiceExecuteEvalTargetResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -7245,7 +10672,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) BLength() int { return l } -func (p *EvalTargetServiceListSourceEvalTargetsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceExecuteEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -7254,7 +10681,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) fastWriteField0(buf []byt return offset } -func (p *EvalTargetServiceListSourceEvalTargetsResult) field0Length() int { +func (p *EvalTargetServiceExecuteEvalTargetResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -7263,15 +10690,15 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) field0Length() int { return l } -func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceListSourceEvalTargetsResult) +func (p *EvalTargetServiceExecuteEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceExecuteEvalTargetResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *ListSourceEvalTargetsResponse + var _success *ExecuteEvalTargetResponse if src.Success != nil { - _success = &ListSourceEvalTargetsResponse{} + _success = &ExecuteEvalTargetResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -7281,7 +10708,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepCopy(s interface{}) e return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7325,14 +10752,14 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastRead(buf []byte) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewListSourceEvalTargetVersionsRequest() + _field := NewGetEvalTargetRecordRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7342,11 +10769,11 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastReadField1(buf [ return offset, nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -7355,7 +10782,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) FastWriteNocopy(buf return offset } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) BLength() int { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -7364,29 +10791,29 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) BLength() int { return l } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) field1Length() int { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceListSourceEvalTargetVersionsArgs) +func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceGetEvalTargetRecordArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *ListSourceEvalTargetVersionsRequest + var _request *GetEvalTargetRecordRequest if src.Request != nil { - _request = &ListSourceEvalTargetVersionsRequest{} + _request = &GetEvalTargetRecordRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -7396,7 +10823,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepCopy(s interface return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7440,14 +10867,14 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastRead(buf []byt ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewListSourceEvalTargetVersionsResponse() + _field := NewGetEvalTargetRecordResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7457,11 +10884,11 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastReadField0(buf return offset, nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceGetEvalTargetRecordResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceGetEvalTargetRecordResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -7470,7 +10897,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) FastWriteNocopy(bu return offset } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) BLength() int { +func (p *EvalTargetServiceGetEvalTargetRecordResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -7479,7 +10906,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) BLength() int { return l } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceGetEvalTargetRecordResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -7488,7 +10915,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) fastWriteField0(bu return offset } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) field0Length() int { +func (p *EvalTargetServiceGetEvalTargetRecordResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -7497,15 +10924,15 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) field0Length() int return l } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceListSourceEvalTargetVersionsResult) +func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceGetEvalTargetRecordResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *ListSourceEvalTargetVersionsResponse + var _success *GetEvalTargetRecordResponse if src.Success != nil { - _success = &ListSourceEvalTargetVersionsResponse{} + _success = &GetEvalTargetRecordResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -7515,7 +10942,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepCopy(s interfa return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7559,14 +10986,14 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastRead(buf []byte) (i ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetSourceEvalTargetsRequest() + _field := NewBatchGetEvalTargetRecordsRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7576,11 +11003,11 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastReadField1(buf []by return offset, nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -7589,7 +11016,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) FastWriteNocopy(buf []b return offset } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) BLength() int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -7598,29 +11025,29 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) BLength() int { return l } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) field1Length() int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetSourceEvalTargetsArgs) +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetRecordsArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *BatchGetSourceEvalTargetsRequest + var _request *BatchGetEvalTargetRecordsRequest if src.Request != nil { - _request = &BatchGetSourceEvalTargetsRequest{} + _request = &BatchGetEvalTargetRecordsRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -7630,7 +11057,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepCopy(s interface{}) return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7674,14 +11101,14 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastRead(buf []byte) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetSourceEvalTargetsResponse() + _field := NewBatchGetEvalTargetRecordsResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7691,11 +11118,11 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastReadField0(buf [] return offset, nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -7704,7 +11131,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) FastWriteNocopy(buf [ return offset } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) BLength() int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -7713,7 +11140,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) BLength() int { return l } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -7722,7 +11149,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) fastWriteField0(buf [ return offset } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) field0Length() int { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -7731,15 +11158,15 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) field0Length() int { return l } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetSourceEvalTargetsResult) +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceBatchGetEvalTargetRecordsResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *BatchGetSourceEvalTargetsResponse + var _success *BatchGetEvalTargetRecordsResponse if src.Success != nil { - _success = &BatchGetSourceEvalTargetsResponse{} + _success = &BatchGetEvalTargetRecordsResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -7749,7 +11176,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepCopy(s interface{ return nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7793,14 +11220,14 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) FastRead(buf []byte) (int, erro ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewExecuteEvalTargetRequest() + _field := NewDebugEvalTargetRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7810,11 +11237,11 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) FastReadField1(buf []byte) (int return offset, nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceDebugEvalTargetArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceDebugEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -7823,7 +11250,7 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) FastWriteNocopy(buf []byte, w t return offset } -func (p *EvalTargetServiceExecuteEvalTargetArgs) BLength() int { +func (p *EvalTargetServiceDebugEvalTargetArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -7832,29 +11259,29 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) BLength() int { return l } -func (p *EvalTargetServiceExecuteEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceDebugEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceExecuteEvalTargetArgs) field1Length() int { +func (p *EvalTargetServiceDebugEvalTargetArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceExecuteEvalTargetArgs) +func (p *EvalTargetServiceDebugEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceDebugEvalTargetArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *ExecuteEvalTargetRequest + var _request *DebugEvalTargetRequest if src.Request != nil { - _request = &ExecuteEvalTargetRequest{} + _request = &DebugEvalTargetRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -7864,7 +11291,7 @@ func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepCopy(s interface{}) error { return nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceDebugEvalTargetResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -7908,14 +11335,14 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) FastRead(buf []byte) (int, er ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceDebugEvalTargetResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewExecuteEvalTargetResponse() + _field := NewDebugEvalTargetResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -7925,11 +11352,11 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) FastReadField0(buf []byte) (i return offset, nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceDebugEvalTargetResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceExecuteEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceDebugEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -7938,7 +11365,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) FastWriteNocopy(buf []byte, w return offset } -func (p *EvalTargetServiceExecuteEvalTargetResult) BLength() int { +func (p *EvalTargetServiceDebugEvalTargetResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -7947,7 +11374,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) BLength() int { return l } -func (p *EvalTargetServiceExecuteEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceDebugEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -7956,7 +11383,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) fastWriteField0(buf []byte, w return offset } -func (p *EvalTargetServiceExecuteEvalTargetResult) field0Length() int { +func (p *EvalTargetServiceDebugEvalTargetResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -7965,15 +11392,15 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) field0Length() int { return l } -func (p *EvalTargetServiceExecuteEvalTargetResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceExecuteEvalTargetResult) +func (p *EvalTargetServiceDebugEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceDebugEvalTargetResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *ExecuteEvalTargetResponse + var _success *DebugEvalTargetResponse if src.Success != nil { - _success = &ExecuteEvalTargetResponse{} + _success = &DebugEvalTargetResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -7983,7 +11410,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) DeepCopy(s interface{}) error return nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -8027,14 +11454,14 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastRead(buf []byte) (int, er ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewGetEvalTargetRecordRequest() + _field := NewAsyncDebugEvalTargetRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -8044,11 +11471,11 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastReadField1(buf []byte) (i return offset, nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -8057,7 +11484,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastWriteNocopy(buf []byte, w return offset } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) BLength() int { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -8066,29 +11493,29 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) BLength() int { return l } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) field1Length() int { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Request.BLength() return l } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceGetEvalTargetRecordArgs) +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceAsyncDebugEvalTargetArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *GetEvalTargetRecordRequest + var _request *AsyncDebugEvalTargetRequest if src.Request != nil { - _request = &GetEvalTargetRecordRequest{} + _request = &AsyncDebugEvalTargetRequest{} if err := _request.DeepCopy(src.Request); err != nil { return err } @@ -8098,7 +11525,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepCopy(s interface{}) error return nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -8142,14 +11569,14 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) FastRead(buf []byte) (int, ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewGetEvalTargetRecordResponse() + _field := NewAsyncDebugEvalTargetResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -8159,11 +11586,11 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) FastReadField0(buf []byte) return offset, nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) FastWrite(buf []byte) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -8172,7 +11599,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) FastWriteNocopy(buf []byte, return offset } -func (p *EvalTargetServiceGetEvalTargetRecordResult) BLength() int { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -8181,7 +11608,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) BLength() int { return l } -func (p *EvalTargetServiceGetEvalTargetRecordResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -8190,7 +11617,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) fastWriteField0(buf []byte, return offset } -func (p *EvalTargetServiceGetEvalTargetRecordResult) field0Length() int { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -8199,15 +11626,15 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) field0Length() int { return l } -func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceGetEvalTargetRecordResult) +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceAsyncDebugEvalTargetResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *GetEvalTargetRecordResponse + var _success *AsyncDebugEvalTargetResponse if src.Success != nil { - _success = &GetEvalTargetRecordResponse{} + _success = &AsyncDebugEvalTargetResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -8217,7 +11644,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepCopy(s interface{}) err return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -8261,28 +11688,28 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastRead(buf []byte) (i ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastReadField1(buf []byte) (int, error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetRecordsRequest() + _field := NewPassbackEvalTargetInvokeResultRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.Request = _field + p.Req = _field return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastWrite(buf []byte) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -8291,7 +11718,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) FastWriteNocopy(buf []b return offset } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) BLength() int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -8300,39 +11727,39 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Request.FastWriteNocopy(buf[offset:], w) + offset += p.Req.FastWriteNocopy(buf[offset:], w) return offset } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) field1Length() int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() - l += p.Request.BLength() + l += p.Req.BLength() return l } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetRecordsArgs) +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServicePassbackEvalTargetInvokeResultArgs) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _request *BatchGetEvalTargetRecordsRequest - if src.Request != nil { - _request = &BatchGetEvalTargetRecordsRequest{} - if err := _request.DeepCopy(src.Request); err != nil { + var _req *PassbackEvalTargetInvokeResultRequest + if src.Req != nil { + _req = &PassbackEvalTargetInvokeResultRequest{} + if err := _req.DeepCopy(src.Req); err != nil { return err } } - p.Request = _request + p.Req = _req return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastRead(buf []byte) (int, error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastRead(buf []byte) (int, error) { var err error var offset int @@ -8376,14 +11803,14 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastRead(buf []byte) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastReadField0(buf []byte) (int, error) { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewBatchGetEvalTargetRecordsResponse() + _field := NewPassbackEvalTargetInvokeResultResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -8393,11 +11820,11 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastReadField0(buf [] return offset, nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastWrite(buf []byte) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -8406,7 +11833,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) FastWriteNocopy(buf [ return offset } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) BLength() int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -8415,7 +11842,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) BLength() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -8424,7 +11851,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) fastWriteField0(buf [ return offset } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) field0Length() int { +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -8433,15 +11860,15 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) field0Length() int { return l } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServiceBatchGetEvalTargetRecordsResult) +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServicePassbackEvalTargetInvokeResultResult) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - var _success *BatchGetEvalTargetRecordsResponse + var _success *PassbackEvalTargetInvokeResultResponse if src.Success != nil { - _success = &BatchGetEvalTargetRecordsResponse{} + _success = &PassbackEvalTargetInvokeResultResponse{} if err := _success.DeepCopy(src.Success); err != nil { return err } @@ -8507,6 +11934,14 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) GetResult() interface return p.Success } +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvalTargetServiceSearchCustomEvalTargetResult) GetResult() interface{} { + return p.Success +} + func (p *EvalTargetServiceExecuteEvalTargetArgs) GetFirstArgument() interface{} { return p.Request } @@ -8530,3 +11965,27 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) GetFirstArgument() inte func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) GetResult() interface{} { return p.Success } + +func (p *EvalTargetServiceDebugEvalTargetArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *EvalTargetServiceDebugEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) GetResult() interface{} { + return p.Success +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go index b8db17c0c..44ac06dc5 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go @@ -18,9 +18,13 @@ type Client interface { ListSourceEvalTargets(ctx context.Context, request *eval_target.ListSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetsResponse, err error) ListSourceEvalTargetVersions(ctx context.Context, request *eval_target.ListSourceEvalTargetVersionsRequest, callOptions ...callopt.Option) (r *eval_target.ListSourceEvalTargetVersionsResponse, err error) BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) + SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) + DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) + AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) + PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -87,6 +91,11 @@ func (p *kEvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context return p.kClient.BatchGetSourceEvalTargets(ctx, request) } +func (p *kEvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchCustomEvalTarget(ctx, req) +} + func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.ExecuteEvalTarget(ctx, request) @@ -101,3 +110,18 @@ func (p *kEvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.BatchGetEvalTargetRecords(ctx, request) } + +func (p *kEvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncDebugEvalTarget(ctx, request) +} + +func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go index b39c03d22..f97d8c6b5 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go @@ -63,6 +63,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "SearchCustomEvalTarget": kitex.NewMethodInfo( + searchCustomEvalTargetHandler, + newEvalTargetServiceSearchCustomEvalTargetArgs, + newEvalTargetServiceSearchCustomEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "ExecuteEvalTarget": kitex.NewMethodInfo( executeEvalTargetHandler, newEvalTargetServiceExecuteEvalTargetArgs, @@ -84,6 +91,27 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "DebugEvalTarget": kitex.NewMethodInfo( + debugEvalTargetHandler, + newEvalTargetServiceDebugEvalTargetArgs, + newEvalTargetServiceDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncDebugEvalTarget": kitex.NewMethodInfo( + asyncDebugEvalTargetHandler, + newEvalTargetServiceAsyncDebugEvalTargetArgs, + newEvalTargetServiceAsyncDebugEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( + passbackEvalTargetInvokeResult_Handler, + newEvalTargetServicePassbackEvalTargetInvokeResultArgs, + newEvalTargetServicePassbackEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -250,6 +278,25 @@ func newEvalTargetServiceBatchGetSourceEvalTargetsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetSourceEvalTargetsResult() } +func searchCustomEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceSearchCustomEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceSearchCustomEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).SearchCustomEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceSearchCustomEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetArgs() +} + +func newEvalTargetServiceSearchCustomEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceSearchCustomEvalTargetResult() +} + func executeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceExecuteEvalTargetArgs) realResult := result.(*eval_target.EvalTargetServiceExecuteEvalTargetResult) @@ -307,6 +354,63 @@ func newEvalTargetServiceBatchGetEvalTargetRecordsResult() interface{} { return eval_target.NewEvalTargetServiceBatchGetEvalTargetRecordsResult() } +func debugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).DebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetArgs() +} + +func newEvalTargetServiceDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceDebugEvalTargetResult() +} + +func asyncDebugEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncDebugEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncDebugEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetArgs() +} + +func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() +} + +func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) + realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) + success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() +} + +func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { + return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() +} + type kClient struct { c client.Client sc client.Streaming @@ -389,6 +493,16 @@ func (p *kClient) BatchGetSourceEvalTargets(ctx context.Context, request *eval_t return _result.GetSuccess(), nil } +func (p *kClient) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceSearchCustomEvalTargetArgs + _args.Req = req + var _result eval_target.EvalTargetServiceSearchCustomEvalTargetResult + if err = p.c.Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest) (r *eval_target.ExecuteEvalTargetResponse, err error) { var _args eval_target.EvalTargetServiceExecuteEvalTargetArgs _args.Request = request @@ -418,3 +532,33 @@ func (p *kClient) BatchGetEvalTargetRecords(ctx context.Context, request *eval_t } return _result.GetSuccess(), nil } + +func (p *kClient) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceDebugEvalTargetResult + if err = p.c.Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncDebugEvalTargetResult + if err = p.c.Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs + _args.Req = req + var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/observability/domain/trace/k-trace.go b/backend/kitex_gen/coze/loop/observability/domain/trace/k-trace.go index 4f0812316..9fcc649d2 100644 --- a/backend/kitex_gen/coze/loop/observability/domain/trace/k-trace.go +++ b/backend/kitex_gen/coze/loop/observability/domain/trace/k-trace.go @@ -203,8 +203,8 @@ func (p *TokenCost) FastRead(buf []byte) (int, error) { var l int var fieldTypeId thrift.TType var fieldId int16 - var issetInput bool = false - var issetOutput bool = false + var issetInputToken bool = false + var issetOutputToken bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -222,7 +222,7 @@ func (p *TokenCost) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetInput = true + issetInputToken = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -237,7 +237,7 @@ func (p *TokenCost) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetOutput = true + issetOutputToken = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -254,12 +254,12 @@ func (p *TokenCost) FastRead(buf []byte) (int, error) { } } - if !issetInput { + if !issetInputToken { fieldId = 1 goto RequiredFieldNotSetError } - if !issetOutput { + if !issetOutputToken { fieldId = 2 goto RequiredFieldNotSetError } @@ -284,7 +284,7 @@ func (p *TokenCost) FastReadField1(buf []byte) (int, error) { offset += l _field = v } - p.Input = _field + p.InputToken = _field return offset, nil } @@ -298,7 +298,7 @@ func (p *TokenCost) FastReadField2(buf []byte) (int, error) { offset += l _field = v } - p.Output = _field + p.OutputToken = _field return offset, nil } @@ -329,14 +329,14 @@ func (p *TokenCost) BLength() int { func (p *TokenCost) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], p.Input) + offset += thrift.Binary.WriteI64(buf[offset:], p.InputToken) return offset } func (p *TokenCost) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) - offset += thrift.Binary.WriteI64(buf[offset:], p.Output) + offset += thrift.Binary.WriteI64(buf[offset:], p.OutputToken) return offset } @@ -360,9 +360,9 @@ func (p *TokenCost) DeepCopy(s interface{}) error { return fmt.Errorf("%T's type not matched %T", s, p) } - p.Input = src.Input + p.InputToken = src.InputToken - p.Output = src.Output + p.OutputToken = src.OutputToken return nil } diff --git a/backend/kitex_gen/coze/loop/observability/domain/trace/trace.go b/backend/kitex_gen/coze/loop/observability/domain/trace/trace.go index c9fc5c24a..89b63dc07 100644 --- a/backend/kitex_gen/coze/loop/observability/domain/trace/trace.go +++ b/backend/kitex_gen/coze/loop/observability/domain/trace/trace.go @@ -259,8 +259,8 @@ func (p *Trace) Field2DeepEqual(src *TokenCost) bool { } type TokenCost struct { - Input int64 `thrift:"input,1,required" frugal:"1,required,i64" json:"input" form:"input,required" query:"input,required"` - Output int64 `thrift:"output,2,required" frugal:"2,required,i64" json:"output" form:"output,required" query:"output,required"` + InputToken int64 `thrift:"input_token,1,required" frugal:"1,required,i64" json:"input_token" form:"input_token,required" query:"input_token,required"` + OutputToken int64 `thrift:"output_token,2,required" frugal:"2,required,i64" json:"output_token" form:"output_token,required" query:"output_token,required"` } func NewTokenCost() *TokenCost { @@ -270,36 +270,36 @@ func NewTokenCost() *TokenCost { func (p *TokenCost) InitDefault() { } -func (p *TokenCost) GetInput() (v int64) { +func (p *TokenCost) GetInputToken() (v int64) { if p != nil { - return p.Input + return p.InputToken } return } -func (p *TokenCost) GetOutput() (v int64) { +func (p *TokenCost) GetOutputToken() (v int64) { if p != nil { - return p.Output + return p.OutputToken } return } -func (p *TokenCost) SetInput(val int64) { - p.Input = val +func (p *TokenCost) SetInputToken(val int64) { + p.InputToken = val } -func (p *TokenCost) SetOutput(val int64) { - p.Output = val +func (p *TokenCost) SetOutputToken(val int64) { + p.OutputToken = val } var fieldIDToName_TokenCost = map[int16]string{ - 1: "input", - 2: "output", + 1: "input_token", + 2: "output_token", } func (p *TokenCost) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetInput bool = false - var issetOutput bool = false + var issetInputToken bool = false + var issetOutputToken bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -320,7 +320,7 @@ func (p *TokenCost) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetInput = true + issetInputToken = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -329,7 +329,7 @@ func (p *TokenCost) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetOutput = true + issetOutputToken = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -346,12 +346,12 @@ func (p *TokenCost) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetInput { + if !issetInputToken { fieldId = 1 goto RequiredFieldNotSetError } - if !issetOutput { + if !issetOutputToken { fieldId = 2 goto RequiredFieldNotSetError } @@ -381,7 +381,7 @@ func (p *TokenCost) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Input = _field + p.InputToken = _field return nil } func (p *TokenCost) ReadField2(iprot thrift.TProtocol) error { @@ -392,7 +392,7 @@ func (p *TokenCost) ReadField2(iprot thrift.TProtocol) error { } else { _field = v } - p.Output = _field + p.OutputToken = _field return nil } @@ -429,10 +429,10 @@ WriteStructEndError: } func (p *TokenCost) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("input", thrift.I64, 1); err != nil { + if err = oprot.WriteFieldBegin("input_token", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.Input); err != nil { + if err := oprot.WriteI64(p.InputToken); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -445,10 +445,10 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } func (p *TokenCost) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("output", thrift.I64, 2); err != nil { + if err = oprot.WriteFieldBegin("output_token", thrift.I64, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.Output); err != nil { + if err := oprot.WriteI64(p.OutputToken); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -475,10 +475,10 @@ func (p *TokenCost) DeepEqual(ano *TokenCost) bool { } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Input) { + if !p.Field1DeepEqual(ano.InputToken) { return false } - if !p.Field2DeepEqual(ano.Output) { + if !p.Field2DeepEqual(ano.OutputToken) { return false } return true @@ -486,14 +486,14 @@ func (p *TokenCost) DeepEqual(ano *TokenCost) bool { func (p *TokenCost) Field1DeepEqual(src int64) bool { - if p.Input != src { + if p.InputToken != src { return false } return true } func (p *TokenCost) Field2DeepEqual(src int64) bool { - if p.Output != src { + if p.OutputToken != src { return false } return true diff --git a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go index c02a55a85..0f745fa4f 100644 --- a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go +++ b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go @@ -181,6 +181,29 @@ func (l *LocalEvalTargetService) BatchGetSourceEvalTargets(ctx context.Context, return result.GetSuccess(), nil } +// SearchCustomEvalTarget +// 搜索自定义评测对象 +func (l *LocalEvalTargetService) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (*eval_target.SearchCustomEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*eval_target.EvalTargetServiceSearchCustomEvalTargetArgs) + result := out.(*eval_target.EvalTargetServiceSearchCustomEvalTargetResult) + resp, err := l.impl.SearchCustomEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &eval_target.EvalTargetServiceSearchCustomEvalTargetArgs{Req: req} + result := &eval_target.EvalTargetServiceSearchCustomEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "SearchCustomEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + // ExecuteEvalTarget // 执行 func (l *LocalEvalTargetService) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (*eval_target.ExecuteEvalTargetResponse, error) { @@ -246,6 +269,73 @@ func (l *LocalEvalTargetService) BatchGetEvalTargetRecords(ctx context.Context, return result.GetSuccess(), nil } +// DebugEvalTarget +// debug +func (l *LocalEvalTargetService) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (*eval_target.DebugEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*eval_target.EvalTargetServiceDebugEvalTargetArgs) + result := out.(*eval_target.EvalTargetServiceDebugEvalTargetResult) + resp, err := l.impl.DebugEvalTarget(ctx, arg.Request) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &eval_target.EvalTargetServiceDebugEvalTargetArgs{Request: request} + result := &eval_target.EvalTargetServiceDebugEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "DebugEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvalTargetService) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (*eval_target.AsyncDebugEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs) + result := out.(*eval_target.EvalTargetServiceAsyncDebugEvalTargetResult) + resp, err := l.impl.AsyncDebugEvalTarget(ctx, arg.Request) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &eval_target.EvalTargetServiceAsyncDebugEvalTargetArgs{Request: request} + result := &eval_target.EvalTargetServiceAsyncDebugEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "AsyncDebugEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +// PassbackEvalTargetInvokeResult_ +// 回传执行结果 +func (l *LocalEvalTargetService) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (*eval_target.PassbackEvalTargetInvokeResultResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) + result := out.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) + resp, err := l.impl.PassbackEvalTargetInvokeResult_(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs{Req: req} + result := &eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult{} + ctx = l.injectRPCInfo(ctx, "PassbackEvalTargetInvokeResult_") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + func (l *LocalEvalTargetService) injectRPCInfo(ctx context.Context, method string) context.Context { rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) ri := rpcinfo.NewRPCInfo( diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 0e58e5ba9..049570f29 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -396,3 +396,23 @@ func (e EvalTargetApplicationImpl) BatchGetSourceEvalTargets(ctx context.Context EvalTargets: dtos, }, nil } + +func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + // TODO implement me + panic("implement me") +} + +func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { + // TODO implement me + panic("implement me") +} + +func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + // TODO implement me + panic("implement me") +} + +func (e EvalTargetApplicationImpl) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { + // TODO implement me + panic("implement me") +} diff --git a/backend/modules/evaluation/domain/entity/target.go b/backend/modules/evaluation/domain/entity/target.go index 9a80e7bf7..dccfff804 100644 --- a/backend/modules/evaluation/domain/entity/target.go +++ b/backend/modules/evaluation/domain/entity/target.go @@ -29,6 +29,7 @@ type EvalTargetVersion struct { Prompt *LoopPrompt CozeWorkflow *CozeWorkflow VolcengineAgent *VolcengineAgent + CustomPsm *CustomPSM InputSchema []*ArgsSchema OutputSchema []*ArgsSchema @@ -50,6 +51,8 @@ const ( EvalTargetTypeCozeWorkflow EvalTargetType = 4 // 火山智能体 EvalTargetTypeVolcengineAgent EvalTargetType = 5 + // 自定义psm服务 for内场 + EvalTargetType_CustomPSM EvalTargetType = 6 ) func (p EvalTargetType) String() string { @@ -64,6 +67,8 @@ func (p EvalTargetType) String() string { return "CozeWorkflow" case EvalTargetTypeVolcengineAgent: return "VolcengineAgent" + case EvalTargetType_CustomPSM: + return "CustomPSM" } return "" } diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go new file mode 100644 index 000000000..14e5ce9f1 --- /dev/null +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go @@ -0,0 +1,73 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package entity + +type CustomPSM struct { + // 应用ID + ID *string + // DTO使用,不存数据库 + Name *string `json:"-"` + // DTO使用,不存数据库 + Description *string `json:"-"` + // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 + Psm *string + // 接入协议 + AccessProtocol *AccessProtocol + Regions []Region + Cluster *string + // 执行http信息 + InvokeHTTPInfo *HttpInfo + // 异步执行http信息,如果用户选了异步就传入这个字段 + AsyncInvokeHTTPInfo *HttpInfo + // 是否需要搜索对象 + NeedSearchTarget *bool + // 搜索对象http信息 + SearchHTTPInfo *HttpInfo + // 搜索对象返回的信息 + CustomEvalTarget *CustomEvalTarget + // 是否异步 + IsAsync *bool +} + +type HttpInfo struct { + Method *HttpMethod + Path *string + // ms,默认5000,最大800,000 + Timeout *int64 +} + +type CustomEvalTarget struct { + // 唯一键,平台不消费,仅做透传 + ID *string + // 名称,平台用于展示在对象搜索下拉列表 + Name *string + // 头像url,平台用于展示在对象搜索下拉列表 + AvatarURL *string + // 扩展字段,目前主要存储旧版协议response中的额外字段:object_type(旧版ID)、object_meta、space_id + Ext map[string]string +} + +type Region = string + +const ( + RegionBOE = "boe" + RegionCN = "cn" + RegionI18N = "i18n" +) + +type AccessProtocol = string + +const ( + AccessProtocolRPC = "rpc" + AccessProtocolRPCOld = "rpc_old" + AccessProtocolBytefaasHTTP = "bytefaas_http" + AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" +) + +type HttpMethod = string + +const ( + HttpMethodGet = "get" + HttpMethodPost = "post" +) diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index e527e5f74..f320875af 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -52,7 +52,7 @@ enum EvalTargetType { Trace = 3 // Trace CozeWorkflow = 4 VolcengineAgent = 5 // 火山智能体 - CustomPSM = 6 // 自定义psm for内场 + CustomPSM = 6 // 自定义psm服务 for内场 } struct CustomPSM { From e82d2a4aec621bd9dc9a214679730bde885b59a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 20:35:04 +0800 Subject: [PATCH 008/100] fix: [Coda] complete CustomPSM DO to DTO conversion in eval_target.go (LogID: 20250915202050010091094121747A8EC) Co-Authored-By: Coda --- .../convertor/target/eval_target.go | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 8a93bab61..2185a68d4 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -186,6 +186,28 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi BaseInfo: commonconvertor.ConvertBaseInfoDO2DTO(targetVersionDO.VolcengineAgent.BaseInfo), } } + case do.EvalTargetType_CustomPSM: + targetVersionDTO.EvalTargetContent = &dto.EvalTargetContent{ + InputSchemas: make([]*commondto.ArgsSchema, 0), + OutputSchemas: make([]*commondto.ArgsSchema, 0), + } + if targetVersionDO.CustomPsm != nil { + targetVersionDTO.EvalTargetContent.CustomPsm = &dto.CustomPSM{ + ID: targetVersionDO.CustomPsm.ID, + Name: targetVersionDO.CustomPsm.Name, + Description: targetVersionDO.CustomPsm.Description, + Psm: targetVersionDO.CustomPsm.Psm, + AccessProtocol: targetVersionDO.CustomPsm.AccessProtocol, + Regions: targetVersionDO.CustomPsm.Regions, + Cluster: targetVersionDO.CustomPsm.Cluster, + InvokeHTTPInfo: targetVersionDO.CustomPsm.InvokeHTTPInfo, + AsyncInvokeHTTPInfo: targetVersionDO.CustomPsm.AsyncInvokeHTTPInfo, + NeedSearchTarget: targetVersionDO.CustomPsm.NeedSearchTarget, + SearchHTTPInfo: targetVersionDO.CustomPsm.SearchHTTPInfo, + CustomEvalTarget: targetVersionDO.CustomPsm.CustomEvalTarget, + IsAsync: targetVersionDO.CustomPsm.IsAsync, + } + } default: targetVersionDTO.EvalTargetContent = &dto.EvalTargetContent{ InputSchemas: make([]*commondto.ArgsSchema, 0), @@ -201,4 +223,4 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi targetVersionDTO.BaseInfo = commonconvertor.ConvertBaseInfoDO2DTO(targetVersionDO.BaseInfo) return targetVersionDTO -} +} \ No newline at end of file From 08cb7ff6c5dfb2fc92396da1f3f046586eb7ad91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 20:51:36 +0800 Subject: [PATCH 009/100] fix Change-Id: I6736d7c0bb734a78fe6c4d8eb17815d7e70742b7 --- backend/go.sum | 2 - .../convertor/target/eval_target.go | 45 ++++++++++++++----- .../entity/target_builtin_custom_psm.go | 16 +++---- .../target/mysql/convertor/eval_target.go | 10 +++++ 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/backend/go.sum b/backend/go.sum index cba7b541b..2f5f99197 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -249,8 +249,6 @@ github.com/coocood/freecache v1.2.4/go.mod h1:RBUWa/Cy+OHdfTGFEhEuE1pMCMX51Ncizj github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coze-dev/cozeloop-go v0.1.9 h1:4mb1x+uP0WNRG/safwWrOwm65T+qQsWOt+W8ZrZEFUU= -github.com/coze-dev/cozeloop-go v0.1.9/go.mod h1:RMH0F6ZMwZm4ZL92IHLjTf4lmr8QHxYJVPCdz60ZbbI= github.com/coze-dev/cozeloop-go v0.1.10-0.20250901062520-61d3699b1e83 h1:7Jh4flr9XqvissJtafWhTcs1vcErUcsjNkkniH/szxY= github.com/coze-dev/cozeloop-go v0.1.10-0.20250901062520-61d3699b1e83/go.mod h1:RMH0F6ZMwZm4ZL92IHLjTf4lmr8QHxYJVPCdz60ZbbI= github.com/coze-dev/cozeloop-go/spec v0.1.4-0.20250829072213-3812ddbfb735 h1:qxAwjHy0SLQazDO3oGJ8D24vOeM2Oz2+n27bNPegBls= diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 2185a68d4..8355704db 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -193,18 +193,18 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi } if targetVersionDO.CustomPsm != nil { targetVersionDTO.EvalTargetContent.CustomPsm = &dto.CustomPSM{ - ID: targetVersionDO.CustomPsm.ID, - Name: targetVersionDO.CustomPsm.Name, - Description: targetVersionDO.CustomPsm.Description, - Psm: targetVersionDO.CustomPsm.Psm, - AccessProtocol: targetVersionDO.CustomPsm.AccessProtocol, + ID: &targetVersionDO.CustomPsm.ID, + Name: &targetVersionDO.CustomPsm.Name, + Description: &targetVersionDO.CustomPsm.Description, + Psm: &targetVersionDO.CustomPsm.Psm, + AccessProtocol: &targetVersionDO.CustomPsm.AccessProtocol, Regions: targetVersionDO.CustomPsm.Regions, - Cluster: targetVersionDO.CustomPsm.Cluster, - InvokeHTTPInfo: targetVersionDO.CustomPsm.InvokeHTTPInfo, - AsyncInvokeHTTPInfo: targetVersionDO.CustomPsm.AsyncInvokeHTTPInfo, + Cluster: &targetVersionDO.CustomPsm.Cluster, + InvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.InvokeHTTPInfo), + AsyncInvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.AsyncInvokeHTTPInfo), NeedSearchTarget: targetVersionDO.CustomPsm.NeedSearchTarget, - SearchHTTPInfo: targetVersionDO.CustomPsm.SearchHTTPInfo, - CustomEvalTarget: targetVersionDO.CustomPsm.CustomEvalTarget, + SearchHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.SearchHTTPInfo), + CustomEvalTarget: CustomEvalTargetDO2DTO(targetVersionDO.CustomPsm.CustomEvalTarget), IsAsync: targetVersionDO.CustomPsm.IsAsync, } } @@ -223,4 +223,27 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi targetVersionDTO.BaseInfo = commonconvertor.ConvertBaseInfoDO2DTO(targetVersionDO.BaseInfo) return targetVersionDTO -} \ No newline at end of file +} + +func HttpInfoDO2DTO(httpInfoDO *do.HttpInfo) (httpInfoDTO *dto.HttpInfo) { + if httpInfoDO == nil { + return nil + } + return &dto.HttpInfo{ + Method: gptr.Of(httpInfoDO.Method), + Path: gptr.Of(httpInfoDO.Path), + Timeout: httpInfoDO.Timeout, + } +} + +func CustomEvalTargetDO2DTO(customEvalTargetDO *do.CustomEvalTarget) (customEvalTargetDTO *dto.CustomEvalTarget) { + if customEvalTargetDO == nil { + return nil + } + return &dto.CustomEvalTarget{ + ID: customEvalTargetDO.ID, + Name: customEvalTargetDO.Name, + AvatarURL: customEvalTargetDO.AvatarURL, + Ext: customEvalTargetDO.Ext, + } +} diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go index 14e5ce9f1..2165a16ad 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go @@ -5,17 +5,17 @@ package entity type CustomPSM struct { // 应用ID - ID *string + ID string // DTO使用,不存数据库 - Name *string `json:"-"` + Name string `json:"-"` // DTO使用,不存数据库 - Description *string `json:"-"` + Description string `json:"-"` // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 - Psm *string + Psm string // 接入协议 - AccessProtocol *AccessProtocol + AccessProtocol AccessProtocol Regions []Region - Cluster *string + Cluster string // 执行http信息 InvokeHTTPInfo *HttpInfo // 异步执行http信息,如果用户选了异步就传入这个字段 @@ -31,8 +31,8 @@ type CustomPSM struct { } type HttpInfo struct { - Method *HttpMethod - Path *string + Method HttpMethod + Path string // ms,默认5000,最大800,000 Timeout *int64 } diff --git a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go index ef7d44a90..b42579a28 100644 --- a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go @@ -63,6 +63,11 @@ func EvalTargetVersionDO2PO(do *entity.EvalTargetVersion) (po *model.TargetVersi if err != nil { return nil, err } + case entity.EvalTargetType_CustomPSM: + meta, err = json.Marshal(do.CustomPsm) + if err != nil { + return nil, err + } } if do.InputSchema != nil { inputSchema, err = json.Marshal(do.InputSchema) @@ -200,6 +205,11 @@ func EvalTargetVersionPO2DO(targetVersionPO *model.TargetVersion, targetType ent if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { targetVersionDO.VolcengineAgent = meta } + case entity.EvalTargetType_CustomPSM: + meta := &entity.CustomPSM{} + if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { + targetVersionDO.CustomPsm = meta + } default: // todo } From a5efcb789da27cf7b0c7a45d7ed988b28e27d051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 21:17:41 +0800 Subject: [PATCH 010/100] fix Change-Id: I35feace15e2bcd68beaab2c408bda4a59f1a6d82 --- .../spi/coze.loop.evaluation.spi.go | 5546 +++++++++++++++++ .../spi/coze.loop.evaluation.spi_validator.go | 129 + .../spi/evaluationspiservice/client.go | 61 + .../evaluationspiservice.go | 167 + .../spi/evaluationspiservice/server.go | 25 + .../coze/loop/evaluation/spi/k-consts.go | 4 + .../spi/k-coze.loop.evaluation.spi.go | 3823 ++++++++++++ .../lospi/local_evaluationspiservice.go | 98 + 8 files changed, 9853 insertions(+) create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go create mode 100644 backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go new file mode 100644 index 000000000..7808c012a --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go @@ -0,0 +1,5546 @@ +// Code generated by thriftgo (0.4.1). DO NOT EDIT. + +package spi + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "strings" +) + +const ( + ContentTypeText = "text" + + ContentTypeImage = "image" + + ContentTypeMultiPart = "multi_part" +) + +type ContentType = string + +type SearchEvalTargetRequest struct { + // 空间id + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 搜索关键字,如需使用请用户自行实现 + Keyword *string `thrift:"keyword,2,optional" frugal:"2,optional,string" form:"keyword" json:"keyword,omitempty" query:"keyword"` + // 扩展字段:目前会透传regoin和空间id信息,key名如下:search_region、search_space_id + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` + PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` + PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewSearchEvalTargetRequest() *SearchEvalTargetRequest { + return &SearchEvalTargetRequest{} +} + +func (p *SearchEvalTargetRequest) InitDefault() { +} + +var SearchEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *SearchEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return SearchEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var SearchEvalTargetRequest_Keyword_DEFAULT string + +func (p *SearchEvalTargetRequest) GetKeyword() (v string) { + if p == nil { + return + } + if !p.IsSetKeyword() { + return SearchEvalTargetRequest_Keyword_DEFAULT + } + return *p.Keyword +} + +var SearchEvalTargetRequest_Ext_DEFAULT map[string]string + +func (p *SearchEvalTargetRequest) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return SearchEvalTargetRequest_Ext_DEFAULT + } + return p.Ext +} + +var SearchEvalTargetRequest_PageSize_DEFAULT int32 + +func (p *SearchEvalTargetRequest) GetPageSize() (v int32) { + if p == nil { + return + } + if !p.IsSetPageSize() { + return SearchEvalTargetRequest_PageSize_DEFAULT + } + return *p.PageSize +} + +var SearchEvalTargetRequest_PageToken_DEFAULT string + +func (p *SearchEvalTargetRequest) GetPageToken() (v string) { + if p == nil { + return + } + if !p.IsSetPageToken() { + return SearchEvalTargetRequest_PageToken_DEFAULT + } + return *p.PageToken +} + +var SearchEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *SearchEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return SearchEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *SearchEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *SearchEvalTargetRequest) SetKeyword(val *string) { + p.Keyword = val +} +func (p *SearchEvalTargetRequest) SetExt(val map[string]string) { + p.Ext = val +} +func (p *SearchEvalTargetRequest) SetPageSize(val *int32) { + p.PageSize = val +} +func (p *SearchEvalTargetRequest) SetPageToken(val *string) { + p.PageToken = val +} +func (p *SearchEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_SearchEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "keyword", + 20: "ext", + 100: "page_size", + 101: "page_token", + 255: "Base", +} + +func (p *SearchEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *SearchEvalTargetRequest) IsSetKeyword() bool { + return p.Keyword != nil +} + +func (p *SearchEvalTargetRequest) IsSetExt() bool { + return p.Ext != nil +} + +func (p *SearchEvalTargetRequest) IsSetPageSize() bool { + return p.PageSize != nil +} + +func (p *SearchEvalTargetRequest) IsSetPageToken() bool { + return p.PageToken != nil +} + +func (p *SearchEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *SearchEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.I32 { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.STRING { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Keyword = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField100(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.PageSize = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField101(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.PageToken = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *SearchEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetKeyword() { + if err = oprot.WriteFieldBegin("keyword", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Keyword); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetPageSize() { + if err = oprot.WriteFieldBegin("page_size", thrift.I32, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.PageSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetPageToken() { + if err = oprot.WriteFieldBegin("page_token", thrift.STRING, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.PageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchEvalTargetRequest(%+v)", *p) + +} + +func (p *SearchEvalTargetRequest) DeepEqual(ano *SearchEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.Keyword) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + if !p.Field100DeepEqual(ano.PageSize) { + return false + } + if !p.Field101DeepEqual(ano.PageToken) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *SearchEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field2DeepEqual(src *string) bool { + + if p.Keyword == src { + return true + } else if p.Keyword == nil || src == nil { + return false + } + if strings.Compare(*p.Keyword, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *SearchEvalTargetRequest) Field100DeepEqual(src *int32) bool { + + if p.PageSize == src { + return true + } else if p.PageSize == nil || src == nil { + return false + } + if *p.PageSize != *src { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field101DeepEqual(src *string) bool { + + if p.PageToken == src { + return true + } else if p.PageToken == nil || src == nil { + return false + } + if strings.Compare(*p.PageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type SearchEvalTargetResponse struct { + CustomEvalTargets []*CustomEvalTarget `thrift:"custom_eval_targets,1,optional" frugal:"1,optional,list" form:"custom_eval_targets" json:"custom_eval_targets,omitempty" query:"custom_eval_targets"` + NextPageToken *string `thrift:"next_page_token,100,optional" frugal:"100,optional,string" form:"next_page_token" json:"next_page_token,omitempty" query:"next_page_token"` + HasMore *bool `thrift:"has_more,101,optional" frugal:"101,optional,bool" form:"has_more" json:"has_more,omitempty" query:"has_more"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewSearchEvalTargetResponse() *SearchEvalTargetResponse { + return &SearchEvalTargetResponse{} +} + +func (p *SearchEvalTargetResponse) InitDefault() { +} + +var SearchEvalTargetResponse_CustomEvalTargets_DEFAULT []*CustomEvalTarget + +func (p *SearchEvalTargetResponse) GetCustomEvalTargets() (v []*CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTargets() { + return SearchEvalTargetResponse_CustomEvalTargets_DEFAULT + } + return p.CustomEvalTargets +} + +var SearchEvalTargetResponse_NextPageToken_DEFAULT string + +func (p *SearchEvalTargetResponse) GetNextPageToken() (v string) { + if p == nil { + return + } + if !p.IsSetNextPageToken() { + return SearchEvalTargetResponse_NextPageToken_DEFAULT + } + return *p.NextPageToken +} + +var SearchEvalTargetResponse_HasMore_DEFAULT bool + +func (p *SearchEvalTargetResponse) GetHasMore() (v bool) { + if p == nil { + return + } + if !p.IsSetHasMore() { + return SearchEvalTargetResponse_HasMore_DEFAULT + } + return *p.HasMore +} + +var SearchEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *SearchEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return SearchEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *SearchEvalTargetResponse) SetCustomEvalTargets(val []*CustomEvalTarget) { + p.CustomEvalTargets = val +} +func (p *SearchEvalTargetResponse) SetNextPageToken(val *string) { + p.NextPageToken = val +} +func (p *SearchEvalTargetResponse) SetHasMore(val *bool) { + p.HasMore = val +} +func (p *SearchEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_SearchEvalTargetResponse = map[int16]string{ + 1: "custom_eval_targets", + 100: "next_page_token", + 101: "has_more", + 255: "BaseResp", +} + +func (p *SearchEvalTargetResponse) IsSetCustomEvalTargets() bool { + return p.CustomEvalTargets != nil +} + +func (p *SearchEvalTargetResponse) IsSetNextPageToken() bool { + return p.NextPageToken != nil +} + +func (p *SearchEvalTargetResponse) IsSetHasMore() bool { + return p.HasMore != nil +} + +func (p *SearchEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *SearchEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.STRING { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*CustomEvalTarget, 0, size) + values := make([]CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.CustomEvalTargets = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField100(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.NextPageToken = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField101(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.HasMore = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *SearchEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTargets() { + if err = oprot.WriteFieldBegin("custom_eval_targets", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CustomEvalTargets)); err != nil { + return err + } + for _, v := range p.CustomEvalTargets { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetNextPageToken() { + if err = oprot.WriteFieldBegin("next_page_token", thrift.STRING, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.NextPageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetHasMore() { + if err = oprot.WriteFieldBegin("has_more", thrift.BOOL, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.HasMore); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchEvalTargetResponse(%+v)", *p) + +} + +func (p *SearchEvalTargetResponse) DeepEqual(ano *SearchEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.CustomEvalTargets) { + return false + } + if !p.Field100DeepEqual(ano.NextPageToken) { + return false + } + if !p.Field101DeepEqual(ano.HasMore) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *SearchEvalTargetResponse) Field1DeepEqual(src []*CustomEvalTarget) bool { + + if len(p.CustomEvalTargets) != len(src) { + return false + } + for i, v := range p.CustomEvalTargets { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *SearchEvalTargetResponse) Field100DeepEqual(src *string) bool { + + if p.NextPageToken == src { + return true + } else if p.NextPageToken == nil || src == nil { + return false + } + if strings.Compare(*p.NextPageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetResponse) Field101DeepEqual(src *bool) bool { + + if p.HasMore == src { + return true + } else if p.HasMore == nil || src == nil { + return false + } + if *p.HasMore != *src { + return false + } + return true +} +func (p *SearchEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type CustomEvalTarget struct { + // 唯一键,平台不消费,仅做透传 + ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` + // 名称,平台用于展示在对象搜索下拉列表 + Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` + // 头像url,平台用于展示在对象搜索下拉列表 + AvatarURL *string `thrift:"avatar_url,3,optional" frugal:"3,optional,string" form:"avatar_url" json:"avatar_url,omitempty" query:"avatar_url"` +} + +func NewCustomEvalTarget() *CustomEvalTarget { + return &CustomEvalTarget{} +} + +func (p *CustomEvalTarget) InitDefault() { +} + +var CustomEvalTarget_ID_DEFAULT string + +func (p *CustomEvalTarget) GetID() (v string) { + if p == nil { + return + } + if !p.IsSetID() { + return CustomEvalTarget_ID_DEFAULT + } + return *p.ID +} + +var CustomEvalTarget_Name_DEFAULT string + +func (p *CustomEvalTarget) GetName() (v string) { + if p == nil { + return + } + if !p.IsSetName() { + return CustomEvalTarget_Name_DEFAULT + } + return *p.Name +} + +var CustomEvalTarget_AvatarURL_DEFAULT string + +func (p *CustomEvalTarget) GetAvatarURL() (v string) { + if p == nil { + return + } + if !p.IsSetAvatarURL() { + return CustomEvalTarget_AvatarURL_DEFAULT + } + return *p.AvatarURL +} +func (p *CustomEvalTarget) SetID(val *string) { + p.ID = val +} +func (p *CustomEvalTarget) SetName(val *string) { + p.Name = val +} +func (p *CustomEvalTarget) SetAvatarURL(val *string) { + p.AvatarURL = val +} + +var fieldIDToName_CustomEvalTarget = map[int16]string{ + 1: "id", + 2: "name", + 3: "avatar_url", +} + +func (p *CustomEvalTarget) IsSetID() bool { + return p.ID != nil +} + +func (p *CustomEvalTarget) IsSetName() bool { + return p.Name != nil +} + +func (p *CustomEvalTarget) IsSetAvatarURL() bool { + return p.AvatarURL != nil +} + +func (p *CustomEvalTarget) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CustomEvalTarget) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ID = _field + return nil +} +func (p *CustomEvalTarget) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Name = _field + return nil +} +func (p *CustomEvalTarget) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.AvatarURL = _field + return nil +} + +func (p *CustomEvalTarget) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CustomEvalTarget"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CustomEvalTarget) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetID() { + if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAvatarURL() { + if err = oprot.WriteFieldBegin("avatar_url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.AvatarURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *CustomEvalTarget) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CustomEvalTarget(%+v)", *p) + +} + +func (p *CustomEvalTarget) DeepEqual(ano *CustomEvalTarget) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ID) { + return false + } + if !p.Field2DeepEqual(ano.Name) { + return false + } + if !p.Field3DeepEqual(ano.AvatarURL) { + return false + } + return true +} + +func (p *CustomEvalTarget) Field1DeepEqual(src *string) bool { + + if p.ID == src { + return true + } else if p.ID == nil || src == nil { + return false + } + if strings.Compare(*p.ID, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field2DeepEqual(src *string) bool { + + if p.Name == src { + return true + } else if p.Name == nil || src == nil { + return false + } + if strings.Compare(*p.Name, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field3DeepEqual(src *string) bool { + + if p.AvatarURL == src { + return true + } else if p.AvatarURL == nil || src == nil { + return false + } + if strings.Compare(*p.AvatarURL, *src) != 0 { + return false + } + return true +} + +type InvokeEvalTargetRequest struct { + // 空间id + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 输入信息 + Input *InvokeEvalTargetInput `thrift:"input,2,optional" frugal:"2,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` + // 如果创建实验时选了二级对象,则会透传search接口返回的二级对象信息 + CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,3,optional" frugal:"3,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` +} + +func NewInvokeEvalTargetRequest() *InvokeEvalTargetRequest { + return &InvokeEvalTargetRequest{} +} + +func (p *InvokeEvalTargetRequest) InitDefault() { +} + +var InvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *InvokeEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return InvokeEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var InvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput + +func (p *InvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { + if p == nil { + return + } + if !p.IsSetInput() { + return InvokeEvalTargetRequest_Input_DEFAULT + } + return p.Input +} + +var InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget + +func (p *InvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} + +var InvokeEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *InvokeEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return InvokeEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *InvokeEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *InvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { + p.Input = val +} +func (p *InvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { + p.CustomEvalTarget = val +} +func (p *InvokeEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_InvokeEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "input", + 3: "custom_eval_target", + 255: "Base", +} + +func (p *InvokeEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *InvokeEvalTargetRequest) IsSetInput() bool { + return p.Input != nil +} + +func (p *InvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + +func (p *InvokeEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *InvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetInput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Input = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { + _field := NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *InvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInput() { + if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Input.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetRequest(%+v)", *p) + +} + +func (p *InvokeEvalTargetRequest) DeepEqual(ano *InvokeEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.Input) { + return false + } + if !p.Field3DeepEqual(ano.CustomEvalTarget) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *InvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field2DeepEqual(src *InvokeEvalTargetInput) bool { + + if !p.Input.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field3DeepEqual(src *CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type InvokeEvalTargetResponse struct { + // 输出 + Output *InvokeEvalTargetOutput `thrift:"output,1,optional" frugal:"1,optional,InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` + // 消耗 + Usage *InvokeEvalTargetUsage `thrift:"usage,2,optional" frugal:"2,optional,InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewInvokeEvalTargetResponse() *InvokeEvalTargetResponse { + return &InvokeEvalTargetResponse{} +} + +func (p *InvokeEvalTargetResponse) InitDefault() { +} + +var InvokeEvalTargetResponse_Output_DEFAULT *InvokeEvalTargetOutput + +func (p *InvokeEvalTargetResponse) GetOutput() (v *InvokeEvalTargetOutput) { + if p == nil { + return + } + if !p.IsSetOutput() { + return InvokeEvalTargetResponse_Output_DEFAULT + } + return p.Output +} + +var InvokeEvalTargetResponse_Usage_DEFAULT *InvokeEvalTargetUsage + +func (p *InvokeEvalTargetResponse) GetUsage() (v *InvokeEvalTargetUsage) { + if p == nil { + return + } + if !p.IsSetUsage() { + return InvokeEvalTargetResponse_Usage_DEFAULT + } + return p.Usage +} + +var InvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *InvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return InvokeEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *InvokeEvalTargetResponse) SetOutput(val *InvokeEvalTargetOutput) { + p.Output = val +} +func (p *InvokeEvalTargetResponse) SetUsage(val *InvokeEvalTargetUsage) { + p.Usage = val +} +func (p *InvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_InvokeEvalTargetResponse = map[int16]string{ + 1: "output", + 2: "usage", + 255: "BaseResp", +} + +func (p *InvokeEvalTargetResponse) IsSetOutput() bool { + return p.Output != nil +} + +func (p *InvokeEvalTargetResponse) IsSetUsage() bool { + return p.Usage != nil +} + +func (p *InvokeEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *InvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetOutput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Output = _field + return nil +} +func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetUsage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Usage = _field + return nil +} +func (p *InvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *InvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetOutput() { + if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Output.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetUsage() { + if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Usage.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *InvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetResponse(%+v)", *p) + +} + +func (p *InvokeEvalTargetResponse) DeepEqual(ano *InvokeEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Output) { + return false + } + if !p.Field2DeepEqual(ano.Usage) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *InvokeEvalTargetResponse) Field1DeepEqual(src *InvokeEvalTargetOutput) bool { + + if !p.Output.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetResponse) Field2DeepEqual(src *InvokeEvalTargetUsage) bool { + + if !p.Usage.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type InvokeEvalTargetInput struct { + // 评测集字段信息,key=评测集列名,value=评测集列值 + EvalSetFields map[string]*Content `thrift:"eval_set_fields,1,optional" frugal:"1,optional,map" form:"eval_set_fields" json:"eval_set_fields,omitempty" query:"eval_set_fields"` + // 扩展字段,动态参数会通过ext字段传递 + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` +} + +func NewInvokeEvalTargetInput() *InvokeEvalTargetInput { + return &InvokeEvalTargetInput{} +} + +func (p *InvokeEvalTargetInput) InitDefault() { +} + +var InvokeEvalTargetInput_EvalSetFields_DEFAULT map[string]*Content + +func (p *InvokeEvalTargetInput) GetEvalSetFields() (v map[string]*Content) { + if p == nil { + return + } + if !p.IsSetEvalSetFields() { + return InvokeEvalTargetInput_EvalSetFields_DEFAULT + } + return p.EvalSetFields +} + +var InvokeEvalTargetInput_Ext_DEFAULT map[string]string + +func (p *InvokeEvalTargetInput) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return InvokeEvalTargetInput_Ext_DEFAULT + } + return p.Ext +} +func (p *InvokeEvalTargetInput) SetEvalSetFields(val map[string]*Content) { + p.EvalSetFields = val +} +func (p *InvokeEvalTargetInput) SetExt(val map[string]string) { + p.Ext = val +} + +var fieldIDToName_InvokeEvalTargetInput = map[int16]string{ + 1: "eval_set_fields", + 20: "ext", +} + +func (p *InvokeEvalTargetInput) IsSetEvalSetFields() bool { + return p.EvalSetFields != nil +} + +func (p *InvokeEvalTargetInput) IsSetExt() bool { + return p.Ext != nil +} + +func (p *InvokeEvalTargetInput) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]*Content, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + _val := &values[i] + _val.InitDefault() + if err := _val.Read(iprot); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.EvalSetFields = _field + return nil +} +func (p *InvokeEvalTargetInput) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} + +func (p *InvokeEvalTargetInput) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetInput"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalSetFields() { + if err = oprot.WriteFieldBegin("eval_set_fields", thrift.MAP, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.EvalSetFields)); err != nil { + return err + } + for k, v := range p.EvalSetFields { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetInput) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetInput(%+v)", *p) + +} + +func (p *InvokeEvalTargetInput) DeepEqual(ano *InvokeEvalTargetInput) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.EvalSetFields) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + return true +} + +func (p *InvokeEvalTargetInput) Field1DeepEqual(src map[string]*Content) bool { + + if len(p.EvalSetFields) != len(src) { + return false + } + for k, v := range p.EvalSetFields { + _src := src[k] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *InvokeEvalTargetInput) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +// 新增 +type InvokeEvalTargetOutput struct { + // 实际输出 + ActualOutput *Content `thrift:"actual_output,1,optional" frugal:"1,optional,Content" form:"actual_output" json:"actual_output,omitempty" query:"actual_output"` + // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` +} + +func NewInvokeEvalTargetOutput() *InvokeEvalTargetOutput { + return &InvokeEvalTargetOutput{} +} + +func (p *InvokeEvalTargetOutput) InitDefault() { +} + +var InvokeEvalTargetOutput_ActualOutput_DEFAULT *Content + +func (p *InvokeEvalTargetOutput) GetActualOutput() (v *Content) { + if p == nil { + return + } + if !p.IsSetActualOutput() { + return InvokeEvalTargetOutput_ActualOutput_DEFAULT + } + return p.ActualOutput +} + +var InvokeEvalTargetOutput_Ext_DEFAULT map[string]string + +func (p *InvokeEvalTargetOutput) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return InvokeEvalTargetOutput_Ext_DEFAULT + } + return p.Ext +} +func (p *InvokeEvalTargetOutput) SetActualOutput(val *Content) { + p.ActualOutput = val +} +func (p *InvokeEvalTargetOutput) SetExt(val map[string]string) { + p.Ext = val +} + +var fieldIDToName_InvokeEvalTargetOutput = map[int16]string{ + 1: "actual_output", + 20: "ext", +} + +func (p *InvokeEvalTargetOutput) IsSetActualOutput() bool { + return p.ActualOutput != nil +} + +func (p *InvokeEvalTargetOutput) IsSetExt() bool { + return p.Ext != nil +} + +func (p *InvokeEvalTargetOutput) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) ReadField1(iprot thrift.TProtocol) error { + _field := NewContent() + if err := _field.Read(iprot); err != nil { + return err + } + p.ActualOutput = _field + return nil +} +func (p *InvokeEvalTargetOutput) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} + +func (p *InvokeEvalTargetOutput) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetOutput"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetActualOutput() { + if err = oprot.WriteFieldBegin("actual_output", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.ActualOutput.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetOutput) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetOutput(%+v)", *p) + +} + +func (p *InvokeEvalTargetOutput) DeepEqual(ano *InvokeEvalTargetOutput) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ActualOutput) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + return true +} + +func (p *InvokeEvalTargetOutput) Field1DeepEqual(src *Content) bool { + + if !p.ActualOutput.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetOutput) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +type Content struct { + // 类型 + ContentType *ContentType `thrift:"content_type,1,optional" frugal:"1,optional,string" form:"content_type" json:"content_type,omitempty" query:"content_type"` + // 当content_type=text,则从此字段中取值 + Text *string `thrift:"text,10,optional" frugal:"10,optional,string" form:"text" json:"text,omitempty" query:"text"` + // 当content_type=image,则从此字段中取图片信息 + Image *Image `thrift:"image,11,optional" frugal:"11,optional,Image" form:"image" json:"image,omitempty" query:"image"` + // 当content_type=multi_part,则从此字段遍历获取多模态的值 + MultiPart []*Content `thrift:"multi_part,12,optional" frugal:"12,optional,list" form:"multi_part" json:"multi_part,omitempty" query:"multi_part"` +} + +func NewContent() *Content { + return &Content{} +} + +func (p *Content) InitDefault() { +} + +var Content_ContentType_DEFAULT ContentType + +func (p *Content) GetContentType() (v ContentType) { + if p == nil { + return + } + if !p.IsSetContentType() { + return Content_ContentType_DEFAULT + } + return *p.ContentType +} + +var Content_Text_DEFAULT string + +func (p *Content) GetText() (v string) { + if p == nil { + return + } + if !p.IsSetText() { + return Content_Text_DEFAULT + } + return *p.Text +} + +var Content_Image_DEFAULT *Image + +func (p *Content) GetImage() (v *Image) { + if p == nil { + return + } + if !p.IsSetImage() { + return Content_Image_DEFAULT + } + return p.Image +} + +var Content_MultiPart_DEFAULT []*Content + +func (p *Content) GetMultiPart() (v []*Content) { + if p == nil { + return + } + if !p.IsSetMultiPart() { + return Content_MultiPart_DEFAULT + } + return p.MultiPart +} +func (p *Content) SetContentType(val *ContentType) { + p.ContentType = val +} +func (p *Content) SetText(val *string) { + p.Text = val +} +func (p *Content) SetImage(val *Image) { + p.Image = val +} +func (p *Content) SetMultiPart(val []*Content) { + p.MultiPart = val +} + +var fieldIDToName_Content = map[int16]string{ + 1: "content_type", + 10: "text", + 11: "image", + 12: "multi_part", +} + +func (p *Content) IsSetContentType() bool { + return p.ContentType != nil +} + +func (p *Content) IsSetText() bool { + return p.Text != nil +} + +func (p *Content) IsSetImage() bool { + return p.Image != nil +} + +func (p *Content) IsSetMultiPart() bool { + return p.MultiPart != nil +} + +func (p *Content) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Content) ReadField1(iprot thrift.TProtocol) error { + + var _field *ContentType + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ContentType = _field + return nil +} +func (p *Content) ReadField10(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Text = _field + return nil +} +func (p *Content) ReadField11(iprot thrift.TProtocol) error { + _field := NewImage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Image = _field + return nil +} +func (p *Content) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Content, 0, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.MultiPart = _field + return nil +} + +func (p *Content) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Content"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Content) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetContentType() { + if err = oprot.WriteFieldBegin("content_type", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ContentType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *Content) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetText() { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *Content) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetImage() { + if err = oprot.WriteFieldBegin("image", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Image.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *Content) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetMultiPart() { + if err = oprot.WriteFieldBegin("multi_part", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MultiPart)); err != nil { + return err + } + for _, v := range p.MultiPart { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Content) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Content(%+v)", *p) + +} + +func (p *Content) DeepEqual(ano *Content) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ContentType) { + return false + } + if !p.Field10DeepEqual(ano.Text) { + return false + } + if !p.Field11DeepEqual(ano.Image) { + return false + } + if !p.Field12DeepEqual(ano.MultiPart) { + return false + } + return true +} + +func (p *Content) Field1DeepEqual(src *ContentType) bool { + + if p.ContentType == src { + return true + } else if p.ContentType == nil || src == nil { + return false + } + if strings.Compare(*p.ContentType, *src) != 0 { + return false + } + return true +} +func (p *Content) Field10DeepEqual(src *string) bool { + + if p.Text == src { + return true + } else if p.Text == nil || src == nil { + return false + } + if strings.Compare(*p.Text, *src) != 0 { + return false + } + return true +} +func (p *Content) Field11DeepEqual(src *Image) bool { + + if !p.Image.DeepEqual(src) { + return false + } + return true +} +func (p *Content) Field12DeepEqual(src []*Content) bool { + + if len(p.MultiPart) != len(src) { + return false + } + for i, v := range p.MultiPart { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} + +type Image struct { + URL *string `thrift:"url,1,optional" frugal:"1,optional,string" form:"url" json:"url,omitempty" query:"url"` +} + +func NewImage() *Image { + return &Image{} +} + +func (p *Image) InitDefault() { +} + +var Image_URL_DEFAULT string + +func (p *Image) GetURL() (v string) { + if p == nil { + return + } + if !p.IsSetURL() { + return Image_URL_DEFAULT + } + return *p.URL +} +func (p *Image) SetURL(val *string) { + p.URL = val +} + +var fieldIDToName_Image = map[int16]string{ + 1: "url", +} + +func (p *Image) IsSetURL() bool { + return p.URL != nil +} + +func (p *Image) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Image) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.URL = _field + return nil +} + +func (p *Image) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Image"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Image) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Image) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Image(%+v)", *p) + +} + +func (p *Image) DeepEqual(ano *Image) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.URL) { + return false + } + return true +} + +func (p *Image) Field1DeepEqual(src *string) bool { + + if p.URL == src { + return true + } else if p.URL == nil || src == nil { + return false + } + if strings.Compare(*p.URL, *src) != 0 { + return false + } + return true +} + +type InvokeEvalTargetUsage struct { + // 输入token消耗 + InputTokens *int64 `thrift:"input_tokens,1,optional" frugal:"1,optional,i64" form:"input_tokens" json:"input_tokens,omitempty" query:"input_tokens"` + // 输出token消耗 + OutputTokens *int64 `thrift:"output_tokens,2,optional" frugal:"2,optional,i64" form:"output_tokens" json:"output_tokens,omitempty" query:"output_tokens"` +} + +func NewInvokeEvalTargetUsage() *InvokeEvalTargetUsage { + return &InvokeEvalTargetUsage{} +} + +func (p *InvokeEvalTargetUsage) InitDefault() { +} + +var InvokeEvalTargetUsage_InputTokens_DEFAULT int64 + +func (p *InvokeEvalTargetUsage) GetInputTokens() (v int64) { + if p == nil { + return + } + if !p.IsSetInputTokens() { + return InvokeEvalTargetUsage_InputTokens_DEFAULT + } + return *p.InputTokens +} + +var InvokeEvalTargetUsage_OutputTokens_DEFAULT int64 + +func (p *InvokeEvalTargetUsage) GetOutputTokens() (v int64) { + if p == nil { + return + } + if !p.IsSetOutputTokens() { + return InvokeEvalTargetUsage_OutputTokens_DEFAULT + } + return *p.OutputTokens +} +func (p *InvokeEvalTargetUsage) SetInputTokens(val *int64) { + p.InputTokens = val +} +func (p *InvokeEvalTargetUsage) SetOutputTokens(val *int64) { + p.OutputTokens = val +} + +var fieldIDToName_InvokeEvalTargetUsage = map[int16]string{ + 1: "input_tokens", + 2: "output_tokens", +} + +func (p *InvokeEvalTargetUsage) IsSetInputTokens() bool { + return p.InputTokens != nil +} + +func (p *InvokeEvalTargetUsage) IsSetOutputTokens() bool { + return p.OutputTokens != nil +} + +func (p *InvokeEvalTargetUsage) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InputTokens = _field + return nil +} +func (p *InvokeEvalTargetUsage) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.OutputTokens = _field + return nil +} + +func (p *InvokeEvalTargetUsage) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetUsage"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetInputTokens() { + if err = oprot.WriteFieldBegin("input_tokens", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InputTokens); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetUsage) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetOutputTokens() { + if err = oprot.WriteFieldBegin("output_tokens", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.OutputTokens); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetUsage(%+v)", *p) + +} + +func (p *InvokeEvalTargetUsage) DeepEqual(ano *InvokeEvalTargetUsage) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.InputTokens) { + return false + } + if !p.Field2DeepEqual(ano.OutputTokens) { + return false + } + return true +} + +func (p *InvokeEvalTargetUsage) Field1DeepEqual(src *int64) bool { + + if p.InputTokens == src { + return true + } else if p.InputTokens == nil || src == nil { + return false + } + if *p.InputTokens != *src { + return false + } + return true +} +func (p *InvokeEvalTargetUsage) Field2DeepEqual(src *int64) bool { + + if p.OutputTokens == src { + return true + } else if p.OutputTokens == nil || src == nil { + return false + } + if *p.OutputTokens != *src { + return false + } + return true +} + +type AsyncInvokeEvalTargetRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 执行id,传递给自定义对象,在回传结果时透传 + InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` + // 根据invoke_id签发的token,在回传结果时透传 + Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` + // 执行输入信息 + Input *InvokeEvalTargetInput `thrift:"input,4,optional" frugal:"4,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` + // 如果创建实验时选了二级对象,则会透传二级对象信息 + CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,5,optional" frugal:"5,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` +} + +func NewAsyncInvokeEvalTargetRequest() *AsyncInvokeEvalTargetRequest { + return &AsyncInvokeEvalTargetRequest{} +} + +func (p *AsyncInvokeEvalTargetRequest) InitDefault() { +} + +var AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *AsyncInvokeEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT int64 + +func (p *AsyncInvokeEvalTargetRequest) GetInvokeID() (v int64) { + if p == nil { + return + } + if !p.IsSetInvokeID() { + return AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT + } + return *p.InvokeID +} + +var AsyncInvokeEvalTargetRequest_Token_DEFAULT string + +func (p *AsyncInvokeEvalTargetRequest) GetToken() (v string) { + if p == nil { + return + } + if !p.IsSetToken() { + return AsyncInvokeEvalTargetRequest_Token_DEFAULT + } + return *p.Token +} + +var AsyncInvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput + +func (p *AsyncInvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { + if p == nil { + return + } + if !p.IsSetInput() { + return AsyncInvokeEvalTargetRequest_Input_DEFAULT + } + return p.Input +} + +var AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget + +func (p *AsyncInvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} + +var AsyncInvokeEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *AsyncInvokeEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return AsyncInvokeEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *AsyncInvokeEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *AsyncInvokeEvalTargetRequest) SetInvokeID(val *int64) { + p.InvokeID = val +} +func (p *AsyncInvokeEvalTargetRequest) SetToken(val *string) { + p.Token = val +} +func (p *AsyncInvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { + p.Input = val +} +func (p *AsyncInvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { + p.CustomEvalTarget = val +} +func (p *AsyncInvokeEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_AsyncInvokeEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "invoke_id", + 3: "token", + 4: "input", + 5: "custom_eval_target", + 255: "Base", +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetInvokeID() bool { + return p.InvokeID != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetToken() bool { + return p.Token != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetInput() bool { + return p.Input != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *AsyncInvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InvokeID = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetInput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Input = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { + _field := NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *AsyncInvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeID() { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetInput() { + if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Input.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncInvokeEvalTargetRequest(%+v)", *p) + +} + +func (p *AsyncInvokeEvalTargetRequest) DeepEqual(ano *AsyncInvokeEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.InvokeID) { + return false + } + if !p.Field3DeepEqual(ano.Token) { + return false + } + if !p.Field4DeepEqual(ano.Input) { + return false + } + if !p.Field5DeepEqual(ano.CustomEvalTarget) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *AsyncInvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field2DeepEqual(src *int64) bool { + + if p.InvokeID == src { + return true + } else if p.InvokeID == nil || src == nil { + return false + } + if *p.InvokeID != *src { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field3DeepEqual(src *string) bool { + + if p.Token == src { + return true + } else if p.Token == nil || src == nil { + return false + } + if strings.Compare(*p.Token, *src) != 0 { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field4DeepEqual(src *InvokeEvalTargetInput) bool { + + if !p.Input.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field5DeepEqual(src *CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type AsyncInvokeEvalTargetResponse struct { + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewAsyncInvokeEvalTargetResponse() *AsyncInvokeEvalTargetResponse { + return &AsyncInvokeEvalTargetResponse{} +} + +func (p *AsyncInvokeEvalTargetResponse) InitDefault() { +} + +var AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *AsyncInvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *AsyncInvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_AsyncInvokeEvalTargetResponse = map[int16]string{ + 255: "BaseResp", +} + +func (p *AsyncInvokeEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *AsyncInvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *AsyncInvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncInvokeEvalTargetResponse(%+v)", *p) + +} + +func (p *AsyncInvokeEvalTargetResponse) DeepEqual(ano *AsyncInvokeEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *AsyncInvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIService interface { + SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) + + InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) + + AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) +} + +type EvaluationSPIServiceClient struct { + c thrift.TClient +} + +func NewEvaluationSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewEvaluationSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewEvaluationSPIServiceClient(c thrift.TClient) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: c, + } +} + +func (p *EvaluationSPIServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *EvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) { + var _args EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceSearchEvalTargetResult + if err = p.Client_().Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) { + var _args EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceInvokeEvalTargetResult + if err = p.Client_().Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) { + var _args EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.Client_().Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type EvaluationSPIServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler EvaluationSPIService +} + +func (p *EvaluationSPIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *EvaluationSPIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *EvaluationSPIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewEvaluationSPIServiceProcessor(handler EvaluationSPIService) *EvaluationSPIServiceProcessor { + self := &EvaluationSPIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("SearchEvalTarget", &evaluationSPIServiceProcessorSearchEvalTarget{handler: handler}) + self.AddToProcessorMap("InvokeEvalTarget", &evaluationSPIServiceProcessorInvokeEvalTarget{handler: handler}) + self.AddToProcessorMap("AsyncInvokeEvalTarget", &evaluationSPIServiceProcessorAsyncInvokeEvalTarget{handler: handler}) + return self +} +func (p *EvaluationSPIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type evaluationSPIServiceProcessorSearchEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorSearchEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceSearchEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceSearchEvalTargetResult{} + var retval *SearchEvalTargetResponse + if retval, err2 = p.handler.SearchEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("SearchEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evaluationSPIServiceProcessorInvokeEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceInvokeEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceInvokeEvalTargetResult{} + var retval *InvokeEvalTargetResponse + if retval, err2 = p.handler.InvokeEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing InvokeEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("InvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evaluationSPIServiceProcessorAsyncInvokeEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorAsyncInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceAsyncInvokeEvalTargetResult{} + var retval *AsyncInvokeEvalTargetResponse + if retval, err2 = p.handler.AsyncInvokeEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncInvokeEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type EvaluationSPIServiceSearchEvalTargetArgs struct { + Req *SearchEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchEvalTargetRequest"` +} + +func NewEvaluationSPIServiceSearchEvalTargetArgs() *EvaluationSPIServiceSearchEvalTargetArgs { + return &EvaluationSPIServiceSearchEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT *SearchEvalTargetRequest + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetReq() (v *SearchEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceSearchEvalTargetArgs) SetReq(val *SearchEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSearchEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Field1DeepEqual(src *SearchEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceSearchEvalTargetResult struct { + Success *SearchEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchEvalTargetResponse"` +} + +func NewEvaluationSPIServiceSearchEvalTargetResult() *EvaluationSPIServiceSearchEvalTargetResult { + return &EvaluationSPIServiceSearchEvalTargetResult{} +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT *SearchEvalTargetResponse + +func (p *EvaluationSPIServiceSearchEvalTargetResult) GetSuccess() (v *SearchEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceSearchEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*SearchEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSearchEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Field0DeepEqual(src *SearchEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceInvokeEvalTargetArgs struct { + Req *InvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,InvokeEvalTargetRequest"` +} + +func NewEvaluationSPIServiceInvokeEvalTargetArgs() *EvaluationSPIServiceInvokeEvalTargetArgs { + return &EvaluationSPIServiceInvokeEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT *InvokeEvalTargetRequest + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetReq() (v *InvokeEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) SetReq(val *InvokeEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Field1DeepEqual(src *InvokeEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceInvokeEvalTargetResult struct { + Success *InvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,InvokeEvalTargetResponse"` +} + +func NewEvaluationSPIServiceInvokeEvalTargetResult() *EvaluationSPIServiceInvokeEvalTargetResult { + return &EvaluationSPIServiceInvokeEvalTargetResult{} +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT *InvokeEvalTargetResponse + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetSuccess() (v *InvokeEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceInvokeEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*InvokeEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Field0DeepEqual(src *InvokeEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceAsyncInvokeEvalTargetArgs struct { + Req *AsyncInvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,AsyncInvokeEvalTargetRequest"` +} + +func NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() *EvaluationSPIServiceAsyncInvokeEvalTargetArgs { + return &EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT *AsyncInvokeEvalTargetRequest + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetReq() (v *AsyncInvokeEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) SetReq(val *AsyncInvokeEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAsyncInvokeEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Field1DeepEqual(src *AsyncInvokeEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceAsyncInvokeEvalTargetResult struct { + Success *AsyncInvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncInvokeEvalTargetResponse"` +} + +func NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() *EvaluationSPIServiceAsyncInvokeEvalTargetResult { + return &EvaluationSPIServiceAsyncInvokeEvalTargetResult{} +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT *AsyncInvokeEvalTargetResponse + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetSuccess() (v *AsyncInvokeEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*AsyncInvokeEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAsyncInvokeEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Field0DeepEqual(src *AsyncInvokeEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go new file mode 100644 index 000000000..1fd02ed04 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go @@ -0,0 +1,129 @@ +// Code generated by Validator v0.2.6. DO NOT EDIT. + +package spi + +import ( + "bytes" + "fmt" + "reflect" + "regexp" + "strings" + "time" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = (*regexp.Regexp)(nil) + _ = time.Nanosecond +) + +func (p *SearchEvalTargetRequest) IsValid() error { + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *SearchEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *CustomEvalTarget) IsValid() error { + return nil +} +func (p *InvokeEvalTargetRequest) IsValid() error { + if p.Input != nil { + if err := p.Input.IsValid(); err != nil { + return fmt.Errorf("field Input not valid, %w", err) + } + } + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *InvokeEvalTargetResponse) IsValid() error { + if p.Output != nil { + if err := p.Output.IsValid(); err != nil { + return fmt.Errorf("field Output not valid, %w", err) + } + } + if p.Usage != nil { + if err := p.Usage.IsValid(); err != nil { + return fmt.Errorf("field Usage not valid, %w", err) + } + } + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *InvokeEvalTargetInput) IsValid() error { + return nil +} +func (p *InvokeEvalTargetOutput) IsValid() error { + if p.ActualOutput != nil { + if err := p.ActualOutput.IsValid(); err != nil { + return fmt.Errorf("field ActualOutput not valid, %w", err) + } + } + return nil +} +func (p *Content) IsValid() error { + if p.Image != nil { + if err := p.Image.IsValid(); err != nil { + return fmt.Errorf("field Image not valid, %w", err) + } + } + return nil +} +func (p *Image) IsValid() error { + return nil +} +func (p *InvokeEvalTargetUsage) IsValid() error { + return nil +} +func (p *AsyncInvokeEvalTargetRequest) IsValid() error { + if p.Input != nil { + if err := p.Input.IsValid(); err != nil { + return fmt.Errorf("field Input not valid, %w", err) + } + } + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *AsyncInvokeEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go new file mode 100644 index 000000000..4805b07ff --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go @@ -0,0 +1,61 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationspiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) + InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) + AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvaluationSPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvaluationSPIServiceClient struct { + *kClient +} + +func (p *kEvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchEvalTarget(ctx, req) +} + +func (p *kEvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.InvokeEvalTarget(ctx, req) +} + +func (p *kEvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncInvokeEvalTarget(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go new file mode 100644 index 000000000..12c2c80cf --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go @@ -0,0 +1,167 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationspiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "SearchEvalTarget": kitex.NewMethodInfo( + searchEvalTargetHandler, + newEvaluationSPIServiceSearchEvalTargetArgs, + newEvaluationSPIServiceSearchEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "InvokeEvalTarget": kitex.NewMethodInfo( + invokeEvalTargetHandler, + newEvaluationSPIServiceInvokeEvalTargetArgs, + newEvaluationSPIServiceInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncInvokeEvalTarget": kitex.NewMethodInfo( + asyncInvokeEvalTargetHandler, + newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, + newEvaluationSPIServiceAsyncInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evaluationSPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evaluationSPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvaluationSPIService" + handlerType := (*spi.EvaluationSPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "spi", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() +} + +func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetResult() +} + +func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() +} + +func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceSearchEvalTargetResult + if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceInvokeEvalTargetResult + if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go new file mode 100644 index 000000000..a93da14d8 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evaluationspiservice + +import ( + server "github.com/cloudwego/kitex/server" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler spi.EvaluationSPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler spi.EvaluationSPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go new file mode 100644 index 000000000..e75303c47 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go @@ -0,0 +1,4 @@ +package spi + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go new file mode 100644 index 000000000..afc3bcf99 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go @@ -0,0 +1,3823 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package spi + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cloudwego/gopkg/protocol/thrift" + kutils "github.com/cloudwego/kitex/pkg/utils" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" +) + +var ( + _ = base.KitexUnusedProtection +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.STOP +) + +func (p *SearchEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SearchEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Keyword = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *int32 + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageSize = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageToken = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *SearchEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SearchEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field20Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SearchEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetKeyword() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Keyword) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageSize() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 100) + offset += thrift.Binary.WriteI32(buf[offset:], *p.PageSize) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 101) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.PageToken) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *SearchEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *SearchEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetKeyword() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Keyword) + } + return l +} + +func (p *SearchEvalTargetRequest) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *SearchEvalTargetRequest) field100Length() int { + l := 0 + if p.IsSetPageSize() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *SearchEvalTargetRequest) field101Length() int { + l := 0 + if p.IsSetPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.PageToken) + } + return l +} + +func (p *SearchEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *SearchEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*SearchEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.Keyword != nil { + var tmp string + if *src.Keyword != "" { + tmp = kutils.StringDeepCopy(*src.Keyword) + } + p.Keyword = &tmp + } + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + if src.PageSize != nil { + tmp := *src.PageSize + p.PageSize = &tmp + } + + if src.PageToken != nil { + var tmp string + if *src.PageToken != "" { + tmp = kutils.StringDeepCopy(*src.PageToken) + } + p.PageToken = &tmp + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *SearchEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SearchEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*CustomEvalTarget, 0, size) + values := make([]CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.CustomEvalTargets = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.NextPageToken = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.HasMore = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *SearchEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SearchEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SearchEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTargets() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 1) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.CustomEvalTargets { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetNextPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.NextPageToken) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetHasMore() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 101) + offset += thrift.Binary.WriteBool(buf[offset:], *p.HasMore) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *SearchEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetCustomEvalTargets() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.CustomEvalTargets { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *SearchEvalTargetResponse) field100Length() int { + l := 0 + if p.IsSetNextPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.NextPageToken) + } + return l +} + +func (p *SearchEvalTargetResponse) field101Length() int { + l := 0 + if p.IsSetHasMore() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *SearchEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *SearchEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*SearchEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.CustomEvalTargets != nil { + p.CustomEvalTargets = make([]*CustomEvalTarget, 0, len(src.CustomEvalTargets)) + for _, elem := range src.CustomEvalTargets { + var _elem *CustomEvalTarget + if elem != nil { + _elem = &CustomEvalTarget{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.CustomEvalTargets = append(p.CustomEvalTargets, _elem) + } + } + + if src.NextPageToken != nil { + var tmp string + if *src.NextPageToken != "" { + tmp = kutils.StringDeepCopy(*src.NextPageToken) + } + p.NextPageToken = &tmp + } + + if src.HasMore != nil { + tmp := *src.HasMore + p.HasMore = &tmp + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *CustomEvalTarget) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CustomEvalTarget) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ID = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Name = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.AvatarURL = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *CustomEvalTarget) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CustomEvalTarget) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CustomEvalTarget) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAvatarURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.AvatarURL) + } + return offset +} + +func (p *CustomEvalTarget) field1Length() int { + l := 0 + if p.IsSetID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ID) + } + return l +} + +func (p *CustomEvalTarget) field2Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *CustomEvalTarget) field3Length() int { + l := 0 + if p.IsSetAvatarURL() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.AvatarURL) + } + return l +} + +func (p *CustomEvalTarget) DeepCopy(s interface{}) error { + src, ok := s.(*CustomEvalTarget) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ID != nil { + var tmp string + if *src.ID != "" { + tmp = kutils.StringDeepCopy(*src.ID) + } + p.ID = &tmp + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.AvatarURL != nil { + var tmp string + if *src.AvatarURL != "" { + tmp = kutils.StringDeepCopy(*src.AvatarURL) + } + p.AvatarURL = &tmp + } + + return nil +} + +func (p *InvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetInput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Input = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + _field := NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.Input.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 3) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetInput() { + l += thrift.Binary.FieldBeginLength() + l += p.Input.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) field3Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + var _input *InvokeEvalTargetInput + if src.Input != nil { + _input = &InvokeEvalTargetInput{} + if err := _input.DeepCopy(src.Input); err != nil { + return err + } + } + p.Input = _input + + var _customEvalTarget *CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *InvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetOutput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Output = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetUsage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Usage = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Output.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUsage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.Usage.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *InvokeEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.Output.BLength() + } + return l +} + +func (p *InvokeEvalTargetResponse) field2Length() int { + l := 0 + if p.IsSetUsage() { + l += thrift.Binary.FieldBeginLength() + l += p.Usage.BLength() + } + return l +} + +func (p *InvokeEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *InvokeEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _output *InvokeEvalTargetOutput + if src.Output != nil { + _output = &InvokeEvalTargetOutput{} + if err := _output.DeepCopy(src.Output); err != nil { + return err + } + } + p.Output = _output + + var _usage *InvokeEvalTargetUsage + if src.Usage != nil { + _usage = &InvokeEvalTargetUsage{} + if err := _usage.DeepCopy(src.Usage); err != nil { + return err + } + } + p.Usage = _usage + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *InvokeEvalTargetInput) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetInput) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]*Content, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + _val := &values[i] + _val.InitDefault() + if l, err := _val.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field[_key] = _val + } + p.EvalSetFields = _field + return offset, nil +} + +func (p *InvokeEvalTargetInput) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *InvokeEvalTargetInput) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetInput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetInput) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field20Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetInput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalSetFields() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 1) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.EvalSetFields { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) + } + return offset +} + +func (p *InvokeEvalTargetInput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *InvokeEvalTargetInput) field1Length() int { + l := 0 + if p.IsSetEvalSetFields() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.EvalSetFields { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += v.BLength() + } + } + return l +} + +func (p *InvokeEvalTargetInput) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *InvokeEvalTargetInput) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetInput) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.EvalSetFields != nil { + p.EvalSetFields = make(map[string]*Content, len(src.EvalSetFields)) + for key, val := range src.EvalSetFields { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val *Content + if val != nil { + _val = &Content{} + if err := _val.DeepCopy(val); err != nil { + return err + } + } + + p.EvalSetFields[_key] = _val + } + } + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + return nil +} + +func (p *InvokeEvalTargetOutput) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetOutput) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewContent() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.ActualOutput = _field + return offset, nil +} + +func (p *InvokeEvalTargetOutput) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *InvokeEvalTargetOutput) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetOutput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetOutput) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field20Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetOutput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetActualOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.ActualOutput.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetOutput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *InvokeEvalTargetOutput) field1Length() int { + l := 0 + if p.IsSetActualOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.ActualOutput.BLength() + } + return l +} + +func (p *InvokeEvalTargetOutput) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *InvokeEvalTargetOutput) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetOutput) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _actualOutput *Content + if src.ActualOutput != nil { + _actualOutput = &Content{} + if err := _actualOutput.DeepCopy(src.ActualOutput); err != nil { + return err + } + } + p.ActualOutput = _actualOutput + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + return nil +} + +func (p *Content) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Content) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *ContentType + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ContentType = _field + return offset, nil +} + +func (p *Content) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Text = _field + return offset, nil +} + +func (p *Content) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := NewImage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Image = _field + return offset, nil +} + +func (p *Content) FastReadField12(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*Content, 0, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.MultiPart = _field + return offset, nil +} + +func (p *Content) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Content) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Content) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Content) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetContentType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ContentType) + } + return offset +} + +func (p *Content) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetText() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Text) + } + return offset +} + +func (p *Content) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetImage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.Image.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *Content) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetMultiPart() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 12) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.MultiPart { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *Content) field1Length() int { + l := 0 + if p.IsSetContentType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ContentType) + } + return l +} + +func (p *Content) field10Length() int { + l := 0 + if p.IsSetText() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Text) + } + return l +} + +func (p *Content) field11Length() int { + l := 0 + if p.IsSetImage() { + l += thrift.Binary.FieldBeginLength() + l += p.Image.BLength() + } + return l +} + +func (p *Content) field12Length() int { + l := 0 + if p.IsSetMultiPart() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.MultiPart { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *Content) DeepCopy(s interface{}) error { + src, ok := s.(*Content) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ContentType != nil { + tmp := *src.ContentType + p.ContentType = &tmp + } + + if src.Text != nil { + var tmp string + if *src.Text != "" { + tmp = kutils.StringDeepCopy(*src.Text) + } + p.Text = &tmp + } + + var _image *Image + if src.Image != nil { + _image = &Image{} + if err := _image.DeepCopy(src.Image); err != nil { + return err + } + } + p.Image = _image + + if src.MultiPart != nil { + p.MultiPart = make([]*Content, 0, len(src.MultiPart)) + for _, elem := range src.MultiPart { + var _elem *Content + if elem != nil { + _elem = &Content{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.MultiPart = append(p.MultiPart, _elem) + } + } + + return nil +} + +func (p *Image) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Image) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.URL = _field + return offset, nil +} + +func (p *Image) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Image) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Image) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Image) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.URL) + } + return offset +} + +func (p *Image) field1Length() int { + l := 0 + if p.IsSetURL() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.URL) + } + return l +} + +func (p *Image) DeepCopy(s interface{}) error { + src, ok := s.(*Image) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.URL != nil { + var tmp string + if *src.URL != "" { + tmp = kutils.StringDeepCopy(*src.URL) + } + p.URL = &tmp + } + + return nil +} + +func (p *InvokeEvalTargetUsage) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetUsage) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InputTokens = _field + return offset, nil +} + +func (p *InvokeEvalTargetUsage) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.OutputTokens = _field + return offset, nil +} + +func (p *InvokeEvalTargetUsage) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetUsage) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetUsage) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetUsage) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInputTokens() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InputTokens) + } + return offset +} + +func (p *InvokeEvalTargetUsage) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutputTokens() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.OutputTokens) + } + return offset +} + +func (p *InvokeEvalTargetUsage) field1Length() int { + l := 0 + if p.IsSetInputTokens() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetUsage) field2Length() int { + l := 0 + if p.IsSetOutputTokens() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetUsage) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetUsage) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.InputTokens != nil { + tmp := *src.InputTokens + p.InputTokens = &tmp + } + + if src.OutputTokens != nil { + tmp := *src.OutputTokens + p.OutputTokens = &tmp + } + + return nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InvokeID = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Token = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetInput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Input = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + _field := NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncInvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 4) + offset += p.Input.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 5) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetInvokeID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field3Length() int { + l := 0 + if p.IsSetToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Token) + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field4Length() int { + l := 0 + if p.IsSetInput() { + l += thrift.Binary.FieldBeginLength() + l += p.Input.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field5Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncInvokeEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.InvokeID != nil { + tmp := *src.InvokeID + p.InvokeID = &tmp + } + + if src.Token != nil { + var tmp string + if *src.Token != "" { + tmp = kutils.StringDeepCopy(*src.Token) + } + p.Token = &tmp + } + + var _input *InvokeEvalTargetInput + if src.Input != nil { + _input = &InvokeEvalTargetInput{} + if err := _input.DeepCopy(src.Input); err != nil { + return err + } + } + p.Input = _input + + var _customEvalTarget *CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *AsyncInvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncInvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncInvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncInvokeEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncInvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *AsyncInvokeEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *AsyncInvokeEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncInvokeEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewSearchEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceSearchEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *SearchEvalTargetRequest + if src.Req != nil { + _req = &SearchEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewSearchEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceSearchEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *SearchEvalTargetResponse + if src.Success != nil { + _success = &SearchEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *InvokeEvalTargetRequest + if src.Req != nil { + _req = &InvokeEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *InvokeEvalTargetResponse + if src.Success != nil { + _success = &InvokeEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncInvokeEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *AsyncInvokeEvalTargetRequest + if src.Req != nil { + _req = &AsyncInvokeEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncInvokeEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *AsyncInvokeEvalTargetResponse + if src.Success != nil { + _success = &AsyncInvokeEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetResult() interface{} { + return p.Success +} diff --git a/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go b/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go new file mode 100644 index 000000000..67597c82e --- /dev/null +++ b/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go @@ -0,0 +1,98 @@ +// Code generated by cozeloop. DO NOT EDIT. +package lospi // import github.com/coze-dev/coze-loop/backend/lospi + +import ( + "context" + + "github.com/cloudwego/kitex/client/callopt" + "github.com/cloudwego/kitex/pkg/endpoint" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +type LocalEvaluationSPIService struct { + impl spi.EvaluationSPIService // the service implementation + mds endpoint.Middleware +} + +func NewLocalEvaluationSPIService(impl spi.EvaluationSPIService, mds ...endpoint.Middleware) *LocalEvaluationSPIService { + return &LocalEvaluationSPIService{ + impl: impl, + mds: endpoint.Chain(mds...), + } +} + +func (l *LocalEvaluationSPIService) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (*spi.SearchEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + resp, err := l.impl.SearchEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceSearchEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceSearchEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "SearchEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.InvokeEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + resp, err := l.impl.InvokeEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceInvokeEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceInvokeEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "InvokeEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.AsyncInvokeEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + resp, err := l.impl.AsyncInvokeEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "AsyncInvokeEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) injectRPCInfo(ctx context.Context, method string) context.Context { + rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) + ri := rpcinfo.NewRPCInfo( + rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), + rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), + rpcinfo.NewServerInvocation(), + nil, + rpcStats.ImmutableView(), + ) + return rpcinfo.NewCtxWithRPCInfo(ctx, ri) +} From fba5db4df6f4725e71c8be427526eb84e1e5473b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 15 Sep 2025 21:18:35 +0800 Subject: [PATCH 011/100] delete Change-Id: I11f9c2fe8afc48e7d5a3207e1f1846ad6a357400 --- .../spi/coze.loop.evaluation.spi.go | 5546 ----------------- .../spi/coze.loop.evaluation.spi_validator.go | 129 - .../spi/evaluationspiservice/client.go | 61 - .../evaluationspiservice.go | 167 - .../spi/evaluationspiservice/server.go | 25 - .../coze/loop/evaluation/spi/k-consts.go | 4 - .../spi/k-coze.loop.evaluation.spi.go | 3823 ------------ .../lospi/local_evaluationspiservice.go | 98 - 8 files changed, 9853 deletions(-) delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go delete mode 100644 backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go deleted file mode 100644 index 7808c012a..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go +++ /dev/null @@ -1,5546 +0,0 @@ -// Code generated by thriftgo (0.4.1). DO NOT EDIT. - -package spi - -import ( - "context" - "fmt" - "github.com/apache/thrift/lib/go/thrift" - "github.com/coze-dev/coze-loop/backend/kitex_gen/base" - "strings" -) - -const ( - ContentTypeText = "text" - - ContentTypeImage = "image" - - ContentTypeMultiPart = "multi_part" -) - -type ContentType = string - -type SearchEvalTargetRequest struct { - // 空间id - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` - // 搜索关键字,如需使用请用户自行实现 - Keyword *string `thrift:"keyword,2,optional" frugal:"2,optional,string" form:"keyword" json:"keyword,omitempty" query:"keyword"` - // 扩展字段:目前会透传regoin和空间id信息,key名如下:search_region、search_space_id - Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` - PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` - PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` -} - -func NewSearchEvalTargetRequest() *SearchEvalTargetRequest { - return &SearchEvalTargetRequest{} -} - -func (p *SearchEvalTargetRequest) InitDefault() { -} - -var SearchEvalTargetRequest_WorkspaceID_DEFAULT int64 - -func (p *SearchEvalTargetRequest) GetWorkspaceID() (v int64) { - if p == nil { - return - } - if !p.IsSetWorkspaceID() { - return SearchEvalTargetRequest_WorkspaceID_DEFAULT - } - return *p.WorkspaceID -} - -var SearchEvalTargetRequest_Keyword_DEFAULT string - -func (p *SearchEvalTargetRequest) GetKeyword() (v string) { - if p == nil { - return - } - if !p.IsSetKeyword() { - return SearchEvalTargetRequest_Keyword_DEFAULT - } - return *p.Keyword -} - -var SearchEvalTargetRequest_Ext_DEFAULT map[string]string - -func (p *SearchEvalTargetRequest) GetExt() (v map[string]string) { - if p == nil { - return - } - if !p.IsSetExt() { - return SearchEvalTargetRequest_Ext_DEFAULT - } - return p.Ext -} - -var SearchEvalTargetRequest_PageSize_DEFAULT int32 - -func (p *SearchEvalTargetRequest) GetPageSize() (v int32) { - if p == nil { - return - } - if !p.IsSetPageSize() { - return SearchEvalTargetRequest_PageSize_DEFAULT - } - return *p.PageSize -} - -var SearchEvalTargetRequest_PageToken_DEFAULT string - -func (p *SearchEvalTargetRequest) GetPageToken() (v string) { - if p == nil { - return - } - if !p.IsSetPageToken() { - return SearchEvalTargetRequest_PageToken_DEFAULT - } - return *p.PageToken -} - -var SearchEvalTargetRequest_Base_DEFAULT *base.Base - -func (p *SearchEvalTargetRequest) GetBase() (v *base.Base) { - if p == nil { - return - } - if !p.IsSetBase() { - return SearchEvalTargetRequest_Base_DEFAULT - } - return p.Base -} -func (p *SearchEvalTargetRequest) SetWorkspaceID(val *int64) { - p.WorkspaceID = val -} -func (p *SearchEvalTargetRequest) SetKeyword(val *string) { - p.Keyword = val -} -func (p *SearchEvalTargetRequest) SetExt(val map[string]string) { - p.Ext = val -} -func (p *SearchEvalTargetRequest) SetPageSize(val *int32) { - p.PageSize = val -} -func (p *SearchEvalTargetRequest) SetPageToken(val *string) { - p.PageToken = val -} -func (p *SearchEvalTargetRequest) SetBase(val *base.Base) { - p.Base = val -} - -var fieldIDToName_SearchEvalTargetRequest = map[int16]string{ - 1: "workspace_id", - 2: "keyword", - 20: "ext", - 100: "page_size", - 101: "page_token", - 255: "Base", -} - -func (p *SearchEvalTargetRequest) IsSetWorkspaceID() bool { - return p.WorkspaceID != nil -} - -func (p *SearchEvalTargetRequest) IsSetKeyword() bool { - return p.Keyword != nil -} - -func (p *SearchEvalTargetRequest) IsSetExt() bool { - return p.Ext != nil -} - -func (p *SearchEvalTargetRequest) IsSetPageSize() bool { - return p.PageSize != nil -} - -func (p *SearchEvalTargetRequest) IsSetPageToken() bool { - return p.PageToken != nil -} - -func (p *SearchEvalTargetRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *SearchEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 20: - if fieldTypeId == thrift.MAP { - if err = p.ReadField20(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 100: - if fieldTypeId == thrift.I32 { - if err = p.ReadField100(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 101: - if fieldTypeId == thrift.STRING { - if err = p.ReadField101(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SearchEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.WorkspaceID = _field - return nil -} -func (p *SearchEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Keyword = _field - return nil -} -func (p *SearchEvalTargetRequest) ReadField20(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.Ext = _field - return nil -} -func (p *SearchEvalTargetRequest) ReadField100(iprot thrift.TProtocol) error { - - var _field *int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = &v - } - p.PageSize = _field - return nil -} -func (p *SearchEvalTargetRequest) ReadField101(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.PageToken = _field - return nil -} -func (p *SearchEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *SearchEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SearchEvalTargetRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField20(oprot); err != nil { - fieldId = 20 - goto WriteFieldError - } - if err = p.writeField100(oprot); err != nil { - fieldId = 100 - goto WriteFieldError - } - if err = p.writeField101(oprot); err != nil { - fieldId = 101 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SearchEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetWorkspaceID() { - if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.WorkspaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *SearchEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetKeyword() { - if err = oprot.WriteFieldBegin("keyword", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Keyword); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *SearchEvalTargetRequest) writeField20(oprot thrift.TProtocol) (err error) { - if p.IsSetExt() { - if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { - return err - } - for k, v := range p.Ext { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) -} -func (p *SearchEvalTargetRequest) writeField100(oprot thrift.TProtocol) (err error) { - if p.IsSetPageSize() { - if err = oprot.WriteFieldBegin("page_size", thrift.I32, 100); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(*p.PageSize); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) -} -func (p *SearchEvalTargetRequest) writeField101(oprot thrift.TProtocol) (err error) { - if p.IsSetPageToken() { - if err = oprot.WriteFieldBegin("page_token", thrift.STRING, 101); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.PageToken); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) -} -func (p *SearchEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *SearchEvalTargetRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SearchEvalTargetRequest(%+v)", *p) - -} - -func (p *SearchEvalTargetRequest) DeepEqual(ano *SearchEvalTargetRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.WorkspaceID) { - return false - } - if !p.Field2DeepEqual(ano.Keyword) { - return false - } - if !p.Field20DeepEqual(ano.Ext) { - return false - } - if !p.Field100DeepEqual(ano.PageSize) { - return false - } - if !p.Field101DeepEqual(ano.PageToken) { - return false - } - if !p.Field255DeepEqual(ano.Base) { - return false - } - return true -} - -func (p *SearchEvalTargetRequest) Field1DeepEqual(src *int64) bool { - - if p.WorkspaceID == src { - return true - } else if p.WorkspaceID == nil || src == nil { - return false - } - if *p.WorkspaceID != *src { - return false - } - return true -} -func (p *SearchEvalTargetRequest) Field2DeepEqual(src *string) bool { - - if p.Keyword == src { - return true - } else if p.Keyword == nil || src == nil { - return false - } - if strings.Compare(*p.Keyword, *src) != 0 { - return false - } - return true -} -func (p *SearchEvalTargetRequest) Field20DeepEqual(src map[string]string) bool { - - if len(p.Ext) != len(src) { - return false - } - for k, v := range p.Ext { - _src := src[k] - if strings.Compare(v, _src) != 0 { - return false - } - } - return true -} -func (p *SearchEvalTargetRequest) Field100DeepEqual(src *int32) bool { - - if p.PageSize == src { - return true - } else if p.PageSize == nil || src == nil { - return false - } - if *p.PageSize != *src { - return false - } - return true -} -func (p *SearchEvalTargetRequest) Field101DeepEqual(src *string) bool { - - if p.PageToken == src { - return true - } else if p.PageToken == nil || src == nil { - return false - } - if strings.Compare(*p.PageToken, *src) != 0 { - return false - } - return true -} -func (p *SearchEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { - - if !p.Base.DeepEqual(src) { - return false - } - return true -} - -type SearchEvalTargetResponse struct { - CustomEvalTargets []*CustomEvalTarget `thrift:"custom_eval_targets,1,optional" frugal:"1,optional,list" form:"custom_eval_targets" json:"custom_eval_targets,omitempty" query:"custom_eval_targets"` - NextPageToken *string `thrift:"next_page_token,100,optional" frugal:"100,optional,string" form:"next_page_token" json:"next_page_token,omitempty" query:"next_page_token"` - HasMore *bool `thrift:"has_more,101,optional" frugal:"101,optional,bool" form:"has_more" json:"has_more,omitempty" query:"has_more"` - BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` -} - -func NewSearchEvalTargetResponse() *SearchEvalTargetResponse { - return &SearchEvalTargetResponse{} -} - -func (p *SearchEvalTargetResponse) InitDefault() { -} - -var SearchEvalTargetResponse_CustomEvalTargets_DEFAULT []*CustomEvalTarget - -func (p *SearchEvalTargetResponse) GetCustomEvalTargets() (v []*CustomEvalTarget) { - if p == nil { - return - } - if !p.IsSetCustomEvalTargets() { - return SearchEvalTargetResponse_CustomEvalTargets_DEFAULT - } - return p.CustomEvalTargets -} - -var SearchEvalTargetResponse_NextPageToken_DEFAULT string - -func (p *SearchEvalTargetResponse) GetNextPageToken() (v string) { - if p == nil { - return - } - if !p.IsSetNextPageToken() { - return SearchEvalTargetResponse_NextPageToken_DEFAULT - } - return *p.NextPageToken -} - -var SearchEvalTargetResponse_HasMore_DEFAULT bool - -func (p *SearchEvalTargetResponse) GetHasMore() (v bool) { - if p == nil { - return - } - if !p.IsSetHasMore() { - return SearchEvalTargetResponse_HasMore_DEFAULT - } - return *p.HasMore -} - -var SearchEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *SearchEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { - if p == nil { - return - } - if !p.IsSetBaseResp() { - return SearchEvalTargetResponse_BaseResp_DEFAULT - } - return p.BaseResp -} -func (p *SearchEvalTargetResponse) SetCustomEvalTargets(val []*CustomEvalTarget) { - p.CustomEvalTargets = val -} -func (p *SearchEvalTargetResponse) SetNextPageToken(val *string) { - p.NextPageToken = val -} -func (p *SearchEvalTargetResponse) SetHasMore(val *bool) { - p.HasMore = val -} -func (p *SearchEvalTargetResponse) SetBaseResp(val *base.BaseResp) { - p.BaseResp = val -} - -var fieldIDToName_SearchEvalTargetResponse = map[int16]string{ - 1: "custom_eval_targets", - 100: "next_page_token", - 101: "has_more", - 255: "BaseResp", -} - -func (p *SearchEvalTargetResponse) IsSetCustomEvalTargets() bool { - return p.CustomEvalTargets != nil -} - -func (p *SearchEvalTargetResponse) IsSetNextPageToken() bool { - return p.NextPageToken != nil -} - -func (p *SearchEvalTargetResponse) IsSetHasMore() bool { - return p.HasMore != nil -} - -func (p *SearchEvalTargetResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *SearchEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 100: - if fieldTypeId == thrift.STRING { - if err = p.ReadField100(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 101: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField101(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *SearchEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*CustomEvalTarget, 0, size) - values := make([]CustomEvalTarget, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.CustomEvalTargets = _field - return nil -} -func (p *SearchEvalTargetResponse) ReadField100(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.NextPageToken = _field - return nil -} -func (p *SearchEvalTargetResponse) ReadField101(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.HasMore = _field - return nil -} -func (p *SearchEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *SearchEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SearchEvalTargetResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField100(oprot); err != nil { - fieldId = 100 - goto WriteFieldError - } - if err = p.writeField101(oprot); err != nil { - fieldId = 101 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *SearchEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomEvalTargets() { - if err = oprot.WriteFieldBegin("custom_eval_targets", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CustomEvalTargets)); err != nil { - return err - } - for _, v := range p.CustomEvalTargets { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *SearchEvalTargetResponse) writeField100(oprot thrift.TProtocol) (err error) { - if p.IsSetNextPageToken() { - if err = oprot.WriteFieldBegin("next_page_token", thrift.STRING, 100); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.NextPageToken); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) -} -func (p *SearchEvalTargetResponse) writeField101(oprot thrift.TProtocol) (err error) { - if p.IsSetHasMore() { - if err = oprot.WriteFieldBegin("has_more", thrift.BOOL, 101); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.HasMore); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) -} -func (p *SearchEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *SearchEvalTargetResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SearchEvalTargetResponse(%+v)", *p) - -} - -func (p *SearchEvalTargetResponse) DeepEqual(ano *SearchEvalTargetResponse) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.CustomEvalTargets) { - return false - } - if !p.Field100DeepEqual(ano.NextPageToken) { - return false - } - if !p.Field101DeepEqual(ano.HasMore) { - return false - } - if !p.Field255DeepEqual(ano.BaseResp) { - return false - } - return true -} - -func (p *SearchEvalTargetResponse) Field1DeepEqual(src []*CustomEvalTarget) bool { - - if len(p.CustomEvalTargets) != len(src) { - return false - } - for i, v := range p.CustomEvalTargets { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} -func (p *SearchEvalTargetResponse) Field100DeepEqual(src *string) bool { - - if p.NextPageToken == src { - return true - } else if p.NextPageToken == nil || src == nil { - return false - } - if strings.Compare(*p.NextPageToken, *src) != 0 { - return false - } - return true -} -func (p *SearchEvalTargetResponse) Field101DeepEqual(src *bool) bool { - - if p.HasMore == src { - return true - } else if p.HasMore == nil || src == nil { - return false - } - if *p.HasMore != *src { - return false - } - return true -} -func (p *SearchEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { - - if !p.BaseResp.DeepEqual(src) { - return false - } - return true -} - -type CustomEvalTarget struct { - // 唯一键,平台不消费,仅做透传 - ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` - // 名称,平台用于展示在对象搜索下拉列表 - Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` - // 头像url,平台用于展示在对象搜索下拉列表 - AvatarURL *string `thrift:"avatar_url,3,optional" frugal:"3,optional,string" form:"avatar_url" json:"avatar_url,omitempty" query:"avatar_url"` -} - -func NewCustomEvalTarget() *CustomEvalTarget { - return &CustomEvalTarget{} -} - -func (p *CustomEvalTarget) InitDefault() { -} - -var CustomEvalTarget_ID_DEFAULT string - -func (p *CustomEvalTarget) GetID() (v string) { - if p == nil { - return - } - if !p.IsSetID() { - return CustomEvalTarget_ID_DEFAULT - } - return *p.ID -} - -var CustomEvalTarget_Name_DEFAULT string - -func (p *CustomEvalTarget) GetName() (v string) { - if p == nil { - return - } - if !p.IsSetName() { - return CustomEvalTarget_Name_DEFAULT - } - return *p.Name -} - -var CustomEvalTarget_AvatarURL_DEFAULT string - -func (p *CustomEvalTarget) GetAvatarURL() (v string) { - if p == nil { - return - } - if !p.IsSetAvatarURL() { - return CustomEvalTarget_AvatarURL_DEFAULT - } - return *p.AvatarURL -} -func (p *CustomEvalTarget) SetID(val *string) { - p.ID = val -} -func (p *CustomEvalTarget) SetName(val *string) { - p.Name = val -} -func (p *CustomEvalTarget) SetAvatarURL(val *string) { - p.AvatarURL = val -} - -var fieldIDToName_CustomEvalTarget = map[int16]string{ - 1: "id", - 2: "name", - 3: "avatar_url", -} - -func (p *CustomEvalTarget) IsSetID() bool { - return p.ID != nil -} - -func (p *CustomEvalTarget) IsSetName() bool { - return p.Name != nil -} - -func (p *CustomEvalTarget) IsSetAvatarURL() bool { - return p.AvatarURL != nil -} - -func (p *CustomEvalTarget) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *CustomEvalTarget) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ID = _field - return nil -} -func (p *CustomEvalTarget) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Name = _field - return nil -} -func (p *CustomEvalTarget) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.AvatarURL = _field - return nil -} - -func (p *CustomEvalTarget) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CustomEvalTarget"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *CustomEvalTarget) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetID() { - if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *CustomEvalTarget) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetName() { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *CustomEvalTarget) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetAvatarURL() { - if err = oprot.WriteFieldBegin("avatar_url", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.AvatarURL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *CustomEvalTarget) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CustomEvalTarget(%+v)", *p) - -} - -func (p *CustomEvalTarget) DeepEqual(ano *CustomEvalTarget) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ID) { - return false - } - if !p.Field2DeepEqual(ano.Name) { - return false - } - if !p.Field3DeepEqual(ano.AvatarURL) { - return false - } - return true -} - -func (p *CustomEvalTarget) Field1DeepEqual(src *string) bool { - - if p.ID == src { - return true - } else if p.ID == nil || src == nil { - return false - } - if strings.Compare(*p.ID, *src) != 0 { - return false - } - return true -} -func (p *CustomEvalTarget) Field2DeepEqual(src *string) bool { - - if p.Name == src { - return true - } else if p.Name == nil || src == nil { - return false - } - if strings.Compare(*p.Name, *src) != 0 { - return false - } - return true -} -func (p *CustomEvalTarget) Field3DeepEqual(src *string) bool { - - if p.AvatarURL == src { - return true - } else if p.AvatarURL == nil || src == nil { - return false - } - if strings.Compare(*p.AvatarURL, *src) != 0 { - return false - } - return true -} - -type InvokeEvalTargetRequest struct { - // 空间id - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` - // 输入信息 - Input *InvokeEvalTargetInput `thrift:"input,2,optional" frugal:"2,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` - // 如果创建实验时选了二级对象,则会透传search接口返回的二级对象信息 - CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,3,optional" frugal:"3,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` -} - -func NewInvokeEvalTargetRequest() *InvokeEvalTargetRequest { - return &InvokeEvalTargetRequest{} -} - -func (p *InvokeEvalTargetRequest) InitDefault() { -} - -var InvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 - -func (p *InvokeEvalTargetRequest) GetWorkspaceID() (v int64) { - if p == nil { - return - } - if !p.IsSetWorkspaceID() { - return InvokeEvalTargetRequest_WorkspaceID_DEFAULT - } - return *p.WorkspaceID -} - -var InvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput - -func (p *InvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { - if p == nil { - return - } - if !p.IsSetInput() { - return InvokeEvalTargetRequest_Input_DEFAULT - } - return p.Input -} - -var InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget - -func (p *InvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { - if p == nil { - return - } - if !p.IsSetCustomEvalTarget() { - return InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT - } - return p.CustomEvalTarget -} - -var InvokeEvalTargetRequest_Base_DEFAULT *base.Base - -func (p *InvokeEvalTargetRequest) GetBase() (v *base.Base) { - if p == nil { - return - } - if !p.IsSetBase() { - return InvokeEvalTargetRequest_Base_DEFAULT - } - return p.Base -} -func (p *InvokeEvalTargetRequest) SetWorkspaceID(val *int64) { - p.WorkspaceID = val -} -func (p *InvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { - p.Input = val -} -func (p *InvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { - p.CustomEvalTarget = val -} -func (p *InvokeEvalTargetRequest) SetBase(val *base.Base) { - p.Base = val -} - -var fieldIDToName_InvokeEvalTargetRequest = map[int16]string{ - 1: "workspace_id", - 2: "input", - 3: "custom_eval_target", - 255: "Base", -} - -func (p *InvokeEvalTargetRequest) IsSetWorkspaceID() bool { - return p.WorkspaceID != nil -} - -func (p *InvokeEvalTargetRequest) IsSetInput() bool { - return p.Input != nil -} - -func (p *InvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { - return p.CustomEvalTarget != nil -} - -func (p *InvokeEvalTargetRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *InvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *InvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.WorkspaceID = _field - return nil -} -func (p *InvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetInput() - if err := _field.Read(iprot); err != nil { - return err - } - p.Input = _field - return nil -} -func (p *InvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { - _field := NewCustomEvalTarget() - if err := _field.Read(iprot); err != nil { - return err - } - p.CustomEvalTarget = _field - return nil -} -func (p *InvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *InvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTargetRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *InvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetWorkspaceID() { - if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.WorkspaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *InvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetInput() { - if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.Input.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *InvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomEvalTarget() { - if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.CustomEvalTarget.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *InvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *InvokeEvalTargetRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("InvokeEvalTargetRequest(%+v)", *p) - -} - -func (p *InvokeEvalTargetRequest) DeepEqual(ano *InvokeEvalTargetRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.WorkspaceID) { - return false - } - if !p.Field2DeepEqual(ano.Input) { - return false - } - if !p.Field3DeepEqual(ano.CustomEvalTarget) { - return false - } - if !p.Field255DeepEqual(ano.Base) { - return false - } - return true -} - -func (p *InvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { - - if p.WorkspaceID == src { - return true - } else if p.WorkspaceID == nil || src == nil { - return false - } - if *p.WorkspaceID != *src { - return false - } - return true -} -func (p *InvokeEvalTargetRequest) Field2DeepEqual(src *InvokeEvalTargetInput) bool { - - if !p.Input.DeepEqual(src) { - return false - } - return true -} -func (p *InvokeEvalTargetRequest) Field3DeepEqual(src *CustomEvalTarget) bool { - - if !p.CustomEvalTarget.DeepEqual(src) { - return false - } - return true -} -func (p *InvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { - - if !p.Base.DeepEqual(src) { - return false - } - return true -} - -type InvokeEvalTargetResponse struct { - // 输出 - Output *InvokeEvalTargetOutput `thrift:"output,1,optional" frugal:"1,optional,InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` - // 消耗 - Usage *InvokeEvalTargetUsage `thrift:"usage,2,optional" frugal:"2,optional,InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` - BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` -} - -func NewInvokeEvalTargetResponse() *InvokeEvalTargetResponse { - return &InvokeEvalTargetResponse{} -} - -func (p *InvokeEvalTargetResponse) InitDefault() { -} - -var InvokeEvalTargetResponse_Output_DEFAULT *InvokeEvalTargetOutput - -func (p *InvokeEvalTargetResponse) GetOutput() (v *InvokeEvalTargetOutput) { - if p == nil { - return - } - if !p.IsSetOutput() { - return InvokeEvalTargetResponse_Output_DEFAULT - } - return p.Output -} - -var InvokeEvalTargetResponse_Usage_DEFAULT *InvokeEvalTargetUsage - -func (p *InvokeEvalTargetResponse) GetUsage() (v *InvokeEvalTargetUsage) { - if p == nil { - return - } - if !p.IsSetUsage() { - return InvokeEvalTargetResponse_Usage_DEFAULT - } - return p.Usage -} - -var InvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *InvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { - if p == nil { - return - } - if !p.IsSetBaseResp() { - return InvokeEvalTargetResponse_BaseResp_DEFAULT - } - return p.BaseResp -} -func (p *InvokeEvalTargetResponse) SetOutput(val *InvokeEvalTargetOutput) { - p.Output = val -} -func (p *InvokeEvalTargetResponse) SetUsage(val *InvokeEvalTargetUsage) { - p.Usage = val -} -func (p *InvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { - p.BaseResp = val -} - -var fieldIDToName_InvokeEvalTargetResponse = map[int16]string{ - 1: "output", - 2: "usage", - 255: "BaseResp", -} - -func (p *InvokeEvalTargetResponse) IsSetOutput() bool { - return p.Output != nil -} - -func (p *InvokeEvalTargetResponse) IsSetUsage() bool { - return p.Usage != nil -} - -func (p *InvokeEvalTargetResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *InvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *InvokeEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetOutput() - if err := _field.Read(iprot); err != nil { - return err - } - p.Output = _field - return nil -} -func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetUsage() - if err := _field.Read(iprot); err != nil { - return err - } - p.Usage = _field - return nil -} -func (p *InvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *InvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTargetResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *InvokeEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetOutput() { - if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Output.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *InvokeEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetUsage() { - if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.Usage.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *InvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *InvokeEvalTargetResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("InvokeEvalTargetResponse(%+v)", *p) - -} - -func (p *InvokeEvalTargetResponse) DeepEqual(ano *InvokeEvalTargetResponse) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Output) { - return false - } - if !p.Field2DeepEqual(ano.Usage) { - return false - } - if !p.Field255DeepEqual(ano.BaseResp) { - return false - } - return true -} - -func (p *InvokeEvalTargetResponse) Field1DeepEqual(src *InvokeEvalTargetOutput) bool { - - if !p.Output.DeepEqual(src) { - return false - } - return true -} -func (p *InvokeEvalTargetResponse) Field2DeepEqual(src *InvokeEvalTargetUsage) bool { - - if !p.Usage.DeepEqual(src) { - return false - } - return true -} -func (p *InvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { - - if !p.BaseResp.DeepEqual(src) { - return false - } - return true -} - -type InvokeEvalTargetInput struct { - // 评测集字段信息,key=评测集列名,value=评测集列值 - EvalSetFields map[string]*Content `thrift:"eval_set_fields,1,optional" frugal:"1,optional,map" form:"eval_set_fields" json:"eval_set_fields,omitempty" query:"eval_set_fields"` - // 扩展字段,动态参数会通过ext字段传递 - Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` -} - -func NewInvokeEvalTargetInput() *InvokeEvalTargetInput { - return &InvokeEvalTargetInput{} -} - -func (p *InvokeEvalTargetInput) InitDefault() { -} - -var InvokeEvalTargetInput_EvalSetFields_DEFAULT map[string]*Content - -func (p *InvokeEvalTargetInput) GetEvalSetFields() (v map[string]*Content) { - if p == nil { - return - } - if !p.IsSetEvalSetFields() { - return InvokeEvalTargetInput_EvalSetFields_DEFAULT - } - return p.EvalSetFields -} - -var InvokeEvalTargetInput_Ext_DEFAULT map[string]string - -func (p *InvokeEvalTargetInput) GetExt() (v map[string]string) { - if p == nil { - return - } - if !p.IsSetExt() { - return InvokeEvalTargetInput_Ext_DEFAULT - } - return p.Ext -} -func (p *InvokeEvalTargetInput) SetEvalSetFields(val map[string]*Content) { - p.EvalSetFields = val -} -func (p *InvokeEvalTargetInput) SetExt(val map[string]string) { - p.Ext = val -} - -var fieldIDToName_InvokeEvalTargetInput = map[int16]string{ - 1: "eval_set_fields", - 20: "ext", -} - -func (p *InvokeEvalTargetInput) IsSetEvalSetFields() bool { - return p.EvalSetFields != nil -} - -func (p *InvokeEvalTargetInput) IsSetExt() bool { - return p.Ext != nil -} - -func (p *InvokeEvalTargetInput) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 20: - if fieldTypeId == thrift.MAP { - if err = p.ReadField20(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *InvokeEvalTargetInput) ReadField1(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]*Content, size) - values := make([]Content, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - _val := &values[i] - _val.InitDefault() - if err := _val.Read(iprot); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.EvalSetFields = _field - return nil -} -func (p *InvokeEvalTargetInput) ReadField20(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.Ext = _field - return nil -} - -func (p *InvokeEvalTargetInput) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTargetInput"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField20(oprot); err != nil { - fieldId = 20 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *InvokeEvalTargetInput) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetEvalSetFields() { - if err = oprot.WriteFieldBegin("eval_set_fields", thrift.MAP, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.EvalSetFields)); err != nil { - return err - } - for k, v := range p.EvalSetFields { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *InvokeEvalTargetInput) writeField20(oprot thrift.TProtocol) (err error) { - if p.IsSetExt() { - if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { - return err - } - for k, v := range p.Ext { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) -} - -func (p *InvokeEvalTargetInput) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("InvokeEvalTargetInput(%+v)", *p) - -} - -func (p *InvokeEvalTargetInput) DeepEqual(ano *InvokeEvalTargetInput) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.EvalSetFields) { - return false - } - if !p.Field20DeepEqual(ano.Ext) { - return false - } - return true -} - -func (p *InvokeEvalTargetInput) Field1DeepEqual(src map[string]*Content) bool { - - if len(p.EvalSetFields) != len(src) { - return false - } - for k, v := range p.EvalSetFields { - _src := src[k] - if !v.DeepEqual(_src) { - return false - } - } - return true -} -func (p *InvokeEvalTargetInput) Field20DeepEqual(src map[string]string) bool { - - if len(p.Ext) != len(src) { - return false - } - for k, v := range p.Ext { - _src := src[k] - if strings.Compare(v, _src) != 0 { - return false - } - } - return true -} - -// 新增 -type InvokeEvalTargetOutput struct { - // 实际输出 - ActualOutput *Content `thrift:"actual_output,1,optional" frugal:"1,optional,Content" form:"actual_output" json:"actual_output,omitempty" query:"actual_output"` - // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 - Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` -} - -func NewInvokeEvalTargetOutput() *InvokeEvalTargetOutput { - return &InvokeEvalTargetOutput{} -} - -func (p *InvokeEvalTargetOutput) InitDefault() { -} - -var InvokeEvalTargetOutput_ActualOutput_DEFAULT *Content - -func (p *InvokeEvalTargetOutput) GetActualOutput() (v *Content) { - if p == nil { - return - } - if !p.IsSetActualOutput() { - return InvokeEvalTargetOutput_ActualOutput_DEFAULT - } - return p.ActualOutput -} - -var InvokeEvalTargetOutput_Ext_DEFAULT map[string]string - -func (p *InvokeEvalTargetOutput) GetExt() (v map[string]string) { - if p == nil { - return - } - if !p.IsSetExt() { - return InvokeEvalTargetOutput_Ext_DEFAULT - } - return p.Ext -} -func (p *InvokeEvalTargetOutput) SetActualOutput(val *Content) { - p.ActualOutput = val -} -func (p *InvokeEvalTargetOutput) SetExt(val map[string]string) { - p.Ext = val -} - -var fieldIDToName_InvokeEvalTargetOutput = map[int16]string{ - 1: "actual_output", - 20: "ext", -} - -func (p *InvokeEvalTargetOutput) IsSetActualOutput() bool { - return p.ActualOutput != nil -} - -func (p *InvokeEvalTargetOutput) IsSetExt() bool { - return p.Ext != nil -} - -func (p *InvokeEvalTargetOutput) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 20: - if fieldTypeId == thrift.MAP { - if err = p.ReadField20(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *InvokeEvalTargetOutput) ReadField1(iprot thrift.TProtocol) error { - _field := NewContent() - if err := _field.Read(iprot); err != nil { - return err - } - p.ActualOutput = _field - return nil -} -func (p *InvokeEvalTargetOutput) ReadField20(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.Ext = _field - return nil -} - -func (p *InvokeEvalTargetOutput) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTargetOutput"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField20(oprot); err != nil { - fieldId = 20 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *InvokeEvalTargetOutput) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetActualOutput() { - if err = oprot.WriteFieldBegin("actual_output", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.ActualOutput.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *InvokeEvalTargetOutput) writeField20(oprot thrift.TProtocol) (err error) { - if p.IsSetExt() { - if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { - return err - } - for k, v := range p.Ext { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) -} - -func (p *InvokeEvalTargetOutput) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("InvokeEvalTargetOutput(%+v)", *p) - -} - -func (p *InvokeEvalTargetOutput) DeepEqual(ano *InvokeEvalTargetOutput) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ActualOutput) { - return false - } - if !p.Field20DeepEqual(ano.Ext) { - return false - } - return true -} - -func (p *InvokeEvalTargetOutput) Field1DeepEqual(src *Content) bool { - - if !p.ActualOutput.DeepEqual(src) { - return false - } - return true -} -func (p *InvokeEvalTargetOutput) Field20DeepEqual(src map[string]string) bool { - - if len(p.Ext) != len(src) { - return false - } - for k, v := range p.Ext { - _src := src[k] - if strings.Compare(v, _src) != 0 { - return false - } - } - return true -} - -type Content struct { - // 类型 - ContentType *ContentType `thrift:"content_type,1,optional" frugal:"1,optional,string" form:"content_type" json:"content_type,omitempty" query:"content_type"` - // 当content_type=text,则从此字段中取值 - Text *string `thrift:"text,10,optional" frugal:"10,optional,string" form:"text" json:"text,omitempty" query:"text"` - // 当content_type=image,则从此字段中取图片信息 - Image *Image `thrift:"image,11,optional" frugal:"11,optional,Image" form:"image" json:"image,omitempty" query:"image"` - // 当content_type=multi_part,则从此字段遍历获取多模态的值 - MultiPart []*Content `thrift:"multi_part,12,optional" frugal:"12,optional,list" form:"multi_part" json:"multi_part,omitempty" query:"multi_part"` -} - -func NewContent() *Content { - return &Content{} -} - -func (p *Content) InitDefault() { -} - -var Content_ContentType_DEFAULT ContentType - -func (p *Content) GetContentType() (v ContentType) { - if p == nil { - return - } - if !p.IsSetContentType() { - return Content_ContentType_DEFAULT - } - return *p.ContentType -} - -var Content_Text_DEFAULT string - -func (p *Content) GetText() (v string) { - if p == nil { - return - } - if !p.IsSetText() { - return Content_Text_DEFAULT - } - return *p.Text -} - -var Content_Image_DEFAULT *Image - -func (p *Content) GetImage() (v *Image) { - if p == nil { - return - } - if !p.IsSetImage() { - return Content_Image_DEFAULT - } - return p.Image -} - -var Content_MultiPart_DEFAULT []*Content - -func (p *Content) GetMultiPart() (v []*Content) { - if p == nil { - return - } - if !p.IsSetMultiPart() { - return Content_MultiPart_DEFAULT - } - return p.MultiPart -} -func (p *Content) SetContentType(val *ContentType) { - p.ContentType = val -} -func (p *Content) SetText(val *string) { - p.Text = val -} -func (p *Content) SetImage(val *Image) { - p.Image = val -} -func (p *Content) SetMultiPart(val []*Content) { - p.MultiPart = val -} - -var fieldIDToName_Content = map[int16]string{ - 1: "content_type", - 10: "text", - 11: "image", - 12: "multi_part", -} - -func (p *Content) IsSetContentType() bool { - return p.ContentType != nil -} - -func (p *Content) IsSetText() bool { - return p.Text != nil -} - -func (p *Content) IsSetImage() bool { - return p.Image != nil -} - -func (p *Content) IsSetMultiPart() bool { - return p.MultiPart != nil -} - -func (p *Content) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.STRING { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 12: - if fieldTypeId == thrift.LIST { - if err = p.ReadField12(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *Content) ReadField1(iprot thrift.TProtocol) error { - - var _field *ContentType - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.ContentType = _field - return nil -} -func (p *Content) ReadField10(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Text = _field - return nil -} -func (p *Content) ReadField11(iprot thrift.TProtocol) error { - _field := NewImage() - if err := _field.Read(iprot); err != nil { - return err - } - p.Image = _field - return nil -} -func (p *Content) ReadField12(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*Content, 0, size) - values := make([]Content, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.MultiPart = _field - return nil -} - -func (p *Content) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("Content"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField12(oprot); err != nil { - fieldId = 12 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *Content) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetContentType() { - if err = oprot.WriteFieldBegin("content_type", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.ContentType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *Content) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetText() { - if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Text); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) -} -func (p *Content) writeField11(oprot thrift.TProtocol) (err error) { - if p.IsSetImage() { - if err = oprot.WriteFieldBegin("image", thrift.STRUCT, 11); err != nil { - goto WriteFieldBeginError - } - if err := p.Image.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} -func (p *Content) writeField12(oprot thrift.TProtocol) (err error) { - if p.IsSetMultiPart() { - if err = oprot.WriteFieldBegin("multi_part", thrift.LIST, 12); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MultiPart)); err != nil { - return err - } - for _, v := range p.MultiPart { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) -} - -func (p *Content) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Content(%+v)", *p) - -} - -func (p *Content) DeepEqual(ano *Content) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ContentType) { - return false - } - if !p.Field10DeepEqual(ano.Text) { - return false - } - if !p.Field11DeepEqual(ano.Image) { - return false - } - if !p.Field12DeepEqual(ano.MultiPart) { - return false - } - return true -} - -func (p *Content) Field1DeepEqual(src *ContentType) bool { - - if p.ContentType == src { - return true - } else if p.ContentType == nil || src == nil { - return false - } - if strings.Compare(*p.ContentType, *src) != 0 { - return false - } - return true -} -func (p *Content) Field10DeepEqual(src *string) bool { - - if p.Text == src { - return true - } else if p.Text == nil || src == nil { - return false - } - if strings.Compare(*p.Text, *src) != 0 { - return false - } - return true -} -func (p *Content) Field11DeepEqual(src *Image) bool { - - if !p.Image.DeepEqual(src) { - return false - } - return true -} -func (p *Content) Field12DeepEqual(src []*Content) bool { - - if len(p.MultiPart) != len(src) { - return false - } - for i, v := range p.MultiPart { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - -type Image struct { - URL *string `thrift:"url,1,optional" frugal:"1,optional,string" form:"url" json:"url,omitempty" query:"url"` -} - -func NewImage() *Image { - return &Image{} -} - -func (p *Image) InitDefault() { -} - -var Image_URL_DEFAULT string - -func (p *Image) GetURL() (v string) { - if p == nil { - return - } - if !p.IsSetURL() { - return Image_URL_DEFAULT - } - return *p.URL -} -func (p *Image) SetURL(val *string) { - p.URL = val -} - -var fieldIDToName_Image = map[int16]string{ - 1: "url", -} - -func (p *Image) IsSetURL() bool { - return p.URL != nil -} - -func (p *Image) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *Image) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.URL = _field - return nil -} - -func (p *Image) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("Image"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *Image) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetURL() { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.URL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *Image) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Image(%+v)", *p) - -} - -func (p *Image) DeepEqual(ano *Image) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.URL) { - return false - } - return true -} - -func (p *Image) Field1DeepEqual(src *string) bool { - - if p.URL == src { - return true - } else if p.URL == nil || src == nil { - return false - } - if strings.Compare(*p.URL, *src) != 0 { - return false - } - return true -} - -type InvokeEvalTargetUsage struct { - // 输入token消耗 - InputTokens *int64 `thrift:"input_tokens,1,optional" frugal:"1,optional,i64" form:"input_tokens" json:"input_tokens,omitempty" query:"input_tokens"` - // 输出token消耗 - OutputTokens *int64 `thrift:"output_tokens,2,optional" frugal:"2,optional,i64" form:"output_tokens" json:"output_tokens,omitempty" query:"output_tokens"` -} - -func NewInvokeEvalTargetUsage() *InvokeEvalTargetUsage { - return &InvokeEvalTargetUsage{} -} - -func (p *InvokeEvalTargetUsage) InitDefault() { -} - -var InvokeEvalTargetUsage_InputTokens_DEFAULT int64 - -func (p *InvokeEvalTargetUsage) GetInputTokens() (v int64) { - if p == nil { - return - } - if !p.IsSetInputTokens() { - return InvokeEvalTargetUsage_InputTokens_DEFAULT - } - return *p.InputTokens -} - -var InvokeEvalTargetUsage_OutputTokens_DEFAULT int64 - -func (p *InvokeEvalTargetUsage) GetOutputTokens() (v int64) { - if p == nil { - return - } - if !p.IsSetOutputTokens() { - return InvokeEvalTargetUsage_OutputTokens_DEFAULT - } - return *p.OutputTokens -} -func (p *InvokeEvalTargetUsage) SetInputTokens(val *int64) { - p.InputTokens = val -} -func (p *InvokeEvalTargetUsage) SetOutputTokens(val *int64) { - p.OutputTokens = val -} - -var fieldIDToName_InvokeEvalTargetUsage = map[int16]string{ - 1: "input_tokens", - 2: "output_tokens", -} - -func (p *InvokeEvalTargetUsage) IsSetInputTokens() bool { - return p.InputTokens != nil -} - -func (p *InvokeEvalTargetUsage) IsSetOutputTokens() bool { - return p.OutputTokens != nil -} - -func (p *InvokeEvalTargetUsage) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *InvokeEvalTargetUsage) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.InputTokens = _field - return nil -} -func (p *InvokeEvalTargetUsage) ReadField2(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.OutputTokens = _field - return nil -} - -func (p *InvokeEvalTargetUsage) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTargetUsage"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *InvokeEvalTargetUsage) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetInputTokens() { - if err = oprot.WriteFieldBegin("input_tokens", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.InputTokens); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *InvokeEvalTargetUsage) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetOutputTokens() { - if err = oprot.WriteFieldBegin("output_tokens", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.OutputTokens); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *InvokeEvalTargetUsage) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("InvokeEvalTargetUsage(%+v)", *p) - -} - -func (p *InvokeEvalTargetUsage) DeepEqual(ano *InvokeEvalTargetUsage) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.InputTokens) { - return false - } - if !p.Field2DeepEqual(ano.OutputTokens) { - return false - } - return true -} - -func (p *InvokeEvalTargetUsage) Field1DeepEqual(src *int64) bool { - - if p.InputTokens == src { - return true - } else if p.InputTokens == nil || src == nil { - return false - } - if *p.InputTokens != *src { - return false - } - return true -} -func (p *InvokeEvalTargetUsage) Field2DeepEqual(src *int64) bool { - - if p.OutputTokens == src { - return true - } else if p.OutputTokens == nil || src == nil { - return false - } - if *p.OutputTokens != *src { - return false - } - return true -} - -type AsyncInvokeEvalTargetRequest struct { - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` - // 执行id,传递给自定义对象,在回传结果时透传 - InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` - // 根据invoke_id签发的token,在回传结果时透传 - Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` - // 执行输入信息 - Input *InvokeEvalTargetInput `thrift:"input,4,optional" frugal:"4,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` - // 如果创建实验时选了二级对象,则会透传二级对象信息 - CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,5,optional" frugal:"5,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` -} - -func NewAsyncInvokeEvalTargetRequest() *AsyncInvokeEvalTargetRequest { - return &AsyncInvokeEvalTargetRequest{} -} - -func (p *AsyncInvokeEvalTargetRequest) InitDefault() { -} - -var AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 - -func (p *AsyncInvokeEvalTargetRequest) GetWorkspaceID() (v int64) { - if p == nil { - return - } - if !p.IsSetWorkspaceID() { - return AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT - } - return *p.WorkspaceID -} - -var AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT int64 - -func (p *AsyncInvokeEvalTargetRequest) GetInvokeID() (v int64) { - if p == nil { - return - } - if !p.IsSetInvokeID() { - return AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT - } - return *p.InvokeID -} - -var AsyncInvokeEvalTargetRequest_Token_DEFAULT string - -func (p *AsyncInvokeEvalTargetRequest) GetToken() (v string) { - if p == nil { - return - } - if !p.IsSetToken() { - return AsyncInvokeEvalTargetRequest_Token_DEFAULT - } - return *p.Token -} - -var AsyncInvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput - -func (p *AsyncInvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { - if p == nil { - return - } - if !p.IsSetInput() { - return AsyncInvokeEvalTargetRequest_Input_DEFAULT - } - return p.Input -} - -var AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget - -func (p *AsyncInvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { - if p == nil { - return - } - if !p.IsSetCustomEvalTarget() { - return AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT - } - return p.CustomEvalTarget -} - -var AsyncInvokeEvalTargetRequest_Base_DEFAULT *base.Base - -func (p *AsyncInvokeEvalTargetRequest) GetBase() (v *base.Base) { - if p == nil { - return - } - if !p.IsSetBase() { - return AsyncInvokeEvalTargetRequest_Base_DEFAULT - } - return p.Base -} -func (p *AsyncInvokeEvalTargetRequest) SetWorkspaceID(val *int64) { - p.WorkspaceID = val -} -func (p *AsyncInvokeEvalTargetRequest) SetInvokeID(val *int64) { - p.InvokeID = val -} -func (p *AsyncInvokeEvalTargetRequest) SetToken(val *string) { - p.Token = val -} -func (p *AsyncInvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { - p.Input = val -} -func (p *AsyncInvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { - p.CustomEvalTarget = val -} -func (p *AsyncInvokeEvalTargetRequest) SetBase(val *base.Base) { - p.Base = val -} - -var fieldIDToName_AsyncInvokeEvalTargetRequest = map[int16]string{ - 1: "workspace_id", - 2: "invoke_id", - 3: "token", - 4: "input", - 5: "custom_eval_target", - 255: "Base", -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetWorkspaceID() bool { - return p.WorkspaceID != nil -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetInvokeID() bool { - return p.InvokeID != nil -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetToken() bool { - return p.Token != nil -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetInput() bool { - return p.Input != nil -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { - return p.CustomEvalTarget != nil -} - -func (p *AsyncInvokeEvalTargetRequest) IsSetBase() bool { - return p.Base != nil -} - -func (p *AsyncInvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.WorkspaceID = _field - return nil -} -func (p *AsyncInvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.InvokeID = _field - return nil -} -func (p *AsyncInvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Token = _field - return nil -} -func (p *AsyncInvokeEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetInput() - if err := _field.Read(iprot); err != nil { - return err - } - p.Input = _field - return nil -} -func (p *AsyncInvokeEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { - _field := NewCustomEvalTarget() - if err := _field.Read(iprot); err != nil { - return err - } - p.CustomEvalTarget = _field - return nil -} -func (p *AsyncInvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *AsyncInvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetWorkspaceID() { - if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.WorkspaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *AsyncInvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetInvokeID() { - if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.InvokeID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *AsyncInvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetToken() { - if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Token); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *AsyncInvokeEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetInput() { - if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 4); err != nil { - goto WriteFieldBeginError - } - if err := p.Input.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} -func (p *AsyncInvokeEvalTargetRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomEvalTarget() { - if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.CustomEvalTarget.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} -func (p *AsyncInvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AsyncInvokeEvalTargetRequest(%+v)", *p) - -} - -func (p *AsyncInvokeEvalTargetRequest) DeepEqual(ano *AsyncInvokeEvalTargetRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.WorkspaceID) { - return false - } - if !p.Field2DeepEqual(ano.InvokeID) { - return false - } - if !p.Field3DeepEqual(ano.Token) { - return false - } - if !p.Field4DeepEqual(ano.Input) { - return false - } - if !p.Field5DeepEqual(ano.CustomEvalTarget) { - return false - } - if !p.Field255DeepEqual(ano.Base) { - return false - } - return true -} - -func (p *AsyncInvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { - - if p.WorkspaceID == src { - return true - } else if p.WorkspaceID == nil || src == nil { - return false - } - if *p.WorkspaceID != *src { - return false - } - return true -} -func (p *AsyncInvokeEvalTargetRequest) Field2DeepEqual(src *int64) bool { - - if p.InvokeID == src { - return true - } else if p.InvokeID == nil || src == nil { - return false - } - if *p.InvokeID != *src { - return false - } - return true -} -func (p *AsyncInvokeEvalTargetRequest) Field3DeepEqual(src *string) bool { - - if p.Token == src { - return true - } else if p.Token == nil || src == nil { - return false - } - if strings.Compare(*p.Token, *src) != 0 { - return false - } - return true -} -func (p *AsyncInvokeEvalTargetRequest) Field4DeepEqual(src *InvokeEvalTargetInput) bool { - - if !p.Input.DeepEqual(src) { - return false - } - return true -} -func (p *AsyncInvokeEvalTargetRequest) Field5DeepEqual(src *CustomEvalTarget) bool { - - if !p.CustomEvalTarget.DeepEqual(src) { - return false - } - return true -} -func (p *AsyncInvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { - - if !p.Base.DeepEqual(src) { - return false - } - return true -} - -type AsyncInvokeEvalTargetResponse struct { - BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` -} - -func NewAsyncInvokeEvalTargetResponse() *AsyncInvokeEvalTargetResponse { - return &AsyncInvokeEvalTargetResponse{} -} - -func (p *AsyncInvokeEvalTargetResponse) InitDefault() { -} - -var AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *AsyncInvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { - if p == nil { - return - } - if !p.IsSetBaseResp() { - return AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT - } - return p.BaseResp -} -func (p *AsyncInvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { - p.BaseResp = val -} - -var fieldIDToName_AsyncInvokeEvalTargetResponse = map[int16]string{ - 255: "BaseResp", -} - -func (p *AsyncInvokeEvalTargetResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *AsyncInvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *AsyncInvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *AsyncInvokeEvalTargetResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AsyncInvokeEvalTargetResponse(%+v)", *p) - -} - -func (p *AsyncInvokeEvalTargetResponse) DeepEqual(ano *AsyncInvokeEvalTargetResponse) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field255DeepEqual(ano.BaseResp) { - return false - } - return true -} - -func (p *AsyncInvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { - - if !p.BaseResp.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIService interface { - SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) - - InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) - - AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) -} - -type EvaluationSPIServiceClient struct { - c thrift.TClient -} - -func NewEvaluationSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvaluationSPIServiceClient { - return &EvaluationSPIServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewEvaluationSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvaluationSPIServiceClient { - return &EvaluationSPIServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewEvaluationSPIServiceClient(c thrift.TClient) *EvaluationSPIServiceClient { - return &EvaluationSPIServiceClient{ - c: c, - } -} - -func (p *EvaluationSPIServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *EvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) { - var _args EvaluationSPIServiceSearchEvalTargetArgs - _args.Req = req - var _result EvaluationSPIServiceSearchEvalTargetResult - if err = p.Client_().Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) { - var _args EvaluationSPIServiceInvokeEvalTargetArgs - _args.Req = req - var _result EvaluationSPIServiceInvokeEvalTargetResult - if err = p.Client_().Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) { - var _args EvaluationSPIServiceAsyncInvokeEvalTargetArgs - _args.Req = req - var _result EvaluationSPIServiceAsyncInvokeEvalTargetResult - if err = p.Client_().Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -type EvaluationSPIServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler EvaluationSPIService -} - -func (p *EvaluationSPIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *EvaluationSPIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *EvaluationSPIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewEvaluationSPIServiceProcessor(handler EvaluationSPIService) *EvaluationSPIServiceProcessor { - self := &EvaluationSPIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("SearchEvalTarget", &evaluationSPIServiceProcessorSearchEvalTarget{handler: handler}) - self.AddToProcessorMap("InvokeEvalTarget", &evaluationSPIServiceProcessorInvokeEvalTarget{handler: handler}) - self.AddToProcessorMap("AsyncInvokeEvalTarget", &evaluationSPIServiceProcessorAsyncInvokeEvalTarget{handler: handler}) - return self -} -func (p *EvaluationSPIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x -} - -type evaluationSPIServiceProcessorSearchEvalTarget struct { - handler EvaluationSPIService -} - -func (p *evaluationSPIServiceProcessorSearchEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvaluationSPIServiceSearchEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvaluationSPIServiceSearchEvalTargetResult{} - var retval *SearchEvalTargetResponse - if retval, err2 = p.handler.SearchEvalTarget(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("SearchEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evaluationSPIServiceProcessorInvokeEvalTarget struct { - handler EvaluationSPIService -} - -func (p *evaluationSPIServiceProcessorInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvaluationSPIServiceInvokeEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvaluationSPIServiceInvokeEvalTargetResult{} - var retval *InvokeEvalTargetResponse - if retval, err2 = p.handler.InvokeEvalTarget(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing InvokeEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("InvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evaluationSPIServiceProcessorAsyncInvokeEvalTarget struct { - handler EvaluationSPIService -} - -func (p *evaluationSPIServiceProcessorAsyncInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvaluationSPIServiceAsyncInvokeEvalTargetResult{} - var retval *AsyncInvokeEvalTargetResponse - if retval, err2 = p.handler.AsyncInvokeEvalTarget(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncInvokeEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type EvaluationSPIServiceSearchEvalTargetArgs struct { - Req *SearchEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchEvalTargetRequest"` -} - -func NewEvaluationSPIServiceSearchEvalTargetArgs() *EvaluationSPIServiceSearchEvalTargetArgs { - return &EvaluationSPIServiceSearchEvalTargetArgs{} -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) InitDefault() { -} - -var EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT *SearchEvalTargetRequest - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetReq() (v *SearchEvalTargetRequest) { - if p == nil { - return - } - if !p.IsSetReq() { - return EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT - } - return p.Req -} -func (p *EvaluationSPIServiceSearchEvalTargetArgs) SetReq(val *SearchEvalTargetRequest) { - p.Req = val -} - -var fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs = map[int16]string{ - 1: "req", -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewSearchEvalTargetRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SearchEvalTarget_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetArgs(%+v)", *p) - -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Req) { - return false - } - return true -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) Field1DeepEqual(src *SearchEvalTargetRequest) bool { - - if !p.Req.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIServiceSearchEvalTargetResult struct { - Success *SearchEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchEvalTargetResponse"` -} - -func NewEvaluationSPIServiceSearchEvalTargetResult() *EvaluationSPIServiceSearchEvalTargetResult { - return &EvaluationSPIServiceSearchEvalTargetResult{} -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) InitDefault() { -} - -var EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT *SearchEvalTargetResponse - -func (p *EvaluationSPIServiceSearchEvalTargetResult) GetSuccess() (v *SearchEvalTargetResponse) { - if p == nil { - return - } - if !p.IsSetSuccess() { - return EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT - } - return p.Success -} -func (p *EvaluationSPIServiceSearchEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*SearchEvalTargetResponse) -} - -var fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult = map[int16]string{ - 0: "success", -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewSearchEvalTargetResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("SearchEvalTarget_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetResult(%+v)", *p) - -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field0DeepEqual(ano.Success) { - return false - } - return true -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) Field0DeepEqual(src *SearchEvalTargetResponse) bool { - - if !p.Success.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIServiceInvokeEvalTargetArgs struct { - Req *InvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,InvokeEvalTargetRequest"` -} - -func NewEvaluationSPIServiceInvokeEvalTargetArgs() *EvaluationSPIServiceInvokeEvalTargetArgs { - return &EvaluationSPIServiceInvokeEvalTargetArgs{} -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) InitDefault() { -} - -var EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT *InvokeEvalTargetRequest - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetReq() (v *InvokeEvalTargetRequest) { - if p == nil { - return - } - if !p.IsSetReq() { - return EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT - } - return p.Req -} -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) SetReq(val *InvokeEvalTargetRequest) { - p.Req = val -} - -var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs = map[int16]string{ - 1: "req", -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTarget_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetArgs(%+v)", *p) - -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Req) { - return false - } - return true -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Field1DeepEqual(src *InvokeEvalTargetRequest) bool { - - if !p.Req.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIServiceInvokeEvalTargetResult struct { - Success *InvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,InvokeEvalTargetResponse"` -} - -func NewEvaluationSPIServiceInvokeEvalTargetResult() *EvaluationSPIServiceInvokeEvalTargetResult { - return &EvaluationSPIServiceInvokeEvalTargetResult{} -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) InitDefault() { -} - -var EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT *InvokeEvalTargetResponse - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetSuccess() (v *InvokeEvalTargetResponse) { - if p == nil { - return - } - if !p.IsSetSuccess() { - return EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT - } - return p.Success -} -func (p *EvaluationSPIServiceInvokeEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*InvokeEvalTargetResponse) -} - -var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult = map[int16]string{ - 0: "success", -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewInvokeEvalTargetResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("InvokeEvalTarget_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetResult(%+v)", *p) - -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field0DeepEqual(ano.Success) { - return false - } - return true -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) Field0DeepEqual(src *InvokeEvalTargetResponse) bool { - - if !p.Success.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIServiceAsyncInvokeEvalTargetArgs struct { - Req *AsyncInvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,AsyncInvokeEvalTargetRequest"` -} - -func NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() *EvaluationSPIServiceAsyncInvokeEvalTargetArgs { - return &EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) InitDefault() { -} - -var EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT *AsyncInvokeEvalTargetRequest - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetReq() (v *AsyncInvokeEvalTargetRequest) { - if p == nil { - return - } - if !p.IsSetReq() { - return EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT - } - return p.Req -} -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) SetReq(val *AsyncInvokeEvalTargetRequest) { - p.Req = val -} - -var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs = map[int16]string{ - 1: "req", -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAsyncInvokeEvalTargetRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetArgs(%+v)", *p) - -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Req) { - return false - } - return true -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Field1DeepEqual(src *AsyncInvokeEvalTargetRequest) bool { - - if !p.Req.DeepEqual(src) { - return false - } - return true -} - -type EvaluationSPIServiceAsyncInvokeEvalTargetResult struct { - Success *AsyncInvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncInvokeEvalTargetResponse"` -} - -func NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() *EvaluationSPIServiceAsyncInvokeEvalTargetResult { - return &EvaluationSPIServiceAsyncInvokeEvalTargetResult{} -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) InitDefault() { -} - -var EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT *AsyncInvokeEvalTargetResponse - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetSuccess() (v *AsyncInvokeEvalTargetResponse) { - if p == nil { - return - } - if !p.IsSetSuccess() { - return EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT - } - return p.Success -} -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*AsyncInvokeEvalTargetResponse) -} - -var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult = map[int16]string{ - 0: "success", -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewAsyncInvokeEvalTargetResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetResult(%+v)", *p) - -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field0DeepEqual(ano.Success) { - return false - } - return true -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Field0DeepEqual(src *AsyncInvokeEvalTargetResponse) bool { - - if !p.Success.DeepEqual(src) { - return false - } - return true -} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go deleted file mode 100644 index 1fd02ed04..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by Validator v0.2.6. DO NOT EDIT. - -package spi - -import ( - "bytes" - "fmt" - "reflect" - "regexp" - "strings" - "time" -) - -// unused protection -var ( - _ = fmt.Formatter(nil) - _ = (*bytes.Buffer)(nil) - _ = (*strings.Builder)(nil) - _ = reflect.Type(nil) - _ = (*regexp.Regexp)(nil) - _ = time.Nanosecond -) - -func (p *SearchEvalTargetRequest) IsValid() error { - if p.Base != nil { - if err := p.Base.IsValid(); err != nil { - return fmt.Errorf("field Base not valid, %w", err) - } - } - return nil -} -func (p *SearchEvalTargetResponse) IsValid() error { - if p.BaseResp != nil { - if err := p.BaseResp.IsValid(); err != nil { - return fmt.Errorf("field BaseResp not valid, %w", err) - } - } - return nil -} -func (p *CustomEvalTarget) IsValid() error { - return nil -} -func (p *InvokeEvalTargetRequest) IsValid() error { - if p.Input != nil { - if err := p.Input.IsValid(); err != nil { - return fmt.Errorf("field Input not valid, %w", err) - } - } - if p.CustomEvalTarget != nil { - if err := p.CustomEvalTarget.IsValid(); err != nil { - return fmt.Errorf("field CustomEvalTarget not valid, %w", err) - } - } - if p.Base != nil { - if err := p.Base.IsValid(); err != nil { - return fmt.Errorf("field Base not valid, %w", err) - } - } - return nil -} -func (p *InvokeEvalTargetResponse) IsValid() error { - if p.Output != nil { - if err := p.Output.IsValid(); err != nil { - return fmt.Errorf("field Output not valid, %w", err) - } - } - if p.Usage != nil { - if err := p.Usage.IsValid(); err != nil { - return fmt.Errorf("field Usage not valid, %w", err) - } - } - if p.BaseResp != nil { - if err := p.BaseResp.IsValid(); err != nil { - return fmt.Errorf("field BaseResp not valid, %w", err) - } - } - return nil -} -func (p *InvokeEvalTargetInput) IsValid() error { - return nil -} -func (p *InvokeEvalTargetOutput) IsValid() error { - if p.ActualOutput != nil { - if err := p.ActualOutput.IsValid(); err != nil { - return fmt.Errorf("field ActualOutput not valid, %w", err) - } - } - return nil -} -func (p *Content) IsValid() error { - if p.Image != nil { - if err := p.Image.IsValid(); err != nil { - return fmt.Errorf("field Image not valid, %w", err) - } - } - return nil -} -func (p *Image) IsValid() error { - return nil -} -func (p *InvokeEvalTargetUsage) IsValid() error { - return nil -} -func (p *AsyncInvokeEvalTargetRequest) IsValid() error { - if p.Input != nil { - if err := p.Input.IsValid(); err != nil { - return fmt.Errorf("field Input not valid, %w", err) - } - } - if p.CustomEvalTarget != nil { - if err := p.CustomEvalTarget.IsValid(); err != nil { - return fmt.Errorf("field CustomEvalTarget not valid, %w", err) - } - } - if p.Base != nil { - if err := p.Base.IsValid(); err != nil { - return fmt.Errorf("field Base not valid, %w", err) - } - } - return nil -} -func (p *AsyncInvokeEvalTargetResponse) IsValid() error { - if p.BaseResp != nil { - if err := p.BaseResp.IsValid(); err != nil { - return fmt.Errorf("field BaseResp not valid, %w", err) - } - } - return nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go deleted file mode 100644 index 4805b07ff..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. - -package evaluationspiservice - -import ( - "context" - client "github.com/cloudwego/kitex/client" - callopt "github.com/cloudwego/kitex/client/callopt" - spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. -type Client interface { - SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) - InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) - AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) -} - -// NewClient creates a client for the service defined in IDL. -func NewClient(destService string, opts ...client.Option) (Client, error) { - var options []client.Option - options = append(options, client.WithDestService(destService)) - - options = append(options, opts...) - - kc, err := client.NewClient(serviceInfo(), options...) - if err != nil { - return nil, err - } - return &kEvaluationSPIServiceClient{ - kClient: newServiceClient(kc), - }, nil -} - -// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. -func MustNewClient(destService string, opts ...client.Option) Client { - kc, err := NewClient(destService, opts...) - if err != nil { - panic(err) - } - return kc -} - -type kEvaluationSPIServiceClient struct { - *kClient -} - -func (p *kEvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.SearchEvalTarget(ctx, req) -} - -func (p *kEvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.InvokeEvalTarget(ctx, req) -} - -func (p *kEvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.AsyncInvokeEvalTarget(ctx, req) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go deleted file mode 100644 index 12c2c80cf..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. - -package evaluationspiservice - -import ( - "context" - "errors" - client "github.com/cloudwego/kitex/client" - kitex "github.com/cloudwego/kitex/pkg/serviceinfo" - spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -var errInvalidMessageType = errors.New("invalid message type for service method handler") - -var serviceMethods = map[string]kitex.MethodInfo{ - "SearchEvalTarget": kitex.NewMethodInfo( - searchEvalTargetHandler, - newEvaluationSPIServiceSearchEvalTargetArgs, - newEvaluationSPIServiceSearchEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), - "InvokeEvalTarget": kitex.NewMethodInfo( - invokeEvalTargetHandler, - newEvaluationSPIServiceInvokeEvalTargetArgs, - newEvaluationSPIServiceInvokeEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), - "AsyncInvokeEvalTarget": kitex.NewMethodInfo( - asyncInvokeEvalTargetHandler, - newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, - newEvaluationSPIServiceAsyncInvokeEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), -} - -var ( - evaluationSPIServiceServiceInfo = NewServiceInfo() -) - -// for server -func serviceInfo() *kitex.ServiceInfo { - return evaluationSPIServiceServiceInfo -} - -// NewServiceInfo creates a new ServiceInfo -func NewServiceInfo() *kitex.ServiceInfo { - return newServiceInfo() -} - -func newServiceInfo() *kitex.ServiceInfo { - serviceName := "EvaluationSPIService" - handlerType := (*spi.EvaluationSPIService)(nil) - extra := map[string]interface{}{ - "PackageName": "spi", - } - svcInfo := &kitex.ServiceInfo{ - ServiceName: serviceName, - HandlerType: handlerType, - Methods: serviceMethods, - PayloadCodec: kitex.Thrift, - KiteXGenVersion: "v0.13.1", - Extra: extra, - } - return svcInfo -} - -func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() -} - -func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceSearchEvalTargetResult() -} - -func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() -} - -func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() -} - -func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() -} - -func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() -} - -type kClient struct { - c client.Client - sc client.Streaming -} - -func newServiceClient(c client.Client) *kClient { - return &kClient{ - c: c, - sc: c.(client.Streaming), - } -} - -func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceSearchEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceSearchEvalTargetResult - if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceInvokeEvalTargetResult - if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult - if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go deleted file mode 100644 index a93da14d8..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. -package evaluationspiservice - -import ( - server "github.com/cloudwego/kitex/server" - spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -// NewServer creates a server.Server with the given handler and options. -func NewServer(handler spi.EvaluationSPIService, opts ...server.Option) server.Server { - var options []server.Option - - options = append(options, opts...) - options = append(options, server.WithCompatibleMiddlewareForUnary()) - - svr := server.NewServer(options...) - if err := svr.RegisterService(serviceInfo(), handler); err != nil { - panic(err) - } - return svr -} - -func RegisterService(svr server.Server, handler spi.EvaluationSPIService, opts ...server.RegisterOption) error { - return svr.RegisterService(serviceInfo(), handler, opts...) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go deleted file mode 100644 index e75303c47..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go +++ /dev/null @@ -1,4 +0,0 @@ -package spi - -// KitexUnusedProtection is used to prevent 'imported and not used' error. -var KitexUnusedProtection = struct{}{} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go deleted file mode 100644 index afc3bcf99..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go +++ /dev/null @@ -1,3823 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. - -package spi - -import ( - "bytes" - "fmt" - "reflect" - "strings" - - "github.com/cloudwego/gopkg/protocol/thrift" - kutils "github.com/cloudwego/kitex/pkg/utils" - - "github.com/coze-dev/coze-loop/backend/kitex_gen/base" -) - -var ( - _ = base.KitexUnusedProtection -) - -// unused protection -var ( - _ = fmt.Formatter(nil) - _ = (*bytes.Buffer)(nil) - _ = (*strings.Builder)(nil) - _ = reflect.Type(nil) - _ = thrift.STOP -) - -func (p *SearchEvalTargetRequest) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 20: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField20(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 100: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField100(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 101: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField101(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *SearchEvalTargetRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.WorkspaceID = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Keyword = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastReadField20(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - var _val string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _val = v - } - - _field[_key] = _val - } - p.Ext = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastReadField100(buf []byte) (int, error) { - offset := 0 - - var _field *int32 - if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.PageSize = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastReadField101(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.PageToken = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBase() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Base = _field - return offset, nil -} - -func (p *SearchEvalTargetRequest) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *SearchEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField100(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField20(buf[offset:], w) - offset += p.fastWriteField101(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *SearchEvalTargetRequest) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field20Length() - l += p.field100Length() - l += p.field101Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *SearchEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetWorkspaceID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) - } - return offset -} - -func (p *SearchEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetKeyword() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Keyword) - } - return offset -} - -func (p *SearchEvalTargetRequest) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetExt() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.Ext { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) - } - return offset -} - -func (p *SearchEvalTargetRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetPageSize() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 100) - offset += thrift.Binary.WriteI32(buf[offset:], *p.PageSize) - } - return offset -} - -func (p *SearchEvalTargetRequest) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetPageToken() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 101) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.PageToken) - } - return offset -} - -func (p *SearchEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetBase() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.Base.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *SearchEvalTargetRequest) field1Length() int { - l := 0 - if p.IsSetWorkspaceID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *SearchEvalTargetRequest) field2Length() int { - l := 0 - if p.IsSetKeyword() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Keyword) - } - return l -} - -func (p *SearchEvalTargetRequest) field20Length() int { - l := 0 - if p.IsSetExt() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.Ext { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += thrift.Binary.StringLengthNocopy(v) - } - } - return l -} - -func (p *SearchEvalTargetRequest) field100Length() int { - l := 0 - if p.IsSetPageSize() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I32Length() - } - return l -} - -func (p *SearchEvalTargetRequest) field101Length() int { - l := 0 - if p.IsSetPageToken() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.PageToken) - } - return l -} - -func (p *SearchEvalTargetRequest) field255Length() int { - l := 0 - if p.IsSetBase() { - l += thrift.Binary.FieldBeginLength() - l += p.Base.BLength() - } - return l -} - -func (p *SearchEvalTargetRequest) DeepCopy(s interface{}) error { - src, ok := s.(*SearchEvalTargetRequest) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.WorkspaceID != nil { - tmp := *src.WorkspaceID - p.WorkspaceID = &tmp - } - - if src.Keyword != nil { - var tmp string - if *src.Keyword != "" { - tmp = kutils.StringDeepCopy(*src.Keyword) - } - p.Keyword = &tmp - } - - if src.Ext != nil { - p.Ext = make(map[string]string, len(src.Ext)) - for key, val := range src.Ext { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val string - if val != "" { - _val = kutils.StringDeepCopy(val) - } - - p.Ext[_key] = _val - } - } - - if src.PageSize != nil { - tmp := *src.PageSize - p.PageSize = &tmp - } - - if src.PageToken != nil { - var tmp string - if *src.PageToken != "" { - tmp = kutils.StringDeepCopy(*src.PageToken) - } - p.PageToken = &tmp - } - - var _base *base.Base - if src.Base != nil { - _base = &base.Base{} - if err := _base.DeepCopy(src.Base); err != nil { - return err - } - } - p.Base = _base - - return nil -} - -func (p *SearchEvalTargetResponse) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 100: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField100(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 101: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField101(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *SearchEvalTargetResponse) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make([]*CustomEvalTarget, 0, size) - values := make([]CustomEvalTarget, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _field = append(_field, _elem) - } - p.CustomEvalTargets = _field - return offset, nil -} - -func (p *SearchEvalTargetResponse) FastReadField100(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.NextPageToken = _field - return offset, nil -} - -func (p *SearchEvalTargetResponse) FastReadField101(buf []byte) (int, error) { - offset := 0 - - var _field *bool - if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.HasMore = _field - return offset, nil -} - -func (p *SearchEvalTargetResponse) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBaseResp() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.BaseResp = _field - return offset, nil -} - -func (p *SearchEvalTargetResponse) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *SearchEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField101(buf[offset:], w) - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField100(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *SearchEvalTargetResponse) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field100Length() - l += p.field101Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *SearchEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetCustomEvalTargets() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 1) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.CustomEvalTargets { - length++ - offset += v.FastWriteNocopy(buf[offset:], w) - } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - } - return offset -} - -func (p *SearchEvalTargetResponse) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetNextPageToken() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.NextPageToken) - } - return offset -} - -func (p *SearchEvalTargetResponse) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetHasMore() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 101) - offset += thrift.Binary.WriteBool(buf[offset:], *p.HasMore) - } - return offset -} - -func (p *SearchEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *SearchEvalTargetResponse) field1Length() int { - l := 0 - if p.IsSetCustomEvalTargets() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.CustomEvalTargets { - _ = v - l += v.BLength() - } - } - return l -} - -func (p *SearchEvalTargetResponse) field100Length() int { - l := 0 - if p.IsSetNextPageToken() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.NextPageToken) - } - return l -} - -func (p *SearchEvalTargetResponse) field101Length() int { - l := 0 - if p.IsSetHasMore() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.BoolLength() - } - return l -} - -func (p *SearchEvalTargetResponse) field255Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.BaseResp.BLength() - return l -} - -func (p *SearchEvalTargetResponse) DeepCopy(s interface{}) error { - src, ok := s.(*SearchEvalTargetResponse) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.CustomEvalTargets != nil { - p.CustomEvalTargets = make([]*CustomEvalTarget, 0, len(src.CustomEvalTargets)) - for _, elem := range src.CustomEvalTargets { - var _elem *CustomEvalTarget - if elem != nil { - _elem = &CustomEvalTarget{} - if err := _elem.DeepCopy(elem); err != nil { - return err - } - } - - p.CustomEvalTargets = append(p.CustomEvalTargets, _elem) - } - } - - if src.NextPageToken != nil { - var tmp string - if *src.NextPageToken != "" { - tmp = kutils.StringDeepCopy(*src.NextPageToken) - } - p.NextPageToken = &tmp - } - - if src.HasMore != nil { - tmp := *src.HasMore - p.HasMore = &tmp - } - - var _baseResp *base.BaseResp - if src.BaseResp != nil { - _baseResp = &base.BaseResp{} - if err := _baseResp.DeepCopy(src.BaseResp); err != nil { - return err - } - } - p.BaseResp = _baseResp - - return nil -} - -func (p *CustomEvalTarget) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *CustomEvalTarget) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.ID = _field - return offset, nil -} - -func (p *CustomEvalTarget) FastReadField2(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Name = _field - return offset, nil -} - -func (p *CustomEvalTarget) FastReadField3(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.AvatarURL = _field - return offset, nil -} - -func (p *CustomEvalTarget) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *CustomEvalTarget) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *CustomEvalTarget) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *CustomEvalTarget) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) - } - return offset -} - -func (p *CustomEvalTarget) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetName() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) - } - return offset -} - -func (p *CustomEvalTarget) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetAvatarURL() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.AvatarURL) - } - return offset -} - -func (p *CustomEvalTarget) field1Length() int { - l := 0 - if p.IsSetID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.ID) - } - return l -} - -func (p *CustomEvalTarget) field2Length() int { - l := 0 - if p.IsSetName() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Name) - } - return l -} - -func (p *CustomEvalTarget) field3Length() int { - l := 0 - if p.IsSetAvatarURL() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.AvatarURL) - } - return l -} - -func (p *CustomEvalTarget) DeepCopy(s interface{}) error { - src, ok := s.(*CustomEvalTarget) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.ID != nil { - var tmp string - if *src.ID != "" { - tmp = kutils.StringDeepCopy(*src.ID) - } - p.ID = &tmp - } - - if src.Name != nil { - var tmp string - if *src.Name != "" { - tmp = kutils.StringDeepCopy(*src.Name) - } - p.Name = &tmp - } - - if src.AvatarURL != nil { - var tmp string - if *src.AvatarURL != "" { - tmp = kutils.StringDeepCopy(*src.AvatarURL) - } - p.AvatarURL = &tmp - } - - return nil -} - -func (p *InvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *InvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.WorkspaceID = _field - return offset, nil -} - -func (p *InvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetInput() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Input = _field - return offset, nil -} - -func (p *InvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - _field := NewCustomEvalTarget() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.CustomEvalTarget = _field - return offset, nil -} - -func (p *InvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBase() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Base = _field - return offset, nil -} - -func (p *InvokeEvalTargetRequest) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *InvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *InvokeEvalTargetRequest) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *InvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetWorkspaceID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) - } - return offset -} - -func (p *InvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) - offset += p.Input.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetCustomEvalTarget() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 3) - offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetBase() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.Base.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetRequest) field1Length() int { - l := 0 - if p.IsSetWorkspaceID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *InvokeEvalTargetRequest) field2Length() int { - l := 0 - if p.IsSetInput() { - l += thrift.Binary.FieldBeginLength() - l += p.Input.BLength() - } - return l -} - -func (p *InvokeEvalTargetRequest) field3Length() int { - l := 0 - if p.IsSetCustomEvalTarget() { - l += thrift.Binary.FieldBeginLength() - l += p.CustomEvalTarget.BLength() - } - return l -} - -func (p *InvokeEvalTargetRequest) field255Length() int { - l := 0 - if p.IsSetBase() { - l += thrift.Binary.FieldBeginLength() - l += p.Base.BLength() - } - return l -} - -func (p *InvokeEvalTargetRequest) DeepCopy(s interface{}) error { - src, ok := s.(*InvokeEvalTargetRequest) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.WorkspaceID != nil { - tmp := *src.WorkspaceID - p.WorkspaceID = &tmp - } - - var _input *InvokeEvalTargetInput - if src.Input != nil { - _input = &InvokeEvalTargetInput{} - if err := _input.DeepCopy(src.Input); err != nil { - return err - } - } - p.Input = _input - - var _customEvalTarget *CustomEvalTarget - if src.CustomEvalTarget != nil { - _customEvalTarget = &CustomEvalTarget{} - if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { - return err - } - } - p.CustomEvalTarget = _customEvalTarget - - var _base *base.Base - if src.Base != nil { - _base = &base.Base{} - if err := _base.DeepCopy(src.Base); err != nil { - return err - } - } - p.Base = _base - - return nil -} - -func (p *InvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *InvokeEvalTargetResponse) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetOutput() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Output = _field - return offset, nil -} - -func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetUsage() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Usage = _field - return offset, nil -} - -func (p *InvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBaseResp() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.BaseResp = _field - return offset, nil -} - -func (p *InvokeEvalTargetResponse) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *InvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *InvokeEvalTargetResponse) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *InvokeEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetOutput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Output.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetUsage() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) - offset += p.Usage.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *InvokeEvalTargetResponse) field1Length() int { - l := 0 - if p.IsSetOutput() { - l += thrift.Binary.FieldBeginLength() - l += p.Output.BLength() - } - return l -} - -func (p *InvokeEvalTargetResponse) field2Length() int { - l := 0 - if p.IsSetUsage() { - l += thrift.Binary.FieldBeginLength() - l += p.Usage.BLength() - } - return l -} - -func (p *InvokeEvalTargetResponse) field255Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.BaseResp.BLength() - return l -} - -func (p *InvokeEvalTargetResponse) DeepCopy(s interface{}) error { - src, ok := s.(*InvokeEvalTargetResponse) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _output *InvokeEvalTargetOutput - if src.Output != nil { - _output = &InvokeEvalTargetOutput{} - if err := _output.DeepCopy(src.Output); err != nil { - return err - } - } - p.Output = _output - - var _usage *InvokeEvalTargetUsage - if src.Usage != nil { - _usage = &InvokeEvalTargetUsage{} - if err := _usage.DeepCopy(src.Usage); err != nil { - return err - } - } - p.Usage = _usage - - var _baseResp *base.BaseResp - if src.BaseResp != nil { - _baseResp = &base.BaseResp{} - if err := _baseResp.DeepCopy(src.BaseResp); err != nil { - return err - } - } - p.BaseResp = _baseResp - - return nil -} - -func (p *InvokeEvalTargetInput) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 20: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField20(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *InvokeEvalTargetInput) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]*Content, size) - values := make([]Content, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - _val := &values[i] - _val.InitDefault() - if l, err := _val.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _field[_key] = _val - } - p.EvalSetFields = _field - return offset, nil -} - -func (p *InvokeEvalTargetInput) FastReadField20(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - var _val string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _val = v - } - - _field[_key] = _val - } - p.Ext = _field - return offset, nil -} - -func (p *InvokeEvalTargetInput) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *InvokeEvalTargetInput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField20(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *InvokeEvalTargetInput) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field20Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *InvokeEvalTargetInput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetEvalSetFields() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 1) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.EvalSetFields { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += v.FastWriteNocopy(buf[offset:], w) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) - } - return offset -} - -func (p *InvokeEvalTargetInput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetExt() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.Ext { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) - } - return offset -} - -func (p *InvokeEvalTargetInput) field1Length() int { - l := 0 - if p.IsSetEvalSetFields() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.EvalSetFields { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += v.BLength() - } - } - return l -} - -func (p *InvokeEvalTargetInput) field20Length() int { - l := 0 - if p.IsSetExt() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.Ext { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += thrift.Binary.StringLengthNocopy(v) - } - } - return l -} - -func (p *InvokeEvalTargetInput) DeepCopy(s interface{}) error { - src, ok := s.(*InvokeEvalTargetInput) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.EvalSetFields != nil { - p.EvalSetFields = make(map[string]*Content, len(src.EvalSetFields)) - for key, val := range src.EvalSetFields { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val *Content - if val != nil { - _val = &Content{} - if err := _val.DeepCopy(val); err != nil { - return err - } - } - - p.EvalSetFields[_key] = _val - } - } - - if src.Ext != nil { - p.Ext = make(map[string]string, len(src.Ext)) - for key, val := range src.Ext { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val string - if val != "" { - _val = kutils.StringDeepCopy(val) - } - - p.Ext[_key] = _val - } - } - - return nil -} - -func (p *InvokeEvalTargetOutput) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 20: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField20(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *InvokeEvalTargetOutput) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewContent() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.ActualOutput = _field - return offset, nil -} - -func (p *InvokeEvalTargetOutput) FastReadField20(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - var _val string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _val = v - } - - _field[_key] = _val - } - p.Ext = _field - return offset, nil -} - -func (p *InvokeEvalTargetOutput) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *InvokeEvalTargetOutput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField20(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *InvokeEvalTargetOutput) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field20Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *InvokeEvalTargetOutput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetActualOutput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.ActualOutput.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *InvokeEvalTargetOutput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetExt() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.Ext { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) - } - return offset -} - -func (p *InvokeEvalTargetOutput) field1Length() int { - l := 0 - if p.IsSetActualOutput() { - l += thrift.Binary.FieldBeginLength() - l += p.ActualOutput.BLength() - } - return l -} - -func (p *InvokeEvalTargetOutput) field20Length() int { - l := 0 - if p.IsSetExt() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.Ext { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += thrift.Binary.StringLengthNocopy(v) - } - } - return l -} - -func (p *InvokeEvalTargetOutput) DeepCopy(s interface{}) error { - src, ok := s.(*InvokeEvalTargetOutput) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _actualOutput *Content - if src.ActualOutput != nil { - _actualOutput = &Content{} - if err := _actualOutput.DeepCopy(src.ActualOutput); err != nil { - return err - } - } - p.ActualOutput = _actualOutput - - if src.Ext != nil { - p.Ext = make(map[string]string, len(src.Ext)) - for key, val := range src.Ext { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val string - if val != "" { - _val = kutils.StringDeepCopy(val) - } - - p.Ext[_key] = _val - } - } - - return nil -} - -func (p *Content) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField11(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 12: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField12(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *Content) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *ContentType - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.ContentType = _field - return offset, nil -} - -func (p *Content) FastReadField10(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Text = _field - return offset, nil -} - -func (p *Content) FastReadField11(buf []byte) (int, error) { - offset := 0 - _field := NewImage() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Image = _field - return offset, nil -} - -func (p *Content) FastReadField12(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make([]*Content, 0, size) - values := make([]Content, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _field = append(_field, _elem) - } - p.MultiPart = _field - return offset, nil -} - -func (p *Content) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *Content) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField10(buf[offset:], w) - offset += p.fastWriteField11(buf[offset:], w) - offset += p.fastWriteField12(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *Content) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field10Length() - l += p.field11Length() - l += p.field12Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *Content) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetContentType() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ContentType) - } - return offset -} - -func (p *Content) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetText() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Text) - } - return offset -} - -func (p *Content) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetImage() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) - offset += p.Image.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *Content) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetMultiPart() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 12) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.MultiPart { - length++ - offset += v.FastWriteNocopy(buf[offset:], w) - } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - } - return offset -} - -func (p *Content) field1Length() int { - l := 0 - if p.IsSetContentType() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.ContentType) - } - return l -} - -func (p *Content) field10Length() int { - l := 0 - if p.IsSetText() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Text) - } - return l -} - -func (p *Content) field11Length() int { - l := 0 - if p.IsSetImage() { - l += thrift.Binary.FieldBeginLength() - l += p.Image.BLength() - } - return l -} - -func (p *Content) field12Length() int { - l := 0 - if p.IsSetMultiPart() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.MultiPart { - _ = v - l += v.BLength() - } - } - return l -} - -func (p *Content) DeepCopy(s interface{}) error { - src, ok := s.(*Content) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.ContentType != nil { - tmp := *src.ContentType - p.ContentType = &tmp - } - - if src.Text != nil { - var tmp string - if *src.Text != "" { - tmp = kutils.StringDeepCopy(*src.Text) - } - p.Text = &tmp - } - - var _image *Image - if src.Image != nil { - _image = &Image{} - if err := _image.DeepCopy(src.Image); err != nil { - return err - } - } - p.Image = _image - - if src.MultiPart != nil { - p.MultiPart = make([]*Content, 0, len(src.MultiPart)) - for _, elem := range src.MultiPart { - var _elem *Content - if elem != nil { - _elem = &Content{} - if err := _elem.DeepCopy(elem); err != nil { - return err - } - } - - p.MultiPart = append(p.MultiPart, _elem) - } - } - - return nil -} - -func (p *Image) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *Image) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.URL = _field - return offset, nil -} - -func (p *Image) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *Image) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *Image) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *Image) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetURL() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.URL) - } - return offset -} - -func (p *Image) field1Length() int { - l := 0 - if p.IsSetURL() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.URL) - } - return l -} - -func (p *Image) DeepCopy(s interface{}) error { - src, ok := s.(*Image) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.URL != nil { - var tmp string - if *src.URL != "" { - tmp = kutils.StringDeepCopy(*src.URL) - } - p.URL = &tmp - } - - return nil -} - -func (p *InvokeEvalTargetUsage) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *InvokeEvalTargetUsage) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.InputTokens = _field - return offset, nil -} - -func (p *InvokeEvalTargetUsage) FastReadField2(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.OutputTokens = _field - return offset, nil -} - -func (p *InvokeEvalTargetUsage) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *InvokeEvalTargetUsage) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *InvokeEvalTargetUsage) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *InvokeEvalTargetUsage) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInputTokens() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], *p.InputTokens) - } - return offset -} - -func (p *InvokeEvalTargetUsage) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetOutputTokens() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) - offset += thrift.Binary.WriteI64(buf[offset:], *p.OutputTokens) - } - return offset -} - -func (p *InvokeEvalTargetUsage) field1Length() int { - l := 0 - if p.IsSetInputTokens() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *InvokeEvalTargetUsage) field2Length() int { - l := 0 - if p.IsSetOutputTokens() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *InvokeEvalTargetUsage) DeepCopy(s interface{}) error { - src, ok := s.(*InvokeEvalTargetUsage) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.InputTokens != nil { - tmp := *src.InputTokens - p.InputTokens = &tmp - } - - if src.OutputTokens != nil { - tmp := *src.OutputTokens - p.OutputTokens = &tmp - } - - return nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.WorkspaceID = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.InvokeID = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Token = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField4(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetInput() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Input = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField5(buf []byte) (int, error) { - offset := 0 - _field := NewCustomEvalTarget() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.CustomEvalTarget = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBase() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Base = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetRequest) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *AsyncInvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) - offset += p.fastWriteField4(buf[offset:], w) - offset += p.fastWriteField5(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetWorkspaceID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInvokeID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) - offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetToken() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 4) - offset += p.Input.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetCustomEvalTarget() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 5) - offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetBase() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.Base.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *AsyncInvokeEvalTargetRequest) field1Length() int { - l := 0 - if p.IsSetWorkspaceID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) field2Length() int { - l := 0 - if p.IsSetInvokeID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) field3Length() int { - l := 0 - if p.IsSetToken() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Token) - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) field4Length() int { - l := 0 - if p.IsSetInput() { - l += thrift.Binary.FieldBeginLength() - l += p.Input.BLength() - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) field5Length() int { - l := 0 - if p.IsSetCustomEvalTarget() { - l += thrift.Binary.FieldBeginLength() - l += p.CustomEvalTarget.BLength() - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) field255Length() int { - l := 0 - if p.IsSetBase() { - l += thrift.Binary.FieldBeginLength() - l += p.Base.BLength() - } - return l -} - -func (p *AsyncInvokeEvalTargetRequest) DeepCopy(s interface{}) error { - src, ok := s.(*AsyncInvokeEvalTargetRequest) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.WorkspaceID != nil { - tmp := *src.WorkspaceID - p.WorkspaceID = &tmp - } - - if src.InvokeID != nil { - tmp := *src.InvokeID - p.InvokeID = &tmp - } - - if src.Token != nil { - var tmp string - if *src.Token != "" { - tmp = kutils.StringDeepCopy(*src.Token) - } - p.Token = &tmp - } - - var _input *InvokeEvalTargetInput - if src.Input != nil { - _input = &InvokeEvalTargetInput{} - if err := _input.DeepCopy(src.Input); err != nil { - return err - } - } - p.Input = _input - - var _customEvalTarget *CustomEvalTarget - if src.CustomEvalTarget != nil { - _customEvalTarget = &CustomEvalTarget{} - if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { - return err - } - } - p.CustomEvalTarget = _customEvalTarget - - var _base *base.Base - if src.Base != nil { - _base = &base.Base{} - if err := _base.DeepCopy(src.Base); err != nil { - return err - } - } - p.Base = _base - - return nil -} - -func (p *AsyncInvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *AsyncInvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBaseResp() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.BaseResp = _field - return offset, nil -} - -func (p *AsyncInvokeEvalTargetResponse) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *AsyncInvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *AsyncInvokeEvalTargetResponse) BLength() int { - l := 0 - if p != nil { - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *AsyncInvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *AsyncInvokeEvalTargetResponse) field255Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.BaseResp.BLength() - return l -} - -func (p *AsyncInvokeEvalTargetResponse) DeepCopy(s interface{}) error { - src, ok := s.(*AsyncInvokeEvalTargetResponse) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _baseResp *base.BaseResp - if src.BaseResp != nil { - _baseResp = &base.BaseResp{} - if err := _baseResp.DeepCopy(src.BaseResp); err != nil { - return err - } - } - p.BaseResp = _baseResp - - return nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewSearchEvalTargetRequest() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Req = _field - return offset, nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Req.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.Req.BLength() - return l -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceSearchEvalTargetArgs) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _req *SearchEvalTargetRequest - if src.Req != nil { - _req = &SearchEvalTargetRequest{} - if err := _req.DeepCopy(src.Req); err != nil { - return err - } - } - p.Req = _req - - return nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - _field := NewSearchEvalTargetResponse() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = _field - return offset, nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField0(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) BLength() int { - l := 0 - if p != nil { - l += p.field0Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += thrift.Binary.FieldBeginLength() - l += p.Success.BLength() - } - return l -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceSearchEvalTargetResult) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _success *SearchEvalTargetResponse - if src.Success != nil { - _success = &SearchEvalTargetResponse{} - if err := _success.DeepCopy(src.Success); err != nil { - return err - } - } - p.Success = _success - - return nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetRequest() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Req = _field - return offset, nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Req.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.Req.BLength() - return l -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetArgs) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _req *InvokeEvalTargetRequest - if src.Req != nil { - _req = &InvokeEvalTargetRequest{} - if err := _req.DeepCopy(src.Req); err != nil { - return err - } - } - p.Req = _req - - return nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - _field := NewInvokeEvalTargetResponse() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = _field - return offset, nil -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField0(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) BLength() int { - l := 0 - if p != nil { - l += p.field0Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += thrift.Binary.FieldBeginLength() - l += p.Success.BLength() - } - return l -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetResult) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _success *InvokeEvalTargetResponse - if src.Success != nil { - _success = &InvokeEvalTargetResponse{} - if err := _success.DeepCopy(src.Success); err != nil { - return err - } - } - p.Success = _success - - return nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewAsyncInvokeEvalTargetRequest() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Req = _field - return offset, nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Req.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.Req.BLength() - return l -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetArgs) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _req *AsyncInvokeEvalTargetRequest - if src.Req != nil { - _req = &AsyncInvokeEvalTargetRequest{} - if err := _req.DeepCopy(src.Req); err != nil { - return err - } - } - p.Req = _req - - return nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - _field := NewAsyncInvokeEvalTargetResponse() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = _field - return offset, nil -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField0(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) BLength() int { - l := 0 - if p != nil { - l += p.field0Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += thrift.Binary.FieldBeginLength() - l += p.Success.BLength() - } - return l -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetResult) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _success *AsyncInvokeEvalTargetResponse - if src.Success != nil { - _success = &AsyncInvokeEvalTargetResponse{} - if err := _success.DeepCopy(src.Success); err != nil { - return err - } - } - p.Success = _success - - return nil -} - -func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetFirstArgument() interface{} { - return p.Req -} - -func (p *EvaluationSPIServiceSearchEvalTargetResult) GetResult() interface{} { - return p.Success -} - -func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetFirstArgument() interface{} { - return p.Req -} - -func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetResult() interface{} { - return p.Success -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetFirstArgument() interface{} { - return p.Req -} - -func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetResult() interface{} { - return p.Success -} diff --git a/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go b/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go deleted file mode 100644 index 67597c82e..000000000 --- a/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by cozeloop. DO NOT EDIT. -package lospi // import github.com/coze-dev/coze-loop/backend/lospi - -import ( - "context" - - "github.com/cloudwego/kitex/client/callopt" - "github.com/cloudwego/kitex/pkg/endpoint" - "github.com/cloudwego/kitex/pkg/rpcinfo" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -type LocalEvaluationSPIService struct { - impl spi.EvaluationSPIService // the service implementation - mds endpoint.Middleware -} - -func NewLocalEvaluationSPIService(impl spi.EvaluationSPIService, mds ...endpoint.Middleware) *LocalEvaluationSPIService { - return &LocalEvaluationSPIService{ - impl: impl, - mds: endpoint.Chain(mds...), - } -} - -func (l *LocalEvaluationSPIService) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (*spi.SearchEvalTargetResponse, error) { - chain := l.mds(func(ctx context.Context, in, out interface{}) error { - arg := in.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) - result := out.(*spi.EvaluationSPIServiceSearchEvalTargetResult) - resp, err := l.impl.SearchEvalTarget(ctx, arg.Req) - if err != nil { - return err - } - result.SetSuccess(resp) - return nil - }) - - arg := &spi.EvaluationSPIServiceSearchEvalTargetArgs{Req: req} - result := &spi.EvaluationSPIServiceSearchEvalTargetResult{} - ctx = l.injectRPCInfo(ctx, "SearchEvalTarget") - if err := chain(ctx, arg, result); err != nil { - return nil, err - } - return result.GetSuccess(), nil -} - -func (l *LocalEvaluationSPIService) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.InvokeEvalTargetResponse, error) { - chain := l.mds(func(ctx context.Context, in, out interface{}) error { - arg := in.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) - result := out.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) - resp, err := l.impl.InvokeEvalTarget(ctx, arg.Req) - if err != nil { - return err - } - result.SetSuccess(resp) - return nil - }) - - arg := &spi.EvaluationSPIServiceInvokeEvalTargetArgs{Req: req} - result := &spi.EvaluationSPIServiceInvokeEvalTargetResult{} - ctx = l.injectRPCInfo(ctx, "InvokeEvalTarget") - if err := chain(ctx, arg, result); err != nil { - return nil, err - } - return result.GetSuccess(), nil -} - -func (l *LocalEvaluationSPIService) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.AsyncInvokeEvalTargetResponse, error) { - chain := l.mds(func(ctx context.Context, in, out interface{}) error { - arg := in.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) - result := out.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) - resp, err := l.impl.AsyncInvokeEvalTarget(ctx, arg.Req) - if err != nil { - return err - } - result.SetSuccess(resp) - return nil - }) - - arg := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs{Req: req} - result := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult{} - ctx = l.injectRPCInfo(ctx, "AsyncInvokeEvalTarget") - if err := chain(ctx, arg, result); err != nil { - return nil, err - } - return result.GetSuccess(), nil -} - -func (l *LocalEvaluationSPIService) injectRPCInfo(ctx context.Context, method string) context.Context { - rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) - ri := rpcinfo.NewRPCInfo( - rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), - rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), - rpcinfo.NewServerInvocation(), - nil, - rpcStats.ImmutableView(), - ) - return rpcinfo.NewCtxWithRPCInfo(ctx, ri) -} From 736f9553f1373b4a061decdc54a90d4196e691c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 10:52:00 +0800 Subject: [PATCH 012/100] fix Change-Id: I3ea100fd14ec463236b991d315b09b8939ee5299 --- .../evaluation/application/convertor/target/eval_target.go | 2 +- backend/modules/evaluation/domain/entity/target.go | 4 ++-- .../infra/repo/target/mysql/convertor/eval_target.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 8355704db..3c5071b5b 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -186,7 +186,7 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi BaseInfo: commonconvertor.ConvertBaseInfoDO2DTO(targetVersionDO.VolcengineAgent.BaseInfo), } } - case do.EvalTargetType_CustomPSM: + case do.EvalTargetTypeCustomPSM: targetVersionDTO.EvalTargetContent = &dto.EvalTargetContent{ InputSchemas: make([]*commondto.ArgsSchema, 0), OutputSchemas: make([]*commondto.ArgsSchema, 0), diff --git a/backend/modules/evaluation/domain/entity/target.go b/backend/modules/evaluation/domain/entity/target.go index dccfff804..bf1890292 100644 --- a/backend/modules/evaluation/domain/entity/target.go +++ b/backend/modules/evaluation/domain/entity/target.go @@ -52,7 +52,7 @@ const ( // 火山智能体 EvalTargetTypeVolcengineAgent EvalTargetType = 5 // 自定义psm服务 for内场 - EvalTargetType_CustomPSM EvalTargetType = 6 + EvalTargetTypeCustomPSM EvalTargetType = 6 ) func (p EvalTargetType) String() string { @@ -67,7 +67,7 @@ func (p EvalTargetType) String() string { return "CozeWorkflow" case EvalTargetTypeVolcengineAgent: return "VolcengineAgent" - case EvalTargetType_CustomPSM: + case EvalTargetTypeCustomPSM: return "CustomPSM" } return "" diff --git a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go index b42579a28..993d875a9 100644 --- a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go @@ -63,7 +63,7 @@ func EvalTargetVersionDO2PO(do *entity.EvalTargetVersion) (po *model.TargetVersi if err != nil { return nil, err } - case entity.EvalTargetType_CustomPSM: + case entity.EvalTargetTypeCustomPSM: meta, err = json.Marshal(do.CustomPsm) if err != nil { return nil, err @@ -205,7 +205,7 @@ func EvalTargetVersionPO2DO(targetVersionPO *model.TargetVersion, targetType ent if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { targetVersionDO.VolcengineAgent = meta } - case entity.EvalTargetType_CustomPSM: + case entity.EvalTargetTypeCustomPSM: meta := &entity.CustomPSM{} if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { targetVersionDO.CustomPsm = meta From 9f68949a84729ed4e68f53b671e54e3e60008b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 11:10:36 +0800 Subject: [PATCH 013/100] fix Change-Id: Ic2f65b1d4227ca52a1c309f5293b4324f2276f7b --- .../domain/eval_target/eval_target.go | 22 +++++++++---------- .../domain/eval_target/k-eval_target.go | 19 +++++++--------- .../entity/target_builtin_custom_psm.go | 2 +- .../loop/evaluation/domain/eval_target.thrift | 2 +- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index 0beba7170..dfee45e07 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -2136,7 +2136,7 @@ func (p *EvalTargetContent) Field105DeepEqual(src *CustomPSM) bool { type CustomPSM struct { // 应用ID - ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` + ID *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" form:"id" json:"id,omitempty" query:"id"` // DTO使用,不存数据库 Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` // DTO使用,不存数据库 @@ -2168,9 +2168,9 @@ func NewCustomPSM() *CustomPSM { func (p *CustomPSM) InitDefault() { } -var CustomPSM_ID_DEFAULT string +var CustomPSM_ID_DEFAULT int64 -func (p *CustomPSM) GetID() (v string) { +func (p *CustomPSM) GetID() (v int64) { if p == nil { return } @@ -2323,7 +2323,7 @@ func (p *CustomPSM) GetIsAsync() (v bool) { } return *p.IsAsync } -func (p *CustomPSM) SetID(val *string) { +func (p *CustomPSM) SetID(val *int64) { p.ID = val } func (p *CustomPSM) SetName(val *string) { @@ -2450,7 +2450,7 @@ func (p *CustomPSM) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -2584,8 +2584,8 @@ ReadStructEndError: func (p *CustomPSM) ReadField1(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err } else { _field = &v @@ -2804,10 +2804,10 @@ WriteStructEndError: func (p *CustomPSM) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetID() { - if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.ID); err != nil { + if err := oprot.WriteI64(*p.ID); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3101,14 +3101,14 @@ func (p *CustomPSM) DeepEqual(ano *CustomPSM) bool { return true } -func (p *CustomPSM) Field1DeepEqual(src *string) bool { +func (p *CustomPSM) Field1DeepEqual(src *int64) bool { if p.ID == src { return true } else if p.ID == nil || src == nil { return false } - if strings.Compare(*p.ID, *src) != 0 { + if *p.ID != *src { return false } return true diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 50e7bd816..18b134dbf 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -1390,7 +1390,7 @@ func (p *CustomPSM) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -1592,8 +1592,8 @@ SkipFieldError: func (p *CustomPSM) FastReadField1(buf []byte) (int, error) { offset := 0 - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l @@ -1780,9 +1780,9 @@ func (p *CustomPSM) FastWrite(buf []byte) int { func (p *CustomPSM) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { + offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField16(buf[offset:], w) offset += p.fastWriteField19(buf[offset:], w) - offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) @@ -1822,8 +1822,8 @@ func (p *CustomPSM) BLength() int { func (p *CustomPSM) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.ID) } return offset } @@ -1947,7 +1947,7 @@ func (p *CustomPSM) field1Length() int { l := 0 if p.IsSetID() { l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.ID) + l += thrift.Binary.I64Length() } return l } @@ -2071,10 +2071,7 @@ func (p *CustomPSM) DeepCopy(s interface{}) error { } if src.ID != nil { - var tmp string - if *src.ID != "" { - tmp = kutils.StringDeepCopy(*src.ID) - } + tmp := *src.ID p.ID = &tmp } diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go index 2165a16ad..016562edd 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go @@ -5,7 +5,7 @@ package entity type CustomPSM struct { // 应用ID - ID string + ID int64 // DTO使用,不存数据库 Name string `json:"-"` // DTO使用,不存数据库 diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index f320875af..35cb53648 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -56,7 +56,7 @@ enum EvalTargetType { } struct CustomPSM { - 1: optional string id // 应用ID + 1: optional i64 id // 应用ID 2: optional string name // DTO使用,不存数据库 3: optional string description // DTO使用,不存数据库 From 825ee03d7d5161f024d0bcc9ec524331db4e4b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 11:26:02 +0800 Subject: [PATCH 014/100] fix Change-Id: I07971653610c864df49bb4ee0109e2195da47132 --- .../spi/coze.loop.evaluation.spi.go | 5546 +++++++++++++++++ .../spi/coze.loop.evaluation.spi_validator.go | 129 + .../spi/evaluationspiservice/client.go | 61 + .../evaluationspiservice.go | 167 + .../spi/evaluationspiservice/server.go | 25 + .../coze/loop/evaluation/spi/k-consts.go | 4 + .../spi/k-coze.loop.evaluation.spi.go | 3823 ++++++++++++ .../lospi/local_evaluationspiservice.go | 98 + .../modules/evaluation/domain/entity/param.go | 11 +- 9 files changed, 9862 insertions(+), 2 deletions(-) create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go create mode 100644 backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go new file mode 100644 index 000000000..7808c012a --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go @@ -0,0 +1,5546 @@ +// Code generated by thriftgo (0.4.1). DO NOT EDIT. + +package spi + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "strings" +) + +const ( + ContentTypeText = "text" + + ContentTypeImage = "image" + + ContentTypeMultiPart = "multi_part" +) + +type ContentType = string + +type SearchEvalTargetRequest struct { + // 空间id + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 搜索关键字,如需使用请用户自行实现 + Keyword *string `thrift:"keyword,2,optional" frugal:"2,optional,string" form:"keyword" json:"keyword,omitempty" query:"keyword"` + // 扩展字段:目前会透传regoin和空间id信息,key名如下:search_region、search_space_id + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` + PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` + PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewSearchEvalTargetRequest() *SearchEvalTargetRequest { + return &SearchEvalTargetRequest{} +} + +func (p *SearchEvalTargetRequest) InitDefault() { +} + +var SearchEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *SearchEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return SearchEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var SearchEvalTargetRequest_Keyword_DEFAULT string + +func (p *SearchEvalTargetRequest) GetKeyword() (v string) { + if p == nil { + return + } + if !p.IsSetKeyword() { + return SearchEvalTargetRequest_Keyword_DEFAULT + } + return *p.Keyword +} + +var SearchEvalTargetRequest_Ext_DEFAULT map[string]string + +func (p *SearchEvalTargetRequest) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return SearchEvalTargetRequest_Ext_DEFAULT + } + return p.Ext +} + +var SearchEvalTargetRequest_PageSize_DEFAULT int32 + +func (p *SearchEvalTargetRequest) GetPageSize() (v int32) { + if p == nil { + return + } + if !p.IsSetPageSize() { + return SearchEvalTargetRequest_PageSize_DEFAULT + } + return *p.PageSize +} + +var SearchEvalTargetRequest_PageToken_DEFAULT string + +func (p *SearchEvalTargetRequest) GetPageToken() (v string) { + if p == nil { + return + } + if !p.IsSetPageToken() { + return SearchEvalTargetRequest_PageToken_DEFAULT + } + return *p.PageToken +} + +var SearchEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *SearchEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return SearchEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *SearchEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *SearchEvalTargetRequest) SetKeyword(val *string) { + p.Keyword = val +} +func (p *SearchEvalTargetRequest) SetExt(val map[string]string) { + p.Ext = val +} +func (p *SearchEvalTargetRequest) SetPageSize(val *int32) { + p.PageSize = val +} +func (p *SearchEvalTargetRequest) SetPageToken(val *string) { + p.PageToken = val +} +func (p *SearchEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_SearchEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "keyword", + 20: "ext", + 100: "page_size", + 101: "page_token", + 255: "Base", +} + +func (p *SearchEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *SearchEvalTargetRequest) IsSetKeyword() bool { + return p.Keyword != nil +} + +func (p *SearchEvalTargetRequest) IsSetExt() bool { + return p.Ext != nil +} + +func (p *SearchEvalTargetRequest) IsSetPageSize() bool { + return p.PageSize != nil +} + +func (p *SearchEvalTargetRequest) IsSetPageToken() bool { + return p.PageToken != nil +} + +func (p *SearchEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *SearchEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.I32 { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.STRING { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Keyword = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField100(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.PageSize = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField101(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.PageToken = _field + return nil +} +func (p *SearchEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *SearchEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetKeyword() { + if err = oprot.WriteFieldBegin("keyword", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Keyword); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetPageSize() { + if err = oprot.WriteFieldBegin("page_size", thrift.I32, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.PageSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetPageToken() { + if err = oprot.WriteFieldBegin("page_token", thrift.STRING, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.PageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchEvalTargetRequest(%+v)", *p) + +} + +func (p *SearchEvalTargetRequest) DeepEqual(ano *SearchEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.Keyword) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + if !p.Field100DeepEqual(ano.PageSize) { + return false + } + if !p.Field101DeepEqual(ano.PageToken) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *SearchEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field2DeepEqual(src *string) bool { + + if p.Keyword == src { + return true + } else if p.Keyword == nil || src == nil { + return false + } + if strings.Compare(*p.Keyword, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *SearchEvalTargetRequest) Field100DeepEqual(src *int32) bool { + + if p.PageSize == src { + return true + } else if p.PageSize == nil || src == nil { + return false + } + if *p.PageSize != *src { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field101DeepEqual(src *string) bool { + + if p.PageToken == src { + return true + } else if p.PageToken == nil || src == nil { + return false + } + if strings.Compare(*p.PageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type SearchEvalTargetResponse struct { + CustomEvalTargets []*CustomEvalTarget `thrift:"custom_eval_targets,1,optional" frugal:"1,optional,list" form:"custom_eval_targets" json:"custom_eval_targets,omitempty" query:"custom_eval_targets"` + NextPageToken *string `thrift:"next_page_token,100,optional" frugal:"100,optional,string" form:"next_page_token" json:"next_page_token,omitempty" query:"next_page_token"` + HasMore *bool `thrift:"has_more,101,optional" frugal:"101,optional,bool" form:"has_more" json:"has_more,omitempty" query:"has_more"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewSearchEvalTargetResponse() *SearchEvalTargetResponse { + return &SearchEvalTargetResponse{} +} + +func (p *SearchEvalTargetResponse) InitDefault() { +} + +var SearchEvalTargetResponse_CustomEvalTargets_DEFAULT []*CustomEvalTarget + +func (p *SearchEvalTargetResponse) GetCustomEvalTargets() (v []*CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTargets() { + return SearchEvalTargetResponse_CustomEvalTargets_DEFAULT + } + return p.CustomEvalTargets +} + +var SearchEvalTargetResponse_NextPageToken_DEFAULT string + +func (p *SearchEvalTargetResponse) GetNextPageToken() (v string) { + if p == nil { + return + } + if !p.IsSetNextPageToken() { + return SearchEvalTargetResponse_NextPageToken_DEFAULT + } + return *p.NextPageToken +} + +var SearchEvalTargetResponse_HasMore_DEFAULT bool + +func (p *SearchEvalTargetResponse) GetHasMore() (v bool) { + if p == nil { + return + } + if !p.IsSetHasMore() { + return SearchEvalTargetResponse_HasMore_DEFAULT + } + return *p.HasMore +} + +var SearchEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *SearchEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return SearchEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *SearchEvalTargetResponse) SetCustomEvalTargets(val []*CustomEvalTarget) { + p.CustomEvalTargets = val +} +func (p *SearchEvalTargetResponse) SetNextPageToken(val *string) { + p.NextPageToken = val +} +func (p *SearchEvalTargetResponse) SetHasMore(val *bool) { + p.HasMore = val +} +func (p *SearchEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_SearchEvalTargetResponse = map[int16]string{ + 1: "custom_eval_targets", + 100: "next_page_token", + 101: "has_more", + 255: "BaseResp", +} + +func (p *SearchEvalTargetResponse) IsSetCustomEvalTargets() bool { + return p.CustomEvalTargets != nil +} + +func (p *SearchEvalTargetResponse) IsSetNextPageToken() bool { + return p.NextPageToken != nil +} + +func (p *SearchEvalTargetResponse) IsSetHasMore() bool { + return p.HasMore != nil +} + +func (p *SearchEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *SearchEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 100: + if fieldTypeId == thrift.STRING { + if err = p.ReadField100(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 101: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*CustomEvalTarget, 0, size) + values := make([]CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.CustomEvalTargets = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField100(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.NextPageToken = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField101(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.HasMore = _field + return nil +} +func (p *SearchEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *SearchEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTargets() { + if err = oprot.WriteFieldBegin("custom_eval_targets", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.CustomEvalTargets)); err != nil { + return err + } + for _, v := range p.CustomEvalTargets { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetNextPageToken() { + if err = oprot.WriteFieldBegin("next_page_token", thrift.STRING, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.NextPageToken); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetHasMore() { + if err = oprot.WriteFieldBegin("has_more", thrift.BOOL, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.HasMore); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 101 end error: ", p), err) +} +func (p *SearchEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *SearchEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SearchEvalTargetResponse(%+v)", *p) + +} + +func (p *SearchEvalTargetResponse) DeepEqual(ano *SearchEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.CustomEvalTargets) { + return false + } + if !p.Field100DeepEqual(ano.NextPageToken) { + return false + } + if !p.Field101DeepEqual(ano.HasMore) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *SearchEvalTargetResponse) Field1DeepEqual(src []*CustomEvalTarget) bool { + + if len(p.CustomEvalTargets) != len(src) { + return false + } + for i, v := range p.CustomEvalTargets { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *SearchEvalTargetResponse) Field100DeepEqual(src *string) bool { + + if p.NextPageToken == src { + return true + } else if p.NextPageToken == nil || src == nil { + return false + } + if strings.Compare(*p.NextPageToken, *src) != 0 { + return false + } + return true +} +func (p *SearchEvalTargetResponse) Field101DeepEqual(src *bool) bool { + + if p.HasMore == src { + return true + } else if p.HasMore == nil || src == nil { + return false + } + if *p.HasMore != *src { + return false + } + return true +} +func (p *SearchEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type CustomEvalTarget struct { + // 唯一键,平台不消费,仅做透传 + ID *string `thrift:"id,1,optional" frugal:"1,optional,string" form:"id" json:"id,omitempty" query:"id"` + // 名称,平台用于展示在对象搜索下拉列表 + Name *string `thrift:"name,2,optional" frugal:"2,optional,string" form:"name" json:"name,omitempty" query:"name"` + // 头像url,平台用于展示在对象搜索下拉列表 + AvatarURL *string `thrift:"avatar_url,3,optional" frugal:"3,optional,string" form:"avatar_url" json:"avatar_url,omitempty" query:"avatar_url"` +} + +func NewCustomEvalTarget() *CustomEvalTarget { + return &CustomEvalTarget{} +} + +func (p *CustomEvalTarget) InitDefault() { +} + +var CustomEvalTarget_ID_DEFAULT string + +func (p *CustomEvalTarget) GetID() (v string) { + if p == nil { + return + } + if !p.IsSetID() { + return CustomEvalTarget_ID_DEFAULT + } + return *p.ID +} + +var CustomEvalTarget_Name_DEFAULT string + +func (p *CustomEvalTarget) GetName() (v string) { + if p == nil { + return + } + if !p.IsSetName() { + return CustomEvalTarget_Name_DEFAULT + } + return *p.Name +} + +var CustomEvalTarget_AvatarURL_DEFAULT string + +func (p *CustomEvalTarget) GetAvatarURL() (v string) { + if p == nil { + return + } + if !p.IsSetAvatarURL() { + return CustomEvalTarget_AvatarURL_DEFAULT + } + return *p.AvatarURL +} +func (p *CustomEvalTarget) SetID(val *string) { + p.ID = val +} +func (p *CustomEvalTarget) SetName(val *string) { + p.Name = val +} +func (p *CustomEvalTarget) SetAvatarURL(val *string) { + p.AvatarURL = val +} + +var fieldIDToName_CustomEvalTarget = map[int16]string{ + 1: "id", + 2: "name", + 3: "avatar_url", +} + +func (p *CustomEvalTarget) IsSetID() bool { + return p.ID != nil +} + +func (p *CustomEvalTarget) IsSetName() bool { + return p.Name != nil +} + +func (p *CustomEvalTarget) IsSetAvatarURL() bool { + return p.AvatarURL != nil +} + +func (p *CustomEvalTarget) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CustomEvalTarget) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ID = _field + return nil +} +func (p *CustomEvalTarget) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Name = _field + return nil +} +func (p *CustomEvalTarget) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.AvatarURL = _field + return nil +} + +func (p *CustomEvalTarget) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CustomEvalTarget"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CustomEvalTarget) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetID() { + if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *CustomEvalTarget) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAvatarURL() { + if err = oprot.WriteFieldBegin("avatar_url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.AvatarURL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *CustomEvalTarget) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CustomEvalTarget(%+v)", *p) + +} + +func (p *CustomEvalTarget) DeepEqual(ano *CustomEvalTarget) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ID) { + return false + } + if !p.Field2DeepEqual(ano.Name) { + return false + } + if !p.Field3DeepEqual(ano.AvatarURL) { + return false + } + return true +} + +func (p *CustomEvalTarget) Field1DeepEqual(src *string) bool { + + if p.ID == src { + return true + } else if p.ID == nil || src == nil { + return false + } + if strings.Compare(*p.ID, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field2DeepEqual(src *string) bool { + + if p.Name == src { + return true + } else if p.Name == nil || src == nil { + return false + } + if strings.Compare(*p.Name, *src) != 0 { + return false + } + return true +} +func (p *CustomEvalTarget) Field3DeepEqual(src *string) bool { + + if p.AvatarURL == src { + return true + } else if p.AvatarURL == nil || src == nil { + return false + } + if strings.Compare(*p.AvatarURL, *src) != 0 { + return false + } + return true +} + +type InvokeEvalTargetRequest struct { + // 空间id + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 输入信息 + Input *InvokeEvalTargetInput `thrift:"input,2,optional" frugal:"2,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` + // 如果创建实验时选了二级对象,则会透传search接口返回的二级对象信息 + CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,3,optional" frugal:"3,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` +} + +func NewInvokeEvalTargetRequest() *InvokeEvalTargetRequest { + return &InvokeEvalTargetRequest{} +} + +func (p *InvokeEvalTargetRequest) InitDefault() { +} + +var InvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *InvokeEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return InvokeEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var InvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput + +func (p *InvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { + if p == nil { + return + } + if !p.IsSetInput() { + return InvokeEvalTargetRequest_Input_DEFAULT + } + return p.Input +} + +var InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget + +func (p *InvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return InvokeEvalTargetRequest_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} + +var InvokeEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *InvokeEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return InvokeEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *InvokeEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *InvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { + p.Input = val +} +func (p *InvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { + p.CustomEvalTarget = val +} +func (p *InvokeEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_InvokeEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "input", + 3: "custom_eval_target", + 255: "Base", +} + +func (p *InvokeEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *InvokeEvalTargetRequest) IsSetInput() bool { + return p.Input != nil +} + +func (p *InvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + +func (p *InvokeEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *InvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetInput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Input = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { + _field := NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} +func (p *InvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *InvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInput() { + if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Input.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *InvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *InvokeEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetRequest(%+v)", *p) + +} + +func (p *InvokeEvalTargetRequest) DeepEqual(ano *InvokeEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.Input) { + return false + } + if !p.Field3DeepEqual(ano.CustomEvalTarget) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *InvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field2DeepEqual(src *InvokeEvalTargetInput) bool { + + if !p.Input.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field3DeepEqual(src *CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type InvokeEvalTargetResponse struct { + // 输出 + Output *InvokeEvalTargetOutput `thrift:"output,1,optional" frugal:"1,optional,InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` + // 消耗 + Usage *InvokeEvalTargetUsage `thrift:"usage,2,optional" frugal:"2,optional,InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewInvokeEvalTargetResponse() *InvokeEvalTargetResponse { + return &InvokeEvalTargetResponse{} +} + +func (p *InvokeEvalTargetResponse) InitDefault() { +} + +var InvokeEvalTargetResponse_Output_DEFAULT *InvokeEvalTargetOutput + +func (p *InvokeEvalTargetResponse) GetOutput() (v *InvokeEvalTargetOutput) { + if p == nil { + return + } + if !p.IsSetOutput() { + return InvokeEvalTargetResponse_Output_DEFAULT + } + return p.Output +} + +var InvokeEvalTargetResponse_Usage_DEFAULT *InvokeEvalTargetUsage + +func (p *InvokeEvalTargetResponse) GetUsage() (v *InvokeEvalTargetUsage) { + if p == nil { + return + } + if !p.IsSetUsage() { + return InvokeEvalTargetResponse_Usage_DEFAULT + } + return p.Usage +} + +var InvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *InvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return InvokeEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *InvokeEvalTargetResponse) SetOutput(val *InvokeEvalTargetOutput) { + p.Output = val +} +func (p *InvokeEvalTargetResponse) SetUsage(val *InvokeEvalTargetUsage) { + p.Usage = val +} +func (p *InvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_InvokeEvalTargetResponse = map[int16]string{ + 1: "output", + 2: "usage", + 255: "BaseResp", +} + +func (p *InvokeEvalTargetResponse) IsSetOutput() bool { + return p.Output != nil +} + +func (p *InvokeEvalTargetResponse) IsSetUsage() bool { + return p.Usage != nil +} + +func (p *InvokeEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *InvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetOutput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Output = _field + return nil +} +func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetUsage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Usage = _field + return nil +} +func (p *InvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *InvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetOutput() { + if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Output.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetUsage() { + if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Usage.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *InvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *InvokeEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetResponse(%+v)", *p) + +} + +func (p *InvokeEvalTargetResponse) DeepEqual(ano *InvokeEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Output) { + return false + } + if !p.Field2DeepEqual(ano.Usage) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *InvokeEvalTargetResponse) Field1DeepEqual(src *InvokeEvalTargetOutput) bool { + + if !p.Output.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetResponse) Field2DeepEqual(src *InvokeEvalTargetUsage) bool { + + if !p.Usage.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type InvokeEvalTargetInput struct { + // 评测集字段信息,key=评测集列名,value=评测集列值 + EvalSetFields map[string]*Content `thrift:"eval_set_fields,1,optional" frugal:"1,optional,map" form:"eval_set_fields" json:"eval_set_fields,omitempty" query:"eval_set_fields"` + // 扩展字段,动态参数会通过ext字段传递 + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` +} + +func NewInvokeEvalTargetInput() *InvokeEvalTargetInput { + return &InvokeEvalTargetInput{} +} + +func (p *InvokeEvalTargetInput) InitDefault() { +} + +var InvokeEvalTargetInput_EvalSetFields_DEFAULT map[string]*Content + +func (p *InvokeEvalTargetInput) GetEvalSetFields() (v map[string]*Content) { + if p == nil { + return + } + if !p.IsSetEvalSetFields() { + return InvokeEvalTargetInput_EvalSetFields_DEFAULT + } + return p.EvalSetFields +} + +var InvokeEvalTargetInput_Ext_DEFAULT map[string]string + +func (p *InvokeEvalTargetInput) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return InvokeEvalTargetInput_Ext_DEFAULT + } + return p.Ext +} +func (p *InvokeEvalTargetInput) SetEvalSetFields(val map[string]*Content) { + p.EvalSetFields = val +} +func (p *InvokeEvalTargetInput) SetExt(val map[string]string) { + p.Ext = val +} + +var fieldIDToName_InvokeEvalTargetInput = map[int16]string{ + 1: "eval_set_fields", + 20: "ext", +} + +func (p *InvokeEvalTargetInput) IsSetEvalSetFields() bool { + return p.EvalSetFields != nil +} + +func (p *InvokeEvalTargetInput) IsSetExt() bool { + return p.Ext != nil +} + +func (p *InvokeEvalTargetInput) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) ReadField1(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]*Content, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + _val := &values[i] + _val.InitDefault() + if err := _val.Read(iprot); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.EvalSetFields = _field + return nil +} +func (p *InvokeEvalTargetInput) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} + +func (p *InvokeEvalTargetInput) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetInput"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalSetFields() { + if err = oprot.WriteFieldBegin("eval_set_fields", thrift.MAP, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.EvalSetFields)); err != nil { + return err + } + for k, v := range p.EvalSetFields { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetInput) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} + +func (p *InvokeEvalTargetInput) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetInput(%+v)", *p) + +} + +func (p *InvokeEvalTargetInput) DeepEqual(ano *InvokeEvalTargetInput) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.EvalSetFields) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + return true +} + +func (p *InvokeEvalTargetInput) Field1DeepEqual(src map[string]*Content) bool { + + if len(p.EvalSetFields) != len(src) { + return false + } + for k, v := range p.EvalSetFields { + _src := src[k] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *InvokeEvalTargetInput) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +// 新增 +type InvokeEvalTargetOutput struct { + // 实际输出 + ActualOutput *Content `thrift:"actual_output,1,optional" frugal:"1,optional,Content" form:"actual_output" json:"actual_output,omitempty" query:"actual_output"` + // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 + Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` +} + +func NewInvokeEvalTargetOutput() *InvokeEvalTargetOutput { + return &InvokeEvalTargetOutput{} +} + +func (p *InvokeEvalTargetOutput) InitDefault() { +} + +var InvokeEvalTargetOutput_ActualOutput_DEFAULT *Content + +func (p *InvokeEvalTargetOutput) GetActualOutput() (v *Content) { + if p == nil { + return + } + if !p.IsSetActualOutput() { + return InvokeEvalTargetOutput_ActualOutput_DEFAULT + } + return p.ActualOutput +} + +var InvokeEvalTargetOutput_Ext_DEFAULT map[string]string + +func (p *InvokeEvalTargetOutput) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return InvokeEvalTargetOutput_Ext_DEFAULT + } + return p.Ext +} +func (p *InvokeEvalTargetOutput) SetActualOutput(val *Content) { + p.ActualOutput = val +} +func (p *InvokeEvalTargetOutput) SetExt(val map[string]string) { + p.Ext = val +} + +var fieldIDToName_InvokeEvalTargetOutput = map[int16]string{ + 1: "actual_output", + 20: "ext", +} + +func (p *InvokeEvalTargetOutput) IsSetActualOutput() bool { + return p.ActualOutput != nil +} + +func (p *InvokeEvalTargetOutput) IsSetExt() bool { + return p.Ext != nil +} + +func (p *InvokeEvalTargetOutput) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.MAP { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) ReadField1(iprot thrift.TProtocol) error { + _field := NewContent() + if err := _field.Read(iprot); err != nil { + return err + } + p.ActualOutput = _field + return nil +} +func (p *InvokeEvalTargetOutput) ReadField20(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} + +func (p *InvokeEvalTargetOutput) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetOutput"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetActualOutput() { + if err = oprot.WriteFieldBegin("actual_output", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.ActualOutput.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetOutput) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} + +func (p *InvokeEvalTargetOutput) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetOutput(%+v)", *p) + +} + +func (p *InvokeEvalTargetOutput) DeepEqual(ano *InvokeEvalTargetOutput) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ActualOutput) { + return false + } + if !p.Field20DeepEqual(ano.Ext) { + return false + } + return true +} + +func (p *InvokeEvalTargetOutput) Field1DeepEqual(src *Content) bool { + + if !p.ActualOutput.DeepEqual(src) { + return false + } + return true +} +func (p *InvokeEvalTargetOutput) Field20DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +type Content struct { + // 类型 + ContentType *ContentType `thrift:"content_type,1,optional" frugal:"1,optional,string" form:"content_type" json:"content_type,omitempty" query:"content_type"` + // 当content_type=text,则从此字段中取值 + Text *string `thrift:"text,10,optional" frugal:"10,optional,string" form:"text" json:"text,omitempty" query:"text"` + // 当content_type=image,则从此字段中取图片信息 + Image *Image `thrift:"image,11,optional" frugal:"11,optional,Image" form:"image" json:"image,omitempty" query:"image"` + // 当content_type=multi_part,则从此字段遍历获取多模态的值 + MultiPart []*Content `thrift:"multi_part,12,optional" frugal:"12,optional,list" form:"multi_part" json:"multi_part,omitempty" query:"multi_part"` +} + +func NewContent() *Content { + return &Content{} +} + +func (p *Content) InitDefault() { +} + +var Content_ContentType_DEFAULT ContentType + +func (p *Content) GetContentType() (v ContentType) { + if p == nil { + return + } + if !p.IsSetContentType() { + return Content_ContentType_DEFAULT + } + return *p.ContentType +} + +var Content_Text_DEFAULT string + +func (p *Content) GetText() (v string) { + if p == nil { + return + } + if !p.IsSetText() { + return Content_Text_DEFAULT + } + return *p.Text +} + +var Content_Image_DEFAULT *Image + +func (p *Content) GetImage() (v *Image) { + if p == nil { + return + } + if !p.IsSetImage() { + return Content_Image_DEFAULT + } + return p.Image +} + +var Content_MultiPart_DEFAULT []*Content + +func (p *Content) GetMultiPart() (v []*Content) { + if p == nil { + return + } + if !p.IsSetMultiPart() { + return Content_MultiPart_DEFAULT + } + return p.MultiPart +} +func (p *Content) SetContentType(val *ContentType) { + p.ContentType = val +} +func (p *Content) SetText(val *string) { + p.Text = val +} +func (p *Content) SetImage(val *Image) { + p.Image = val +} +func (p *Content) SetMultiPart(val []*Content) { + p.MultiPart = val +} + +var fieldIDToName_Content = map[int16]string{ + 1: "content_type", + 10: "text", + 11: "image", + 12: "multi_part", +} + +func (p *Content) IsSetContentType() bool { + return p.ContentType != nil +} + +func (p *Content) IsSetText() bool { + return p.Text != nil +} + +func (p *Content) IsSetImage() bool { + return p.Image != nil +} + +func (p *Content) IsSetMultiPart() bool { + return p.MultiPart != nil +} + +func (p *Content) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.LIST { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Content) ReadField1(iprot thrift.TProtocol) error { + + var _field *ContentType + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ContentType = _field + return nil +} +func (p *Content) ReadField10(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Text = _field + return nil +} +func (p *Content) ReadField11(iprot thrift.TProtocol) error { + _field := NewImage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Image = _field + return nil +} +func (p *Content) ReadField12(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Content, 0, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.MultiPart = _field + return nil +} + +func (p *Content) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Content"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Content) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetContentType() { + if err = oprot.WriteFieldBegin("content_type", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ContentType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *Content) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetText() { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *Content) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetImage() { + if err = oprot.WriteFieldBegin("image", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Image.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *Content) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetMultiPart() { + if err = oprot.WriteFieldBegin("multi_part", thrift.LIST, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MultiPart)); err != nil { + return err + } + for _, v := range p.MultiPart { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Content) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Content(%+v)", *p) + +} + +func (p *Content) DeepEqual(ano *Content) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ContentType) { + return false + } + if !p.Field10DeepEqual(ano.Text) { + return false + } + if !p.Field11DeepEqual(ano.Image) { + return false + } + if !p.Field12DeepEqual(ano.MultiPart) { + return false + } + return true +} + +func (p *Content) Field1DeepEqual(src *ContentType) bool { + + if p.ContentType == src { + return true + } else if p.ContentType == nil || src == nil { + return false + } + if strings.Compare(*p.ContentType, *src) != 0 { + return false + } + return true +} +func (p *Content) Field10DeepEqual(src *string) bool { + + if p.Text == src { + return true + } else if p.Text == nil || src == nil { + return false + } + if strings.Compare(*p.Text, *src) != 0 { + return false + } + return true +} +func (p *Content) Field11DeepEqual(src *Image) bool { + + if !p.Image.DeepEqual(src) { + return false + } + return true +} +func (p *Content) Field12DeepEqual(src []*Content) bool { + + if len(p.MultiPart) != len(src) { + return false + } + for i, v := range p.MultiPart { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} + +type Image struct { + URL *string `thrift:"url,1,optional" frugal:"1,optional,string" form:"url" json:"url,omitempty" query:"url"` +} + +func NewImage() *Image { + return &Image{} +} + +func (p *Image) InitDefault() { +} + +var Image_URL_DEFAULT string + +func (p *Image) GetURL() (v string) { + if p == nil { + return + } + if !p.IsSetURL() { + return Image_URL_DEFAULT + } + return *p.URL +} +func (p *Image) SetURL(val *string) { + p.URL = val +} + +var fieldIDToName_Image = map[int16]string{ + 1: "url", +} + +func (p *Image) IsSetURL() bool { + return p.URL != nil +} + +func (p *Image) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Image) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.URL = _field + return nil +} + +func (p *Image) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Image"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Image) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Image) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Image(%+v)", *p) + +} + +func (p *Image) DeepEqual(ano *Image) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.URL) { + return false + } + return true +} + +func (p *Image) Field1DeepEqual(src *string) bool { + + if p.URL == src { + return true + } else if p.URL == nil || src == nil { + return false + } + if strings.Compare(*p.URL, *src) != 0 { + return false + } + return true +} + +type InvokeEvalTargetUsage struct { + // 输入token消耗 + InputTokens *int64 `thrift:"input_tokens,1,optional" frugal:"1,optional,i64" form:"input_tokens" json:"input_tokens,omitempty" query:"input_tokens"` + // 输出token消耗 + OutputTokens *int64 `thrift:"output_tokens,2,optional" frugal:"2,optional,i64" form:"output_tokens" json:"output_tokens,omitempty" query:"output_tokens"` +} + +func NewInvokeEvalTargetUsage() *InvokeEvalTargetUsage { + return &InvokeEvalTargetUsage{} +} + +func (p *InvokeEvalTargetUsage) InitDefault() { +} + +var InvokeEvalTargetUsage_InputTokens_DEFAULT int64 + +func (p *InvokeEvalTargetUsage) GetInputTokens() (v int64) { + if p == nil { + return + } + if !p.IsSetInputTokens() { + return InvokeEvalTargetUsage_InputTokens_DEFAULT + } + return *p.InputTokens +} + +var InvokeEvalTargetUsage_OutputTokens_DEFAULT int64 + +func (p *InvokeEvalTargetUsage) GetOutputTokens() (v int64) { + if p == nil { + return + } + if !p.IsSetOutputTokens() { + return InvokeEvalTargetUsage_OutputTokens_DEFAULT + } + return *p.OutputTokens +} +func (p *InvokeEvalTargetUsage) SetInputTokens(val *int64) { + p.InputTokens = val +} +func (p *InvokeEvalTargetUsage) SetOutputTokens(val *int64) { + p.OutputTokens = val +} + +var fieldIDToName_InvokeEvalTargetUsage = map[int16]string{ + 1: "input_tokens", + 2: "output_tokens", +} + +func (p *InvokeEvalTargetUsage) IsSetInputTokens() bool { + return p.InputTokens != nil +} + +func (p *InvokeEvalTargetUsage) IsSetOutputTokens() bool { + return p.OutputTokens != nil +} + +func (p *InvokeEvalTargetUsage) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InputTokens = _field + return nil +} +func (p *InvokeEvalTargetUsage) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.OutputTokens = _field + return nil +} + +func (p *InvokeEvalTargetUsage) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTargetUsage"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetInputTokens() { + if err = oprot.WriteFieldBegin("input_tokens", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InputTokens); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *InvokeEvalTargetUsage) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetOutputTokens() { + if err = oprot.WriteFieldBegin("output_tokens", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.OutputTokens); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *InvokeEvalTargetUsage) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InvokeEvalTargetUsage(%+v)", *p) + +} + +func (p *InvokeEvalTargetUsage) DeepEqual(ano *InvokeEvalTargetUsage) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.InputTokens) { + return false + } + if !p.Field2DeepEqual(ano.OutputTokens) { + return false + } + return true +} + +func (p *InvokeEvalTargetUsage) Field1DeepEqual(src *int64) bool { + + if p.InputTokens == src { + return true + } else if p.InputTokens == nil || src == nil { + return false + } + if *p.InputTokens != *src { + return false + } + return true +} +func (p *InvokeEvalTargetUsage) Field2DeepEqual(src *int64) bool { + + if p.OutputTokens == src { + return true + } else if p.OutputTokens == nil || src == nil { + return false + } + if *p.OutputTokens != *src { + return false + } + return true +} + +type AsyncInvokeEvalTargetRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` + // 执行id,传递给自定义对象,在回传结果时透传 + InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` + // 根据invoke_id签发的token,在回传结果时透传 + Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` + // 执行输入信息 + Input *InvokeEvalTargetInput `thrift:"input,4,optional" frugal:"4,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` + // 如果创建实验时选了二级对象,则会透传二级对象信息 + CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,5,optional" frugal:"5,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` +} + +func NewAsyncInvokeEvalTargetRequest() *AsyncInvokeEvalTargetRequest { + return &AsyncInvokeEvalTargetRequest{} +} + +func (p *AsyncInvokeEvalTargetRequest) InitDefault() { +} + +var AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT int64 + +func (p *AsyncInvokeEvalTargetRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return AsyncInvokeEvalTargetRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT int64 + +func (p *AsyncInvokeEvalTargetRequest) GetInvokeID() (v int64) { + if p == nil { + return + } + if !p.IsSetInvokeID() { + return AsyncInvokeEvalTargetRequest_InvokeID_DEFAULT + } + return *p.InvokeID +} + +var AsyncInvokeEvalTargetRequest_Token_DEFAULT string + +func (p *AsyncInvokeEvalTargetRequest) GetToken() (v string) { + if p == nil { + return + } + if !p.IsSetToken() { + return AsyncInvokeEvalTargetRequest_Token_DEFAULT + } + return *p.Token +} + +var AsyncInvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput + +func (p *AsyncInvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { + if p == nil { + return + } + if !p.IsSetInput() { + return AsyncInvokeEvalTargetRequest_Input_DEFAULT + } + return p.Input +} + +var AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT *CustomEvalTarget + +func (p *AsyncInvokeEvalTargetRequest) GetCustomEvalTarget() (v *CustomEvalTarget) { + if p == nil { + return + } + if !p.IsSetCustomEvalTarget() { + return AsyncInvokeEvalTargetRequest_CustomEvalTarget_DEFAULT + } + return p.CustomEvalTarget +} + +var AsyncInvokeEvalTargetRequest_Base_DEFAULT *base.Base + +func (p *AsyncInvokeEvalTargetRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return AsyncInvokeEvalTargetRequest_Base_DEFAULT + } + return p.Base +} +func (p *AsyncInvokeEvalTargetRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *AsyncInvokeEvalTargetRequest) SetInvokeID(val *int64) { + p.InvokeID = val +} +func (p *AsyncInvokeEvalTargetRequest) SetToken(val *string) { + p.Token = val +} +func (p *AsyncInvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { + p.Input = val +} +func (p *AsyncInvokeEvalTargetRequest) SetCustomEvalTarget(val *CustomEvalTarget) { + p.CustomEvalTarget = val +} +func (p *AsyncInvokeEvalTargetRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_AsyncInvokeEvalTargetRequest = map[int16]string{ + 1: "workspace_id", + 2: "invoke_id", + 3: "token", + 4: "input", + 5: "custom_eval_target", + 255: "Base", +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetInvokeID() bool { + return p.InvokeID != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetToken() bool { + return p.Token != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetInput() bool { + return p.Input != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetCustomEvalTarget() bool { + return p.CustomEvalTarget != nil +} + +func (p *AsyncInvokeEvalTargetRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *AsyncInvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InvokeID = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetInput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Input = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { + _field := NewCustomEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.CustomEvalTarget = _field + return nil +} +func (p *AsyncInvokeEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *AsyncInvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeID() { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetInput() { + if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Input.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomEvalTarget() { + if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 5); err != nil { + goto WriteFieldBeginError + } + if err := p.CustomEvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} +func (p *AsyncInvokeEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncInvokeEvalTargetRequest(%+v)", *p) + +} + +func (p *AsyncInvokeEvalTargetRequest) DeepEqual(ano *AsyncInvokeEvalTargetRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.InvokeID) { + return false + } + if !p.Field3DeepEqual(ano.Token) { + return false + } + if !p.Field4DeepEqual(ano.Input) { + return false + } + if !p.Field5DeepEqual(ano.CustomEvalTarget) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *AsyncInvokeEvalTargetRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field2DeepEqual(src *int64) bool { + + if p.InvokeID == src { + return true + } else if p.InvokeID == nil || src == nil { + return false + } + if *p.InvokeID != *src { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field3DeepEqual(src *string) bool { + + if p.Token == src { + return true + } else if p.Token == nil || src == nil { + return false + } + if strings.Compare(*p.Token, *src) != 0 { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field4DeepEqual(src *InvokeEvalTargetInput) bool { + + if !p.Input.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field5DeepEqual(src *CustomEvalTarget) bool { + + if !p.CustomEvalTarget.DeepEqual(src) { + return false + } + return true +} +func (p *AsyncInvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type AsyncInvokeEvalTargetResponse struct { + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` +} + +func NewAsyncInvokeEvalTargetResponse() *AsyncInvokeEvalTargetResponse { + return &AsyncInvokeEvalTargetResponse{} +} + +func (p *AsyncInvokeEvalTargetResponse) InitDefault() { +} + +var AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *AsyncInvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return AsyncInvokeEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *AsyncInvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_AsyncInvokeEvalTargetResponse = map[int16]string{ + 255: "BaseResp", +} + +func (p *AsyncInvokeEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *AsyncInvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *AsyncInvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncInvokeEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncInvokeEvalTargetResponse(%+v)", *p) + +} + +func (p *AsyncInvokeEvalTargetResponse) DeepEqual(ano *AsyncInvokeEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *AsyncInvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIService interface { + SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) + + InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) + + AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) +} + +type EvaluationSPIServiceClient struct { + c thrift.TClient +} + +func NewEvaluationSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewEvaluationSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewEvaluationSPIServiceClient(c thrift.TClient) *EvaluationSPIServiceClient { + return &EvaluationSPIServiceClient{ + c: c, + } +} + +func (p *EvaluationSPIServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *EvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *SearchEvalTargetRequest) (r *SearchEvalTargetResponse, err error) { + var _args EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceSearchEvalTargetResult + if err = p.Client_().Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *InvokeEvalTargetRequest) (r *InvokeEvalTargetResponse, err error) { + var _args EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceInvokeEvalTargetResult + if err = p.Client_().Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *EvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *AsyncInvokeEvalTargetRequest) (r *AsyncInvokeEvalTargetResponse, err error) { + var _args EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.Client_().Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type EvaluationSPIServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler EvaluationSPIService +} + +func (p *EvaluationSPIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *EvaluationSPIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *EvaluationSPIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewEvaluationSPIServiceProcessor(handler EvaluationSPIService) *EvaluationSPIServiceProcessor { + self := &EvaluationSPIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("SearchEvalTarget", &evaluationSPIServiceProcessorSearchEvalTarget{handler: handler}) + self.AddToProcessorMap("InvokeEvalTarget", &evaluationSPIServiceProcessorInvokeEvalTarget{handler: handler}) + self.AddToProcessorMap("AsyncInvokeEvalTarget", &evaluationSPIServiceProcessorAsyncInvokeEvalTarget{handler: handler}) + return self +} +func (p *EvaluationSPIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type evaluationSPIServiceProcessorSearchEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorSearchEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceSearchEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceSearchEvalTargetResult{} + var retval *SearchEvalTargetResponse + if retval, err2 = p.handler.SearchEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("SearchEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("SearchEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evaluationSPIServiceProcessorInvokeEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceInvokeEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceInvokeEvalTargetResult{} + var retval *InvokeEvalTargetResponse + if retval, err2 = p.handler.InvokeEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing InvokeEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("InvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("InvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evaluationSPIServiceProcessorAsyncInvokeEvalTarget struct { + handler EvaluationSPIService +} + +func (p *evaluationSPIServiceProcessorAsyncInvokeEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationSPIServiceAsyncInvokeEvalTargetResult{} + var retval *AsyncInvokeEvalTargetResponse + if retval, err2 = p.handler.AsyncInvokeEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncInvokeEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AsyncInvokeEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type EvaluationSPIServiceSearchEvalTargetArgs struct { + Req *SearchEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchEvalTargetRequest"` +} + +func NewEvaluationSPIServiceSearchEvalTargetArgs() *EvaluationSPIServiceSearchEvalTargetArgs { + return &EvaluationSPIServiceSearchEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT *SearchEvalTargetRequest + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetReq() (v *SearchEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceSearchEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceSearchEvalTargetArgs) SetReq(val *SearchEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSearchEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) Field1DeepEqual(src *SearchEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceSearchEvalTargetResult struct { + Success *SearchEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchEvalTargetResponse"` +} + +func NewEvaluationSPIServiceSearchEvalTargetResult() *EvaluationSPIServiceSearchEvalTargetResult { + return &EvaluationSPIServiceSearchEvalTargetResult{} +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT *SearchEvalTargetResponse + +func (p *EvaluationSPIServiceSearchEvalTargetResult) GetSuccess() (v *SearchEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceSearchEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceSearchEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*SearchEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSearchEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SearchEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceSearchEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceSearchEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) Field0DeepEqual(src *SearchEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceInvokeEvalTargetArgs struct { + Req *InvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,InvokeEvalTargetRequest"` +} + +func NewEvaluationSPIServiceInvokeEvalTargetArgs() *EvaluationSPIServiceInvokeEvalTargetArgs { + return &EvaluationSPIServiceInvokeEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT *InvokeEvalTargetRequest + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetReq() (v *InvokeEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceInvokeEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) SetReq(val *InvokeEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) Field1DeepEqual(src *InvokeEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceInvokeEvalTargetResult struct { + Success *InvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,InvokeEvalTargetResponse"` +} + +func NewEvaluationSPIServiceInvokeEvalTargetResult() *EvaluationSPIServiceInvokeEvalTargetResult { + return &EvaluationSPIServiceInvokeEvalTargetResult{} +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT *InvokeEvalTargetResponse + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetSuccess() (v *InvokeEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceInvokeEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceInvokeEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*InvokeEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewInvokeEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("InvokeEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceInvokeEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceInvokeEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) Field0DeepEqual(src *InvokeEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceAsyncInvokeEvalTargetArgs struct { + Req *AsyncInvokeEvalTargetRequest `thrift:"req,1" frugal:"1,default,AsyncInvokeEvalTargetRequest"` +} + +func NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() *EvaluationSPIServiceAsyncInvokeEvalTargetArgs { + return &EvaluationSPIServiceAsyncInvokeEvalTargetArgs{} +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) InitDefault() { +} + +var EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT *AsyncInvokeEvalTargetRequest + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetReq() (v *AsyncInvokeEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationSPIServiceAsyncInvokeEvalTargetArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) SetReq(val *AsyncInvokeEvalTargetRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAsyncInvokeEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetArgs(%+v)", *p) + +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) Field1DeepEqual(src *AsyncInvokeEvalTargetRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationSPIServiceAsyncInvokeEvalTargetResult struct { + Success *AsyncInvokeEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncInvokeEvalTargetResponse"` +} + +func NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() *EvaluationSPIServiceAsyncInvokeEvalTargetResult { + return &EvaluationSPIServiceAsyncInvokeEvalTargetResult{} +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) InitDefault() { +} + +var EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT *AsyncInvokeEvalTargetResponse + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetSuccess() (v *AsyncInvokeEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationSPIServiceAsyncInvokeEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*AsyncInvokeEvalTargetResponse) +} + +var fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAsyncInvokeEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncInvokeEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationSPIServiceAsyncInvokeEvalTargetResult(%+v)", *p) + +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepEqual(ano *EvaluationSPIServiceAsyncInvokeEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) Field0DeepEqual(src *AsyncInvokeEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go new file mode 100644 index 000000000..1fd02ed04 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi_validator.go @@ -0,0 +1,129 @@ +// Code generated by Validator v0.2.6. DO NOT EDIT. + +package spi + +import ( + "bytes" + "fmt" + "reflect" + "regexp" + "strings" + "time" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = (*regexp.Regexp)(nil) + _ = time.Nanosecond +) + +func (p *SearchEvalTargetRequest) IsValid() error { + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *SearchEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *CustomEvalTarget) IsValid() error { + return nil +} +func (p *InvokeEvalTargetRequest) IsValid() error { + if p.Input != nil { + if err := p.Input.IsValid(); err != nil { + return fmt.Errorf("field Input not valid, %w", err) + } + } + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *InvokeEvalTargetResponse) IsValid() error { + if p.Output != nil { + if err := p.Output.IsValid(); err != nil { + return fmt.Errorf("field Output not valid, %w", err) + } + } + if p.Usage != nil { + if err := p.Usage.IsValid(); err != nil { + return fmt.Errorf("field Usage not valid, %w", err) + } + } + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} +func (p *InvokeEvalTargetInput) IsValid() error { + return nil +} +func (p *InvokeEvalTargetOutput) IsValid() error { + if p.ActualOutput != nil { + if err := p.ActualOutput.IsValid(); err != nil { + return fmt.Errorf("field ActualOutput not valid, %w", err) + } + } + return nil +} +func (p *Content) IsValid() error { + if p.Image != nil { + if err := p.Image.IsValid(); err != nil { + return fmt.Errorf("field Image not valid, %w", err) + } + } + return nil +} +func (p *Image) IsValid() error { + return nil +} +func (p *InvokeEvalTargetUsage) IsValid() error { + return nil +} +func (p *AsyncInvokeEvalTargetRequest) IsValid() error { + if p.Input != nil { + if err := p.Input.IsValid(); err != nil { + return fmt.Errorf("field Input not valid, %w", err) + } + } + if p.CustomEvalTarget != nil { + if err := p.CustomEvalTarget.IsValid(); err != nil { + return fmt.Errorf("field CustomEvalTarget not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *AsyncInvokeEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go new file mode 100644 index 000000000..4805b07ff --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/client.go @@ -0,0 +1,61 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationspiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) + InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) + AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvaluationSPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvaluationSPIServiceClient struct { + *kClient +} + +func (p *kEvaluationSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchEvalTarget(ctx, req) +} + +func (p *kEvaluationSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.InvokeEvalTarget(ctx, req) +} + +func (p *kEvaluationSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncInvokeEvalTarget(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go new file mode 100644 index 000000000..12c2c80cf --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/evaluationspiservice.go @@ -0,0 +1,167 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationspiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "SearchEvalTarget": kitex.NewMethodInfo( + searchEvalTargetHandler, + newEvaluationSPIServiceSearchEvalTargetArgs, + newEvaluationSPIServiceSearchEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "InvokeEvalTarget": kitex.NewMethodInfo( + invokeEvalTargetHandler, + newEvaluationSPIServiceInvokeEvalTargetArgs, + newEvaluationSPIServiceInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncInvokeEvalTarget": kitex.NewMethodInfo( + asyncInvokeEvalTargetHandler, + newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, + newEvaluationSPIServiceAsyncInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evaluationSPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evaluationSPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvaluationSPIService" + handlerType := (*spi.EvaluationSPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "spi", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() +} + +func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetResult() +} + +func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() +} + +func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceSearchEvalTargetResult + if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceInvokeEvalTargetResult + if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go new file mode 100644 index 000000000..a93da14d8 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/evaluationspiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evaluationspiservice + +import ( + server "github.com/cloudwego/kitex/server" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler spi.EvaluationSPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler spi.EvaluationSPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go new file mode 100644 index 000000000..e75303c47 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/k-consts.go @@ -0,0 +1,4 @@ +package spi + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go new file mode 100644 index 000000000..afc3bcf99 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go @@ -0,0 +1,3823 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package spi + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cloudwego/gopkg/protocol/thrift" + kutils "github.com/cloudwego/kitex/pkg/utils" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" +) + +var ( + _ = base.KitexUnusedProtection +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.STOP +) + +func (p *SearchEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SearchEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Keyword = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *int32 + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageSize = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.PageToken = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *SearchEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *SearchEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SearchEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field20Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SearchEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetKeyword() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Keyword) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageSize() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 100) + offset += thrift.Binary.WriteI32(buf[offset:], *p.PageSize) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 101) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.PageToken) + } + return offset +} + +func (p *SearchEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *SearchEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *SearchEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetKeyword() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Keyword) + } + return l +} + +func (p *SearchEvalTargetRequest) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *SearchEvalTargetRequest) field100Length() int { + l := 0 + if p.IsSetPageSize() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *SearchEvalTargetRequest) field101Length() int { + l := 0 + if p.IsSetPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.PageToken) + } + return l +} + +func (p *SearchEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *SearchEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*SearchEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.Keyword != nil { + var tmp string + if *src.Keyword != "" { + tmp = kutils.StringDeepCopy(*src.Keyword) + } + p.Keyword = &tmp + } + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + if src.PageSize != nil { + tmp := *src.PageSize + p.PageSize = &tmp + } + + if src.PageToken != nil { + var tmp string + if *src.PageToken != "" { + tmp = kutils.StringDeepCopy(*src.PageToken) + } + p.PageToken = &tmp + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *SearchEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 100: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField100(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 101: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField101(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SearchEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SearchEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*CustomEvalTarget, 0, size) + values := make([]CustomEvalTarget, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.CustomEvalTargets = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField100(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.NextPageToken = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField101(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.HasMore = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *SearchEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *SearchEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SearchEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field100Length() + l += p.field101Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SearchEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTargets() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 1) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.CustomEvalTargets { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetNextPageToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.NextPageToken) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetHasMore() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 101) + offset += thrift.Binary.WriteBool(buf[offset:], *p.HasMore) + } + return offset +} + +func (p *SearchEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *SearchEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetCustomEvalTargets() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.CustomEvalTargets { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *SearchEvalTargetResponse) field100Length() int { + l := 0 + if p.IsSetNextPageToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.NextPageToken) + } + return l +} + +func (p *SearchEvalTargetResponse) field101Length() int { + l := 0 + if p.IsSetHasMore() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *SearchEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *SearchEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*SearchEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.CustomEvalTargets != nil { + p.CustomEvalTargets = make([]*CustomEvalTarget, 0, len(src.CustomEvalTargets)) + for _, elem := range src.CustomEvalTargets { + var _elem *CustomEvalTarget + if elem != nil { + _elem = &CustomEvalTarget{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.CustomEvalTargets = append(p.CustomEvalTargets, _elem) + } + } + + if src.NextPageToken != nil { + var tmp string + if *src.NextPageToken != "" { + tmp = kutils.StringDeepCopy(*src.NextPageToken) + } + p.NextPageToken = &tmp + } + + if src.HasMore != nil { + tmp := *src.HasMore + p.HasMore = &tmp + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *CustomEvalTarget) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomEvalTarget[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CustomEvalTarget) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ID = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Name = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.AvatarURL = _field + return offset, nil +} + +func (p *CustomEvalTarget) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *CustomEvalTarget) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CustomEvalTarget) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CustomEvalTarget) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ID) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *CustomEvalTarget) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAvatarURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.AvatarURL) + } + return offset +} + +func (p *CustomEvalTarget) field1Length() int { + l := 0 + if p.IsSetID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ID) + } + return l +} + +func (p *CustomEvalTarget) field2Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *CustomEvalTarget) field3Length() int { + l := 0 + if p.IsSetAvatarURL() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.AvatarURL) + } + return l +} + +func (p *CustomEvalTarget) DeepCopy(s interface{}) error { + src, ok := s.(*CustomEvalTarget) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ID != nil { + var tmp string + if *src.ID != "" { + tmp = kutils.StringDeepCopy(*src.ID) + } + p.ID = &tmp + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.AvatarURL != nil { + var tmp string + if *src.AvatarURL != "" { + tmp = kutils.StringDeepCopy(*src.AvatarURL) + } + p.AvatarURL = &tmp + } + + return nil +} + +func (p *InvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetInput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Input = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + _field := NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *InvokeEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.Input.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 3) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetInput() { + l += thrift.Binary.FieldBeginLength() + l += p.Input.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) field3Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *InvokeEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + var _input *InvokeEvalTargetInput + if src.Input != nil { + _input = &InvokeEvalTargetInput{} + if err := _input.DeepCopy(src.Input); err != nil { + return err + } + } + p.Input = _input + + var _customEvalTarget *CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *InvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetOutput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Output = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetUsage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Usage = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Output.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUsage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.Usage.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *InvokeEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.Output.BLength() + } + return l +} + +func (p *InvokeEvalTargetResponse) field2Length() int { + l := 0 + if p.IsSetUsage() { + l += thrift.Binary.FieldBeginLength() + l += p.Usage.BLength() + } + return l +} + +func (p *InvokeEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *InvokeEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _output *InvokeEvalTargetOutput + if src.Output != nil { + _output = &InvokeEvalTargetOutput{} + if err := _output.DeepCopy(src.Output); err != nil { + return err + } + } + p.Output = _output + + var _usage *InvokeEvalTargetUsage + if src.Usage != nil { + _usage = &InvokeEvalTargetUsage{} + if err := _usage.DeepCopy(src.Usage); err != nil { + return err + } + } + p.Usage = _usage + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *InvokeEvalTargetInput) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetInput[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetInput) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]*Content, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + _val := &values[i] + _val.InitDefault() + if l, err := _val.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field[_key] = _val + } + p.EvalSetFields = _field + return offset, nil +} + +func (p *InvokeEvalTargetInput) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *InvokeEvalTargetInput) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetInput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetInput) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field20Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetInput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalSetFields() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 1) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.EvalSetFields { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) + } + return offset +} + +func (p *InvokeEvalTargetInput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *InvokeEvalTargetInput) field1Length() int { + l := 0 + if p.IsSetEvalSetFields() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.EvalSetFields { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += v.BLength() + } + } + return l +} + +func (p *InvokeEvalTargetInput) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *InvokeEvalTargetInput) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetInput) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.EvalSetFields != nil { + p.EvalSetFields = make(map[string]*Content, len(src.EvalSetFields)) + for key, val := range src.EvalSetFields { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val *Content + if val != nil { + _val = &Content{} + if err := _val.DeepCopy(val); err != nil { + return err + } + } + + p.EvalSetFields[_key] = _val + } + } + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + return nil +} + +func (p *InvokeEvalTargetOutput) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetOutput[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetOutput) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewContent() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.ActualOutput = _field + return offset, nil +} + +func (p *InvokeEvalTargetOutput) FastReadField20(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + +func (p *InvokeEvalTargetOutput) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetOutput) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetOutput) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field20Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetOutput) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetActualOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.ActualOutput.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *InvokeEvalTargetOutput) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 20) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + +func (p *InvokeEvalTargetOutput) field1Length() int { + l := 0 + if p.IsSetActualOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.ActualOutput.BLength() + } + return l +} + +func (p *InvokeEvalTargetOutput) field20Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *InvokeEvalTargetOutput) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetOutput) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _actualOutput *Content + if src.ActualOutput != nil { + _actualOutput = &Content{} + if err := _actualOutput.DeepCopy(src.ActualOutput); err != nil { + return err + } + } + p.ActualOutput = _actualOutput + + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + + return nil +} + +func (p *Content) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Content[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Content) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *ContentType + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ContentType = _field + return offset, nil +} + +func (p *Content) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Text = _field + return offset, nil +} + +func (p *Content) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := NewImage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Image = _field + return offset, nil +} + +func (p *Content) FastReadField12(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*Content, 0, size) + values := make([]Content, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.MultiPart = _field + return offset, nil +} + +func (p *Content) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Content) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Content) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Content) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetContentType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ContentType) + } + return offset +} + +func (p *Content) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetText() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Text) + } + return offset +} + +func (p *Content) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetImage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.Image.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *Content) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetMultiPart() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 12) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.MultiPart { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *Content) field1Length() int { + l := 0 + if p.IsSetContentType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ContentType) + } + return l +} + +func (p *Content) field10Length() int { + l := 0 + if p.IsSetText() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Text) + } + return l +} + +func (p *Content) field11Length() int { + l := 0 + if p.IsSetImage() { + l += thrift.Binary.FieldBeginLength() + l += p.Image.BLength() + } + return l +} + +func (p *Content) field12Length() int { + l := 0 + if p.IsSetMultiPart() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.MultiPart { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *Content) DeepCopy(s interface{}) error { + src, ok := s.(*Content) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ContentType != nil { + tmp := *src.ContentType + p.ContentType = &tmp + } + + if src.Text != nil { + var tmp string + if *src.Text != "" { + tmp = kutils.StringDeepCopy(*src.Text) + } + p.Text = &tmp + } + + var _image *Image + if src.Image != nil { + _image = &Image{} + if err := _image.DeepCopy(src.Image); err != nil { + return err + } + } + p.Image = _image + + if src.MultiPart != nil { + p.MultiPart = make([]*Content, 0, len(src.MultiPart)) + for _, elem := range src.MultiPart { + var _elem *Content + if elem != nil { + _elem = &Content{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.MultiPart = append(p.MultiPart, _elem) + } + } + + return nil +} + +func (p *Image) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Image[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Image) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.URL = _field + return offset, nil +} + +func (p *Image) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Image) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Image) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Image) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.URL) + } + return offset +} + +func (p *Image) field1Length() int { + l := 0 + if p.IsSetURL() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.URL) + } + return l +} + +func (p *Image) DeepCopy(s interface{}) error { + src, ok := s.(*Image) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.URL != nil { + var tmp string + if *src.URL != "" { + tmp = kutils.StringDeepCopy(*src.URL) + } + p.URL = &tmp + } + + return nil +} + +func (p *InvokeEvalTargetUsage) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InvokeEvalTargetUsage[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *InvokeEvalTargetUsage) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InputTokens = _field + return offset, nil +} + +func (p *InvokeEvalTargetUsage) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.OutputTokens = _field + return offset, nil +} + +func (p *InvokeEvalTargetUsage) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *InvokeEvalTargetUsage) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *InvokeEvalTargetUsage) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *InvokeEvalTargetUsage) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInputTokens() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InputTokens) + } + return offset +} + +func (p *InvokeEvalTargetUsage) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutputTokens() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.OutputTokens) + } + return offset +} + +func (p *InvokeEvalTargetUsage) field1Length() int { + l := 0 + if p.IsSetInputTokens() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetUsage) field2Length() int { + l := 0 + if p.IsSetOutputTokens() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *InvokeEvalTargetUsage) DeepCopy(s interface{}) error { + src, ok := s.(*InvokeEvalTargetUsage) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.InputTokens != nil { + tmp := *src.InputTokens + p.InputTokens = &tmp + } + + if src.OutputTokens != nil { + tmp := *src.OutputTokens + p.OutputTokens = &tmp + } + + return nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InvokeID = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Token = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetInput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Input = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + _field := NewCustomEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CustomEvalTarget = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncInvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetToken() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 4) + offset += p.Input.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 5) + offset += p.CustomEvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *AsyncInvokeEvalTargetRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field2Length() int { + l := 0 + if p.IsSetInvokeID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field3Length() int { + l := 0 + if p.IsSetToken() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Token) + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field4Length() int { + l := 0 + if p.IsSetInput() { + l += thrift.Binary.FieldBeginLength() + l += p.Input.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field5Length() int { + l := 0 + if p.IsSetCustomEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.CustomEvalTarget.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *AsyncInvokeEvalTargetRequest) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncInvokeEvalTargetRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.InvokeID != nil { + tmp := *src.InvokeID + p.InvokeID = &tmp + } + + if src.Token != nil { + var tmp string + if *src.Token != "" { + tmp = kutils.StringDeepCopy(*src.Token) + } + p.Token = &tmp + } + + var _input *InvokeEvalTargetInput + if src.Input != nil { + _input = &InvokeEvalTargetInput{} + if err := _input.DeepCopy(src.Input); err != nil { + return err + } + } + p.Input = _input + + var _customEvalTarget *CustomEvalTarget + if src.CustomEvalTarget != nil { + _customEvalTarget = &CustomEvalTarget{} + if err := _customEvalTarget.DeepCopy(src.CustomEvalTarget); err != nil { + return err + } + } + p.CustomEvalTarget = _customEvalTarget + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *AsyncInvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncInvokeEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncInvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *AsyncInvokeEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncInvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncInvokeEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncInvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *AsyncInvokeEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *AsyncInvokeEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncInvokeEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewSearchEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceSearchEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *SearchEvalTargetRequest + if src.Req != nil { + _req = &SearchEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceSearchEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewSearchEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceSearchEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *SearchEvalTargetResponse + if src.Success != nil { + _success = &SearchEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *InvokeEvalTargetRequest + if src.Req != nil { + _req = &InvokeEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewInvokeEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceInvokeEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *InvokeEvalTargetResponse + if src.Success != nil { + _success = &InvokeEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncInvokeEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *AsyncInvokeEvalTargetRequest + if src.Req != nil { + _req = &AsyncInvokeEvalTargetRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationSPIServiceAsyncInvokeEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncInvokeEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationSPIServiceAsyncInvokeEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *AsyncInvokeEvalTargetResponse + if src.Success != nil { + _success = &AsyncInvokeEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationSPIServiceSearchEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceSearchEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvaluationSPIServiceInvokeEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceInvokeEvalTargetResult) GetResult() interface{} { + return p.Success +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationSPIServiceAsyncInvokeEvalTargetResult) GetResult() interface{} { + return p.Success +} diff --git a/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go b/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go new file mode 100644 index 000000000..67597c82e --- /dev/null +++ b/backend/loop_gen/coze/loop/evaluation/lospi/local_evaluationspiservice.go @@ -0,0 +1,98 @@ +// Code generated by cozeloop. DO NOT EDIT. +package lospi // import github.com/coze-dev/coze-loop/backend/lospi + +import ( + "context" + + "github.com/cloudwego/kitex/client/callopt" + "github.com/cloudwego/kitex/pkg/endpoint" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +type LocalEvaluationSPIService struct { + impl spi.EvaluationSPIService // the service implementation + mds endpoint.Middleware +} + +func NewLocalEvaluationSPIService(impl spi.EvaluationSPIService, mds ...endpoint.Middleware) *LocalEvaluationSPIService { + return &LocalEvaluationSPIService{ + impl: impl, + mds: endpoint.Chain(mds...), + } +} + +func (l *LocalEvaluationSPIService) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (*spi.SearchEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + resp, err := l.impl.SearchEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceSearchEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceSearchEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "SearchEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.InvokeEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + resp, err := l.impl.InvokeEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceInvokeEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceInvokeEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "InvokeEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (*spi.AsyncInvokeEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + result := out.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + resp, err := l.impl.AsyncInvokeEvalTarget(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs{Req: req} + result := &spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "AsyncInvokeEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationSPIService) injectRPCInfo(ctx context.Context, method string) context.Context { + rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) + ri := rpcinfo.NewRPCInfo( + rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), + rpcinfo.NewEndpointInfo("EvaluationSPIService", method, nil, nil), + rpcinfo.NewServerInvocation(), + nil, + rpcStats.ImmutableView(), + ) + return rpcinfo.NewCtxWithRPCInfo(ctx, ri) +} diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index a35922fcf..cdf70c208 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -85,8 +85,9 @@ type BatchGetEvaluationSetVersionsResult struct { type Option func(option *Opt) type Opt struct { - PublishVersion *string - BotInfoType CozeBotInfoType + PublishVersion *string + BotInfoType CozeBotInfoType + CustomEvalTarget *CustomEvalTarget } func WithCozeBotPublishVersion(publishVersion *string) Option { @@ -101,6 +102,12 @@ func WithCozeBotInfoType(botInfoType CozeBotInfoType) Option { } } +func WithCustomEvalTarget(customTarget *CustomEvalTarget) Option { + return func(option *Opt) { + option.CustomEvalTarget = customTarget + } +} + type ExecuteEvalTargetParam struct { TargetID int64 VersionID int64 From 8c05e7ea63f262f1af14f0c45cb6c2b94f6f740c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 11:38:00 +0800 Subject: [PATCH 015/100] fix Change-Id: I85ba8299df085da4e887f919635456c545e9be65 --- .../application/convertor/experiment/expt.go | 9 ++++++++- .../evaluation/application/eval_target_app.go | 15 ++++++++++++--- backend/modules/evaluation/domain/entity/expt.go | 5 +++-- .../evaluation/domain/service/expt_manage_impl.go | 14 ++++++++++++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/experiment/expt.go b/backend/modules/evaluation/application/convertor/experiment/expt.go index 74139cfef..d967cbafe 100644 --- a/backend/modules/evaluation/application/convertor/experiment/expt.go +++ b/backend/modules/evaluation/application/convertor/experiment/expt.go @@ -283,7 +283,14 @@ func CreateEvalTargetParamDTO2DO(param *eval_target.CreateEvalTargetParam) *enti if param.BotInfoType != nil { res.BotInfoType = gptr.Of(entity.CozeBotInfoType(*param.BotInfoType)) } - + if param.CustomEvalTarget != nil { + res.CustomEvalTarget = &entity.CustomEvalTarget{ + ID: param.CustomEvalTarget.ID, + Name: param.CustomEvalTarget.Name, + AvatarURL: param.CustomEvalTarget.AvatarURL, + Ext: param.CustomEvalTarget.Ext, + } + } return res } diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 049570f29..6dc715a5c 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -71,10 +71,19 @@ func (e EvalTargetApplicationImpl) CreateEvalTarget(ctx context.Context, request if err != nil { return nil, err } - id, versionID, err := e.evalTargetService.CreateEvalTarget(ctx, request.WorkspaceID, request.Param.GetSourceTargetID(), request.Param.GetSourceTargetVersion(), - entity.EvalTargetType(request.Param.GetEvalTargetType()), - entity.WithCozeBotPublishVersion(request.Param.BotPublishVersion), + opts := make([]entity.Option, 0) + opts = append(opts, entity.WithCozeBotPublishVersion(request.Param.BotPublishVersion), entity.WithCozeBotInfoType(entity.CozeBotInfoType(request.Param.GetBotInfoType()))) + if request.GetParam().GetCustomEvalTarget() != nil { + opts = append(opts, entity.WithCustomEvalTarget(&entity.CustomEvalTarget{ + ID: request.GetParam().GetCustomEvalTarget().ID, + Name: request.GetParam().GetCustomEvalTarget().Name, + AvatarURL: request.GetParam().GetCustomEvalTarget().AvatarURL, + Ext: request.GetParam().GetCustomEvalTarget().Ext, + })) + } + id, versionID, err := e.evalTargetService.CreateEvalTarget(ctx, request.WorkspaceID, request.Param.GetSourceTargetID(), request.Param.GetSourceTargetVersion(), + entity.EvalTargetType(request.Param.GetEvalTargetType()), opts...) if err != nil { return nil, err } diff --git a/backend/modules/evaluation/domain/entity/expt.go b/backend/modules/evaluation/domain/entity/expt.go index 4ea3059cd..65ce5338a 100644 --- a/backend/modules/evaluation/domain/entity/expt.go +++ b/backend/modules/evaluation/domain/entity/expt.go @@ -173,9 +173,9 @@ type EvaluatorsConf struct { } func (e *EvaluatorsConf) Valid(ctx context.Context) error { - //if e == nil || len(e.EvaluatorConf) == 0 { + // if e == nil || len(e.EvaluatorConf) == 0 { // return fmt.Errorf("invalid EvaluatorConf: %v", json.Jsonify(e)) - //} + // } for _, conf := range e.EvaluatorConf { if err := conf.Valid(ctx); err != nil { return err @@ -295,6 +295,7 @@ type CreateEvalTargetParam struct { EvalTargetType *EvalTargetType BotInfoType *CozeBotInfoType BotPublishVersion *string + CustomEvalTarget *CustomEvalTarget // 搜索对象返回的信息 } func (c *CreateEvalTargetParam) IsNull() bool { diff --git a/backend/modules/evaluation/domain/service/expt_manage_impl.go b/backend/modules/evaluation/domain/service/expt_manage_impl.go index a3271f0d6..f542c6fb1 100644 --- a/backend/modules/evaluation/domain/service/expt_manage_impl.go +++ b/backend/modules/evaluation/domain/service/expt_manage_impl.go @@ -481,9 +481,19 @@ func (e *ExptMangerImpl) CreateExpt(ctx context.Context, req *entity.CreateExptP var versionedTargetID *entity.VersionedTargetID if !req.CreateEvalTargetParam.IsNull() { - targetID, targetVersionID, err := e.evalTargetService.CreateEvalTarget(ctx, req.WorkspaceID, gptr.Indirect(req.CreateEvalTargetParam.SourceTargetID), gptr.Indirect(req.CreateEvalTargetParam.SourceTargetVersion), gptr.Indirect(req.CreateEvalTargetParam.EvalTargetType), - entity.WithCozeBotPublishVersion(req.CreateEvalTargetParam.BotPublishVersion), + opts := make([]entity.Option, 0) + opts = append(opts, entity.WithCozeBotPublishVersion(req.CreateEvalTargetParam.BotPublishVersion), entity.WithCozeBotInfoType(gptr.Indirect(req.CreateEvalTargetParam.BotInfoType))) + if req.CreateEvalTargetParam.CustomEvalTarget != nil { + opts = append(opts, entity.WithCustomEvalTarget(&entity.CustomEvalTarget{ + ID: req.CreateEvalTargetParam.CustomEvalTarget.ID, + Name: req.CreateEvalTargetParam.CustomEvalTarget.Name, + AvatarURL: req.CreateEvalTargetParam.CustomEvalTarget.AvatarURL, + Ext: req.CreateEvalTargetParam.CustomEvalTarget.Ext, + })) + } + targetID, targetVersionID, err := e.evalTargetService.CreateEvalTarget(ctx, req.WorkspaceID, gptr.Indirect(req.CreateEvalTargetParam.SourceTargetID), gptr.Indirect(req.CreateEvalTargetParam.SourceTargetVersion), gptr.Indirect(req.CreateEvalTargetParam.EvalTargetType), + opts...) if err != nil { return nil, errorx.Wrapf(err, "CreateEvalTarget failed, param: %v", json.Jsonify(req.CreateEvalTargetParam)) } From 8fe20abf9550d0b801418b9a127095fabdb423a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 12:04:21 +0800 Subject: [PATCH 016/100] fix Change-Id: I983651fd7489a515390887ee6cff9b7a2e58766a --- .../domain/eval_target/eval_target.go | 118 +++++++++--------- .../convertor/target/eval_target.go | 4 +- .../entity/target_builtin_custom_psm.go | 16 +-- .../loop/evaluation/domain/eval_target.thrift | 16 +-- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index dfee45e07..d0bbda4c4 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -26,9 +26,9 @@ const ( AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" - HttpMethodGet = "get" + HTTPMethodGet = "get" - HttpMethodPost = "post" + HTTPMethodPost = "post" ) type EvalTargetType int64 @@ -289,7 +289,7 @@ type Region = string type AccessProtocol = string -type HttpMethod = string +type HTTPMethod = string type EvalTarget struct { // 基本信息 @@ -2148,13 +2148,13 @@ type CustomPSM struct { Regions []Region `thrift:"regions,12,optional" frugal:"12,optional,list" form:"regions" json:"regions,omitempty" query:"regions"` Cluster *string `thrift:"cluster,13,optional" frugal:"13,optional,string" form:"cluster" json:"cluster,omitempty" query:"cluster"` // 执行http信息 - InvokeHTTPInfo *HttpInfo `thrift:"invoke_http_info,14,optional" frugal:"14,optional,HttpInfo" form:"invoke_http_info" json:"invoke_http_info,omitempty" query:"invoke_http_info"` + InvokeHTTPInfo *HTTPInfo `thrift:"invoke_http_info,14,optional" frugal:"14,optional,HTTPInfo" form:"invoke_http_info" json:"invoke_http_info,omitempty" query:"invoke_http_info"` // 异步执行http信息,如果用户选了异步就传入这个字段 - AsyncInvokeHTTPInfo *HttpInfo `thrift:"async_invoke_http_info,15,optional" frugal:"15,optional,HttpInfo" form:"async_invoke_http_info" json:"async_invoke_http_info,omitempty" query:"async_invoke_http_info"` + AsyncInvokeHTTPInfo *HTTPInfo `thrift:"async_invoke_http_info,15,optional" frugal:"15,optional,HTTPInfo" form:"async_invoke_http_info" json:"async_invoke_http_info,omitempty" query:"async_invoke_http_info"` // 是否需要搜索对象 NeedSearchTarget *bool `thrift:"need_search_target,16,optional" frugal:"16,optional,bool" form:"need_search_target" json:"need_search_target,omitempty" query:"need_search_target"` // 搜索对象http信息 - SearchHTTPInfo *HttpInfo `thrift:"search_http_info,17,optional" frugal:"17,optional,HttpInfo" form:"search_http_info" json:"search_http_info,omitempty" query:"search_http_info"` + SearchHTTPInfo *HTTPInfo `thrift:"search_http_info,17,optional" frugal:"17,optional,HTTPInfo" form:"search_http_info" json:"search_http_info,omitempty" query:"search_http_info"` // 搜索对象返回的信息 CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,18,optional" frugal:"18,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` // 是否异步 @@ -2252,9 +2252,9 @@ func (p *CustomPSM) GetCluster() (v string) { return *p.Cluster } -var CustomPSM_InvokeHTTPInfo_DEFAULT *HttpInfo +var CustomPSM_InvokeHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetInvokeHTTPInfo() (v *HttpInfo) { +func (p *CustomPSM) GetInvokeHTTPInfo() (v *HTTPInfo) { if p == nil { return } @@ -2264,9 +2264,9 @@ func (p *CustomPSM) GetInvokeHTTPInfo() (v *HttpInfo) { return p.InvokeHTTPInfo } -var CustomPSM_AsyncInvokeHTTPInfo_DEFAULT *HttpInfo +var CustomPSM_AsyncInvokeHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetAsyncInvokeHTTPInfo() (v *HttpInfo) { +func (p *CustomPSM) GetAsyncInvokeHTTPInfo() (v *HTTPInfo) { if p == nil { return } @@ -2288,9 +2288,9 @@ func (p *CustomPSM) GetNeedSearchTarget() (v bool) { return *p.NeedSearchTarget } -var CustomPSM_SearchHTTPInfo_DEFAULT *HttpInfo +var CustomPSM_SearchHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetSearchHTTPInfo() (v *HttpInfo) { +func (p *CustomPSM) GetSearchHTTPInfo() (v *HTTPInfo) { if p == nil { return } @@ -2344,16 +2344,16 @@ func (p *CustomPSM) SetRegions(val []Region) { func (p *CustomPSM) SetCluster(val *string) { p.Cluster = val } -func (p *CustomPSM) SetInvokeHTTPInfo(val *HttpInfo) { +func (p *CustomPSM) SetInvokeHTTPInfo(val *HTTPInfo) { p.InvokeHTTPInfo = val } -func (p *CustomPSM) SetAsyncInvokeHTTPInfo(val *HttpInfo) { +func (p *CustomPSM) SetAsyncInvokeHTTPInfo(val *HTTPInfo) { p.AsyncInvokeHTTPInfo = val } func (p *CustomPSM) SetNeedSearchTarget(val *bool) { p.NeedSearchTarget = val } -func (p *CustomPSM) SetSearchHTTPInfo(val *HttpInfo) { +func (p *CustomPSM) SetSearchHTTPInfo(val *HTTPInfo) { p.SearchHTTPInfo = val } func (p *CustomPSM) SetCustomEvalTarget(val *CustomEvalTarget) { @@ -2672,7 +2672,7 @@ func (p *CustomPSM) ReadField13(iprot thrift.TProtocol) error { return nil } func (p *CustomPSM) ReadField14(iprot thrift.TProtocol) error { - _field := NewHttpInfo() + _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err } @@ -2680,7 +2680,7 @@ func (p *CustomPSM) ReadField14(iprot thrift.TProtocol) error { return nil } func (p *CustomPSM) ReadField15(iprot thrift.TProtocol) error { - _field := NewHttpInfo() + _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err } @@ -2699,7 +2699,7 @@ func (p *CustomPSM) ReadField16(iprot thrift.TProtocol) error { return nil } func (p *CustomPSM) ReadField17(iprot thrift.TProtocol) error { - _field := NewHttpInfo() + _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err } @@ -3186,14 +3186,14 @@ func (p *CustomPSM) Field13DeepEqual(src *string) bool { } return true } -func (p *CustomPSM) Field14DeepEqual(src *HttpInfo) bool { +func (p *CustomPSM) Field14DeepEqual(src *HTTPInfo) bool { if !p.InvokeHTTPInfo.DeepEqual(src) { return false } return true } -func (p *CustomPSM) Field15DeepEqual(src *HttpInfo) bool { +func (p *CustomPSM) Field15DeepEqual(src *HTTPInfo) bool { if !p.AsyncInvokeHTTPInfo.DeepEqual(src) { return false @@ -3212,7 +3212,7 @@ func (p *CustomPSM) Field16DeepEqual(src *bool) bool { } return true } -func (p *CustomPSM) Field17DeepEqual(src *HttpInfo) bool { +func (p *CustomPSM) Field17DeepEqual(src *HTTPInfo) bool { if !p.SearchHTTPInfo.DeepEqual(src) { return false @@ -3685,84 +3685,84 @@ func (p *CustomEvalTarget) Field10DeepEqual(src map[string]string) bool { return true } -type HttpInfo struct { - Method *HttpMethod `thrift:"method,1,optional" frugal:"1,optional,string" form:"method" json:"method,omitempty" query:"method"` +type HTTPInfo struct { + Method *HTTPMethod `thrift:"method,1,optional" frugal:"1,optional,string" form:"method" json:"method,omitempty" query:"method"` Path *string `thrift:"path,2,optional" frugal:"2,optional,string" form:"path" json:"path,omitempty" query:"path"` // ms,默认5000,最大800,000 Timeout *int64 `thrift:"timeout,4,optional" frugal:"4,optional,i64" form:"timeout" json:"timeout,omitempty" query:"timeout"` } -func NewHttpInfo() *HttpInfo { - return &HttpInfo{} +func NewHTTPInfo() *HTTPInfo { + return &HTTPInfo{} } -func (p *HttpInfo) InitDefault() { +func (p *HTTPInfo) InitDefault() { } -var HttpInfo_Method_DEFAULT HttpMethod +var HTTPInfo_Method_DEFAULT HTTPMethod -func (p *HttpInfo) GetMethod() (v HttpMethod) { +func (p *HTTPInfo) GetMethod() (v HTTPMethod) { if p == nil { return } if !p.IsSetMethod() { - return HttpInfo_Method_DEFAULT + return HTTPInfo_Method_DEFAULT } return *p.Method } -var HttpInfo_Path_DEFAULT string +var HTTPInfo_Path_DEFAULT string -func (p *HttpInfo) GetPath() (v string) { +func (p *HTTPInfo) GetPath() (v string) { if p == nil { return } if !p.IsSetPath() { - return HttpInfo_Path_DEFAULT + return HTTPInfo_Path_DEFAULT } return *p.Path } -var HttpInfo_Timeout_DEFAULT int64 +var HTTPInfo_Timeout_DEFAULT int64 -func (p *HttpInfo) GetTimeout() (v int64) { +func (p *HTTPInfo) GetTimeout() (v int64) { if p == nil { return } if !p.IsSetTimeout() { - return HttpInfo_Timeout_DEFAULT + return HTTPInfo_Timeout_DEFAULT } return *p.Timeout } -func (p *HttpInfo) SetMethod(val *HttpMethod) { +func (p *HTTPInfo) SetMethod(val *HTTPMethod) { p.Method = val } -func (p *HttpInfo) SetPath(val *string) { +func (p *HTTPInfo) SetPath(val *string) { p.Path = val } -func (p *HttpInfo) SetTimeout(val *int64) { +func (p *HTTPInfo) SetTimeout(val *int64) { p.Timeout = val } -var fieldIDToName_HttpInfo = map[int16]string{ +var fieldIDToName_HTTPInfo = map[int16]string{ 1: "method", 2: "path", 4: "timeout", } -func (p *HttpInfo) IsSetMethod() bool { +func (p *HTTPInfo) IsSetMethod() bool { return p.Method != nil } -func (p *HttpInfo) IsSetPath() bool { +func (p *HTTPInfo) IsSetPath() bool { return p.Path != nil } -func (p *HttpInfo) IsSetTimeout() bool { +func (p *HTTPInfo) IsSetTimeout() bool { return p.Timeout != nil } -func (p *HttpInfo) Read(iprot thrift.TProtocol) (err error) { +func (p *HTTPInfo) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -3823,7 +3823,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HttpInfo[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_HTTPInfo[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -3833,9 +3833,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *HttpInfo) ReadField1(iprot thrift.TProtocol) error { +func (p *HTTPInfo) ReadField1(iprot thrift.TProtocol) error { - var _field *HttpMethod + var _field *HTTPMethod if v, err := iprot.ReadString(); err != nil { return err } else { @@ -3844,7 +3844,7 @@ func (p *HttpInfo) ReadField1(iprot thrift.TProtocol) error { p.Method = _field return nil } -func (p *HttpInfo) ReadField2(iprot thrift.TProtocol) error { +func (p *HTTPInfo) ReadField2(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -3855,7 +3855,7 @@ func (p *HttpInfo) ReadField2(iprot thrift.TProtocol) error { p.Path = _field return nil } -func (p *HttpInfo) ReadField4(iprot thrift.TProtocol) error { +func (p *HTTPInfo) ReadField4(iprot thrift.TProtocol) error { var _field *int64 if v, err := iprot.ReadI64(); err != nil { @@ -3867,9 +3867,9 @@ func (p *HttpInfo) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *HttpInfo) Write(oprot thrift.TProtocol) (err error) { +func (p *HTTPInfo) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("HttpInfo"); err != nil { + if err = oprot.WriteStructBegin("HTTPInfo"); err != nil { goto WriteStructBeginError } if p != nil { @@ -3903,7 +3903,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *HttpInfo) writeField1(oprot thrift.TProtocol) (err error) { +func (p *HTTPInfo) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetMethod() { if err = oprot.WriteFieldBegin("method", thrift.STRING, 1); err != nil { goto WriteFieldBeginError @@ -3921,7 +3921,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *HttpInfo) writeField2(oprot thrift.TProtocol) (err error) { +func (p *HTTPInfo) writeField2(oprot thrift.TProtocol) (err error) { if p.IsSetPath() { if err = oprot.WriteFieldBegin("path", thrift.STRING, 2); err != nil { goto WriteFieldBeginError @@ -3939,7 +3939,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *HttpInfo) writeField4(oprot thrift.TProtocol) (err error) { +func (p *HTTPInfo) writeField4(oprot thrift.TProtocol) (err error) { if p.IsSetTimeout() { if err = oprot.WriteFieldBegin("timeout", thrift.I64, 4); err != nil { goto WriteFieldBeginError @@ -3958,15 +3958,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *HttpInfo) String() string { +func (p *HTTPInfo) String() string { if p == nil { return "" } - return fmt.Sprintf("HttpInfo(%+v)", *p) + return fmt.Sprintf("HTTPInfo(%+v)", *p) } -func (p *HttpInfo) DeepEqual(ano *HttpInfo) bool { +func (p *HTTPInfo) DeepEqual(ano *HTTPInfo) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -3984,7 +3984,7 @@ func (p *HttpInfo) DeepEqual(ano *HttpInfo) bool { return true } -func (p *HttpInfo) Field1DeepEqual(src *HttpMethod) bool { +func (p *HTTPInfo) Field1DeepEqual(src *HTTPMethod) bool { if p.Method == src { return true @@ -3996,7 +3996,7 @@ func (p *HttpInfo) Field1DeepEqual(src *HttpMethod) bool { } return true } -func (p *HttpInfo) Field2DeepEqual(src *string) bool { +func (p *HTTPInfo) Field2DeepEqual(src *string) bool { if p.Path == src { return true @@ -4008,7 +4008,7 @@ func (p *HttpInfo) Field2DeepEqual(src *string) bool { } return true } -func (p *HttpInfo) Field4DeepEqual(src *int64) bool { +func (p *HTTPInfo) Field4DeepEqual(src *int64) bool { if p.Timeout == src { return true diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 3c5071b5b..0aaa7b26d 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -225,11 +225,11 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi return targetVersionDTO } -func HttpInfoDO2DTO(httpInfoDO *do.HttpInfo) (httpInfoDTO *dto.HttpInfo) { +func HttpInfoDO2DTO(httpInfoDO *do.HTTPInfo) (httpInfoDTO *dto.HTTPInfo) { if httpInfoDO == nil { return nil } - return &dto.HttpInfo{ + return &dto.HTTPInfo{ Method: gptr.Of(httpInfoDO.Method), Path: gptr.Of(httpInfoDO.Path), Timeout: httpInfoDO.Timeout, diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go index 016562edd..9bad0e4b9 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go @@ -17,21 +17,21 @@ type CustomPSM struct { Regions []Region Cluster string // 执行http信息 - InvokeHTTPInfo *HttpInfo + InvokeHTTPInfo *HTTPInfo // 异步执行http信息,如果用户选了异步就传入这个字段 - AsyncInvokeHTTPInfo *HttpInfo + AsyncInvokeHTTPInfo *HTTPInfo // 是否需要搜索对象 NeedSearchTarget *bool // 搜索对象http信息 - SearchHTTPInfo *HttpInfo + SearchHTTPInfo *HTTPInfo // 搜索对象返回的信息 CustomEvalTarget *CustomEvalTarget // 是否异步 IsAsync *bool } -type HttpInfo struct { - Method HttpMethod +type HTTPInfo struct { + Method HTTPMethod Path string // ms,默认5000,最大800,000 Timeout *int64 @@ -65,9 +65,9 @@ const ( AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" ) -type HttpMethod = string +type HTTPMethod = string const ( - HttpMethodGet = "get" - HttpMethodPost = "post" + HTTPMethodGet = "get" + HTTPMethodPost = "post" ) diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 35cb53648..66535d51c 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -66,10 +66,10 @@ struct CustomPSM { 11: optional AccessProtocol access_protocol // 接入协议 12: optional list regions 13: optional string cluster - 14: optional HttpInfo invoke_http_info // 执行http信息 - 15: optional HttpInfo async_invoke_http_info // 异步执行http信息,如果用户选了异步就传入这个字段 + 14: optional HTTPInfo invoke_http_info // 执行http信息 + 15: optional HTTPInfo async_invoke_http_info // 异步执行http信息,如果用户选了异步就传入这个字段 16: optional bool need_search_target // 是否需要搜索对象 - 17: optional HttpInfo search_http_info // 搜索对象http信息 + 17: optional HTTPInfo search_http_info // 搜索对象http信息 18: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 19: optional bool is_async // 是否异步 @@ -83,8 +83,8 @@ struct CustomEvalTarget { 10: optional map ext // 扩展字段,目前主要存储旧版协议response中的额外字段:object_type(旧版ID)、object_meta、space_id } -struct HttpInfo { - 1: optional HttpMethod method +struct HTTPInfo { + 1: optional HTTPMethod method 2: optional string path 4: optional i64 timeout // ms,默认5000,最大800,000 } @@ -100,9 +100,9 @@ const AccessProtocol AccessProtocol_RPCOld = "rpc_old" const AccessProtocol AccessProtocol_BytefaasHTTP = "bytefaas_http" const AccessProtocol AccessProtocol_BytefaasHTTPOld = "bytefaas_http_old" -typedef string HttpMethod (ts.enum="true") -const HttpMethod HttpMethod_Get = "get" -const HttpMethod HttpMethod_Post = "post" +typedef string HTTPMethod (ts.enum="true") +const HTTPMethod HTTPMethod_Get = "get" +const HTTPMethod HTTPMethod_Post = "post" struct VolcengineAgent { From 45911cc0963f4e40d3cd6097d1ba1fc460a9684e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 14:15:47 +0800 Subject: [PATCH 017/100] fix Change-Id: I2578a4e1147fb285ad2113437b59bf0d8cf04d1a --- .../domain/eval_target/eval_target.go | 316 +++++++++--------- .../eval_target/eval_target_validator.go | 8 +- .../domain/eval_target/k-eval_target.go | 132 ++++---- .../coze.loop.evaluation.eval_target.go | 258 +++++++------- ...e.loop.evaluation.eval_target_validator.go | 18 +- .../k-coze.loop.evaluation.eval_target.go | 148 ++++---- .../convertor/target/eval_target.go | 32 +- .../evaluation/domain/entity/target.go | 10 +- .../entity/target_builtin_custom_psm.go | 12 +- .../target/mysql/convertor/eval_target.go | 10 +- .../coze.loop.evaluation.eval_target.thrift | 12 +- .../loop/evaluation/domain/eval_target.thrift | 14 +- 12 files changed, 485 insertions(+), 485 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index d0bbda4c4..d1ebc7d47 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -22,9 +22,9 @@ const ( AccessProtocolRPCOld = "rpc_old" - AccessProtocolBytefaasHTTP = "bytefaas_http" + AccessProtocolFaasHTTP = "faas_http" - AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" + AccessProtocolFaasHTTPOld = "faas_http_old" HTTPMethodGet = "get" @@ -43,8 +43,8 @@ const ( EvalTargetType_CozeWorkflow EvalTargetType = 4 // 火山智能体 EvalTargetType_VolcengineAgent EvalTargetType = 5 - // 自定义psm服务 for内场 - EvalTargetType_CustomPSM EvalTargetType = 6 + // 自定义RPC服务 for内场 + EvalTargetType_CustomRPCServer EvalTargetType = 6 ) func (p EvalTargetType) String() string { @@ -59,8 +59,8 @@ func (p EvalTargetType) String() string { return "CozeWorkflow" case EvalTargetType_VolcengineAgent: return "VolcengineAgent" - case EvalTargetType_CustomPSM: - return "CustomPSM" + case EvalTargetType_CustomRPCServer: + return "CustomRPCServer" } return "" } @@ -77,8 +77,8 @@ func EvalTargetTypeFromString(s string) (EvalTargetType, error) { return EvalTargetType_CozeWorkflow, nil case "VolcengineAgent": return EvalTargetType_VolcengineAgent, nil - case "CustomPSM": - return EvalTargetType_CustomPSM, nil + case "CustomRPCServer": + return EvalTargetType_CustomRPCServer, nil } return EvalTargetType(0), fmt.Errorf("not a valid EvalTargetType string") } @@ -1419,8 +1419,8 @@ type EvalTargetContent struct { CozeWorkflow *CozeWorkflow `thrift:"coze_workflow,103,optional" frugal:"103,optional,CozeWorkflow" form:"coze_workflow" json:"coze_workflow,omitempty" query:"coze_workflow"` // EvalTargetType=5 时,传参此字段。 评测对象为 VolcengineAgent 时, 需要设置 VolcengineAgent 信息 VolcengineAgent *VolcengineAgent `thrift:"volcengine_agent,104,optional" frugal:"104,optional,VolcengineAgent" form:"volcengine_agent" json:"volcengine_agent,omitempty" query:"volcengine_agent"` - // EvalTargetType=6 时,传参此字段。 评测对象为 CustomPSM 时, 需要设置 CustomPSM 信息 - CustomPsm *CustomPSM `thrift:"custom_psm,105,optional" frugal:"105,optional,CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` + // EvalTargetType=6 时,传参此字段。 评测对象为 CustomRPCServer 时, 需要设置 CustomRPCServer 信息 + CustomRPCServer *CustomRPCServer `thrift:"custom_rpc_server,105,optional" frugal:"105,optional,CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` } func NewEvalTargetContent() *EvalTargetContent { @@ -1514,16 +1514,16 @@ func (p *EvalTargetContent) GetVolcengineAgent() (v *VolcengineAgent) { return p.VolcengineAgent } -var EvalTargetContent_CustomPsm_DEFAULT *CustomPSM +var EvalTargetContent_CustomRPCServer_DEFAULT *CustomRPCServer -func (p *EvalTargetContent) GetCustomPsm() (v *CustomPSM) { +func (p *EvalTargetContent) GetCustomRPCServer() (v *CustomRPCServer) { if p == nil { return } - if !p.IsSetCustomPsm() { - return EvalTargetContent_CustomPsm_DEFAULT + if !p.IsSetCustomRPCServer() { + return EvalTargetContent_CustomRPCServer_DEFAULT } - return p.CustomPsm + return p.CustomRPCServer } func (p *EvalTargetContent) SetInputSchemas(val []*common.ArgsSchema) { p.InputSchemas = val @@ -1546,8 +1546,8 @@ func (p *EvalTargetContent) SetCozeWorkflow(val *CozeWorkflow) { func (p *EvalTargetContent) SetVolcengineAgent(val *VolcengineAgent) { p.VolcengineAgent = val } -func (p *EvalTargetContent) SetCustomPsm(val *CustomPSM) { - p.CustomPsm = val +func (p *EvalTargetContent) SetCustomRPCServer(val *CustomRPCServer) { + p.CustomRPCServer = val } var fieldIDToName_EvalTargetContent = map[int16]string{ @@ -1558,7 +1558,7 @@ var fieldIDToName_EvalTargetContent = map[int16]string{ 102: "prompt", 103: "coze_workflow", 104: "volcengine_agent", - 105: "custom_psm", + 105: "custom_rpc_server", } func (p *EvalTargetContent) IsSetInputSchemas() bool { @@ -1589,8 +1589,8 @@ func (p *EvalTargetContent) IsSetVolcengineAgent() bool { return p.VolcengineAgent != nil } -func (p *EvalTargetContent) IsSetCustomPsm() bool { - return p.CustomPsm != nil +func (p *EvalTargetContent) IsSetCustomRPCServer() bool { + return p.CustomRPCServer != nil } func (p *EvalTargetContent) Read(iprot thrift.TProtocol) (err error) { @@ -1794,11 +1794,11 @@ func (p *EvalTargetContent) ReadField104(iprot thrift.TProtocol) error { return nil } func (p *EvalTargetContent) ReadField105(iprot thrift.TProtocol) error { - _field := NewCustomPSM() + _field := NewCustomRPCServer() if err := _field.Read(iprot); err != nil { return err } - p.CustomPsm = _field + p.CustomRPCServer = _field return nil } @@ -2001,11 +2001,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 104 end error: ", p), err) } func (p *EvalTargetContent) writeField105(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomPsm() { - if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 105); err != nil { + if p.IsSetCustomRPCServer() { + if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 105); err != nil { goto WriteFieldBeginError } - if err := p.CustomPsm.Write(oprot); err != nil { + if err := p.CustomRPCServer.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -2054,7 +2054,7 @@ func (p *EvalTargetContent) DeepEqual(ano *EvalTargetContent) bool { if !p.Field104DeepEqual(ano.VolcengineAgent) { return false } - if !p.Field105DeepEqual(ano.CustomPsm) { + if !p.Field105DeepEqual(ano.CustomRPCServer) { return false } return true @@ -2126,15 +2126,15 @@ func (p *EvalTargetContent) Field104DeepEqual(src *VolcengineAgent) bool { } return true } -func (p *EvalTargetContent) Field105DeepEqual(src *CustomPSM) bool { +func (p *EvalTargetContent) Field105DeepEqual(src *CustomRPCServer) bool { - if !p.CustomPsm.DeepEqual(src) { + if !p.CustomRPCServer.DeepEqual(src) { return false } return true } -type CustomPSM struct { +type CustomRPCServer struct { // 应用ID ID *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" form:"id" json:"id,omitempty" query:"id"` // DTO使用,不存数据库 @@ -2142,7 +2142,7 @@ type CustomPSM struct { // DTO使用,不存数据库 Description *string `thrift:"description,3,optional" frugal:"3,optional,string" form:"description" json:"description,omitempty" query:"description"` // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 - Psm *string `thrift:"psm,10,optional" frugal:"10,optional,string" form:"psm" json:"psm,omitempty" query:"psm"` + ServerName *string `thrift:"server_name,10,optional" frugal:"10,optional,string" form:"server_name" json:"server_name,omitempty" query:"server_name"` // 接入协议 AccessProtocol *AccessProtocol `thrift:"access_protocol,11,optional" frugal:"11,optional,string" form:"access_protocol" json:"access_protocol,omitempty" query:"access_protocol"` Regions []Region `thrift:"regions,12,optional" frugal:"12,optional,list" form:"regions" json:"regions,omitempty" query:"regions"` @@ -2161,213 +2161,213 @@ type CustomPSM struct { IsAsync *bool `thrift:"is_async,19,optional" frugal:"19,optional,bool" form:"is_async" json:"is_async,omitempty" query:"is_async"` } -func NewCustomPSM() *CustomPSM { - return &CustomPSM{} +func NewCustomRPCServer() *CustomRPCServer { + return &CustomRPCServer{} } -func (p *CustomPSM) InitDefault() { +func (p *CustomRPCServer) InitDefault() { } -var CustomPSM_ID_DEFAULT int64 +var CustomRPCServer_ID_DEFAULT int64 -func (p *CustomPSM) GetID() (v int64) { +func (p *CustomRPCServer) GetID() (v int64) { if p == nil { return } if !p.IsSetID() { - return CustomPSM_ID_DEFAULT + return CustomRPCServer_ID_DEFAULT } return *p.ID } -var CustomPSM_Name_DEFAULT string +var CustomRPCServer_Name_DEFAULT string -func (p *CustomPSM) GetName() (v string) { +func (p *CustomRPCServer) GetName() (v string) { if p == nil { return } if !p.IsSetName() { - return CustomPSM_Name_DEFAULT + return CustomRPCServer_Name_DEFAULT } return *p.Name } -var CustomPSM_Description_DEFAULT string +var CustomRPCServer_Description_DEFAULT string -func (p *CustomPSM) GetDescription() (v string) { +func (p *CustomRPCServer) GetDescription() (v string) { if p == nil { return } if !p.IsSetDescription() { - return CustomPSM_Description_DEFAULT + return CustomRPCServer_Description_DEFAULT } return *p.Description } -var CustomPSM_Psm_DEFAULT string +var CustomRPCServer_ServerName_DEFAULT string -func (p *CustomPSM) GetPsm() (v string) { +func (p *CustomRPCServer) GetServerName() (v string) { if p == nil { return } - if !p.IsSetPsm() { - return CustomPSM_Psm_DEFAULT + if !p.IsSetServerName() { + return CustomRPCServer_ServerName_DEFAULT } - return *p.Psm + return *p.ServerName } -var CustomPSM_AccessProtocol_DEFAULT AccessProtocol +var CustomRPCServer_AccessProtocol_DEFAULT AccessProtocol -func (p *CustomPSM) GetAccessProtocol() (v AccessProtocol) { +func (p *CustomRPCServer) GetAccessProtocol() (v AccessProtocol) { if p == nil { return } if !p.IsSetAccessProtocol() { - return CustomPSM_AccessProtocol_DEFAULT + return CustomRPCServer_AccessProtocol_DEFAULT } return *p.AccessProtocol } -var CustomPSM_Regions_DEFAULT []Region +var CustomRPCServer_Regions_DEFAULT []Region -func (p *CustomPSM) GetRegions() (v []Region) { +func (p *CustomRPCServer) GetRegions() (v []Region) { if p == nil { return } if !p.IsSetRegions() { - return CustomPSM_Regions_DEFAULT + return CustomRPCServer_Regions_DEFAULT } return p.Regions } -var CustomPSM_Cluster_DEFAULT string +var CustomRPCServer_Cluster_DEFAULT string -func (p *CustomPSM) GetCluster() (v string) { +func (p *CustomRPCServer) GetCluster() (v string) { if p == nil { return } if !p.IsSetCluster() { - return CustomPSM_Cluster_DEFAULT + return CustomRPCServer_Cluster_DEFAULT } return *p.Cluster } -var CustomPSM_InvokeHTTPInfo_DEFAULT *HTTPInfo +var CustomRPCServer_InvokeHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetInvokeHTTPInfo() (v *HTTPInfo) { +func (p *CustomRPCServer) GetInvokeHTTPInfo() (v *HTTPInfo) { if p == nil { return } if !p.IsSetInvokeHTTPInfo() { - return CustomPSM_InvokeHTTPInfo_DEFAULT + return CustomRPCServer_InvokeHTTPInfo_DEFAULT } return p.InvokeHTTPInfo } -var CustomPSM_AsyncInvokeHTTPInfo_DEFAULT *HTTPInfo +var CustomRPCServer_AsyncInvokeHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetAsyncInvokeHTTPInfo() (v *HTTPInfo) { +func (p *CustomRPCServer) GetAsyncInvokeHTTPInfo() (v *HTTPInfo) { if p == nil { return } if !p.IsSetAsyncInvokeHTTPInfo() { - return CustomPSM_AsyncInvokeHTTPInfo_DEFAULT + return CustomRPCServer_AsyncInvokeHTTPInfo_DEFAULT } return p.AsyncInvokeHTTPInfo } -var CustomPSM_NeedSearchTarget_DEFAULT bool +var CustomRPCServer_NeedSearchTarget_DEFAULT bool -func (p *CustomPSM) GetNeedSearchTarget() (v bool) { +func (p *CustomRPCServer) GetNeedSearchTarget() (v bool) { if p == nil { return } if !p.IsSetNeedSearchTarget() { - return CustomPSM_NeedSearchTarget_DEFAULT + return CustomRPCServer_NeedSearchTarget_DEFAULT } return *p.NeedSearchTarget } -var CustomPSM_SearchHTTPInfo_DEFAULT *HTTPInfo +var CustomRPCServer_SearchHTTPInfo_DEFAULT *HTTPInfo -func (p *CustomPSM) GetSearchHTTPInfo() (v *HTTPInfo) { +func (p *CustomRPCServer) GetSearchHTTPInfo() (v *HTTPInfo) { if p == nil { return } if !p.IsSetSearchHTTPInfo() { - return CustomPSM_SearchHTTPInfo_DEFAULT + return CustomRPCServer_SearchHTTPInfo_DEFAULT } return p.SearchHTTPInfo } -var CustomPSM_CustomEvalTarget_DEFAULT *CustomEvalTarget +var CustomRPCServer_CustomEvalTarget_DEFAULT *CustomEvalTarget -func (p *CustomPSM) GetCustomEvalTarget() (v *CustomEvalTarget) { +func (p *CustomRPCServer) GetCustomEvalTarget() (v *CustomEvalTarget) { if p == nil { return } if !p.IsSetCustomEvalTarget() { - return CustomPSM_CustomEvalTarget_DEFAULT + return CustomRPCServer_CustomEvalTarget_DEFAULT } return p.CustomEvalTarget } -var CustomPSM_IsAsync_DEFAULT bool +var CustomRPCServer_IsAsync_DEFAULT bool -func (p *CustomPSM) GetIsAsync() (v bool) { +func (p *CustomRPCServer) GetIsAsync() (v bool) { if p == nil { return } if !p.IsSetIsAsync() { - return CustomPSM_IsAsync_DEFAULT + return CustomRPCServer_IsAsync_DEFAULT } return *p.IsAsync } -func (p *CustomPSM) SetID(val *int64) { +func (p *CustomRPCServer) SetID(val *int64) { p.ID = val } -func (p *CustomPSM) SetName(val *string) { +func (p *CustomRPCServer) SetName(val *string) { p.Name = val } -func (p *CustomPSM) SetDescription(val *string) { +func (p *CustomRPCServer) SetDescription(val *string) { p.Description = val } -func (p *CustomPSM) SetPsm(val *string) { - p.Psm = val +func (p *CustomRPCServer) SetServerName(val *string) { + p.ServerName = val } -func (p *CustomPSM) SetAccessProtocol(val *AccessProtocol) { +func (p *CustomRPCServer) SetAccessProtocol(val *AccessProtocol) { p.AccessProtocol = val } -func (p *CustomPSM) SetRegions(val []Region) { +func (p *CustomRPCServer) SetRegions(val []Region) { p.Regions = val } -func (p *CustomPSM) SetCluster(val *string) { +func (p *CustomRPCServer) SetCluster(val *string) { p.Cluster = val } -func (p *CustomPSM) SetInvokeHTTPInfo(val *HTTPInfo) { +func (p *CustomRPCServer) SetInvokeHTTPInfo(val *HTTPInfo) { p.InvokeHTTPInfo = val } -func (p *CustomPSM) SetAsyncInvokeHTTPInfo(val *HTTPInfo) { +func (p *CustomRPCServer) SetAsyncInvokeHTTPInfo(val *HTTPInfo) { p.AsyncInvokeHTTPInfo = val } -func (p *CustomPSM) SetNeedSearchTarget(val *bool) { +func (p *CustomRPCServer) SetNeedSearchTarget(val *bool) { p.NeedSearchTarget = val } -func (p *CustomPSM) SetSearchHTTPInfo(val *HTTPInfo) { +func (p *CustomRPCServer) SetSearchHTTPInfo(val *HTTPInfo) { p.SearchHTTPInfo = val } -func (p *CustomPSM) SetCustomEvalTarget(val *CustomEvalTarget) { +func (p *CustomRPCServer) SetCustomEvalTarget(val *CustomEvalTarget) { p.CustomEvalTarget = val } -func (p *CustomPSM) SetIsAsync(val *bool) { +func (p *CustomRPCServer) SetIsAsync(val *bool) { p.IsAsync = val } -var fieldIDToName_CustomPSM = map[int16]string{ +var fieldIDToName_CustomRPCServer = map[int16]string{ 1: "id", 2: "name", 3: "description", - 10: "psm", + 10: "server_name", 11: "access_protocol", 12: "regions", 13: "cluster", @@ -2379,59 +2379,59 @@ var fieldIDToName_CustomPSM = map[int16]string{ 19: "is_async", } -func (p *CustomPSM) IsSetID() bool { +func (p *CustomRPCServer) IsSetID() bool { return p.ID != nil } -func (p *CustomPSM) IsSetName() bool { +func (p *CustomRPCServer) IsSetName() bool { return p.Name != nil } -func (p *CustomPSM) IsSetDescription() bool { +func (p *CustomRPCServer) IsSetDescription() bool { return p.Description != nil } -func (p *CustomPSM) IsSetPsm() bool { - return p.Psm != nil +func (p *CustomRPCServer) IsSetServerName() bool { + return p.ServerName != nil } -func (p *CustomPSM) IsSetAccessProtocol() bool { +func (p *CustomRPCServer) IsSetAccessProtocol() bool { return p.AccessProtocol != nil } -func (p *CustomPSM) IsSetRegions() bool { +func (p *CustomRPCServer) IsSetRegions() bool { return p.Regions != nil } -func (p *CustomPSM) IsSetCluster() bool { +func (p *CustomRPCServer) IsSetCluster() bool { return p.Cluster != nil } -func (p *CustomPSM) IsSetInvokeHTTPInfo() bool { +func (p *CustomRPCServer) IsSetInvokeHTTPInfo() bool { return p.InvokeHTTPInfo != nil } -func (p *CustomPSM) IsSetAsyncInvokeHTTPInfo() bool { +func (p *CustomRPCServer) IsSetAsyncInvokeHTTPInfo() bool { return p.AsyncInvokeHTTPInfo != nil } -func (p *CustomPSM) IsSetNeedSearchTarget() bool { +func (p *CustomRPCServer) IsSetNeedSearchTarget() bool { return p.NeedSearchTarget != nil } -func (p *CustomPSM) IsSetSearchHTTPInfo() bool { +func (p *CustomRPCServer) IsSetSearchHTTPInfo() bool { return p.SearchHTTPInfo != nil } -func (p *CustomPSM) IsSetCustomEvalTarget() bool { +func (p *CustomRPCServer) IsSetCustomEvalTarget() bool { return p.CustomEvalTarget != nil } -func (p *CustomPSM) IsSetIsAsync() bool { +func (p *CustomRPCServer) IsSetIsAsync() bool { return p.IsAsync != nil } -func (p *CustomPSM) Read(iprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -2572,7 +2572,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomPSM[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomRPCServer[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -2582,7 +2582,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CustomPSM) ReadField1(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField1(iprot thrift.TProtocol) error { var _field *int64 if v, err := iprot.ReadI64(); err != nil { @@ -2593,7 +2593,7 @@ func (p *CustomPSM) ReadField1(iprot thrift.TProtocol) error { p.ID = _field return nil } -func (p *CustomPSM) ReadField2(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField2(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2604,7 +2604,7 @@ func (p *CustomPSM) ReadField2(iprot thrift.TProtocol) error { p.Name = _field return nil } -func (p *CustomPSM) ReadField3(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField3(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2615,7 +2615,7 @@ func (p *CustomPSM) ReadField3(iprot thrift.TProtocol) error { p.Description = _field return nil } -func (p *CustomPSM) ReadField10(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField10(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2623,10 +2623,10 @@ func (p *CustomPSM) ReadField10(iprot thrift.TProtocol) error { } else { _field = &v } - p.Psm = _field + p.ServerName = _field return nil } -func (p *CustomPSM) ReadField11(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField11(iprot thrift.TProtocol) error { var _field *AccessProtocol if v, err := iprot.ReadString(); err != nil { @@ -2637,7 +2637,7 @@ func (p *CustomPSM) ReadField11(iprot thrift.TProtocol) error { p.AccessProtocol = _field return nil } -func (p *CustomPSM) ReadField12(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField12(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err @@ -2660,7 +2660,7 @@ func (p *CustomPSM) ReadField12(iprot thrift.TProtocol) error { p.Regions = _field return nil } -func (p *CustomPSM) ReadField13(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField13(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2671,7 +2671,7 @@ func (p *CustomPSM) ReadField13(iprot thrift.TProtocol) error { p.Cluster = _field return nil } -func (p *CustomPSM) ReadField14(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField14(iprot thrift.TProtocol) error { _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err @@ -2679,7 +2679,7 @@ func (p *CustomPSM) ReadField14(iprot thrift.TProtocol) error { p.InvokeHTTPInfo = _field return nil } -func (p *CustomPSM) ReadField15(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField15(iprot thrift.TProtocol) error { _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err @@ -2687,7 +2687,7 @@ func (p *CustomPSM) ReadField15(iprot thrift.TProtocol) error { p.AsyncInvokeHTTPInfo = _field return nil } -func (p *CustomPSM) ReadField16(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField16(iprot thrift.TProtocol) error { var _field *bool if v, err := iprot.ReadBool(); err != nil { @@ -2698,7 +2698,7 @@ func (p *CustomPSM) ReadField16(iprot thrift.TProtocol) error { p.NeedSearchTarget = _field return nil } -func (p *CustomPSM) ReadField17(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField17(iprot thrift.TProtocol) error { _field := NewHTTPInfo() if err := _field.Read(iprot); err != nil { return err @@ -2706,7 +2706,7 @@ func (p *CustomPSM) ReadField17(iprot thrift.TProtocol) error { p.SearchHTTPInfo = _field return nil } -func (p *CustomPSM) ReadField18(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField18(iprot thrift.TProtocol) error { _field := NewCustomEvalTarget() if err := _field.Read(iprot); err != nil { return err @@ -2714,7 +2714,7 @@ func (p *CustomPSM) ReadField18(iprot thrift.TProtocol) error { p.CustomEvalTarget = _field return nil } -func (p *CustomPSM) ReadField19(iprot thrift.TProtocol) error { +func (p *CustomRPCServer) ReadField19(iprot thrift.TProtocol) error { var _field *bool if v, err := iprot.ReadBool(); err != nil { @@ -2726,9 +2726,9 @@ func (p *CustomPSM) ReadField19(iprot thrift.TProtocol) error { return nil } -func (p *CustomPSM) Write(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CustomPSM"); err != nil { + if err = oprot.WriteStructBegin("CustomRPCServer"); err != nil { goto WriteStructBeginError } if p != nil { @@ -2802,7 +2802,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CustomPSM) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetID() { if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { goto WriteFieldBeginError @@ -2820,7 +2820,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CustomPSM) writeField2(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField2(oprot thrift.TProtocol) (err error) { if p.IsSetName() { if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { goto WriteFieldBeginError @@ -2838,7 +2838,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *CustomPSM) writeField3(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField3(oprot thrift.TProtocol) (err error) { if p.IsSetDescription() { if err = oprot.WriteFieldBegin("description", thrift.STRING, 3); err != nil { goto WriteFieldBeginError @@ -2856,12 +2856,12 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *CustomPSM) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetPsm() { - if err = oprot.WriteFieldBegin("psm", thrift.STRING, 10); err != nil { +func (p *CustomRPCServer) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetServerName() { + if err = oprot.WriteFieldBegin("server_name", thrift.STRING, 10); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Psm); err != nil { + if err := oprot.WriteString(*p.ServerName); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -2874,7 +2874,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } -func (p *CustomPSM) writeField11(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField11(oprot thrift.TProtocol) (err error) { if p.IsSetAccessProtocol() { if err = oprot.WriteFieldBegin("access_protocol", thrift.STRING, 11); err != nil { goto WriteFieldBeginError @@ -2892,7 +2892,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } -func (p *CustomPSM) writeField12(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField12(oprot thrift.TProtocol) (err error) { if p.IsSetRegions() { if err = oprot.WriteFieldBegin("regions", thrift.LIST, 12); err != nil { goto WriteFieldBeginError @@ -2918,7 +2918,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } -func (p *CustomPSM) writeField13(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField13(oprot thrift.TProtocol) (err error) { if p.IsSetCluster() { if err = oprot.WriteFieldBegin("cluster", thrift.STRING, 13); err != nil { goto WriteFieldBeginError @@ -2936,7 +2936,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) } -func (p *CustomPSM) writeField14(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField14(oprot thrift.TProtocol) (err error) { if p.IsSetInvokeHTTPInfo() { if err = oprot.WriteFieldBegin("invoke_http_info", thrift.STRUCT, 14); err != nil { goto WriteFieldBeginError @@ -2954,7 +2954,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) } -func (p *CustomPSM) writeField15(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField15(oprot thrift.TProtocol) (err error) { if p.IsSetAsyncInvokeHTTPInfo() { if err = oprot.WriteFieldBegin("async_invoke_http_info", thrift.STRUCT, 15); err != nil { goto WriteFieldBeginError @@ -2972,7 +2972,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) } -func (p *CustomPSM) writeField16(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField16(oprot thrift.TProtocol) (err error) { if p.IsSetNeedSearchTarget() { if err = oprot.WriteFieldBegin("need_search_target", thrift.BOOL, 16); err != nil { goto WriteFieldBeginError @@ -2990,7 +2990,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) } -func (p *CustomPSM) writeField17(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField17(oprot thrift.TProtocol) (err error) { if p.IsSetSearchHTTPInfo() { if err = oprot.WriteFieldBegin("search_http_info", thrift.STRUCT, 17); err != nil { goto WriteFieldBeginError @@ -3008,7 +3008,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) } -func (p *CustomPSM) writeField18(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField18(oprot thrift.TProtocol) (err error) { if p.IsSetCustomEvalTarget() { if err = oprot.WriteFieldBegin("custom_eval_target", thrift.STRUCT, 18); err != nil { goto WriteFieldBeginError @@ -3026,7 +3026,7 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) } -func (p *CustomPSM) writeField19(oprot thrift.TProtocol) (err error) { +func (p *CustomRPCServer) writeField19(oprot thrift.TProtocol) (err error) { if p.IsSetIsAsync() { if err = oprot.WriteFieldBegin("is_async", thrift.BOOL, 19); err != nil { goto WriteFieldBeginError @@ -3045,15 +3045,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) } -func (p *CustomPSM) String() string { +func (p *CustomRPCServer) String() string { if p == nil { return "" } - return fmt.Sprintf("CustomPSM(%+v)", *p) + return fmt.Sprintf("CustomRPCServer(%+v)", *p) } -func (p *CustomPSM) DeepEqual(ano *CustomPSM) bool { +func (p *CustomRPCServer) DeepEqual(ano *CustomRPCServer) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -3068,7 +3068,7 @@ func (p *CustomPSM) DeepEqual(ano *CustomPSM) bool { if !p.Field3DeepEqual(ano.Description) { return false } - if !p.Field10DeepEqual(ano.Psm) { + if !p.Field10DeepEqual(ano.ServerName) { return false } if !p.Field11DeepEqual(ano.AccessProtocol) { @@ -3101,7 +3101,7 @@ func (p *CustomPSM) DeepEqual(ano *CustomPSM) bool { return true } -func (p *CustomPSM) Field1DeepEqual(src *int64) bool { +func (p *CustomRPCServer) Field1DeepEqual(src *int64) bool { if p.ID == src { return true @@ -3113,7 +3113,7 @@ func (p *CustomPSM) Field1DeepEqual(src *int64) bool { } return true } -func (p *CustomPSM) Field2DeepEqual(src *string) bool { +func (p *CustomRPCServer) Field2DeepEqual(src *string) bool { if p.Name == src { return true @@ -3125,7 +3125,7 @@ func (p *CustomPSM) Field2DeepEqual(src *string) bool { } return true } -func (p *CustomPSM) Field3DeepEqual(src *string) bool { +func (p *CustomRPCServer) Field3DeepEqual(src *string) bool { if p.Description == src { return true @@ -3137,19 +3137,19 @@ func (p *CustomPSM) Field3DeepEqual(src *string) bool { } return true } -func (p *CustomPSM) Field10DeepEqual(src *string) bool { +func (p *CustomRPCServer) Field10DeepEqual(src *string) bool { - if p.Psm == src { + if p.ServerName == src { return true - } else if p.Psm == nil || src == nil { + } else if p.ServerName == nil || src == nil { return false } - if strings.Compare(*p.Psm, *src) != 0 { + if strings.Compare(*p.ServerName, *src) != 0 { return false } return true } -func (p *CustomPSM) Field11DeepEqual(src *AccessProtocol) bool { +func (p *CustomRPCServer) Field11DeepEqual(src *AccessProtocol) bool { if p.AccessProtocol == src { return true @@ -3161,7 +3161,7 @@ func (p *CustomPSM) Field11DeepEqual(src *AccessProtocol) bool { } return true } -func (p *CustomPSM) Field12DeepEqual(src []Region) bool { +func (p *CustomRPCServer) Field12DeepEqual(src []Region) bool { if len(p.Regions) != len(src) { return false @@ -3174,7 +3174,7 @@ func (p *CustomPSM) Field12DeepEqual(src []Region) bool { } return true } -func (p *CustomPSM) Field13DeepEqual(src *string) bool { +func (p *CustomRPCServer) Field13DeepEqual(src *string) bool { if p.Cluster == src { return true @@ -3186,21 +3186,21 @@ func (p *CustomPSM) Field13DeepEqual(src *string) bool { } return true } -func (p *CustomPSM) Field14DeepEqual(src *HTTPInfo) bool { +func (p *CustomRPCServer) Field14DeepEqual(src *HTTPInfo) bool { if !p.InvokeHTTPInfo.DeepEqual(src) { return false } return true } -func (p *CustomPSM) Field15DeepEqual(src *HTTPInfo) bool { +func (p *CustomRPCServer) Field15DeepEqual(src *HTTPInfo) bool { if !p.AsyncInvokeHTTPInfo.DeepEqual(src) { return false } return true } -func (p *CustomPSM) Field16DeepEqual(src *bool) bool { +func (p *CustomRPCServer) Field16DeepEqual(src *bool) bool { if p.NeedSearchTarget == src { return true @@ -3212,21 +3212,21 @@ func (p *CustomPSM) Field16DeepEqual(src *bool) bool { } return true } -func (p *CustomPSM) Field17DeepEqual(src *HTTPInfo) bool { +func (p *CustomRPCServer) Field17DeepEqual(src *HTTPInfo) bool { if !p.SearchHTTPInfo.DeepEqual(src) { return false } return true } -func (p *CustomPSM) Field18DeepEqual(src *CustomEvalTarget) bool { +func (p *CustomRPCServer) Field18DeepEqual(src *CustomEvalTarget) bool { if !p.CustomEvalTarget.DeepEqual(src) { return false } return true } -func (p *CustomPSM) Field19DeepEqual(src *bool) bool { +func (p *CustomRPCServer) Field19DeepEqual(src *bool) bool { if p.IsAsync == src { return true diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go index 68fe03469..3d993f85f 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target_validator.go @@ -68,14 +68,14 @@ func (p *EvalTargetContent) IsValid() error { return fmt.Errorf("field VolcengineAgent not valid, %w", err) } } - if p.CustomPsm != nil { - if err := p.CustomPsm.IsValid(); err != nil { - return fmt.Errorf("field CustomPsm not valid, %w", err) + if p.CustomRPCServer != nil { + if err := p.CustomRPCServer.IsValid(); err != nil { + return fmt.Errorf("field CustomRPCServer not valid, %w", err) } } return nil } -func (p *CustomPSM) IsValid() error { +func (p *CustomRPCServer) IsValid() error { if p.InvokeHTTPInfo != nil { if err := p.InvokeHTTPInfo.IsValid(); err != nil { return fmt.Errorf("field InvokeHTTPInfo not valid, %w", err) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 18b134dbf..5388046ad 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -1068,13 +1068,13 @@ func (p *EvalTargetContent) FastReadField104(buf []byte) (int, error) { func (p *EvalTargetContent) FastReadField105(buf []byte) (int, error) { offset := 0 - _field := NewCustomPSM() + _field := NewCustomRPCServer() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.CustomPsm = _field + p.CustomRPCServer = _field return offset, nil } @@ -1193,9 +1193,9 @@ func (p *EvalTargetContent) fastWriteField104(buf []byte, w thrift.NocopyWriter) func (p *EvalTargetContent) fastWriteField105(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 105) - offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + offset += p.CustomRPCServer.FastWriteNocopy(buf[offset:], w) } return offset } @@ -1273,9 +1273,9 @@ func (p *EvalTargetContent) field104Length() int { func (p *EvalTargetContent) field105Length() int { l := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { l += thrift.Binary.FieldBeginLength() - l += p.CustomPsm.BLength() + l += p.CustomRPCServer.BLength() } return l } @@ -1360,19 +1360,19 @@ func (p *EvalTargetContent) DeepCopy(s interface{}) error { } p.VolcengineAgent = _volcengineAgent - var _customPsm *CustomPSM - if src.CustomPsm != nil { - _customPsm = &CustomPSM{} - if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + var _customRPCServer *CustomRPCServer + if src.CustomRPCServer != nil { + _customRPCServer = &CustomRPCServer{} + if err := _customRPCServer.DeepCopy(src.CustomRPCServer); err != nil { return err } } - p.CustomPsm = _customPsm + p.CustomRPCServer = _customRPCServer return nil } -func (p *CustomPSM) FastRead(buf []byte) (int, error) { +func (p *CustomRPCServer) FastRead(buf []byte) (int, error) { var err error var offset int @@ -1584,12 +1584,12 @@ func (p *CustomPSM) FastRead(buf []byte) (int, error) { ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomPSM[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CustomRPCServer[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CustomPSM) FastReadField1(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField1(buf []byte) (int, error) { offset := 0 var _field *int64 @@ -1603,7 +1603,7 @@ func (p *CustomPSM) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField2(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField2(buf []byte) (int, error) { offset := 0 var _field *string @@ -1617,7 +1617,7 @@ func (p *CustomPSM) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField3(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField3(buf []byte) (int, error) { offset := 0 var _field *string @@ -1631,7 +1631,7 @@ func (p *CustomPSM) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField10(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField10(buf []byte) (int, error) { offset := 0 var _field *string @@ -1641,11 +1641,11 @@ func (p *CustomPSM) FastReadField10(buf []byte) (int, error) { offset += l _field = &v } - p.Psm = _field + p.ServerName = _field return offset, nil } -func (p *CustomPSM) FastReadField11(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField11(buf []byte) (int, error) { offset := 0 var _field *AccessProtocol @@ -1659,7 +1659,7 @@ func (p *CustomPSM) FastReadField11(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField12(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField12(buf []byte) (int, error) { offset := 0 _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) @@ -1683,7 +1683,7 @@ func (p *CustomPSM) FastReadField12(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField13(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField13(buf []byte) (int, error) { offset := 0 var _field *string @@ -1697,7 +1697,7 @@ func (p *CustomPSM) FastReadField13(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField14(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField14(buf []byte) (int, error) { offset := 0 _field := NewHTTPInfo() if l, err := _field.FastRead(buf[offset:]); err != nil { @@ -1709,7 +1709,7 @@ func (p *CustomPSM) FastReadField14(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField15(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField15(buf []byte) (int, error) { offset := 0 _field := NewHTTPInfo() if l, err := _field.FastRead(buf[offset:]); err != nil { @@ -1721,7 +1721,7 @@ func (p *CustomPSM) FastReadField15(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField16(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField16(buf []byte) (int, error) { offset := 0 var _field *bool @@ -1735,7 +1735,7 @@ func (p *CustomPSM) FastReadField16(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField17(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField17(buf []byte) (int, error) { offset := 0 _field := NewHTTPInfo() if l, err := _field.FastRead(buf[offset:]); err != nil { @@ -1747,7 +1747,7 @@ func (p *CustomPSM) FastReadField17(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField18(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField18(buf []byte) (int, error) { offset := 0 _field := NewCustomEvalTarget() if l, err := _field.FastRead(buf[offset:]); err != nil { @@ -1759,7 +1759,7 @@ func (p *CustomPSM) FastReadField18(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastReadField19(buf []byte) (int, error) { +func (p *CustomRPCServer) FastReadField19(buf []byte) (int, error) { offset := 0 var _field *bool @@ -1773,11 +1773,11 @@ func (p *CustomPSM) FastReadField19(buf []byte) (int, error) { return offset, nil } -func (p *CustomPSM) FastWrite(buf []byte) int { +func (p *CustomRPCServer) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } -func (p *CustomPSM) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -1798,7 +1798,7 @@ func (p *CustomPSM) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) BLength() int { +func (p *CustomRPCServer) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -1819,7 +1819,7 @@ func (p *CustomPSM) BLength() int { return l } -func (p *CustomPSM) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetID() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) @@ -1828,7 +1828,7 @@ func (p *CustomPSM) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetName() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) @@ -1837,7 +1837,7 @@ func (p *CustomPSM) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetDescription() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) @@ -1846,16 +1846,16 @@ func (p *CustomPSM) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetPsm() { + if p.IsSetServerName() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Psm) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ServerName) } return offset } -func (p *CustomPSM) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetAccessProtocol() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 11) @@ -1864,7 +1864,7 @@ func (p *CustomPSM) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetRegions() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 12) @@ -1880,7 +1880,7 @@ func (p *CustomPSM) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCluster() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 13) @@ -1889,7 +1889,7 @@ func (p *CustomPSM) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetInvokeHTTPInfo() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 14) @@ -1898,7 +1898,7 @@ func (p *CustomPSM) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetAsyncInvokeHTTPInfo() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 15) @@ -1907,7 +1907,7 @@ func (p *CustomPSM) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField16(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField16(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetNeedSearchTarget() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 16) @@ -1916,7 +1916,7 @@ func (p *CustomPSM) fastWriteField16(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField17(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField17(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSearchHTTPInfo() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 17) @@ -1925,7 +1925,7 @@ func (p *CustomPSM) fastWriteField17(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField18(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField18(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomEvalTarget() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 18) @@ -1934,7 +1934,7 @@ func (p *CustomPSM) fastWriteField18(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) fastWriteField19(buf []byte, w thrift.NocopyWriter) int { +func (p *CustomRPCServer) fastWriteField19(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetIsAsync() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 19) @@ -1943,7 +1943,7 @@ func (p *CustomPSM) fastWriteField19(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *CustomPSM) field1Length() int { +func (p *CustomRPCServer) field1Length() int { l := 0 if p.IsSetID() { l += thrift.Binary.FieldBeginLength() @@ -1952,7 +1952,7 @@ func (p *CustomPSM) field1Length() int { return l } -func (p *CustomPSM) field2Length() int { +func (p *CustomRPCServer) field2Length() int { l := 0 if p.IsSetName() { l += thrift.Binary.FieldBeginLength() @@ -1961,7 +1961,7 @@ func (p *CustomPSM) field2Length() int { return l } -func (p *CustomPSM) field3Length() int { +func (p *CustomRPCServer) field3Length() int { l := 0 if p.IsSetDescription() { l += thrift.Binary.FieldBeginLength() @@ -1970,16 +1970,16 @@ func (p *CustomPSM) field3Length() int { return l } -func (p *CustomPSM) field10Length() int { +func (p *CustomRPCServer) field10Length() int { l := 0 - if p.IsSetPsm() { + if p.IsSetServerName() { l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Psm) + l += thrift.Binary.StringLengthNocopy(*p.ServerName) } return l } -func (p *CustomPSM) field11Length() int { +func (p *CustomRPCServer) field11Length() int { l := 0 if p.IsSetAccessProtocol() { l += thrift.Binary.FieldBeginLength() @@ -1988,7 +1988,7 @@ func (p *CustomPSM) field11Length() int { return l } -func (p *CustomPSM) field12Length() int { +func (p *CustomRPCServer) field12Length() int { l := 0 if p.IsSetRegions() { l += thrift.Binary.FieldBeginLength() @@ -2001,7 +2001,7 @@ func (p *CustomPSM) field12Length() int { return l } -func (p *CustomPSM) field13Length() int { +func (p *CustomRPCServer) field13Length() int { l := 0 if p.IsSetCluster() { l += thrift.Binary.FieldBeginLength() @@ -2010,7 +2010,7 @@ func (p *CustomPSM) field13Length() int { return l } -func (p *CustomPSM) field14Length() int { +func (p *CustomRPCServer) field14Length() int { l := 0 if p.IsSetInvokeHTTPInfo() { l += thrift.Binary.FieldBeginLength() @@ -2019,7 +2019,7 @@ func (p *CustomPSM) field14Length() int { return l } -func (p *CustomPSM) field15Length() int { +func (p *CustomRPCServer) field15Length() int { l := 0 if p.IsSetAsyncInvokeHTTPInfo() { l += thrift.Binary.FieldBeginLength() @@ -2028,7 +2028,7 @@ func (p *CustomPSM) field15Length() int { return l } -func (p *CustomPSM) field16Length() int { +func (p *CustomRPCServer) field16Length() int { l := 0 if p.IsSetNeedSearchTarget() { l += thrift.Binary.FieldBeginLength() @@ -2037,7 +2037,7 @@ func (p *CustomPSM) field16Length() int { return l } -func (p *CustomPSM) field17Length() int { +func (p *CustomRPCServer) field17Length() int { l := 0 if p.IsSetSearchHTTPInfo() { l += thrift.Binary.FieldBeginLength() @@ -2046,7 +2046,7 @@ func (p *CustomPSM) field17Length() int { return l } -func (p *CustomPSM) field18Length() int { +func (p *CustomRPCServer) field18Length() int { l := 0 if p.IsSetCustomEvalTarget() { l += thrift.Binary.FieldBeginLength() @@ -2055,7 +2055,7 @@ func (p *CustomPSM) field18Length() int { return l } -func (p *CustomPSM) field19Length() int { +func (p *CustomRPCServer) field19Length() int { l := 0 if p.IsSetIsAsync() { l += thrift.Binary.FieldBeginLength() @@ -2064,8 +2064,8 @@ func (p *CustomPSM) field19Length() int { return l } -func (p *CustomPSM) DeepCopy(s interface{}) error { - src, ok := s.(*CustomPSM) +func (p *CustomRPCServer) DeepCopy(s interface{}) error { + src, ok := s.(*CustomRPCServer) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } @@ -2091,12 +2091,12 @@ func (p *CustomPSM) DeepCopy(s interface{}) error { p.Description = &tmp } - if src.Psm != nil { + if src.ServerName != nil { var tmp string - if *src.Psm != "" { - tmp = kutils.StringDeepCopy(*src.Psm) + if *src.ServerName != "" { + tmp = kutils.StringDeepCopy(*src.ServerName) } - p.Psm = &tmp + p.ServerName = &tmp } if src.AccessProtocol != nil { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 2a1ece81c..2698e6fda 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -8457,10 +8457,10 @@ type SearchCustomEvalTargetRequest struct { WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` // 透传spi接口 Keyword *string `thrift:"keyword,2,optional" frugal:"2,optional,string" form:"keyword" json:"keyword,omitempty" query:"keyword"` - // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 + // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义服务详情 ApplicationID *int64 `thrift:"application_id,3,optional" frugal:"3,optional,i64" json:"application_id" form:"application_id" query:"application_id"` - // 自定义PSM详情,非必填,应用注册调试时传 - CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,4,optional" frugal:"4,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` + // 自定义服务详情,非必填,应用注册调试时传 + CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,4,optional" frugal:"4,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` // 必填 Region *eval_target.Region `thrift:"region,5,optional" frugal:"5,optional,string" form:"region" json:"region,omitempty" query:"region"` PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` @@ -8511,16 +8511,16 @@ func (p *SearchCustomEvalTargetRequest) GetApplicationID() (v int64) { return *p.ApplicationID } -var SearchCustomEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM +var SearchCustomEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer -func (p *SearchCustomEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { +func (p *SearchCustomEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { if p == nil { return } - if !p.IsSetCustomPsm() { - return SearchCustomEvalTargetRequest_CustomPsm_DEFAULT + if !p.IsSetCustomRPCServer() { + return SearchCustomEvalTargetRequest_CustomRPCServer_DEFAULT } - return p.CustomPsm + return p.CustomRPCServer } var SearchCustomEvalTargetRequest_Region_DEFAULT eval_target.Region @@ -8579,8 +8579,8 @@ func (p *SearchCustomEvalTargetRequest) SetKeyword(val *string) { func (p *SearchCustomEvalTargetRequest) SetApplicationID(val *int64) { p.ApplicationID = val } -func (p *SearchCustomEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { - p.CustomPsm = val +func (p *SearchCustomEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { + p.CustomRPCServer = val } func (p *SearchCustomEvalTargetRequest) SetRegion(val *eval_target.Region) { p.Region = val @@ -8599,7 +8599,7 @@ var fieldIDToName_SearchCustomEvalTargetRequest = map[int16]string{ 1: "workspace_id", 2: "keyword", 3: "application_id", - 4: "custom_psm", + 4: "custom_rpc_server", 5: "region", 100: "page_size", 101: "page_token", @@ -8618,8 +8618,8 @@ func (p *SearchCustomEvalTargetRequest) IsSetApplicationID() bool { return p.ApplicationID != nil } -func (p *SearchCustomEvalTargetRequest) IsSetCustomPsm() bool { - return p.CustomPsm != nil +func (p *SearchCustomEvalTargetRequest) IsSetCustomRPCServer() bool { + return p.CustomRPCServer != nil } func (p *SearchCustomEvalTargetRequest) IsSetRegion() bool { @@ -8783,11 +8783,11 @@ func (p *SearchCustomEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error return nil } func (p *SearchCustomEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { - _field := eval_target.NewCustomPSM() + _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { return err } - p.CustomPsm = _field + p.CustomRPCServer = _field return nil } func (p *SearchCustomEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { @@ -8943,11 +8943,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } func (p *SearchCustomEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomPsm() { - if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 4); err != nil { + if p.IsSetCustomRPCServer() { + if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 4); err != nil { goto WriteFieldBeginError } - if err := p.CustomPsm.Write(oprot); err != nil { + if err := p.CustomRPCServer.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9056,7 +9056,7 @@ func (p *SearchCustomEvalTargetRequest) DeepEqual(ano *SearchCustomEvalTargetReq if !p.Field3DeepEqual(ano.ApplicationID) { return false } - if !p.Field4DeepEqual(ano.CustomPsm) { + if !p.Field4DeepEqual(ano.CustomRPCServer) { return false } if !p.Field5DeepEqual(ano.Region) { @@ -9110,9 +9110,9 @@ func (p *SearchCustomEvalTargetRequest) Field3DeepEqual(src *int64) bool { } return true } -func (p *SearchCustomEvalTargetRequest) Field4DeepEqual(src *eval_target.CustomPSM) bool { +func (p *SearchCustomEvalTargetRequest) Field4DeepEqual(src *eval_target.CustomRPCServer) bool { - if !p.CustomPsm.DeepEqual(src) { + if !p.CustomRPCServer.DeepEqual(src) { return false } return true @@ -9581,9 +9581,9 @@ type DebugEvalTargetRequest struct { Param *string `thrift:"param,10,optional" frugal:"10,optional,string" form:"param" json:"param,omitempty" query:"param"` // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` - // 如果type=6,需要前端传入自定义psm相关信息 - CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,50,optional" frugal:"50,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + // 如果type=6,需要前端传入自定义服务相关信息 + CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewDebugEvalTargetRequest() *DebugEvalTargetRequest { @@ -9641,16 +9641,16 @@ func (p *DebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam return p.TargetRuntimeParam } -var DebugEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM +var DebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer -func (p *DebugEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { +func (p *DebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { if p == nil { return } - if !p.IsSetCustomPsm() { - return DebugEvalTargetRequest_CustomPsm_DEFAULT + if !p.IsSetCustomRPCServer() { + return DebugEvalTargetRequest_CustomRPCServer_DEFAULT } - return p.CustomPsm + return p.CustomRPCServer } var DebugEvalTargetRequest_Base_DEFAULT *base.Base @@ -9676,8 +9676,8 @@ func (p *DebugEvalTargetRequest) SetParam(val *string) { func (p *DebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { p.TargetRuntimeParam = val } -func (p *DebugEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { - p.CustomPsm = val +func (p *DebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { + p.CustomRPCServer = val } func (p *DebugEvalTargetRequest) SetBase(val *base.Base) { p.Base = val @@ -9688,7 +9688,7 @@ var fieldIDToName_DebugEvalTargetRequest = map[int16]string{ 2: "eval_target_type", 10: "param", 11: "target_runtime_param", - 50: "custom_psm", + 50: "custom_rpc_server", 255: "Base", } @@ -9708,8 +9708,8 @@ func (p *DebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { return p.TargetRuntimeParam != nil } -func (p *DebugEvalTargetRequest) IsSetCustomPsm() bool { - return p.CustomPsm != nil +func (p *DebugEvalTargetRequest) IsSetCustomRPCServer() bool { + return p.CustomRPCServer != nil } func (p *DebugEvalTargetRequest) IsSetBase() bool { @@ -9854,11 +9854,11 @@ func (p *DebugEvalTargetRequest) ReadField11(iprot thrift.TProtocol) error { return nil } func (p *DebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { - _field := eval_target.NewCustomPSM() + _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { return err } - p.CustomPsm = _field + p.CustomRPCServer = _field return nil } func (p *DebugEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { @@ -9991,11 +9991,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } func (p *DebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomPsm() { - if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 50); err != nil { + if p.IsSetCustomRPCServer() { + if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { goto WriteFieldBeginError } - if err := p.CustomPsm.Write(oprot); err != nil { + if err := p.CustomRPCServer.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10053,7 +10053,7 @@ func (p *DebugEvalTargetRequest) DeepEqual(ano *DebugEvalTargetRequest) bool { if !p.Field11DeepEqual(ano.TargetRuntimeParam) { return false } - if !p.Field50DeepEqual(ano.CustomPsm) { + if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } if !p.Field255DeepEqual(ano.Base) { @@ -10105,9 +10105,9 @@ func (p *DebugEvalTargetRequest) Field11DeepEqual(src *common.RuntimeParam) bool } return true } -func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomPSM) bool { +func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { - if !p.CustomPsm.DeepEqual(src) { + if !p.CustomRPCServer.DeepEqual(src) { return false } return true @@ -10364,13 +10364,13 @@ type AsyncDebugEvalTargetRequest struct { WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` // 类型 EvalTargetType *eval_target.EvalTargetType `thrift:"eval_target_type,2,optional" frugal:"2,optional,EvalTargetType" form:"eval_target_type" json:"eval_target_type,omitempty" query:"eval_target_type"` - // 动态参数 - TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,10,optional" frugal:"10,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` - // 如果type=6,需要前端传入自定义psm相关信息 - CustomPsm *eval_target.CustomPSM `thrift:"custom_psm,50,optional" frugal:"50,optional,eval_target.CustomPSM" form:"custom_psm" json:"custom_psm,omitempty" query:"custom_psm"` // 执行参数:如果type=6,则传spi request json序列化结果 - CustomPsmSpiParam *string `thrift:"custom_psm_spi_param,51,optional" frugal:"51,optional,string" form:"custom_psm_spi_param" json:"custom_psm_spi_param,omitempty" query:"custom_psm_spi_param"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + Param *string `thrift:"param,10,optional" frugal:"10,optional,string" form:"param" json:"param,omitempty" query:"param"` + // 动态参数 + TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` + // 如果type=6,需要前端传入自定义服务相关信息 + CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewAsyncDebugEvalTargetRequest() *AsyncDebugEvalTargetRequest { @@ -10404,40 +10404,40 @@ func (p *AsyncDebugEvalTargetRequest) GetEvalTargetType() (v eval_target.EvalTar return *p.EvalTargetType } -var AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT *common.RuntimeParam +var AsyncDebugEvalTargetRequest_Param_DEFAULT string -func (p *AsyncDebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam) { +func (p *AsyncDebugEvalTargetRequest) GetParam() (v string) { if p == nil { return } - if !p.IsSetTargetRuntimeParam() { - return AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT + if !p.IsSetParam() { + return AsyncDebugEvalTargetRequest_Param_DEFAULT } - return p.TargetRuntimeParam + return *p.Param } -var AsyncDebugEvalTargetRequest_CustomPsm_DEFAULT *eval_target.CustomPSM +var AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT *common.RuntimeParam -func (p *AsyncDebugEvalTargetRequest) GetCustomPsm() (v *eval_target.CustomPSM) { +func (p *AsyncDebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam) { if p == nil { return } - if !p.IsSetCustomPsm() { - return AsyncDebugEvalTargetRequest_CustomPsm_DEFAULT + if !p.IsSetTargetRuntimeParam() { + return AsyncDebugEvalTargetRequest_TargetRuntimeParam_DEFAULT } - return p.CustomPsm + return p.TargetRuntimeParam } -var AsyncDebugEvalTargetRequest_CustomPsmSpiParam_DEFAULT string +var AsyncDebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer -func (p *AsyncDebugEvalTargetRequest) GetCustomPsmSpiParam() (v string) { +func (p *AsyncDebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { if p == nil { return } - if !p.IsSetCustomPsmSpiParam() { - return AsyncDebugEvalTargetRequest_CustomPsmSpiParam_DEFAULT + if !p.IsSetCustomRPCServer() { + return AsyncDebugEvalTargetRequest_CustomRPCServer_DEFAULT } - return *p.CustomPsmSpiParam + return p.CustomRPCServer } var AsyncDebugEvalTargetRequest_Base_DEFAULT *base.Base @@ -10457,14 +10457,14 @@ func (p *AsyncDebugEvalTargetRequest) SetWorkspaceID(val *int64) { func (p *AsyncDebugEvalTargetRequest) SetEvalTargetType(val *eval_target.EvalTargetType) { p.EvalTargetType = val } +func (p *AsyncDebugEvalTargetRequest) SetParam(val *string) { + p.Param = val +} func (p *AsyncDebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { p.TargetRuntimeParam = val } -func (p *AsyncDebugEvalTargetRequest) SetCustomPsm(val *eval_target.CustomPSM) { - p.CustomPsm = val -} -func (p *AsyncDebugEvalTargetRequest) SetCustomPsmSpiParam(val *string) { - p.CustomPsmSpiParam = val +func (p *AsyncDebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { + p.CustomRPCServer = val } func (p *AsyncDebugEvalTargetRequest) SetBase(val *base.Base) { p.Base = val @@ -10473,9 +10473,9 @@ func (p *AsyncDebugEvalTargetRequest) SetBase(val *base.Base) { var fieldIDToName_AsyncDebugEvalTargetRequest = map[int16]string{ 1: "workspace_id", 2: "eval_target_type", - 10: "target_runtime_param", - 50: "custom_psm", - 51: "custom_psm_spi_param", + 10: "param", + 11: "target_runtime_param", + 50: "custom_rpc_server", 255: "Base", } @@ -10487,16 +10487,16 @@ func (p *AsyncDebugEvalTargetRequest) IsSetEvalTargetType() bool { return p.EvalTargetType != nil } -func (p *AsyncDebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { - return p.TargetRuntimeParam != nil +func (p *AsyncDebugEvalTargetRequest) IsSetParam() bool { + return p.Param != nil } -func (p *AsyncDebugEvalTargetRequest) IsSetCustomPsm() bool { - return p.CustomPsm != nil +func (p *AsyncDebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { + return p.TargetRuntimeParam != nil } -func (p *AsyncDebugEvalTargetRequest) IsSetCustomPsmSpiParam() bool { - return p.CustomPsmSpiParam != nil +func (p *AsyncDebugEvalTargetRequest) IsSetCustomRPCServer() bool { + return p.CustomRPCServer != nil } func (p *AsyncDebugEvalTargetRequest) IsSetBase() bool { @@ -10538,24 +10538,24 @@ func (p *AsyncDebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 10: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { if err = p.ReadField10(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 50: + case 11: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField50(iprot); err != nil { + if err = p.ReadField11(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 51: - if fieldTypeId == thrift.STRING { - if err = p.ReadField51(iprot); err != nil { + case 50: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField50(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -10622,30 +10622,30 @@ func (p *AsyncDebugEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error { return nil } func (p *AsyncDebugEvalTargetRequest) ReadField10(iprot thrift.TProtocol) error { - _field := common.NewRuntimeParam() - if err := _field.Read(iprot); err != nil { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.TargetRuntimeParam = _field + p.Param = _field return nil } -func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { - _field := eval_target.NewCustomPSM() +func (p *AsyncDebugEvalTargetRequest) ReadField11(iprot thrift.TProtocol) error { + _field := common.NewRuntimeParam() if err := _field.Read(iprot); err != nil { return err } - p.CustomPsm = _field + p.TargetRuntimeParam = _field return nil } -func (p *AsyncDebugEvalTargetRequest) ReadField51(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { +func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { + _field := eval_target.NewCustomRPCServer() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = &v } - p.CustomPsmSpiParam = _field + p.CustomRPCServer = _field return nil } func (p *AsyncDebugEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { @@ -10675,12 +10675,12 @@ func (p *AsyncDebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) fieldId = 10 goto WriteFieldError } - if err = p.writeField50(oprot); err != nil { - fieldId = 50 + if err = p.writeField11(oprot); err != nil { + fieldId = 11 goto WriteFieldError } - if err = p.writeField51(oprot); err != nil { - fieldId = 51 + if err = p.writeField50(oprot); err != nil { + fieldId = 50 goto WriteFieldError } if err = p.writeField255(oprot); err != nil { @@ -10742,11 +10742,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } func (p *AsyncDebugEvalTargetRequest) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetTargetRuntimeParam() { - if err = oprot.WriteFieldBegin("target_runtime_param", thrift.STRUCT, 10); err != nil { + if p.IsSetParam() { + if err = oprot.WriteFieldBegin("param", thrift.STRING, 10); err != nil { goto WriteFieldBeginError } - if err := p.TargetRuntimeParam.Write(oprot); err != nil { + if err := oprot.WriteString(*p.Param); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10759,12 +10759,12 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } -func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomPsm() { - if err = oprot.WriteFieldBegin("custom_psm", thrift.STRUCT, 50); err != nil { +func (p *AsyncDebugEvalTargetRequest) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetTargetRuntimeParam() { + if err = oprot.WriteFieldBegin("target_runtime_param", thrift.STRUCT, 11); err != nil { goto WriteFieldBeginError } - if err := p.CustomPsm.Write(oprot); err != nil { + if err := p.TargetRuntimeParam.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10773,16 +10773,16 @@ func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 50 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 50 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } -func (p *AsyncDebugEvalTargetRequest) writeField51(oprot thrift.TProtocol) (err error) { - if p.IsSetCustomPsmSpiParam() { - if err = oprot.WriteFieldBegin("custom_psm_spi_param", thrift.STRING, 51); err != nil { +func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomRPCServer() { + if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.CustomPsmSpiParam); err != nil { + if err := p.CustomRPCServer.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10791,9 +10791,9 @@ func (p *AsyncDebugEvalTargetRequest) writeField51(oprot thrift.TProtocol) (err } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 51 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 50 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 51 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 50 end error: ", p), err) } func (p *AsyncDebugEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { @@ -10834,13 +10834,13 @@ func (p *AsyncDebugEvalTargetRequest) DeepEqual(ano *AsyncDebugEvalTargetRequest if !p.Field2DeepEqual(ano.EvalTargetType) { return false } - if !p.Field10DeepEqual(ano.TargetRuntimeParam) { + if !p.Field10DeepEqual(ano.Param) { return false } - if !p.Field50DeepEqual(ano.CustomPsm) { + if !p.Field11DeepEqual(ano.TargetRuntimeParam) { return false } - if !p.Field51DeepEqual(ano.CustomPsmSpiParam) { + if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } if !p.Field255DeepEqual(ano.Base) { @@ -10873,28 +10873,28 @@ func (p *AsyncDebugEvalTargetRequest) Field2DeepEqual(src *eval_target.EvalTarge } return true } -func (p *AsyncDebugEvalTargetRequest) Field10DeepEqual(src *common.RuntimeParam) bool { +func (p *AsyncDebugEvalTargetRequest) Field10DeepEqual(src *string) bool { - if !p.TargetRuntimeParam.DeepEqual(src) { + if p.Param == src { + return true + } else if p.Param == nil || src == nil { + return false + } + if strings.Compare(*p.Param, *src) != 0 { return false } return true } -func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomPSM) bool { +func (p *AsyncDebugEvalTargetRequest) Field11DeepEqual(src *common.RuntimeParam) bool { - if !p.CustomPsm.DeepEqual(src) { + if !p.TargetRuntimeParam.DeepEqual(src) { return false } return true } -func (p *AsyncDebugEvalTargetRequest) Field51DeepEqual(src *string) bool { +func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { - if p.CustomPsmSpiParam == src { - return true - } else if p.CustomPsmSpiParam == nil || src == nil { - return false - } - if strings.Compare(*p.CustomPsmSpiParam, *src) != 0 { + if !p.CustomRPCServer.DeepEqual(src) { return false } return true diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go index a53899ff4..4cf7b167c 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go @@ -236,9 +236,9 @@ func (p *ListSourceEvalTargetVersionsResponse) IsValid() error { return nil } func (p *SearchCustomEvalTargetRequest) IsValid() error { - if p.CustomPsm != nil { - if err := p.CustomPsm.IsValid(); err != nil { - return fmt.Errorf("field CustomPsm not valid, %w", err) + if p.CustomRPCServer != nil { + if err := p.CustomRPCServer.IsValid(); err != nil { + return fmt.Errorf("field CustomRPCServer not valid, %w", err) } } if p.Base != nil { @@ -262,9 +262,9 @@ func (p *DebugEvalTargetRequest) IsValid() error { return fmt.Errorf("field TargetRuntimeParam not valid, %w", err) } } - if p.CustomPsm != nil { - if err := p.CustomPsm.IsValid(); err != nil { - return fmt.Errorf("field CustomPsm not valid, %w", err) + if p.CustomRPCServer != nil { + if err := p.CustomRPCServer.IsValid(); err != nil { + return fmt.Errorf("field CustomRPCServer not valid, %w", err) } } if p.Base != nil { @@ -293,9 +293,9 @@ func (p *AsyncDebugEvalTargetRequest) IsValid() error { return fmt.Errorf("field TargetRuntimeParam not valid, %w", err) } } - if p.CustomPsm != nil { - if err := p.CustomPsm.IsValid(); err != nil { - return fmt.Errorf("field CustomPsm not valid, %w", err) + if p.CustomRPCServer != nil { + if err := p.CustomRPCServer.IsValid(); err != nil { + return fmt.Errorf("field CustomRPCServer not valid, %w", err) } } if p.Base != nil { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 23ebe1891..7007c8951 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -6359,13 +6359,13 @@ func (p *SearchCustomEvalTargetRequest) FastReadField3(buf []byte) (int, error) func (p *SearchCustomEvalTargetRequest) FastReadField4(buf []byte) (int, error) { offset := 0 - _field := eval_target.NewCustomPSM() + _field := eval_target.NewCustomRPCServer() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.CustomPsm = _field + p.CustomRPCServer = _field return offset, nil } @@ -6488,9 +6488,9 @@ func (p *SearchCustomEvalTargetRequest) fastWriteField3(buf []byte, w thrift.Noc func (p *SearchCustomEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 4) - offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + offset += p.CustomRPCServer.FastWriteNocopy(buf[offset:], w) } return offset } @@ -6560,9 +6560,9 @@ func (p *SearchCustomEvalTargetRequest) field3Length() int { func (p *SearchCustomEvalTargetRequest) field4Length() int { l := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { l += thrift.Binary.FieldBeginLength() - l += p.CustomPsm.BLength() + l += p.CustomRPCServer.BLength() } return l } @@ -6627,14 +6627,14 @@ func (p *SearchCustomEvalTargetRequest) DeepCopy(s interface{}) error { p.ApplicationID = &tmp } - var _customPsm *eval_target.CustomPSM - if src.CustomPsm != nil { - _customPsm = &eval_target.CustomPSM{} - if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + var _customRPCServer *eval_target.CustomRPCServer + if src.CustomRPCServer != nil { + _customRPCServer = &eval_target.CustomRPCServer{} + if err := _customRPCServer.DeepCopy(src.CustomRPCServer); err != nil { return err } } - p.CustomPsm = _customPsm + p.CustomRPCServer = _customRPCServer if src.Region != nil { tmp := *src.Region @@ -7148,13 +7148,13 @@ func (p *DebugEvalTargetRequest) FastReadField11(buf []byte) (int, error) { func (p *DebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 - _field := eval_target.NewCustomPSM() + _field := eval_target.NewCustomRPCServer() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.CustomPsm = _field + p.CustomRPCServer = _field return offset, nil } @@ -7240,9 +7240,9 @@ func (p *DebugEvalTargetRequest) fastWriteField11(buf []byte, w thrift.NocopyWri func (p *DebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 50) - offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + offset += p.CustomRPCServer.FastWriteNocopy(buf[offset:], w) } return offset } @@ -7294,9 +7294,9 @@ func (p *DebugEvalTargetRequest) field11Length() int { func (p *DebugEvalTargetRequest) field50Length() int { l := 0 - if p.IsSetCustomPsm() { + if p.IsSetCustomRPCServer() { l += thrift.Binary.FieldBeginLength() - l += p.CustomPsm.BLength() + l += p.CustomRPCServer.BLength() } return l } @@ -7343,14 +7343,14 @@ func (p *DebugEvalTargetRequest) DeepCopy(s interface{}) error { } p.TargetRuntimeParam = _targetRuntimeParam - var _customPsm *eval_target.CustomPSM - if src.CustomPsm != nil { - _customPsm = &eval_target.CustomPSM{} - if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + var _customRPCServer *eval_target.CustomRPCServer + if src.CustomRPCServer != nil { + _customRPCServer = &eval_target.CustomRPCServer{} + if err := _customRPCServer.DeepCopy(src.CustomRPCServer); err != nil { return err } } - p.CustomPsm = _customPsm + p.CustomRPCServer = _customRPCServer var _base *base.Base if src.Base != nil { @@ -7580,7 +7580,7 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { } } case 10: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField10(buf[offset:]) offset += l if err != nil { @@ -7593,9 +7593,9 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 50: + case 11: if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField50(buf[offset:]) + l, err = p.FastReadField11(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7607,9 +7607,9 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 51: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField51(buf[offset:]) + case 50: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField50(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7685,39 +7685,39 @@ func (p *AsyncDebugEvalTargetRequest) FastReadField2(buf []byte) (int, error) { func (p *AsyncDebugEvalTargetRequest) FastReadField10(buf []byte) (int, error) { offset := 0 - _field := common.NewRuntimeParam() - if l, err := _field.FastRead(buf[offset:]); err != nil { + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + _field = &v } - p.TargetRuntimeParam = _field + p.Param = _field return offset, nil } -func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { +func (p *AsyncDebugEvalTargetRequest) FastReadField11(buf []byte) (int, error) { offset := 0 - _field := eval_target.NewCustomPSM() + _field := common.NewRuntimeParam() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.CustomPsm = _field + p.TargetRuntimeParam = _field return offset, nil } -func (p *AsyncDebugEvalTargetRequest) FastReadField51(buf []byte) (int, error) { +func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + _field := eval_target.NewCustomRPCServer() + if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = &v } - p.CustomPsmSpiParam = _field + p.CustomRPCServer = _field return offset, nil } @@ -7743,8 +7743,8 @@ func (p *AsyncDebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Nocop offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) - offset += p.fastWriteField51(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -7757,8 +7757,8 @@ func (p *AsyncDebugEvalTargetRequest) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field10Length() + l += p.field11Length() l += p.field50Length() - l += p.field51Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -7785,27 +7785,27 @@ func (p *AsyncDebugEvalTargetRequest) fastWriteField2(buf []byte, w thrift.Nocop func (p *AsyncDebugEvalTargetRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetTargetRuntimeParam() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) - offset += p.TargetRuntimeParam.FastWriteNocopy(buf[offset:], w) + if p.IsSetParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Param) } return offset } -func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { +func (p *AsyncDebugEvalTargetRequest) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetCustomPsm() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 50) - offset += p.CustomPsm.FastWriteNocopy(buf[offset:], w) + if p.IsSetTargetRuntimeParam() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.TargetRuntimeParam.FastWriteNocopy(buf[offset:], w) } return offset } -func (p *AsyncDebugEvalTargetRequest) fastWriteField51(buf []byte, w thrift.NocopyWriter) int { +func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 - if p.IsSetCustomPsmSpiParam() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 51) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.CustomPsmSpiParam) + if p.IsSetCustomRPCServer() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 50) + offset += p.CustomRPCServer.FastWriteNocopy(buf[offset:], w) } return offset } @@ -7839,27 +7839,27 @@ func (p *AsyncDebugEvalTargetRequest) field2Length() int { func (p *AsyncDebugEvalTargetRequest) field10Length() int { l := 0 - if p.IsSetTargetRuntimeParam() { + if p.IsSetParam() { l += thrift.Binary.FieldBeginLength() - l += p.TargetRuntimeParam.BLength() + l += thrift.Binary.StringLengthNocopy(*p.Param) } return l } -func (p *AsyncDebugEvalTargetRequest) field50Length() int { +func (p *AsyncDebugEvalTargetRequest) field11Length() int { l := 0 - if p.IsSetCustomPsm() { + if p.IsSetTargetRuntimeParam() { l += thrift.Binary.FieldBeginLength() - l += p.CustomPsm.BLength() + l += p.TargetRuntimeParam.BLength() } return l } -func (p *AsyncDebugEvalTargetRequest) field51Length() int { +func (p *AsyncDebugEvalTargetRequest) field50Length() int { l := 0 - if p.IsSetCustomPsmSpiParam() { + if p.IsSetCustomRPCServer() { l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.CustomPsmSpiParam) + l += p.CustomRPCServer.BLength() } return l } @@ -7889,6 +7889,14 @@ func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { p.EvalTargetType = &tmp } + if src.Param != nil { + var tmp string + if *src.Param != "" { + tmp = kutils.StringDeepCopy(*src.Param) + } + p.Param = &tmp + } + var _targetRuntimeParam *common.RuntimeParam if src.TargetRuntimeParam != nil { _targetRuntimeParam = &common.RuntimeParam{} @@ -7898,22 +7906,14 @@ func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { } p.TargetRuntimeParam = _targetRuntimeParam - var _customPsm *eval_target.CustomPSM - if src.CustomPsm != nil { - _customPsm = &eval_target.CustomPSM{} - if err := _customPsm.DeepCopy(src.CustomPsm); err != nil { + var _customRPCServer *eval_target.CustomRPCServer + if src.CustomRPCServer != nil { + _customRPCServer = &eval_target.CustomRPCServer{} + if err := _customRPCServer.DeepCopy(src.CustomRPCServer); err != nil { return err } } - p.CustomPsm = _customPsm - - if src.CustomPsmSpiParam != nil { - var tmp string - if *src.CustomPsmSpiParam != "" { - tmp = kutils.StringDeepCopy(*src.CustomPsmSpiParam) - } - p.CustomPsmSpiParam = &tmp - } + p.CustomRPCServer = _customRPCServer var _base *base.Base if src.Base != nil { diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 0aaa7b26d..86b85ab3b 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -186,26 +186,26 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi BaseInfo: commonconvertor.ConvertBaseInfoDO2DTO(targetVersionDO.VolcengineAgent.BaseInfo), } } - case do.EvalTargetTypeCustomPSM: + case do.EvalTargetTypeCustomRPCServer: targetVersionDTO.EvalTargetContent = &dto.EvalTargetContent{ InputSchemas: make([]*commondto.ArgsSchema, 0), OutputSchemas: make([]*commondto.ArgsSchema, 0), } - if targetVersionDO.CustomPsm != nil { - targetVersionDTO.EvalTargetContent.CustomPsm = &dto.CustomPSM{ - ID: &targetVersionDO.CustomPsm.ID, - Name: &targetVersionDO.CustomPsm.Name, - Description: &targetVersionDO.CustomPsm.Description, - Psm: &targetVersionDO.CustomPsm.Psm, - AccessProtocol: &targetVersionDO.CustomPsm.AccessProtocol, - Regions: targetVersionDO.CustomPsm.Regions, - Cluster: &targetVersionDO.CustomPsm.Cluster, - InvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.InvokeHTTPInfo), - AsyncInvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.AsyncInvokeHTTPInfo), - NeedSearchTarget: targetVersionDO.CustomPsm.NeedSearchTarget, - SearchHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomPsm.SearchHTTPInfo), - CustomEvalTarget: CustomEvalTargetDO2DTO(targetVersionDO.CustomPsm.CustomEvalTarget), - IsAsync: targetVersionDO.CustomPsm.IsAsync, + if targetVersionDO.CustomRPCServer != nil { + targetVersionDTO.EvalTargetContent.CustomRPCServer = &dto.CustomRPCServer{ + ID: &targetVersionDO.CustomRPCServer.ID, + Name: &targetVersionDO.CustomRPCServer.Name, + Description: &targetVersionDO.CustomRPCServer.Description, + ServerName: &targetVersionDO.CustomRPCServer.ServerName, + AccessProtocol: &targetVersionDO.CustomRPCServer.AccessProtocol, + Regions: targetVersionDO.CustomRPCServer.Regions, + Cluster: &targetVersionDO.CustomRPCServer.Cluster, + InvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.InvokeHTTPInfo), + AsyncInvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.AsyncInvokeHTTPInfo), + NeedSearchTarget: targetVersionDO.CustomRPCServer.NeedSearchTarget, + SearchHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.SearchHTTPInfo), + CustomEvalTarget: CustomEvalTargetDO2DTO(targetVersionDO.CustomRPCServer.CustomEvalTarget), + IsAsync: targetVersionDO.CustomRPCServer.IsAsync, } } default: diff --git a/backend/modules/evaluation/domain/entity/target.go b/backend/modules/evaluation/domain/entity/target.go index bf1890292..10f4db082 100644 --- a/backend/modules/evaluation/domain/entity/target.go +++ b/backend/modules/evaluation/domain/entity/target.go @@ -29,7 +29,7 @@ type EvalTargetVersion struct { Prompt *LoopPrompt CozeWorkflow *CozeWorkflow VolcengineAgent *VolcengineAgent - CustomPsm *CustomPSM + CustomRPCServer *CustomRPCServer InputSchema []*ArgsSchema OutputSchema []*ArgsSchema @@ -51,8 +51,8 @@ const ( EvalTargetTypeCozeWorkflow EvalTargetType = 4 // 火山智能体 EvalTargetTypeVolcengineAgent EvalTargetType = 5 - // 自定义psm服务 for内场 - EvalTargetTypeCustomPSM EvalTargetType = 6 + // 自定义服务 for内场 + EvalTargetTypeCustomRPCServer EvalTargetType = 6 ) func (p EvalTargetType) String() string { @@ -67,8 +67,8 @@ func (p EvalTargetType) String() string { return "CozeWorkflow" case EvalTargetTypeVolcengineAgent: return "VolcengineAgent" - case EvalTargetTypeCustomPSM: - return "CustomPSM" + case EvalTargetTypeCustomRPCServer: + return "CustomRPCServer" } return "" } diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go index 9bad0e4b9..00b81aa31 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go @@ -3,7 +3,7 @@ package entity -type CustomPSM struct { +type CustomRPCServer struct { // 应用ID ID int64 // DTO使用,不存数据库 @@ -11,7 +11,7 @@ type CustomPSM struct { // DTO使用,不存数据库 Description string `json:"-"` // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 - Psm string + ServerName string // 接入协议 AccessProtocol AccessProtocol Regions []Region @@ -59,10 +59,10 @@ const ( type AccessProtocol = string const ( - AccessProtocolRPC = "rpc" - AccessProtocolRPCOld = "rpc_old" - AccessProtocolBytefaasHTTP = "bytefaas_http" - AccessProtocolBytefaasHTTPOld = "bytefaas_http_old" + AccessProtocolRPC = "rpc" + AccessProtocolRPCOld = "rpc_old" + AccessProtocolFaasHTTP = "faas_http" + AccessProtocolFaasHTTPOld = "faas_http_old" ) type HTTPMethod = string diff --git a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go index 993d875a9..72ad23140 100644 --- a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target.go @@ -63,8 +63,8 @@ func EvalTargetVersionDO2PO(do *entity.EvalTargetVersion) (po *model.TargetVersi if err != nil { return nil, err } - case entity.EvalTargetTypeCustomPSM: - meta, err = json.Marshal(do.CustomPsm) + case entity.EvalTargetTypeCustomRPCServer: + meta, err = json.Marshal(do.CustomRPCServer) if err != nil { return nil, err } @@ -205,10 +205,10 @@ func EvalTargetVersionPO2DO(targetVersionPO *model.TargetVersion, targetType ent if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { targetVersionDO.VolcengineAgent = meta } - case entity.EvalTargetTypeCustomPSM: - meta := &entity.CustomPSM{} + case entity.EvalTargetTypeCustomRPCServer: + meta := &entity.CustomRPCServer{} if err := json.Unmarshal(*targetVersionPO.TargetMeta, meta); err == nil { - targetVersionDO.CustomPsm = meta + targetVersionDO.CustomRPCServer = meta } default: // todo diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index 4e9385d47..87edf759d 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -184,8 +184,8 @@ struct ListSourceEvalTargetVersionsResponse { struct SearchCustomEvalTargetRequest { 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') // 空间ID 2: optional string keyword // 透传spi接口 - 3: optional i64 application_id (api.js_conv="true", go.tag = 'json:"application_id"') // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义PSM详情 - 4: optional eval_target.CustomPSM custom_psm, // 自定义PSM详情,非必填,应用注册调试时传 + 3: optional i64 application_id (api.js_conv="true", go.tag = 'json:"application_id"') // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义服务详情 + 4: optional eval_target.CustomRPCServer custom_rpc_server, // 自定义服务详情,非必填,应用注册调试时传 5: optional eval_target.Region region // 必填 100: optional i32 page_size @@ -210,7 +210,7 @@ struct DebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 - 50: optional eval_target.CustomPSM custom_psm // 如果type=6,需要前端传入自定义psm相关信息 + 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 255: optional base.Base Base } @@ -225,10 +225,10 @@ struct AsyncDebugEvalTargetRequest { 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') 2: optional eval_target.EvalTargetType eval_target_type // 类型 - 10: optional common.RuntimeParam target_runtime_param // 动态参数 + 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 + 11: optional common.RuntimeParam target_runtime_param // 动态参数 - 50: optional eval_target.CustomPSM custom_psm // 如果type=6,需要前端传入自定义psm相关信息 - 51: optional string custom_psm_spi_param // 执行参数:如果type=6,则传spi request json序列化结果 + 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 255: optional base.Base Base } diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 66535d51c..59bf5c942 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -42,8 +42,8 @@ struct EvalTargetContent { 103: optional CozeWorkflow coze_workflow // EvalTargetType=5 时,传参此字段。 评测对象为 VolcengineAgent 时, 需要设置 VolcengineAgent 信息 104: optional VolcengineAgent volcengine_agent - // EvalTargetType=6 时,传参此字段。 评测对象为 CustomPSM 时, 需要设置 CustomPSM 信息 - 105: optional CustomPSM custom_psm + // EvalTargetType=6 时,传参此字段。 评测对象为 CustomRPCServer 时, 需要设置 CustomRPCServer 信息 + 105: optional CustomRPCServer custom_rpc_server } enum EvalTargetType { @@ -52,17 +52,17 @@ enum EvalTargetType { Trace = 3 // Trace CozeWorkflow = 4 VolcengineAgent = 5 // 火山智能体 - CustomPSM = 6 // 自定义psm服务 for内场 + CustomRPCServer = 6 // 自定义RPC服务 for内场 } -struct CustomPSM { +struct CustomRPCServer { 1: optional i64 id // 应用ID 2: optional string name // DTO使用,不存数据库 3: optional string description // DTO使用,不存数据库 // 注意以下信息会存储到DB,也就是说实验创建时以下内容就确定了,运行时直接从评测DB中获取,而不是实时从app模块拉 - 10: optional string psm + 10: optional string server_name 11: optional AccessProtocol access_protocol // 接入协议 12: optional list regions 13: optional string cluster @@ -97,8 +97,8 @@ const Region Region_I18N = "i18n" typedef string AccessProtocol (ts.enum="true") const AccessProtocol AccessProtocol_RPC = "rpc" const AccessProtocol AccessProtocol_RPCOld = "rpc_old" -const AccessProtocol AccessProtocol_BytefaasHTTP = "bytefaas_http" -const AccessProtocol AccessProtocol_BytefaasHTTPOld = "bytefaas_http_old" +const AccessProtocol AccessProtocol_faasHTTP = "faas_http" +const AccessProtocol AccessProtocol_faasHTTPOld = "faas_http_old" typedef string HTTPMethod (ts.enum="true") const HTTPMethod HTTPMethod_Get = "get" From 7678e2686239b9f0fdfe27460362e812fd13dc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 14:19:00 +0800 Subject: [PATCH 018/100] fix Change-Id: I147144480dd2819a357d5925ec1f24c75f1652f3 --- ..._builtin_custom_psm.go => target_builtin_custom_rpc_server.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename backend/modules/evaluation/domain/entity/{target_builtin_custom_psm.go => target_builtin_custom_rpc_server.go} (100%) diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go similarity index 100% rename from backend/modules/evaluation/domain/entity/target_builtin_custom_psm.go rename to backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go From 3e3ef0c013be66223a63f34cad3506f076191530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 15:26:23 +0800 Subject: [PATCH 019/100] fix Change-Id: I0a3872541575cc24e77d1103221409c50f7c8940 --- .../convertor/target/eval_target.go | 14 ++++++ .../evaluation/application/eval_target_app.go | 43 ++++++++++++++++++- .../modules/evaluation/domain/entity/param.go | 12 ++++++ .../domain/service/target_source.go | 2 + 4 files changed, 69 insertions(+), 2 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 86b85ab3b..9f3d2f759 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -247,3 +247,17 @@ func CustomEvalTargetDO2DTO(customEvalTargetDO *do.CustomEvalTarget) (customEval Ext: customEvalTargetDO.Ext, } } + +func CustomEvalTargetDO2DTOs(customEvalTargetDOs []*do.CustomEvalTarget) (customEvalTargetDTOs []*dto.CustomEvalTarget) { + if customEvalTargetDOs == nil { + return nil + } + customEvalTargetDTOs = make([]*dto.CustomEvalTarget, 0) + for _, customEvalTargetDO := range customEvalTargetDOs { + if customEvalTargetDO == nil { + continue + } + customEvalTargetDTOs = append(customEvalTargetDTOs, CustomEvalTargetDO2DTO(customEvalTargetDO)) + } + return customEvalTargetDTOs +} diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 6dc715a5c..ce0ceb7ec 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -407,8 +407,47 @@ func (e EvalTargetApplicationImpl) BatchGetSourceEvalTargets(ctx context.Context } func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { - // TODO implement me - panic("implement me") + if req == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("req is nil")) + } + if req.WorkspaceID == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("spaceID is nil")) + } + if req.ApplicationID == nil && req.CustomRPCServer == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("app info is nil")) + } + if req.Region == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("region is nil")) + } + if e.typedOperators[entity.EvalTargetTypeCustomRPCServer] == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) + } + // 鉴权 + err = e.auth.Authorization(ctx, &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(gptr.Indirect(req.WorkspaceID), 10), + SpaceID: gptr.Indirect(req.WorkspaceID), + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of("listLoopEvaluationTarget"), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + }) + if err != nil { + return nil, err + } + res, nextCursor, hasMore, err := e.typedOperators[entity.EvalTargetTypeCustomRPCServer].SearchCustomEvalTarget(ctx, &entity.SearchCustomEvalTargetParam{ + WorkspaceID: req.WorkspaceID, + Keyword: req.Keyword, + ApplicationID: req.ApplicationID, + CustomRPCServer: req.CustomRPCServer, + Region: req.Region, + PageSize: req.PageSize, + PageToken: req.PageToken, + }) + if err != nil { + return nil, err + } + return &eval_target.SearchCustomEvalTargetResponse{ + CustomEvalTargets: target.CustomEvalTargetDO2DTOs(res), + NextPageToken: &nextCursor, + HasMore: &hasMore, + }, nil } func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index cdf70c208..7362df7ed 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -3,6 +3,8 @@ package entity +import "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" + type CreateEvaluationSetParam struct { SpaceID int64 Name string @@ -264,3 +266,13 @@ type LLMCallParam struct { ToolCallConfig *ToolCallConfig ModelConfig *ModelConfig } + +type SearchCustomEvalTargetParam struct { + WorkspaceID *int64 + Keyword *string + ApplicationID *int64 + CustomRPCServer *eval_target.CustomRPCServer + Region *eval_target.Region + PageSize *int32 + PageToken *string +} diff --git a/backend/modules/evaluation/domain/service/target_source.go b/backend/modules/evaluation/domain/service/target_source.go index 97e41e383..828eb3681 100644 --- a/backend/modules/evaluation/domain/service/target_source.go +++ b/backend/modules/evaluation/domain/service/target_source.go @@ -29,6 +29,8 @@ type ISourceEvalTargetOperateService interface { // Execute Execute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (outputData *entity.EvalTargetOutputData, status entity.EvalTargetRunStatus, err error) RuntimeParam() entity.IRuntimeParam + // 搜索自定义评测对象 + SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) (targets []*entity.CustomEvalTarget, nextCursor string, hasMore bool, err error) } //type Option func(option *Opt) From 2a70267d893ce6fbdc789034cfe1e4ced00809ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 15:28:25 +0800 Subject: [PATCH 020/100] fix Change-Id: Iffd3c2524485a307c0e38260fcde03a50e59d39a --- .../domain/service/mocks/target_source.go | 17 +++++++++++++++++ .../service/target_source_loopprompt_impl.go | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/backend/modules/evaluation/domain/service/mocks/target_source.go b/backend/modules/evaluation/domain/service/mocks/target_source.go index b30866224..2f356a570 100644 --- a/backend/modules/evaluation/domain/service/mocks/target_source.go +++ b/backend/modules/evaluation/domain/service/mocks/target_source.go @@ -182,6 +182,23 @@ func (mr *MockISourceEvalTargetOperateServiceMockRecorder) RuntimeParam() *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RuntimeParam", reflect.TypeOf((*MockISourceEvalTargetOperateService)(nil).RuntimeParam)) } +// SearchCustomEvalTarget mocks base method. +func (m *MockISourceEvalTargetOperateService) SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) ([]*entity.CustomEvalTarget, string, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SearchCustomEvalTarget", ctx, param) + ret0, _ := ret[0].([]*entity.CustomEvalTarget) + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(bool) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 +} + +// SearchCustomEvalTarget indicates an expected call of SearchCustomEvalTarget. +func (mr *MockISourceEvalTargetOperateServiceMockRecorder) SearchCustomEvalTarget(ctx, param any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchCustomEvalTarget", reflect.TypeOf((*MockISourceEvalTargetOperateService)(nil).SearchCustomEvalTarget), ctx, param) +} + // ValidateInput mocks base method. func (m *MockISourceEvalTargetOperateService) ValidateInput(ctx context.Context, spaceID int64, inputSchema []*entity.ArgsSchema, input *entity.EvalTargetInputData) error { m.ctrl.T.Helper() diff --git a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go index be6fcb759..dd83f8dfc 100644 --- a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go +++ b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go @@ -473,3 +473,7 @@ func (t *PromptSourceEvalTargetServiceImpl) BatchGetSource(ctx context.Context, } return targets, nil } + +func (t *PromptSourceEvalTargetServiceImpl) SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) (targets []*entity.CustomEvalTarget, nextCursor string, hasMore bool, err error) { + return nil, "", false, nil +} From d88504b61eca35eb0d3738473184105591a62864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 15:37:27 +0800 Subject: [PATCH 021/100] fix Change-Id: Ie819a628599e0d9d77b1b7e0d6c24d09277e5a80 --- backend/modules/evaluation/application/eval_target_app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index ce0ceb7ec..c902ac639 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -407,6 +407,7 @@ func (e EvalTargetApplicationImpl) BatchGetSourceEvalTargets(ctx context.Context } func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest) (r *eval_target.SearchCustomEvalTargetResponse, err error) { + // 参数校验 if req == nil { return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("req is nil")) } From 4d9848a28fe79ca89b0538bff965f36d43eb938c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 18:06:15 +0800 Subject: [PATCH 022/100] fix Change-Id: I3e779cda5e72bb4284b643d565b4b5407b8f635b --- .../coze.loop.evaluation.eval_target.go | 242 +++++++++++++++++- .../k-coze.loop.evaluation.eval_target.go | 168 ++++++++++++ .../modules/evaluation/domain/entity/param.go | 1 + .../coze.loop.evaluation.eval_target.thrift | 3 + 4 files changed, 410 insertions(+), 4 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 2698e6fda..480667560 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -8462,10 +8462,12 @@ type SearchCustomEvalTargetRequest struct { // 自定义服务详情,非必填,应用注册调试时传 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,4,optional" frugal:"4,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` // 必填 - Region *eval_target.Region `thrift:"region,5,optional" frugal:"5,optional,string" form:"region" json:"region,omitempty" query:"region"` - PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` - PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + Region *eval_target.Region `thrift:"region,5,optional" frugal:"5,optional,string" form:"region" json:"region,omitempty" query:"region"` + // 环境 + Env *string `thrift:"env,6,optional" frugal:"6,optional,string" form:"env" json:"env,omitempty" query:"env"` + PageSize *int32 `thrift:"page_size,100,optional" frugal:"100,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` + PageToken *string `thrift:"page_token,101,optional" frugal:"101,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewSearchCustomEvalTargetRequest() *SearchCustomEvalTargetRequest { @@ -8535,6 +8537,18 @@ func (p *SearchCustomEvalTargetRequest) GetRegion() (v eval_target.Region) { return *p.Region } +var SearchCustomEvalTargetRequest_Env_DEFAULT string + +func (p *SearchCustomEvalTargetRequest) GetEnv() (v string) { + if p == nil { + return + } + if !p.IsSetEnv() { + return SearchCustomEvalTargetRequest_Env_DEFAULT + } + return *p.Env +} + var SearchCustomEvalTargetRequest_PageSize_DEFAULT int32 func (p *SearchCustomEvalTargetRequest) GetPageSize() (v int32) { @@ -8585,6 +8599,9 @@ func (p *SearchCustomEvalTargetRequest) SetCustomRPCServer(val *eval_target.Cust func (p *SearchCustomEvalTargetRequest) SetRegion(val *eval_target.Region) { p.Region = val } +func (p *SearchCustomEvalTargetRequest) SetEnv(val *string) { + p.Env = val +} func (p *SearchCustomEvalTargetRequest) SetPageSize(val *int32) { p.PageSize = val } @@ -8601,6 +8618,7 @@ var fieldIDToName_SearchCustomEvalTargetRequest = map[int16]string{ 3: "application_id", 4: "custom_rpc_server", 5: "region", + 6: "env", 100: "page_size", 101: "page_token", 255: "Base", @@ -8626,6 +8644,10 @@ func (p *SearchCustomEvalTargetRequest) IsSetRegion() bool { return p.Region != nil } +func (p *SearchCustomEvalTargetRequest) IsSetEnv() bool { + return p.Env != nil +} + func (p *SearchCustomEvalTargetRequest) IsSetPageSize() bool { return p.PageSize != nil } @@ -8696,6 +8718,14 @@ func (p *SearchCustomEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 100: if fieldTypeId == thrift.I32 { if err = p.ReadField100(iprot); err != nil { @@ -8801,6 +8831,17 @@ func (p *SearchCustomEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error p.Region = _field return nil } +func (p *SearchCustomEvalTargetRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Env = _field + return nil +} func (p *SearchCustomEvalTargetRequest) ReadField100(iprot thrift.TProtocol) error { var _field *int32 @@ -8858,6 +8899,10 @@ func (p *SearchCustomEvalTargetRequest) Write(oprot thrift.TProtocol) (err error fieldId = 5 goto WriteFieldError } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } if err = p.writeField100(oprot); err != nil { fieldId = 100 goto WriteFieldError @@ -8978,6 +9023,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } +func (p *SearchCustomEvalTargetRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetEnv() { + if err = oprot.WriteFieldBegin("env", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Env); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} func (p *SearchCustomEvalTargetRequest) writeField100(oprot thrift.TProtocol) (err error) { if p.IsSetPageSize() { if err = oprot.WriteFieldBegin("page_size", thrift.I32, 100); err != nil { @@ -9062,6 +9125,9 @@ func (p *SearchCustomEvalTargetRequest) DeepEqual(ano *SearchCustomEvalTargetReq if !p.Field5DeepEqual(ano.Region) { return false } + if !p.Field6DeepEqual(ano.Env) { + return false + } if !p.Field100DeepEqual(ano.PageSize) { return false } @@ -9129,6 +9195,18 @@ func (p *SearchCustomEvalTargetRequest) Field5DeepEqual(src *eval_target.Region) } return true } +func (p *SearchCustomEvalTargetRequest) Field6DeepEqual(src *string) bool { + + if p.Env == src { + return true + } else if p.Env == nil || src == nil { + return false + } + if strings.Compare(*p.Env, *src) != 0 { + return false + } + return true +} func (p *SearchCustomEvalTargetRequest) Field100DeepEqual(src *int32) bool { if p.PageSize == src { @@ -9581,6 +9659,8 @@ type DebugEvalTargetRequest struct { Param *string `thrift:"param,10,optional" frugal:"10,optional,string" form:"param" json:"param,omitempty" query:"param"` // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` + // 环境 + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -9641,6 +9721,18 @@ func (p *DebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.RuntimeParam return p.TargetRuntimeParam } +var DebugEvalTargetRequest_Env_DEFAULT string + +func (p *DebugEvalTargetRequest) GetEnv() (v string) { + if p == nil { + return + } + if !p.IsSetEnv() { + return DebugEvalTargetRequest_Env_DEFAULT + } + return *p.Env +} + var DebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *DebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -9676,6 +9768,9 @@ func (p *DebugEvalTargetRequest) SetParam(val *string) { func (p *DebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { p.TargetRuntimeParam = val } +func (p *DebugEvalTargetRequest) SetEnv(val *string) { + p.Env = val +} func (p *DebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -9688,6 +9783,7 @@ var fieldIDToName_DebugEvalTargetRequest = map[int16]string{ 2: "eval_target_type", 10: "param", 11: "target_runtime_param", + 12: "env", 50: "custom_rpc_server", 255: "Base", } @@ -9708,6 +9804,10 @@ func (p *DebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { return p.TargetRuntimeParam != nil } +func (p *DebugEvalTargetRequest) IsSetEnv() bool { + return p.Env != nil +} + func (p *DebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -9766,6 +9866,14 @@ func (p *DebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -9853,6 +9961,17 @@ func (p *DebugEvalTargetRequest) ReadField11(iprot thrift.TProtocol) error { p.TargetRuntimeParam = _field return nil } +func (p *DebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Env = _field + return nil +} func (p *DebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -9892,6 +10011,10 @@ func (p *DebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 11 goto WriteFieldError } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -9990,6 +10113,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } +func (p *DebugEvalTargetRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetEnv() { + if err = oprot.WriteFieldBegin("env", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Env); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} func (p *DebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -10053,6 +10194,9 @@ func (p *DebugEvalTargetRequest) DeepEqual(ano *DebugEvalTargetRequest) bool { if !p.Field11DeepEqual(ano.TargetRuntimeParam) { return false } + if !p.Field12DeepEqual(ano.Env) { + return false + } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -10105,6 +10249,18 @@ func (p *DebugEvalTargetRequest) Field11DeepEqual(src *common.RuntimeParam) bool } return true } +func (p *DebugEvalTargetRequest) Field12DeepEqual(src *string) bool { + + if p.Env == src { + return true + } else if p.Env == nil || src == nil { + return false + } + if strings.Compare(*p.Env, *src) != 0 { + return false + } + return true +} func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { @@ -10368,6 +10524,8 @@ type AsyncDebugEvalTargetRequest struct { Param *string `thrift:"param,10,optional" frugal:"10,optional,string" form:"param" json:"param,omitempty" query:"param"` // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` + // 环境 + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -10428,6 +10586,18 @@ func (p *AsyncDebugEvalTargetRequest) GetTargetRuntimeParam() (v *common.Runtime return p.TargetRuntimeParam } +var AsyncDebugEvalTargetRequest_Env_DEFAULT string + +func (p *AsyncDebugEvalTargetRequest) GetEnv() (v string) { + if p == nil { + return + } + if !p.IsSetEnv() { + return AsyncDebugEvalTargetRequest_Env_DEFAULT + } + return *p.Env +} + var AsyncDebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *AsyncDebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -10463,6 +10633,9 @@ func (p *AsyncDebugEvalTargetRequest) SetParam(val *string) { func (p *AsyncDebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) { p.TargetRuntimeParam = val } +func (p *AsyncDebugEvalTargetRequest) SetEnv(val *string) { + p.Env = val +} func (p *AsyncDebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -10475,6 +10648,7 @@ var fieldIDToName_AsyncDebugEvalTargetRequest = map[int16]string{ 2: "eval_target_type", 10: "param", 11: "target_runtime_param", + 12: "env", 50: "custom_rpc_server", 255: "Base", } @@ -10495,6 +10669,10 @@ func (p *AsyncDebugEvalTargetRequest) IsSetTargetRuntimeParam() bool { return p.TargetRuntimeParam != nil } +func (p *AsyncDebugEvalTargetRequest) IsSetEnv() bool { + return p.Env != nil +} + func (p *AsyncDebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -10553,6 +10731,14 @@ func (p *AsyncDebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -10640,6 +10826,17 @@ func (p *AsyncDebugEvalTargetRequest) ReadField11(iprot thrift.TProtocol) error p.TargetRuntimeParam = _field return nil } +func (p *AsyncDebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Env = _field + return nil +} func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -10679,6 +10876,10 @@ func (p *AsyncDebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) fieldId = 11 goto WriteFieldError } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -10777,6 +10978,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } +func (p *AsyncDebugEvalTargetRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetEnv() { + if err = oprot.WriteFieldBegin("env", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Env); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -10840,6 +11059,9 @@ func (p *AsyncDebugEvalTargetRequest) DeepEqual(ano *AsyncDebugEvalTargetRequest if !p.Field11DeepEqual(ano.TargetRuntimeParam) { return false } + if !p.Field12DeepEqual(ano.Env) { + return false + } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -10892,6 +11114,18 @@ func (p *AsyncDebugEvalTargetRequest) Field11DeepEqual(src *common.RuntimeParam) } return true } +func (p *AsyncDebugEvalTargetRequest) Field12DeepEqual(src *string) bool { + + if p.Env == src { + return true + } else if p.Env == nil || src == nil { + return false + } + if strings.Compare(*p.Env, *src) != 0 { + return false + } + return true +} func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 7007c8951..5b0f7d275 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -6255,6 +6255,20 @@ func (p *SearchCustomEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 100: if fieldTypeId == thrift.I32 { l, err = p.FastReadField100(buf[offset:]) @@ -6383,6 +6397,20 @@ func (p *SearchCustomEvalTargetRequest) FastReadField5(buf []byte) (int, error) return offset, nil } +func (p *SearchCustomEvalTargetRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Env = _field + return offset, nil +} + func (p *SearchCustomEvalTargetRequest) FastReadField100(buf []byte) (int, error) { offset := 0 @@ -6436,6 +6464,7 @@ func (p *SearchCustomEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Noc offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) offset += p.fastWriteField101(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -6451,6 +6480,7 @@ func (p *SearchCustomEvalTargetRequest) BLength() int { l += p.field3Length() l += p.field4Length() l += p.field5Length() + l += p.field6Length() l += p.field100Length() l += p.field101Length() l += p.field255Length() @@ -6504,6 +6534,15 @@ func (p *SearchCustomEvalTargetRequest) fastWriteField5(buf []byte, w thrift.Noc return offset } +func (p *SearchCustomEvalTargetRequest) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEnv() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 6) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Env) + } + return offset +} + func (p *SearchCustomEvalTargetRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetPageSize() { @@ -6576,6 +6615,15 @@ func (p *SearchCustomEvalTargetRequest) field5Length() int { return l } +func (p *SearchCustomEvalTargetRequest) field6Length() int { + l := 0 + if p.IsSetEnv() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Env) + } + return l +} + func (p *SearchCustomEvalTargetRequest) field100Length() int { l := 0 if p.IsSetPageSize() { @@ -6641,6 +6689,14 @@ func (p *SearchCustomEvalTargetRequest) DeepCopy(s interface{}) error { p.Region = &tmp } + if src.Env != nil { + var tmp string + if *src.Env != "" { + tmp = kutils.StringDeepCopy(*src.Env) + } + p.Env = &tmp + } + if src.PageSize != nil { tmp := *src.PageSize p.PageSize = &tmp @@ -7044,6 +7100,20 @@ func (p *DebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 12: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -7146,6 +7216,20 @@ func (p *DebugEvalTargetRequest) FastReadField11(buf []byte) (int, error) { return offset, nil } +func (p *DebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Env = _field + return offset, nil +} + func (p *DebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -7181,6 +7265,7 @@ func (p *DebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWrit offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -7195,6 +7280,7 @@ func (p *DebugEvalTargetRequest) BLength() int { l += p.field2Length() l += p.field10Length() l += p.field11Length() + l += p.field12Length() l += p.field50Length() l += p.field255Length() } @@ -7238,6 +7324,15 @@ func (p *DebugEvalTargetRequest) fastWriteField11(buf []byte, w thrift.NocopyWri return offset } +func (p *DebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEnv() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 12) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Env) + } + return offset +} + func (p *DebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -7292,6 +7387,15 @@ func (p *DebugEvalTargetRequest) field11Length() int { return l } +func (p *DebugEvalTargetRequest) field12Length() int { + l := 0 + if p.IsSetEnv() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Env) + } + return l +} + func (p *DebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -7343,6 +7447,14 @@ func (p *DebugEvalTargetRequest) DeepCopy(s interface{}) error { } p.TargetRuntimeParam = _targetRuntimeParam + if src.Env != nil { + var tmp string + if *src.Env != "" { + tmp = kutils.StringDeepCopy(*src.Env) + } + p.Env = &tmp + } + var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} @@ -7607,6 +7719,20 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 12: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -7709,6 +7835,20 @@ func (p *AsyncDebugEvalTargetRequest) FastReadField11(buf []byte) (int, error) { return offset, nil } +func (p *AsyncDebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Env = _field + return offset, nil +} + func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -7744,6 +7884,7 @@ func (p *AsyncDebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Nocop offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -7758,6 +7899,7 @@ func (p *AsyncDebugEvalTargetRequest) BLength() int { l += p.field2Length() l += p.field10Length() l += p.field11Length() + l += p.field12Length() l += p.field50Length() l += p.field255Length() } @@ -7801,6 +7943,15 @@ func (p *AsyncDebugEvalTargetRequest) fastWriteField11(buf []byte, w thrift.Noco return offset } +func (p *AsyncDebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEnv() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 12) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Env) + } + return offset +} + func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -7855,6 +8006,15 @@ func (p *AsyncDebugEvalTargetRequest) field11Length() int { return l } +func (p *AsyncDebugEvalTargetRequest) field12Length() int { + l := 0 + if p.IsSetEnv() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Env) + } + return l +} + func (p *AsyncDebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -7906,6 +8066,14 @@ func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { } p.TargetRuntimeParam = _targetRuntimeParam + if src.Env != nil { + var tmp string + if *src.Env != "" { + tmp = kutils.StringDeepCopy(*src.Env) + } + p.Env = &tmp + } + var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index 7362df7ed..65b49eaa5 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -273,6 +273,7 @@ type SearchCustomEvalTargetParam struct { ApplicationID *int64 CustomRPCServer *eval_target.CustomRPCServer Region *eval_target.Region + Env *string PageSize *int32 PageToken *string } diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index 87edf759d..4f36302f3 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -187,6 +187,7 @@ struct SearchCustomEvalTargetRequest { 3: optional i64 application_id (api.js_conv="true", go.tag = 'json:"application_id"') // 应用ID,非必填,创建实验时传应用ID,会根据应用ID从应用模块获取自定义服务详情 4: optional eval_target.CustomRPCServer custom_rpc_server, // 自定义服务详情,非必填,应用注册调试时传 5: optional eval_target.Region region // 必填 + 6: optional string env // 环境 100: optional i32 page_size 101: optional string page_token @@ -209,6 +210,7 @@ struct DebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 + 12: optional string env // 环境 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 @@ -227,6 +229,7 @@ struct AsyncDebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 + 12: optional string env // 环境 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 From 2f21375bf604006a4900d448f141afa1b4baf03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 16 Sep 2025 18:55:15 +0800 Subject: [PATCH 023/100] fix Change-Id: I1b5e391e311d09e442261c19174c12db0ac94de5 --- .../domain/entity/target_builtin_custom_rpc_server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go index 00b81aa31..2c9fbe940 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go @@ -28,6 +28,8 @@ type CustomRPCServer struct { CustomEvalTarget *CustomEvalTarget // 是否异步 IsAsync *bool + // 额外信息 + Ext map[string]string } type HTTPInfo struct { From 9e6c8bb021bebd9c4d64cc3a9d09312faaffecc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Wed, 17 Sep 2025 11:30:38 +0800 Subject: [PATCH 024/100] fix Change-Id: I89dc3d66c52de645587b0defca59159278848754 --- backend/infra/http/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/infra/http/http.go b/backend/infra/http/http.go index 0ac7b3c69..2ede83f62 100644 --- a/backend/infra/http/http.go +++ b/backend/infra/http/http.go @@ -21,4 +21,5 @@ type RequestParam struct { Response interface{} Timeout time.Duration + Cluster *string } From f9b066d4abff989a11ef66400d15f3438912535e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Wed, 17 Sep 2025 14:49:53 +0800 Subject: [PATCH 025/100] fix Change-Id: I9bd09ee904fbbe335b82c23a5825c611b03363ef --- .../coze.loop.evaluation.eval_target.go | 156 ++++++++++++++++++ .../k-coze.loop.evaluation.eval_target.go | 109 ++++++++++++ .../application/convertor/experiment/expt.go | 2 + .../evaluation/application/eval_target_app.go | 6 +- .../modules/evaluation/domain/entity/expt.go | 2 + .../modules/evaluation/domain/entity/param.go | 14 ++ .../target_builtin_custom_rpc_server.go | 3 + .../domain/service/expt_manage_impl.go | 4 +- .../coze.loop.evaluation.eval_target.thrift | 2 + 9 files changed, 295 insertions(+), 3 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 480667560..8b05bfa2f 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -333,6 +333,10 @@ type CreateEvalTargetParam struct { BotPublishVersion *string `thrift:"bot_publish_version,5,optional" frugal:"5,optional,string" form:"bot_publish_version" json:"bot_publish_version,omitempty" query:"bot_publish_version"` // type=6,并且有搜索对象,搜索结果信息通过这个字段透传 CustomEvalTarget *eval_target.CustomEvalTarget `thrift:"custom_eval_target,6,optional" frugal:"6,optional,eval_target.CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` + // 有区域限制需要填充这个字段 + Region *eval_target.Region `thrift:"region,7,optional" frugal:"7,optional,string" form:"region" json:"region,omitempty" query:"region"` + // 有环境限制需要填充这个字段 + Env *string `thrift:"env,8,optional" frugal:"8,optional,string" form:"env" json:"env,omitempty" query:"env"` } func NewCreateEvalTargetParam() *CreateEvalTargetParam { @@ -413,6 +417,30 @@ func (p *CreateEvalTargetParam) GetCustomEvalTarget() (v *eval_target.CustomEval } return p.CustomEvalTarget } + +var CreateEvalTargetParam_Region_DEFAULT eval_target.Region + +func (p *CreateEvalTargetParam) GetRegion() (v eval_target.Region) { + if p == nil { + return + } + if !p.IsSetRegion() { + return CreateEvalTargetParam_Region_DEFAULT + } + return *p.Region +} + +var CreateEvalTargetParam_Env_DEFAULT string + +func (p *CreateEvalTargetParam) GetEnv() (v string) { + if p == nil { + return + } + if !p.IsSetEnv() { + return CreateEvalTargetParam_Env_DEFAULT + } + return *p.Env +} func (p *CreateEvalTargetParam) SetSourceTargetID(val *string) { p.SourceTargetID = val } @@ -431,6 +459,12 @@ func (p *CreateEvalTargetParam) SetBotPublishVersion(val *string) { func (p *CreateEvalTargetParam) SetCustomEvalTarget(val *eval_target.CustomEvalTarget) { p.CustomEvalTarget = val } +func (p *CreateEvalTargetParam) SetRegion(val *eval_target.Region) { + p.Region = val +} +func (p *CreateEvalTargetParam) SetEnv(val *string) { + p.Env = val +} var fieldIDToName_CreateEvalTargetParam = map[int16]string{ 1: "source_target_id", @@ -439,6 +473,8 @@ var fieldIDToName_CreateEvalTargetParam = map[int16]string{ 4: "bot_info_type", 5: "bot_publish_version", 6: "custom_eval_target", + 7: "region", + 8: "env", } func (p *CreateEvalTargetParam) IsSetSourceTargetID() bool { @@ -465,6 +501,14 @@ func (p *CreateEvalTargetParam) IsSetCustomEvalTarget() bool { return p.CustomEvalTarget != nil } +func (p *CreateEvalTargetParam) IsSetRegion() bool { + return p.Region != nil +} + +func (p *CreateEvalTargetParam) IsSetEnv() bool { + return p.Env != nil +} + func (p *CreateEvalTargetParam) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -531,6 +575,22 @@ func (p *CreateEvalTargetParam) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRING { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -625,6 +685,28 @@ func (p *CreateEvalTargetParam) ReadField6(iprot thrift.TProtocol) error { p.CustomEvalTarget = _field return nil } +func (p *CreateEvalTargetParam) ReadField7(iprot thrift.TProtocol) error { + + var _field *eval_target.Region + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Region = _field + return nil +} +func (p *CreateEvalTargetParam) ReadField8(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Env = _field + return nil +} func (p *CreateEvalTargetParam) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -656,6 +738,14 @@ func (p *CreateEvalTargetParam) Write(oprot thrift.TProtocol) (err error) { fieldId = 6 goto WriteFieldError } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -782,6 +872,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } +func (p *CreateEvalTargetParam) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetRegion() { + if err = oprot.WriteFieldBegin("region", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Region); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} +func (p *CreateEvalTargetParam) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetEnv() { + if err = oprot.WriteFieldBegin("env", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Env); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} func (p *CreateEvalTargetParam) String() string { if p == nil { @@ -815,6 +941,12 @@ func (p *CreateEvalTargetParam) DeepEqual(ano *CreateEvalTargetParam) bool { if !p.Field6DeepEqual(ano.CustomEvalTarget) { return false } + if !p.Field7DeepEqual(ano.Region) { + return false + } + if !p.Field8DeepEqual(ano.Env) { + return false + } return true } @@ -885,6 +1017,30 @@ func (p *CreateEvalTargetParam) Field6DeepEqual(src *eval_target.CustomEvalTarge } return true } +func (p *CreateEvalTargetParam) Field7DeepEqual(src *eval_target.Region) bool { + + if p.Region == src { + return true + } else if p.Region == nil || src == nil { + return false + } + if strings.Compare(*p.Region, *src) != 0 { + return false + } + return true +} +func (p *CreateEvalTargetParam) Field8DeepEqual(src *string) bool { + + if p.Env == src { + return true + } else if p.Env == nil || src == nil { + return false + } + if strings.Compare(*p.Env, *src) != 0 { + return false + } + return true +} type CreateEvalTargetResponse struct { ID *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" json:"id" form:"id" query:"id"` diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 5b0f7d275..382d96af2 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -362,6 +362,34 @@ func (p *CreateEvalTargetParam) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -466,6 +494,34 @@ func (p *CreateEvalTargetParam) FastReadField6(buf []byte) (int, error) { return offset, nil } +func (p *CreateEvalTargetParam) FastReadField7(buf []byte) (int, error) { + offset := 0 + + var _field *eval_target.Region + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Region = _field + return offset, nil +} + +func (p *CreateEvalTargetParam) FastReadField8(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Env = _field + return offset, nil +} + func (p *CreateEvalTargetParam) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -479,6 +535,8 @@ func (p *CreateEvalTargetParam) FastWriteNocopy(buf []byte, w thrift.NocopyWrite offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) offset += p.fastWriteField6(buf[offset:], w) + offset += p.fastWriteField7(buf[offset:], w) + offset += p.fastWriteField8(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -493,6 +551,8 @@ func (p *CreateEvalTargetParam) BLength() int { l += p.field4Length() l += p.field5Length() l += p.field6Length() + l += p.field7Length() + l += p.field8Length() } l += thrift.Binary.FieldStopLength() return l @@ -552,6 +612,24 @@ func (p *CreateEvalTargetParam) fastWriteField6(buf []byte, w thrift.NocopyWrite return offset } +func (p *CreateEvalTargetParam) fastWriteField7(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetRegion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 7) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Region) + } + return offset +} + +func (p *CreateEvalTargetParam) fastWriteField8(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEnv() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 8) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Env) + } + return offset +} + func (p *CreateEvalTargetParam) field1Length() int { l := 0 if p.IsSetSourceTargetID() { @@ -606,6 +684,24 @@ func (p *CreateEvalTargetParam) field6Length() int { return l } +func (p *CreateEvalTargetParam) field7Length() int { + l := 0 + if p.IsSetRegion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Region) + } + return l +} + +func (p *CreateEvalTargetParam) field8Length() int { + l := 0 + if p.IsSetEnv() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Env) + } + return l +} + func (p *CreateEvalTargetParam) DeepCopy(s interface{}) error { src, ok := s.(*CreateEvalTargetParam) if !ok { @@ -655,6 +751,19 @@ func (p *CreateEvalTargetParam) DeepCopy(s interface{}) error { } p.CustomEvalTarget = _customEvalTarget + if src.Region != nil { + tmp := *src.Region + p.Region = &tmp + } + + if src.Env != nil { + var tmp string + if *src.Env != "" { + tmp = kutils.StringDeepCopy(*src.Env) + } + p.Env = &tmp + } + return nil } diff --git a/backend/modules/evaluation/application/convertor/experiment/expt.go b/backend/modules/evaluation/application/convertor/experiment/expt.go index 32c278563..bd50c6042 100644 --- a/backend/modules/evaluation/application/convertor/experiment/expt.go +++ b/backend/modules/evaluation/application/convertor/experiment/expt.go @@ -270,6 +270,8 @@ func CreateEvalTargetParamDTO2DO(param *eval_target.CreateEvalTargetParam) *enti SourceTargetID: param.SourceTargetID, SourceTargetVersion: param.SourceTargetVersion, BotPublishVersion: param.BotPublishVersion, + Region: param.Region, + Env: param.Env, } if param.EvalTargetType != nil { res.EvalTargetType = gptr.Of(entity.EvalTargetType(*param.EvalTargetType)) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index c902ac639..2cf63af1b 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -73,8 +73,10 @@ func (e EvalTargetApplicationImpl) CreateEvalTarget(ctx context.Context, request } opts := make([]entity.Option, 0) opts = append(opts, entity.WithCozeBotPublishVersion(request.Param.BotPublishVersion), - entity.WithCozeBotInfoType(entity.CozeBotInfoType(request.Param.GetBotInfoType()))) - if request.GetParam().GetCustomEvalTarget() != nil { + entity.WithCozeBotInfoType(entity.CozeBotInfoType(request.Param.GetBotInfoType())), + entity.WithRegion(request.Param.Region), + entity.WithEnv(request.Param.Env)) + if request.GetParam().CustomEvalTarget != nil { opts = append(opts, entity.WithCustomEvalTarget(&entity.CustomEvalTarget{ ID: request.GetParam().GetCustomEvalTarget().ID, Name: request.GetParam().GetCustomEvalTarget().Name, diff --git a/backend/modules/evaluation/domain/entity/expt.go b/backend/modules/evaluation/domain/entity/expt.go index d16df8f6c..cfb8e0d3b 100644 --- a/backend/modules/evaluation/domain/entity/expt.go +++ b/backend/modules/evaluation/domain/entity/expt.go @@ -296,6 +296,8 @@ type CreateEvalTargetParam struct { BotInfoType *CozeBotInfoType BotPublishVersion *string CustomEvalTarget *CustomEvalTarget // 搜索对象返回的信息 + Region *Region + Env *string } func (c *CreateEvalTargetParam) IsNull() bool { diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index 65b49eaa5..74fc6989a 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -90,6 +90,8 @@ type Opt struct { PublishVersion *string BotInfoType CozeBotInfoType CustomEvalTarget *CustomEvalTarget + Region *Region + Env *string } func WithCozeBotPublishVersion(publishVersion *string) Option { @@ -110,6 +112,18 @@ func WithCustomEvalTarget(customTarget *CustomEvalTarget) Option { } } +func WithRegion(region *Region) Option { + return func(option *Opt) { + option.Region = region + } +} + +func WithEnv(env *string) Option { + return func(option *Opt) { + option.Env = env + } +} + type ExecuteEvalTargetParam struct { TargetID int64 VersionID int64 diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go index 2c9fbe940..d4f910028 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go @@ -30,6 +30,9 @@ type CustomRPCServer struct { IsAsync *bool // 额外信息 Ext map[string]string + + ExecRegion Region // 执行区域 + Env string // 执行环境 } type HTTPInfo struct { diff --git a/backend/modules/evaluation/domain/service/expt_manage_impl.go b/backend/modules/evaluation/domain/service/expt_manage_impl.go index f542c6fb1..0dfffdc17 100644 --- a/backend/modules/evaluation/domain/service/expt_manage_impl.go +++ b/backend/modules/evaluation/domain/service/expt_manage_impl.go @@ -483,7 +483,9 @@ func (e *ExptMangerImpl) CreateExpt(ctx context.Context, req *entity.CreateExptP if !req.CreateEvalTargetParam.IsNull() { opts := make([]entity.Option, 0) opts = append(opts, entity.WithCozeBotPublishVersion(req.CreateEvalTargetParam.BotPublishVersion), - entity.WithCozeBotInfoType(gptr.Indirect(req.CreateEvalTargetParam.BotInfoType))) + entity.WithCozeBotInfoType(gptr.Indirect(req.CreateEvalTargetParam.BotInfoType)), + entity.WithRegion(req.CreateEvalTargetParam.Region), + entity.WithEnv(req.CreateEvalTargetParam.Env)) if req.CreateEvalTargetParam.CustomEvalTarget != nil { opts = append(opts, entity.WithCustomEvalTarget(&entity.CustomEvalTarget{ ID: req.CreateEvalTargetParam.CustomEvalTarget.ID, diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index 4f36302f3..f6d4c8e51 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -19,6 +19,8 @@ struct CreateEvalTargetParam { 4: optional eval_target.CozeBotInfoType bot_info_type 5: optional string bot_publish_version // 如果是发布版本则需要填充这个字段 6: optional eval_target.CustomEvalTarget custom_eval_target // type=6,并且有搜索对象,搜索结果信息通过这个字段透传 + 7: optional eval_target.Region region // 有区域限制需要填充这个字段 + 8: optional string env // 有环境限制需要填充这个字段 } struct CreateEvalTargetResponse { From 0abfc8518bf09bc6808c8008c0ad5cf370c21837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Wed, 17 Sep 2025 14:58:40 +0800 Subject: [PATCH 026/100] fi Change-Id: I1014e03889fc43f974c481bbd458e7d31191b7a4 --- .../domain/entity/target_builtin_custom_rpc_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go index d4f910028..b5483bae8 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go @@ -31,8 +31,8 @@ type CustomRPCServer struct { // 额外信息 Ext map[string]string - ExecRegion Region // 执行区域 - Env string // 执行环境 + ExecRegion Region // 执行区域 + Env *string // 执行环境 } type HTTPInfo struct { From 26606e696b2748c6c2f9585ff3ee3101a0390f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Wed, 17 Sep 2025 15:28:57 +0800 Subject: [PATCH 027/100] fix Change-Id: I299cc05f9b6a7612e7e69f628149f88125f810ab --- backend/modules/evaluation/domain/entity/param.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index 74fc6989a..cedbd7233 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -3,8 +3,6 @@ package entity -import "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" - type CreateEvaluationSetParam struct { SpaceID int64 Name string @@ -285,8 +283,8 @@ type SearchCustomEvalTargetParam struct { WorkspaceID *int64 Keyword *string ApplicationID *int64 - CustomRPCServer *eval_target.CustomRPCServer - Region *eval_target.Region + CustomRPCServer *CustomRPCServer + Region *Region Env *string PageSize *int32 PageToken *string From a5cbe56527f3de263ab0eb8d2d280f880aca3926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Wed, 17 Sep 2025 15:44:58 +0800 Subject: [PATCH 028/100] fix Change-Id: Ic6e803bc1827cb4207481037694e6e558291b0b3 --- .../convertor/target/eval_target.go | 44 +++++++++++++++++++ .../evaluation/application/eval_target_app.go | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 9f3d2f759..3342c5faa 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -225,6 +225,38 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi return targetVersionDTO } +func CustomRPCServerDTO2DO(dto *dto.CustomRPCServer) (doRes *do.CustomRPCServer) { + if dto == nil { + return nil + } + return &do.CustomRPCServer{ + ID: gptr.Indirect(dto.ID), + Name: gptr.Indirect(dto.Name), + Description: gptr.Indirect(dto.Description), + ServerName: gptr.Indirect(dto.ServerName), + AccessProtocol: gptr.Indirect(dto.AccessProtocol), + Regions: dto.Regions, + Cluster: gptr.Indirect(dto.Cluster), + NeedSearchTarget: dto.NeedSearchTarget, + IsAsync: dto.IsAsync, + InvokeHTTPInfo: HttpInfoDTO2DO(dto.InvokeHTTPInfo), + AsyncInvokeHTTPInfo: HttpInfoDTO2DO(dto.AsyncInvokeHTTPInfo), + SearchHTTPInfo: HttpInfoDTO2DO(dto.SearchHTTPInfo), + CustomEvalTarget: CustomEvalTargetDTO2DO(dto.CustomEvalTarget), + } +} + +func HttpInfoDTO2DO(httpInfoDTO *dto.HTTPInfo) (httpInfoDO *do.HTTPInfo) { + if httpInfoDTO == nil { + return nil + } + return &do.HTTPInfo{ + Method: gptr.Indirect(httpInfoDTO.Method), + Path: gptr.Indirect(httpInfoDTO.Path), + Timeout: httpInfoDTO.Timeout, + } +} + func HttpInfoDO2DTO(httpInfoDO *do.HTTPInfo) (httpInfoDTO *dto.HTTPInfo) { if httpInfoDO == nil { return nil @@ -236,6 +268,18 @@ func HttpInfoDO2DTO(httpInfoDO *do.HTTPInfo) (httpInfoDTO *dto.HTTPInfo) { } } +func CustomEvalTargetDTO2DO(customEvalTargetDTO *dto.CustomEvalTarget) (customEvalTargetDO *do.CustomEvalTarget) { + if customEvalTargetDTO == nil { + return nil + } + return &do.CustomEvalTarget{ + ID: customEvalTargetDTO.ID, + Name: customEvalTargetDTO.Name, + AvatarURL: customEvalTargetDTO.AvatarURL, + Ext: customEvalTargetDTO.Ext, + } +} + func CustomEvalTargetDO2DTO(customEvalTargetDO *do.CustomEvalTarget) (customEvalTargetDTO *dto.CustomEvalTarget) { if customEvalTargetDO == nil { return nil diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 2cf63af1b..6ebe64974 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -438,7 +438,7 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r WorkspaceID: req.WorkspaceID, Keyword: req.Keyword, ApplicationID: req.ApplicationID, - CustomRPCServer: req.CustomRPCServer, + CustomRPCServer: target.CustomRPCServerDTO2DO(req.CustomRPCServer), Region: req.Region, PageSize: req.PageSize, PageToken: req.PageToken, From 7a90ca4ba68493bf340ad420c6111e61c6915a78 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 15 Sep 2025 19:26:10 +0800 Subject: [PATCH 029/100] fix(evaluation): PassbackEvalTargetInvokeResult openapi feat(evaluation): custom target exec --- .../coze/loop/apis/eval_open_apiservice.go | 31 + .../coze/loop/apis/eval_target_service.go | 90 +- backend/api/handler/coze/loop/apis/handler.go | 6 + backend/api/handler/coze/loop/apis/wire.go | 1 + .../api/handler/coze/loop/apis/wire_gen.go | 11 +- .../router/coze/loop/apis/coze.loop.apis.go | 8 +- .../api/router/coze/loop/apis/middleware.go | 15 + backend/go.sum | 1 + .../coze/loop/apis/coze.loop.apis.go | 68 +- .../loop/apis/evalopenapiservice/client.go | 49 + .../evalopenapiservice/evalopenapiservice.go | 96 + .../loop/apis/evalopenapiservice/server.go | 25 + .../loop/apis/evaltargetservice/client.go | 6 - .../evaltargetservice/evaltargetservice.go | 36 - .../coze/loop/apis/k-coze.loop.apis.go | 10 +- .../loop/evaluation/coze.loop.evaluation.go | 36 + .../coze.loop.evaluation.eval_target.go | 3296 ++++++----------- ...e.loop.evaluation.eval_target_validator.go | 26 - .../eval_target/evaltargetservice/client.go | 6 - .../evaltargetservice/evaltargetservice.go | 36 - .../k-coze.loop.evaluation.eval_target.go | 748 ---- .../evaluation/evalopenapiservice/client.go | 49 + .../evalopenapiservice/evalopenapiservice.go | 96 + .../evaluation/evalopenapiservice/server.go | 25 + .../evaluation/evaltargetservice/client.go | 6 - .../evaltargetservice/evaltargetservice.go | 36 - .../loop/evaluation/k-coze.loop.evaluation.go | 2 + .../openapi/coze.loop.evaluation.openapi.go | 1279 +++++++ .../coze.loop.evaluation.openapi_validator.go | 49 + .../evaluationopenapiservice/client.go | 49 + .../evaluationopenapiservice.go | 95 + .../evaluationopenapiservice/server.go | 25 + .../coze/loop/evaluation/openapi/k-consts.go | 4 + .../openapi/k-coze.loop.evaluation.openapi.go | 833 +++++ .../spi/coze.loop.evaluation.spi.go | 322 +- .../spi/k-coze.loop.evaluation.spi.go | 179 +- .../loeval_target/local_evaltargetservice.go | 23 - .../local_evaluationopenapiservice.go | 56 + .../convertor/target/eval_target_record.go | 95 + .../application/eval_openapi_app.go | 57 + .../evaluation/application/eval_target_app.go | 5 - .../modules/evaluation/application/wire.go | 28 + .../evaluation/application/wire_gen.go | 27 +- .../modules/evaluation/domain/entity/expt.go | 13 + .../evaluation/domain/entity/expt_run.go | 29 + .../modules/evaluation/domain/entity/param.go | 8 + .../evaluation/domain/entity/target_record.go | 7 +- .../modules/evaluation/domain/repo/expt.go | 5 + .../evaluation/domain/repo/mocks/target.go | 19 +- .../modules/evaluation/domain/repo/target.go | 1 + .../domain/service/expt_run_item_impl.go | 3 +- .../domain/service/expt_run_item_turn_impl.go | 77 +- .../evaluation/domain/service/mocks/target.go | 29 + .../domain/service/mocks/target_source.go | 14 + .../evaluation/domain/service/target.go | 2 + .../evaluation/domain/service/target_impl.go | 157 +- .../domain/service/target_source.go | 1 + .../service/target_source_loopprompt_impl.go | 4 + .../repo/experiment/item_turn_eval_async.go | 17 + .../redis/convert/item_turn_eval_async.go | 39 + .../redis/dao/item_turn_eval_async.go | 56 + .../repo/target/eval_target_repo_impl.go | 8 + .../repo/target/mysql/eval_target_record.go | 8 + .../target/mysql/mocks/eval_target_record.go | 14 + .../evaluation/pkg/errno/evaluation.go | 10 + backend/script/errorx/evaluation.yaml | 6 + .../coze/loop/apis/coze.loop.apis.thrift | 2 + .../coze.loop.evaluation.eval_target.thrift | 19 - .../coze.loop.evaluation.expt.thrift | 1 - .../coze.loop.evaluation.openapi.thrift | 27 + .../coze.loop.evaluation.spi.thrift | 19 +- .../evaluation/coze.loop.evaluation.thrift | 5 +- 72 files changed, 5063 insertions(+), 3478 deletions(-) create mode 100644 backend/api/handler/coze/loop/apis/eval_open_apiservice.go create mode 100644 backend/kitex_gen/coze/loop/apis/evalopenapiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/apis/evalopenapiservice/evalopenapiservice.go create mode 100644 backend/kitex_gen/coze/loop/apis/evalopenapiservice/server.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/evalopenapiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/server.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi_validator.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/evaluationopenapiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/server.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/k-consts.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go create mode 100644 backend/loop_gen/coze/loop/evaluation/loopenapi/local_evaluationopenapiservice.go create mode 100644 backend/modules/evaluation/application/eval_openapi_app.go create mode 100644 backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go create mode 100644 backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go create mode 100644 backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go create mode 100644 idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift diff --git a/backend/api/handler/coze/loop/apis/eval_open_apiservice.go b/backend/api/handler/coze/loop/apis/eval_open_apiservice.go new file mode 100644 index 000000000..830dc7d66 --- /dev/null +++ b/backend/api/handler/coze/loop/apis/eval_open_apiservice.go @@ -0,0 +1,31 @@ +// Code generated by hertz generator. + +package apis + +import ( + "context" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice" + openapi0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +var localEvalOpenAPIClient evalopenapiservice.Client + +// ReportEvalTargetInvokeResult . +// @router /v1/loop/evaluation/eval_targets/result [POST] +func ReportEvalTargetInvokeResult(ctx context.Context, c *app.RequestContext) { + var err error + var req openapi0.ReportEvalTargetInvokeResultRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(openapi0.ReportEvalTargetInvokeResultResponse) + + c.JSON(consts.StatusOK, resp) +} diff --git a/backend/api/handler/coze/loop/apis/eval_target_service.go b/backend/api/handler/coze/loop/apis/eval_target_service.go index 660dbf5bb..d74b50eb0 100644 --- a/backend/api/handler/coze/loop/apis/eval_target_service.go +++ b/backend/api/handler/coze/loop/apis/eval_target_service.go @@ -9,9 +9,7 @@ import ( "context" "github.com/cloudwego/hertz/pkg/app" - "github.com/cloudwego/hertz/pkg/protocol/consts" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaltargetservice" ) @@ -56,49 +54,19 @@ func ListSourceEvalTargetVersions(ctx context.Context, c *app.RequestContext) { // ExecuteEvalTarget . // @router /api/evaluation/v2/eval_targets/execute [POST] func ExecuteEvalTarget(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.ExecuteEvalTargetRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.ExecuteEvalTargetResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.ExecuteEvalTarget) } // GetEvalTargetRecord . // @router /api/evaluation/v2/eval_targets/records/:eval_target_record_id [GET] func GetEvalTargetRecord(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.GetEvalTargetRecordRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.GetEvalTargetRecordResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.GetEvalTargetRecord) } // BatchGetEvalTargetRecords // @router /api/evaluation/v2/eval_targets/records/batch_get [POST] func BatchGetEvalTargetRecords(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.BatchGetEvalTargetRecordsRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.BatchGetEvalTargetRecordsResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.BatchGetEvalTargetRecords) } // BatchGetSourceEvalTargets . @@ -110,63 +78,17 @@ func BatchGetSourceEvalTargets(ctx context.Context, c *app.RequestContext) { // SearchCustomEvalTarget . // @router /api/evaluation/v1/eval_targets/search_custom [POST] func SearchCustomEvalTarget(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.SearchCustomEvalTargetRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.SearchCustomEvalTargetResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.SearchCustomEvalTarget) } // DebugEvalTarget . // @router /api/evaluation/v1/eval_targets/debug [POST] func DebugEvalTarget(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.DebugEvalTargetRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.DebugEvalTargetResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.DebugEvalTarget) } // AsyncDebugEvalTarget . // @router /api/evaluation/v1/eval_targets/async_debug [POST] func AsyncDebugEvalTarget(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.AsyncDebugEvalTargetRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.AsyncDebugEvalTargetResponse) - - c.JSON(consts.StatusOK, resp) -} - -// PassbackEvalTargetInvokeResult . -// @router /api/evaluation/v1/eval_targets/passback_result [POST] -func PassbackEvalTargetInvokeResult(ctx context.Context, c *app.RequestContext) { - var err error - var req eval_target.PassbackEvalTargetInvokeResultRequest - err = c.BindAndValidate(&req) - if err != nil { - c.String(consts.StatusBadRequest, err.Error()) - return - } - - resp := new(eval_target.PassbackEvalTargetInvokeResultResponse) - - c.JSON(consts.StatusOK, resp) + invokeAndRender(ctx, c, localEvalTargetSvc.AsyncDebugEvalTarget) } diff --git a/backend/api/handler/coze/loop/apis/handler.go b/backend/api/handler/coze/loop/apis/handler.go index 8e493d9bd..c8fdcdaa6 100644 --- a/backend/api/handler/coze/loop/apis/handler.go +++ b/backend/api/handler/coze/loop/apis/handler.go @@ -25,6 +25,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" + evalopen "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/auth" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/authn" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/file" @@ -45,6 +46,7 @@ import ( "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/evaluation/loeval_target" "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/evaluation/loevaluator" "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/evaluation/loexpt" + loevalopen "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/evaluation/loopenapi" "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/foundation/loauthn" foundationlofile "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/foundation/lofile" foundationloopenapi "github.com/coze-dev/coze-loop/backend/loop_gen/coze/loop/foundation/loopenapi" @@ -82,6 +84,7 @@ type EvaluationHandler struct { evaluation.EvaluatorService evaluation.EvaluationSetService evaluation.EvalTargetService + evaluation.EvalOpenAPIService } type FoundationHandler struct { @@ -122,17 +125,20 @@ func NewEvaluationHandler( evaluatorApp evaluation.EvaluatorService, evaluationSetApp evaluation.EvaluationSetService, evalTargetService evaluation.EvalTargetService, + evalOpenAPIApp evaluation.EvalOpenAPIService, ) *EvaluationHandler { h := &EvaluationHandler{ EvaluatorService: evaluatorApp, IExperimentApplication: exptApp, EvaluationSetService: evaluationSetApp, EvalTargetService: evalTargetService, + EvalOpenAPIService: evalOpenAPIApp, } bindLocalCallClient(expt.ExperimentService(h), &localExptSvc, loexpt.NewLocalExperimentService) bindLocalCallClient(evaluator.EvaluatorService(h), &localEvaluatorSvc, loevaluator.NewLocalEvaluatorService) bindLocalCallClient(eval_set.EvaluationSetService(h), &localEvalSetSvc, loeval_set.NewLocalEvaluationSetService) bindLocalCallClient(eval_target.EvalTargetService(h), &localEvalTargetSvc, loeval_target.NewLocalEvalTargetService) + bindLocalCallClient(evalopen.EvaluationOpenAPIService(h), &localEvalOpenAPIClient, loevalopen.NewLocalEvaluationOpenAPIService) return h } diff --git a/backend/api/handler/coze/loop/apis/wire.go b/backend/api/handler/coze/loop/apis/wire.go index bca7afb64..64e52b7a5 100644 --- a/backend/api/handler/coze/loop/apis/wire.go +++ b/backend/api/handler/coze/loop/apis/wire.go @@ -79,6 +79,7 @@ var ( evaluationapp.InitEvaluatorApplication, evaluationapp.InitEvaluationSetApplication, evaluationapp.InitEvalTargetApplication, + evaluationapp.InitEvalOpenAPIApplication, ) dataSet = wire.NewSet( NewDataHandler, diff --git a/backend/api/handler/coze/loop/apis/wire_gen.go b/backend/api/handler/coze/loop/apis/wire_gen.go index 28bfd2879..7fec4ce70 100644 --- a/backend/api/handler/coze/loop/apis/wire_gen.go +++ b/backend/api/handler/coze/loop/apis/wire_gen.go @@ -10,6 +10,8 @@ import ( "context" "github.com/cloudwego/kitex/pkg/endpoint" + "github.com/google/wire" + "github.com/coze-dev/coze-loop/backend/infra/ck" "github.com/coze-dev/coze-loop/backend/infra/db" "github.com/coze-dev/coze-loop/backend/infra/external/audit" @@ -42,7 +44,6 @@ import ( application6 "github.com/coze-dev/coze-loop/backend/modules/observability/application" application2 "github.com/coze-dev/coze-loop/backend/modules/prompt/application" "github.com/coze-dev/coze-loop/backend/pkg/conf" - "github.com/google/wire" ) // Injectors from wire.go: @@ -127,7 +128,11 @@ func InitEvaluationHandler(ctx context.Context, idgen2 idgen.IIDGenerator, db2 d if err != nil { return nil, err } - evaluationHandler := NewEvaluationHandler(iExperimentApplication, evaluatorService, evaluationSetService, evalTargetService) + evalOpenAPIService, err := application4.InitEvalOpenAPIApplication(ctx, configFactory, mqFactory, cmdable, idgen2, db2, promptClient, pec, authClient, meter) + if err != nil { + return nil, err + } + evaluationHandler := NewEvaluationHandler(iExperimentApplication, evaluatorService, evaluationSetService, evalTargetService, evalOpenAPIService) return evaluationHandler, nil } @@ -179,7 +184,7 @@ var ( NewPromptHandler, application2.InitPromptManageApplication, application2.InitPromptDebugApplication, application2.InitPromptExecuteApplication, application2.InitPromptOpenAPIApplication, ) evaluationSet = wire.NewSet( - NewEvaluationHandler, data.NewDatasetRPCAdapter, prompt.NewPromptRPCAdapter, application4.InitExperimentApplication, application4.InitEvaluatorApplication, application4.InitEvaluationSetApplication, application4.InitEvalTargetApplication, + NewEvaluationHandler, data.NewDatasetRPCAdapter, prompt.NewPromptRPCAdapter, application4.InitExperimentApplication, application4.InitEvaluatorApplication, application4.InitEvaluationSetApplication, application4.InitEvalTargetApplication, application4.InitEvalOpenAPIApplication, ) dataSet = wire.NewSet( NewDataHandler, application5.InitDatasetApplication, application5.InitTagApplication, foundation.NewAuthRPCProvider, conf2.NewConfigerFactory, diff --git a/backend/api/router/coze/loop/apis/coze.loop.apis.go b/backend/api/router/coze/loop/apis/coze.loop.apis.go index 878df5a11..2394fd81b 100644 --- a/backend/api/router/coze/loop/apis/coze.loop.apis.go +++ b/backend/api/router/coze/loop/apis/coze.loop.apis.go @@ -107,7 +107,6 @@ func Register(r *server.Hertz, handler *apis.APIHandler) { _eval_targets.POST("/debug", append(_debugevaltargetMw(handler), apis.DebugEvalTarget)...) _eval_targets.POST("/list_source", append(_listsourceevaltargetsMw(handler), apis.ListSourceEvalTargets)...) _eval_targets.POST("/list_source_version", append(_listsourceevaltargetversionsMw(handler), apis.ListSourceEvalTargetVersions)...) - _eval_targets.POST("/passback_result", append(_passbackevaltargetinvokeresultMw(handler), apis.PassbackEvalTargetInvokeResult)...) _eval_targets.POST("/search_custom", append(_searchcustomevaltargetMw(handler), apis.SearchCustomEvalTarget)...) { _eval_target_id := _eval_targets.Group("/:eval_target_id", _eval_target_idMw(handler)...) @@ -341,6 +340,13 @@ func Register(r *server.Hertz, handler *apis.APIHandler) { _v16 := root.Group("/v1", _v16Mw(handler)...) { _loop := _v16.Group("/loop", _loopMw(handler)...) + { + _evaluation0 := _loop.Group("/evaluation", _evaluation0Mw(handler)...) + { + _eval_targets0 := _evaluation0.Group("/eval_targets", _eval_targets0Mw(handler)...) + _eval_targets0.POST("/result", append(_reportevaltargetinvokeresultMw(handler), apis.ReportEvalTargetInvokeResult)...) + } + } { _files := _loop.Group("/files", _filesMw(handler)...) _files.POST("/upload", append(_uploadloopfileMw(handler), apis.UploadLoopFile)...) diff --git a/backend/api/router/coze/loop/apis/middleware.go b/backend/api/router/coze/loop/apis/middleware.go index 0c586f8d4..cd5bc4fbe 100644 --- a/backend/api/router/coze/loop/apis/middleware.go +++ b/backend/api/router/coze/loop/apis/middleware.go @@ -1290,3 +1290,18 @@ func _searchcustomevaltargetMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil } + +func _evaluation0Mw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} + +func _eval_targets0Mw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} + +func _reportevaltargetinvokeresultMw(handler *apis.APIHandler) []app.HandlerFunc { + // your code... + return nil +} diff --git a/backend/go.sum b/backend/go.sum index f00d4bedc..2e6287c73 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -472,6 +472,7 @@ github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAx github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= diff --git a/backend/kitex_gen/coze/loop/apis/coze.loop.apis.go b/backend/kitex_gen/coze/loop/apis/coze.loop.apis.go index 2f08a1133..987510c0d 100644 --- a/backend/kitex_gen/coze/loop/apis/coze.loop.apis.go +++ b/backend/kitex_gen/coze/loop/apis/coze.loop.apis.go @@ -10,6 +10,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" + openapi0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/auth" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/authn" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/file" @@ -18,12 +19,12 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/user" manage0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/manage" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/runtime" - openapi1 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/openapi" + openapi2 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/openapi" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/trace" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/debug" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/execute" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/manage" - openapi0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/openapi" + openapi1 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/openapi" ) type EvaluationSetService interface { @@ -130,6 +131,32 @@ func NewExperimentServiceClient(c thrift.TClient) *ExperimentServiceClient { } } +type EvalOpenAPIService interface { + openapi0.EvaluationOpenAPIService +} + +type EvalOpenAPIServiceClient struct { + *openapi0.EvaluationOpenAPIServiceClient +} + +func NewEvalOpenAPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi0.NewEvaluationOpenAPIServiceClientFactory(t, f), + } +} + +func NewEvalOpenAPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi0.NewEvaluationOpenAPIServiceClientProtocol(t, iprot, oprot), + } +} + +func NewEvalOpenAPIServiceClient(c thrift.TClient) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi0.NewEvaluationOpenAPIServiceClient(c), + } +} + type DatasetService interface { dataset.DatasetService } @@ -261,28 +288,28 @@ func NewPromptExecuteServiceClient(c thrift.TClient) *PromptExecuteServiceClient } type PromptOpenAPIService interface { - openapi0.PromptOpenAPIService + openapi1.PromptOpenAPIService } type PromptOpenAPIServiceClient struct { - *openapi0.PromptOpenAPIServiceClient + *openapi1.PromptOpenAPIServiceClient } func NewPromptOpenAPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PromptOpenAPIServiceClient { return &PromptOpenAPIServiceClient{ - PromptOpenAPIServiceClient: openapi0.NewPromptOpenAPIServiceClientFactory(t, f), + PromptOpenAPIServiceClient: openapi1.NewPromptOpenAPIServiceClientFactory(t, f), } } func NewPromptOpenAPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PromptOpenAPIServiceClient { return &PromptOpenAPIServiceClient{ - PromptOpenAPIServiceClient: openapi0.NewPromptOpenAPIServiceClientProtocol(t, iprot, oprot), + PromptOpenAPIServiceClient: openapi1.NewPromptOpenAPIServiceClientProtocol(t, iprot, oprot), } } func NewPromptOpenAPIServiceClient(c thrift.TClient) *PromptOpenAPIServiceClient { return &PromptOpenAPIServiceClient{ - PromptOpenAPIServiceClient: openapi0.NewPromptOpenAPIServiceClient(c), + PromptOpenAPIServiceClient: openapi1.NewPromptOpenAPIServiceClient(c), } } @@ -365,28 +392,28 @@ func NewObservabilityTraceServiceClient(c thrift.TClient) *ObservabilityTraceSer } type ObservabilityOpenAPIService interface { - openapi1.OpenAPIService + openapi2.OpenAPIService } type ObservabilityOpenAPIServiceClient struct { - *openapi1.OpenAPIServiceClient + *openapi2.OpenAPIServiceClient } func NewObservabilityOpenAPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ObservabilityOpenAPIServiceClient { return &ObservabilityOpenAPIServiceClient{ - OpenAPIServiceClient: openapi1.NewOpenAPIServiceClientFactory(t, f), + OpenAPIServiceClient: openapi2.NewOpenAPIServiceClientFactory(t, f), } } func NewObservabilityOpenAPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ObservabilityOpenAPIServiceClient { return &ObservabilityOpenAPIServiceClient{ - OpenAPIServiceClient: openapi1.NewOpenAPIServiceClientProtocol(t, iprot, oprot), + OpenAPIServiceClient: openapi2.NewOpenAPIServiceClientProtocol(t, iprot, oprot), } } func NewObservabilityOpenAPIServiceClient(c thrift.TClient) *ObservabilityOpenAPIServiceClient { return &ObservabilityOpenAPIServiceClient{ - OpenAPIServiceClient: openapi1.NewOpenAPIServiceClient(c), + OpenAPIServiceClient: openapi2.NewOpenAPIServiceClient(c), } } @@ -582,6 +609,15 @@ func NewExperimentServiceProcessor(handler ExperimentService) *ExperimentService return self } +type EvalOpenAPIServiceProcessor struct { + *openapi0.EvaluationOpenAPIServiceProcessor +} + +func NewEvalOpenAPIServiceProcessor(handler EvalOpenAPIService) *EvalOpenAPIServiceProcessor { + self := &EvalOpenAPIServiceProcessor{openapi0.NewEvaluationOpenAPIServiceProcessor(handler)} + return self +} + type DatasetServiceProcessor struct { *dataset.DatasetServiceProcessor } @@ -628,11 +664,11 @@ func NewPromptExecuteServiceProcessor(handler PromptExecuteService) *PromptExecu } type PromptOpenAPIServiceProcessor struct { - *openapi0.PromptOpenAPIServiceProcessor + *openapi1.PromptOpenAPIServiceProcessor } func NewPromptOpenAPIServiceProcessor(handler PromptOpenAPIService) *PromptOpenAPIServiceProcessor { - self := &PromptOpenAPIServiceProcessor{openapi0.NewPromptOpenAPIServiceProcessor(handler)} + self := &PromptOpenAPIServiceProcessor{openapi1.NewPromptOpenAPIServiceProcessor(handler)} return self } @@ -664,11 +700,11 @@ func NewObservabilityTraceServiceProcessor(handler ObservabilityTraceService) *O } type ObservabilityOpenAPIServiceProcessor struct { - *openapi1.OpenAPIServiceProcessor + *openapi2.OpenAPIServiceProcessor } func NewObservabilityOpenAPIServiceProcessor(handler ObservabilityOpenAPIService) *ObservabilityOpenAPIServiceProcessor { - self := &ObservabilityOpenAPIServiceProcessor{openapi1.NewOpenAPIServiceProcessor(handler)} + self := &ObservabilityOpenAPIServiceProcessor{openapi2.NewOpenAPIServiceProcessor(handler)} return self } diff --git a/backend/kitex_gen/coze/loop/apis/evalopenapiservice/client.go b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/client.go new file mode 100644 index 000000000..99ffd25bc --- /dev/null +++ b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/client.go @@ -0,0 +1,49 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalopenapiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvalOpenAPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvalOpenAPIServiceClient struct { + *kClient +} + +func (p *kEvalOpenAPIServiceClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ReportEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/apis/evalopenapiservice/evalopenapiservice.go b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/evalopenapiservice.go new file mode 100644 index 000000000..253a8b5fc --- /dev/null +++ b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/evalopenapiservice.go @@ -0,0 +1,96 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalopenapiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + apis "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/apis" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "ReportEvalTargetInvokeResult": kitex.NewMethodInfo( + reportEvalTargetInvokeResult_Handler, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evalOpenAPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evalOpenAPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvalOpenAPIService" + handlerType := (*apis.EvalOpenAPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "apis", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func reportEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) + realResult := result.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) + success, err := handler.(openapi.EvaluationOpenAPIService).ReportEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + var _args openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs + _args.Req = req + var _result openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "ReportEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/apis/evalopenapiservice/server.go b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/server.go new file mode 100644 index 000000000..ca3c51150 --- /dev/null +++ b/backend/kitex_gen/coze/loop/apis/evalopenapiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evalopenapiservice + +import ( + server "github.com/cloudwego/kitex/server" + apis "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/apis" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler apis.EvalOpenAPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler apis.EvalOpenAPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go index 44ac06dc5..6900c6697 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go @@ -24,7 +24,6 @@ type Client interface { BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) - PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -120,8 +119,3 @@ func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, req ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.AsyncDebugEvalTarget(ctx, request) } - -func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) -} diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go index fe0824733..d872f4fd3 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go @@ -105,13 +105,6 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), - "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( - passbackEvalTargetInvokeResult_Handler, - newEvalTargetServicePassbackEvalTargetInvokeResultArgs, - newEvalTargetServicePassbackEvalTargetInvokeResultResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), } var ( @@ -392,25 +385,6 @@ func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() } -func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) - realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) - success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() -} - type kClient struct { c client.Client sc client.Streaming @@ -552,13 +526,3 @@ func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target } return _result.GetSuccess(), nil } - -func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs - _args.Req = req - var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult - if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} diff --git a/backend/kitex_gen/coze/loop/apis/k-coze.loop.apis.go b/backend/kitex_gen/coze/loop/apis/k-coze.loop.apis.go index 8718d250d..70ead1b3a 100644 --- a/backend/kitex_gen/coze/loop/apis/k-coze.loop.apis.go +++ b/backend/kitex_gen/coze/loop/apis/k-coze.loop.apis.go @@ -16,6 +16,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" + openapi0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/auth" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/authn" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/file" @@ -24,12 +25,12 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/foundation/user" manage0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/manage" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/runtime" - openapi1 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/openapi" + openapi2 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/openapi" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/observability/trace" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/debug" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/execute" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/manage" - openapi0 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/openapi" + openapi1 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/prompt/openapi" ) var ( @@ -39,6 +40,7 @@ var ( _ = eval_target.KitexUnusedProtection _ = evaluator.KitexUnusedProtection _ = expt.KitexUnusedProtection + _ = openapi0.KitexUnusedProtection _ = auth.KitexUnusedProtection _ = authn.KitexUnusedProtection _ = file.KitexUnusedProtection @@ -47,12 +49,12 @@ var ( _ = user.KitexUnusedProtection _ = manage0.KitexUnusedProtection _ = runtime.KitexUnusedProtection - _ = openapi1.KitexUnusedProtection + _ = openapi2.KitexUnusedProtection _ = trace.KitexUnusedProtection _ = debug.KitexUnusedProtection _ = execute.KitexUnusedProtection _ = manage.KitexUnusedProtection - _ = openapi0.KitexUnusedProtection + _ = openapi1.KitexUnusedProtection ) // unused protection diff --git a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go index 789421e84..6a09b79cd 100644 --- a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go @@ -8,6 +8,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" ) type EvaluationSetService interface { @@ -114,6 +115,32 @@ func NewEvalTargetServiceClient(c thrift.TClient) *EvalTargetServiceClient { } } +type EvalOpenAPIService interface { + openapi.EvaluationOpenAPIService +} + +type EvalOpenAPIServiceClient struct { + *openapi.EvaluationOpenAPIServiceClient +} + +func NewEvalOpenAPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi.NewEvaluationOpenAPIServiceClientFactory(t, f), + } +} + +func NewEvalOpenAPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi.NewEvaluationOpenAPIServiceClientProtocol(t, iprot, oprot), + } +} + +func NewEvalOpenAPIServiceClient(c thrift.TClient) *EvalOpenAPIServiceClient { + return &EvalOpenAPIServiceClient{ + EvaluationOpenAPIServiceClient: openapi.NewEvaluationOpenAPIServiceClient(c), + } +} + type EvaluationSetServiceProcessor struct { *eval_set.EvaluationSetServiceProcessor } @@ -149,3 +176,12 @@ func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetService self := &EvalTargetServiceProcessor{eval_target.NewEvalTargetServiceProcessor(handler)} return self } + +type EvalOpenAPIServiceProcessor struct { + *openapi.EvaluationOpenAPIServiceProcessor +} + +func NewEvalOpenAPIServiceProcessor(handler EvalOpenAPIService) *EvalOpenAPIServiceProcessor { + self := &EvalOpenAPIServiceProcessor{openapi.NewEvaluationOpenAPIServiceProcessor(handler)} + return self +} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 8b05bfa2f..883a1d865 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -9,7 +9,6 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/base" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" "strings" ) @@ -11537,1270 +11536,255 @@ func (p *AsyncDebugEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) boo return true } -type PassbackEvalTargetInvokeResultRequest struct { - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` - InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" json:"invoke_id" form:"invoke_id" query:"invoke_id"` - Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` - // 输出 - Output *spi.InvokeEvalTargetOutput `thrift:"output,10,optional" frugal:"10,optional,spi.InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` - // 消耗 - Usage *spi.InvokeEvalTargetUsage `thrift:"usage,11,optional" frugal:"11,optional,spi.InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"-" json:"-" query:"-"` -} +type EvalTargetService interface { + // 创建评测对象 + CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) + // 根据source target获取评测对象信息 + BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) + // 获取评测对象+版本 + GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) + // 批量获取+版本 + BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) + // Source评测对象列表 + ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) + // Source评测对象版本列表 + ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) -func NewPassbackEvalTargetInvokeResultRequest() *PassbackEvalTargetInvokeResultRequest { - return &PassbackEvalTargetInvokeResultRequest{} -} + BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) + // 搜索自定义评测对象 + SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) + // 执行 + ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) + + GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) + + BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) + // debug + DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) -func (p *PassbackEvalTargetInvokeResultRequest) InitDefault() { + AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) } -var PassbackEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT int64 +type EvalTargetServiceClient struct { + c thrift.TClient +} -func (p *PassbackEvalTargetInvokeResultRequest) GetWorkspaceID() (v int64) { - if p == nil { - return - } - if !p.IsSetWorkspaceID() { - return PassbackEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT +func NewEvalTargetServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - return *p.WorkspaceID } -var PassbackEvalTargetInvokeResultRequest_InvokeID_DEFAULT int64 - -func (p *PassbackEvalTargetInvokeResultRequest) GetInvokeID() (v int64) { - if p == nil { - return +func NewEvalTargetServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), } - if !p.IsSetInvokeID() { - return PassbackEvalTargetInvokeResultRequest_InvokeID_DEFAULT +} + +func NewEvalTargetServiceClient(c thrift.TClient) *EvalTargetServiceClient { + return &EvalTargetServiceClient{ + c: c, } - return *p.InvokeID } -var PassbackEvalTargetInvokeResultRequest_Token_DEFAULT string +func (p *EvalTargetServiceClient) Client_() thrift.TClient { + return p.c +} -func (p *PassbackEvalTargetInvokeResultRequest) GetToken() (v string) { - if p == nil { +func (p *EvalTargetServiceClient) CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) { + var _args EvalTargetServiceCreateEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceCreateEvalTargetResult + if err = p.Client_().Call(ctx, "CreateEvalTarget", &_args, &_result); err != nil { return } - if !p.IsSetToken() { - return PassbackEvalTargetInvokeResultRequest_Token_DEFAULT - } - return *p.Token + return _result.GetSuccess(), nil } - -var PassbackEvalTargetInvokeResultRequest_Output_DEFAULT *spi.InvokeEvalTargetOutput - -func (p *PassbackEvalTargetInvokeResultRequest) GetOutput() (v *spi.InvokeEvalTargetOutput) { - if p == nil { +func (p *EvalTargetServiceClient) BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetsBySourceArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetsBySourceResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetsBySource", &_args, &_result); err != nil { return } - if !p.IsSetOutput() { - return PassbackEvalTargetInvokeResultRequest_Output_DEFAULT + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) { + var _args EvalTargetServiceGetEvalTargetVersionArgs + _args.Request = request + var _result EvalTargetServiceGetEvalTargetVersionResult + if err = p.Client_().Call(ctx, "GetEvalTargetVersion", &_args, &_result); err != nil { + return } - return p.Output + return _result.GetSuccess(), nil } - -var PassbackEvalTargetInvokeResultRequest_Usage_DEFAULT *spi.InvokeEvalTargetUsage - -func (p *PassbackEvalTargetInvokeResultRequest) GetUsage() (v *spi.InvokeEvalTargetUsage) { - if p == nil { +func (p *EvalTargetServiceClient) BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetVersionsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetVersionsResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetVersions", &_args, &_result); err != nil { return } - if !p.IsSetUsage() { - return PassbackEvalTargetInvokeResultRequest_Usage_DEFAULT + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) { + var _args EvalTargetServiceListSourceEvalTargetsArgs + _args.Request = request + var _result EvalTargetServiceListSourceEvalTargetsResult + if err = p.Client_().Call(ctx, "ListSourceEvalTargets", &_args, &_result); err != nil { + return } - return p.Usage + return _result.GetSuccess(), nil } - -var PassbackEvalTargetInvokeResultRequest_Base_DEFAULT *base.Base - -func (p *PassbackEvalTargetInvokeResultRequest) GetBase() (v *base.Base) { - if p == nil { +func (p *EvalTargetServiceClient) ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) { + var _args EvalTargetServiceListSourceEvalTargetVersionsArgs + _args.Request = request + var _result EvalTargetServiceListSourceEvalTargetVersionsResult + if err = p.Client_().Call(ctx, "ListSourceEvalTargetVersions", &_args, &_result); err != nil { return } - if !p.IsSetBase() { - return PassbackEvalTargetInvokeResultRequest_Base_DEFAULT + return _result.GetSuccess(), nil +} +func (p *EvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) { + var _args EvalTargetServiceBatchGetSourceEvalTargetsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetSourceEvalTargetsResult + if err = p.Client_().Call(ctx, "BatchGetSourceEvalTargets", &_args, &_result); err != nil { + return } - return p.Base + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetWorkspaceID(val *int64) { - p.WorkspaceID = val +func (p *EvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) { + var _args EvalTargetServiceSearchCustomEvalTargetArgs + _args.Req = req + var _result EvalTargetServiceSearchCustomEvalTargetResult + if err = p.Client_().Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetInvokeID(val *int64) { - p.InvokeID = val +func (p *EvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) { + var _args EvalTargetServiceExecuteEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceExecuteEvalTargetResult + if err = p.Client_().Call(ctx, "ExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetToken(val *string) { - p.Token = val +func (p *EvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) { + var _args EvalTargetServiceGetEvalTargetRecordArgs + _args.Request = request + var _result EvalTargetServiceGetEvalTargetRecordResult + if err = p.Client_().Call(ctx, "GetEvalTargetRecord", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetOutput(val *spi.InvokeEvalTargetOutput) { - p.Output = val +func (p *EvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) { + var _args EvalTargetServiceBatchGetEvalTargetRecordsArgs + _args.Request = request + var _result EvalTargetServiceBatchGetEvalTargetRecordsResult + if err = p.Client_().Call(ctx, "BatchGetEvalTargetRecords", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetUsage(val *spi.InvokeEvalTargetUsage) { - p.Usage = val +func (p *EvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) { + var _args EvalTargetServiceDebugEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceDebugEvalTargetResult + if err = p.Client_().Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *PassbackEvalTargetInvokeResultRequest) SetBase(val *base.Base) { - p.Base = val +func (p *EvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) { + var _args EvalTargetServiceAsyncDebugEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceAsyncDebugEvalTargetResult + if err = p.Client_().Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -var fieldIDToName_PassbackEvalTargetInvokeResultRequest = map[int16]string{ - 1: "workspace_id", - 2: "invoke_id", - 3: "token", - 10: "output", - 11: "usage", - 255: "Base", +type EvalTargetServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler EvalTargetService } -func (p *PassbackEvalTargetInvokeResultRequest) IsSetWorkspaceID() bool { - return p.WorkspaceID != nil +func (p *EvalTargetServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -func (p *PassbackEvalTargetInvokeResultRequest) IsSetInvokeID() bool { - return p.InvokeID != nil +func (p *EvalTargetServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -func (p *PassbackEvalTargetInvokeResultRequest) IsSetToken() bool { - return p.Token != nil +func (p *EvalTargetServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -func (p *PassbackEvalTargetInvokeResultRequest) IsSetOutput() bool { - return p.Output != nil +func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetServiceProcessor { + self := &EvalTargetServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateEvalTarget", &evalTargetServiceProcessorCreateEvalTarget{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetsBySource", &evalTargetServiceProcessorBatchGetEvalTargetsBySource{handler: handler}) + self.AddToProcessorMap("GetEvalTargetVersion", &evalTargetServiceProcessorGetEvalTargetVersion{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetVersions", &evalTargetServiceProcessorBatchGetEvalTargetVersions{handler: handler}) + self.AddToProcessorMap("ListSourceEvalTargets", &evalTargetServiceProcessorListSourceEvalTargets{handler: handler}) + self.AddToProcessorMap("ListSourceEvalTargetVersions", &evalTargetServiceProcessorListSourceEvalTargetVersions{handler: handler}) + self.AddToProcessorMap("BatchGetSourceEvalTargets", &evalTargetServiceProcessorBatchGetSourceEvalTargets{handler: handler}) + self.AddToProcessorMap("SearchCustomEvalTarget", &evalTargetServiceProcessorSearchCustomEvalTarget{handler: handler}) + self.AddToProcessorMap("ExecuteEvalTarget", &evalTargetServiceProcessorExecuteEvalTarget{handler: handler}) + self.AddToProcessorMap("GetEvalTargetRecord", &evalTargetServiceProcessorGetEvalTargetRecord{handler: handler}) + self.AddToProcessorMap("BatchGetEvalTargetRecords", &evalTargetServiceProcessorBatchGetEvalTargetRecords{handler: handler}) + self.AddToProcessorMap("DebugEvalTarget", &evalTargetServiceProcessorDebugEvalTarget{handler: handler}) + self.AddToProcessorMap("AsyncDebugEvalTarget", &evalTargetServiceProcessorAsyncDebugEvalTarget{handler: handler}) + return self } - -func (p *PassbackEvalTargetInvokeResultRequest) IsSetUsage() bool { - return p.Usage != nil +func (p *EvalTargetServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x } -func (p *PassbackEvalTargetInvokeResultRequest) IsSetBase() bool { - return p.Base != nil +type evalTargetServiceProcessorCreateEvalTarget struct { + handler EvalTargetService } -func (p *PassbackEvalTargetInvokeResultRequest) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.WorkspaceID = _field - return nil -} -func (p *PassbackEvalTargetInvokeResultRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.InvokeID = _field - return nil -} -func (p *PassbackEvalTargetInvokeResultRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Token = _field - return nil -} -func (p *PassbackEvalTargetInvokeResultRequest) ReadField10(iprot thrift.TProtocol) error { - _field := spi.NewInvokeEvalTargetOutput() - if err := _field.Read(iprot); err != nil { - return err - } - p.Output = _field - return nil -} -func (p *PassbackEvalTargetInvokeResultRequest) ReadField11(iprot thrift.TProtocol) error { - _field := spi.NewInvokeEvalTargetUsage() - if err := _field.Read(iprot); err != nil { - return err - } - p.Usage = _field - return nil -} -func (p *PassbackEvalTargetInvokeResultRequest) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBase() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResultRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetWorkspaceID() { - if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.WorkspaceID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} -func (p *PassbackEvalTargetInvokeResultRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetInvokeID() { - if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.InvokeID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} -func (p *PassbackEvalTargetInvokeResultRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetToken() { - if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Token); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} -func (p *PassbackEvalTargetInvokeResultRequest) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetOutput() { - if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 10); err != nil { - goto WriteFieldBeginError - } - if err := p.Output.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) -} -func (p *PassbackEvalTargetInvokeResultRequest) writeField11(oprot thrift.TProtocol) (err error) { - if p.IsSetUsage() { - if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 11); err != nil { - goto WriteFieldBeginError - } - if err := p.Usage.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} -func (p *PassbackEvalTargetInvokeResultRequest) writeField255(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.Base.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PassbackEvalTargetInvokeResultRequest(%+v)", *p) - -} - -func (p *PassbackEvalTargetInvokeResultRequest) DeepEqual(ano *PassbackEvalTargetInvokeResultRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.WorkspaceID) { - return false - } - if !p.Field2DeepEqual(ano.InvokeID) { - return false - } - if !p.Field3DeepEqual(ano.Token) { - return false - } - if !p.Field10DeepEqual(ano.Output) { - return false - } - if !p.Field11DeepEqual(ano.Usage) { - return false - } - if !p.Field255DeepEqual(ano.Base) { - return false - } - return true -} - -func (p *PassbackEvalTargetInvokeResultRequest) Field1DeepEqual(src *int64) bool { - - if p.WorkspaceID == src { - return true - } else if p.WorkspaceID == nil || src == nil { - return false - } - if *p.WorkspaceID != *src { - return false - } - return true -} -func (p *PassbackEvalTargetInvokeResultRequest) Field2DeepEqual(src *int64) bool { - - if p.InvokeID == src { - return true - } else if p.InvokeID == nil || src == nil { - return false - } - if *p.InvokeID != *src { - return false - } - return true -} -func (p *PassbackEvalTargetInvokeResultRequest) Field3DeepEqual(src *string) bool { - - if p.Token == src { - return true - } else if p.Token == nil || src == nil { - return false - } - if strings.Compare(*p.Token, *src) != 0 { - return false - } - return true -} -func (p *PassbackEvalTargetInvokeResultRequest) Field10DeepEqual(src *spi.InvokeEvalTargetOutput) bool { - - if !p.Output.DeepEqual(src) { - return false - } - return true -} -func (p *PassbackEvalTargetInvokeResultRequest) Field11DeepEqual(src *spi.InvokeEvalTargetUsage) bool { - - if !p.Usage.DeepEqual(src) { - return false - } - return true -} -func (p *PassbackEvalTargetInvokeResultRequest) Field255DeepEqual(src *base.Base) bool { - - if !p.Base.DeepEqual(src) { - return false - } - return true -} - -type PassbackEvalTargetInvokeResultResponse struct { - BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` -} - -func NewPassbackEvalTargetInvokeResultResponse() *PassbackEvalTargetInvokeResultResponse { - return &PassbackEvalTargetInvokeResultResponse{} -} - -func (p *PassbackEvalTargetInvokeResultResponse) InitDefault() { -} - -var PassbackEvalTargetInvokeResultResponse_BaseResp_DEFAULT *base.BaseResp - -func (p *PassbackEvalTargetInvokeResultResponse) GetBaseResp() (v *base.BaseResp) { - if p == nil { - return - } - if !p.IsSetBaseResp() { - return PassbackEvalTargetInvokeResultResponse_BaseResp_DEFAULT - } - return p.BaseResp -} -func (p *PassbackEvalTargetInvokeResultResponse) SetBaseResp(val *base.BaseResp) { - p.BaseResp = val -} - -var fieldIDToName_PassbackEvalTargetInvokeResultResponse = map[int16]string{ - 255: "BaseResp", -} - -func (p *PassbackEvalTargetInvokeResultResponse) IsSetBaseResp() bool { - return p.BaseResp != nil -} - -func (p *PassbackEvalTargetInvokeResultResponse) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 255: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField255(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultResponse[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultResponse) ReadField255(iprot thrift.TProtocol) error { - _field := base.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.BaseResp = _field - return nil -} - -func (p *PassbackEvalTargetInvokeResultResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResultResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField255(oprot); err != nil { - fieldId = 255 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultResponse) writeField255(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { - goto WriteFieldBeginError - } - if err := p.BaseResp.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) -} - -func (p *PassbackEvalTargetInvokeResultResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PassbackEvalTargetInvokeResultResponse(%+v)", *p) - -} - -func (p *PassbackEvalTargetInvokeResultResponse) DeepEqual(ano *PassbackEvalTargetInvokeResultResponse) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field255DeepEqual(ano.BaseResp) { - return false - } - return true -} - -func (p *PassbackEvalTargetInvokeResultResponse) Field255DeepEqual(src *base.BaseResp) bool { - - if !p.BaseResp.DeepEqual(src) { - return false - } - return true -} - -type EvalTargetService interface { - // 创建评测对象 - CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) - // 根据source target获取评测对象信息 - BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) - // 获取评测对象+版本 - GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) - // 批量获取+版本 - BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) - // Source评测对象列表 - ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) - // Source评测对象版本列表 - ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) - - BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) - // 搜索自定义评测对象 - SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) - // 执行 - ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) - - GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) - - BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) - // debug - DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) - - AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) - // 回传执行结果 - PassbackEvalTargetInvokeResult_(ctx context.Context, req *PassbackEvalTargetInvokeResultRequest) (r *PassbackEvalTargetInvokeResultResponse, err error) -} - -type EvalTargetServiceClient struct { - c thrift.TClient -} - -func NewEvalTargetServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} - -func NewEvalTargetServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewEvalTargetServiceClient(c thrift.TClient) *EvalTargetServiceClient { - return &EvalTargetServiceClient{ - c: c, - } -} - -func (p *EvalTargetServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *EvalTargetServiceClient) CreateEvalTarget(ctx context.Context, request *CreateEvalTargetRequest) (r *CreateEvalTargetResponse, err error) { - var _args EvalTargetServiceCreateEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceCreateEvalTargetResult - if err = p.Client_().Call(ctx, "CreateEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetEvalTargetsBySource(ctx context.Context, request *BatchGetEvalTargetsBySourceRequest) (r *BatchGetEvalTargetsBySourceResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetsBySourceArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetsBySourceResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetsBySource", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) GetEvalTargetVersion(ctx context.Context, request *GetEvalTargetVersionRequest) (r *GetEvalTargetVersionResponse, err error) { - var _args EvalTargetServiceGetEvalTargetVersionArgs - _args.Request = request - var _result EvalTargetServiceGetEvalTargetVersionResult - if err = p.Client_().Call(ctx, "GetEvalTargetVersion", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetEvalTargetVersions(ctx context.Context, request *BatchGetEvalTargetVersionsRequest) (r *BatchGetEvalTargetVersionsResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetVersionsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetVersionsResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetVersions", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) ListSourceEvalTargets(ctx context.Context, request *ListSourceEvalTargetsRequest) (r *ListSourceEvalTargetsResponse, err error) { - var _args EvalTargetServiceListSourceEvalTargetsArgs - _args.Request = request - var _result EvalTargetServiceListSourceEvalTargetsResult - if err = p.Client_().Call(ctx, "ListSourceEvalTargets", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) ListSourceEvalTargetVersions(ctx context.Context, request *ListSourceEvalTargetVersionsRequest) (r *ListSourceEvalTargetVersionsResponse, err error) { - var _args EvalTargetServiceListSourceEvalTargetVersionsArgs - _args.Request = request - var _result EvalTargetServiceListSourceEvalTargetVersionsResult - if err = p.Client_().Call(ctx, "ListSourceEvalTargetVersions", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetSourceEvalTargets(ctx context.Context, request *BatchGetSourceEvalTargetsRequest) (r *BatchGetSourceEvalTargetsResponse, err error) { - var _args EvalTargetServiceBatchGetSourceEvalTargetsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetSourceEvalTargetsResult - if err = p.Client_().Call(ctx, "BatchGetSourceEvalTargets", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) SearchCustomEvalTarget(ctx context.Context, req *SearchCustomEvalTargetRequest) (r *SearchCustomEvalTargetResponse, err error) { - var _args EvalTargetServiceSearchCustomEvalTargetArgs - _args.Req = req - var _result EvalTargetServiceSearchCustomEvalTargetResult - if err = p.Client_().Call(ctx, "SearchCustomEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) { - var _args EvalTargetServiceExecuteEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceExecuteEvalTargetResult - if err = p.Client_().Call(ctx, "ExecuteEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) { - var _args EvalTargetServiceGetEvalTargetRecordArgs - _args.Request = request - var _result EvalTargetServiceGetEvalTargetRecordResult - if err = p.Client_().Call(ctx, "GetEvalTargetRecord", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) { - var _args EvalTargetServiceBatchGetEvalTargetRecordsArgs - _args.Request = request - var _result EvalTargetServiceBatchGetEvalTargetRecordsResult - if err = p.Client_().Call(ctx, "BatchGetEvalTargetRecords", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) DebugEvalTarget(ctx context.Context, request *DebugEvalTargetRequest) (r *DebugEvalTargetResponse, err error) { - var _args EvalTargetServiceDebugEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceDebugEvalTargetResult - if err = p.Client_().Call(ctx, "DebugEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, request *AsyncDebugEvalTargetRequest) (r *AsyncDebugEvalTargetResponse, err error) { - var _args EvalTargetServiceAsyncDebugEvalTargetArgs - _args.Request = request - var _result EvalTargetServiceAsyncDebugEvalTargetResult - if err = p.Client_().Call(ctx, "AsyncDebugEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *EvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *PassbackEvalTargetInvokeResultRequest) (r *PassbackEvalTargetInvokeResultResponse, err error) { - var _args EvalTargetServicePassbackEvalTargetInvokeResultArgs - _args.Req = req - var _result EvalTargetServicePassbackEvalTargetInvokeResultResult - if err = p.Client_().Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -type EvalTargetServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler EvalTargetService -} - -func (p *EvalTargetServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *EvalTargetServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *EvalTargetServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetServiceProcessor { - self := &EvalTargetServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("CreateEvalTarget", &evalTargetServiceProcessorCreateEvalTarget{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetsBySource", &evalTargetServiceProcessorBatchGetEvalTargetsBySource{handler: handler}) - self.AddToProcessorMap("GetEvalTargetVersion", &evalTargetServiceProcessorGetEvalTargetVersion{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetVersions", &evalTargetServiceProcessorBatchGetEvalTargetVersions{handler: handler}) - self.AddToProcessorMap("ListSourceEvalTargets", &evalTargetServiceProcessorListSourceEvalTargets{handler: handler}) - self.AddToProcessorMap("ListSourceEvalTargetVersions", &evalTargetServiceProcessorListSourceEvalTargetVersions{handler: handler}) - self.AddToProcessorMap("BatchGetSourceEvalTargets", &evalTargetServiceProcessorBatchGetSourceEvalTargets{handler: handler}) - self.AddToProcessorMap("SearchCustomEvalTarget", &evalTargetServiceProcessorSearchCustomEvalTarget{handler: handler}) - self.AddToProcessorMap("ExecuteEvalTarget", &evalTargetServiceProcessorExecuteEvalTarget{handler: handler}) - self.AddToProcessorMap("GetEvalTargetRecord", &evalTargetServiceProcessorGetEvalTargetRecord{handler: handler}) - self.AddToProcessorMap("BatchGetEvalTargetRecords", &evalTargetServiceProcessorBatchGetEvalTargetRecords{handler: handler}) - self.AddToProcessorMap("DebugEvalTarget", &evalTargetServiceProcessorDebugEvalTarget{handler: handler}) - self.AddToProcessorMap("AsyncDebugEvalTarget", &evalTargetServiceProcessorAsyncDebugEvalTarget{handler: handler}) - self.AddToProcessorMap("PassbackEvalTargetInvokeResult", &evalTargetServiceProcessorPassbackEvalTargetInvokeResult_{handler: handler}) - return self -} -func (p *EvalTargetServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x -} - -type evalTargetServiceProcessorCreateEvalTarget struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorCreateEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceCreateEvalTargetArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceCreateEvalTargetResult{} - var retval *CreateEvalTargetResponse - if retval, err2 = p.handler.CreateEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("CreateEvalTarget", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorBatchGetEvalTargetsBySource struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorBatchGetEvalTargetsBySource) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetEvalTargetsBySourceResult{} - var retval *BatchGetEvalTargetsBySourceResponse - if retval, err2 = p.handler.BatchGetEvalTargetsBySource(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetsBySource: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorGetEvalTargetVersion struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorGetEvalTargetVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceGetEvalTargetVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceGetEvalTargetVersionResult{} - var retval *GetEvalTargetVersionResponse - if retval, err2 = p.handler.GetEvalTargetVersion(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetVersion: "+err2.Error()) - oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorBatchGetEvalTargetVersions struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorBatchGetEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetVersionsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceBatchGetEvalTargetVersionsResult{} - var retval *BatchGetEvalTargetVersionsResponse - if retval, err2 = p.handler.BatchGetEvalTargetVersions(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetVersions: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorListSourceEvalTargets struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorListSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceListSourceEvalTargetsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceListSourceEvalTargetsResult{} - var retval *ListSourceEvalTargetsResponse - if retval, err2 = p.handler.ListSourceEvalTargets(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargets: "+err2.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorListSourceEvalTargetVersions struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorListSourceEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceListSourceEvalTargetVersionsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := EvalTargetServiceListSourceEvalTargetVersionsResult{} - var retval *ListSourceEvalTargetVersionsResponse - if retval, err2 = p.handler.ListSourceEvalTargetVersions(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargetVersions: "+err2.Error()) - oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type evalTargetServiceProcessorBatchGetSourceEvalTargets struct { - handler EvalTargetService -} - -func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetSourceEvalTargetsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *evalTargetServiceProcessorCreateEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceCreateEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceBatchGetSourceEvalTargetsResult{} - var retval *BatchGetSourceEvalTargetsResponse - if retval, err2 = p.handler.BatchGetSourceEvalTargets(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetSourceEvalTargets: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) + result := EvalTargetServiceCreateEvalTargetResult{} + var retval *CreateEvalTargetResponse + if retval, err2 = p.handler.CreateEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("CreateEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12808,7 +11792,7 @@ func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx contex } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("CreateEvalTarget", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12826,16 +11810,16 @@ func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx contex return true, err } -type evalTargetServiceProcessorSearchCustomEvalTarget struct { +type evalTargetServiceProcessorBatchGetEvalTargetsBySource struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceSearchCustomEvalTargetArgs{} +func (p *evalTargetServiceProcessorBatchGetEvalTargetsBySource) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12844,11 +11828,11 @@ func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.C iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceSearchCustomEvalTargetResult{} - var retval *SearchCustomEvalTargetResponse - if retval, err2 = p.handler.SearchCustomEvalTarget(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchCustomEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) + result := EvalTargetServiceBatchGetEvalTargetsBySourceResult{} + var retval *BatchGetEvalTargetsBySourceResponse + if retval, err2 = p.handler.BatchGetEvalTargetsBySource(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetsBySource: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12856,7 +11840,7 @@ func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.C } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetsBySource", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12874,16 +11858,16 @@ func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.C return true, err } -type evalTargetServiceProcessorExecuteEvalTarget struct { +type evalTargetServiceProcessorGetEvalTargetVersion struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceExecuteEvalTargetArgs{} +func (p *evalTargetServiceProcessorGetEvalTargetVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceGetEvalTargetVersionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12892,11 +11876,11 @@ func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Contex iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceExecuteEvalTargetResult{} - var retval *ExecuteEvalTargetResponse - if retval, err2 = p.handler.ExecuteEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + result := EvalTargetServiceGetEvalTargetVersionResult{} + var retval *GetEvalTargetVersionResponse + if retval, err2 = p.handler.GetEvalTargetVersion(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetVersion: "+err2.Error()) + oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12904,7 +11888,7 @@ func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Contex } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetEvalTargetVersion", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12922,16 +11906,16 @@ func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Contex return true, err } -type evalTargetServiceProcessorGetEvalTargetRecord struct { +type evalTargetServiceProcessorBatchGetEvalTargetVersions struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceGetEvalTargetRecordArgs{} +func (p *evalTargetServiceProcessorBatchGetEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetVersionsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12940,11 +11924,11 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceGetEvalTargetRecordResult{} - var retval *GetEvalTargetRecordResponse - if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + result := EvalTargetServiceBatchGetEvalTargetVersionsResult{} + var retval *BatchGetEvalTargetVersionsResponse + if retval, err2 = p.handler.BatchGetEvalTargetVersions(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetVersions: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12952,7 +11936,7 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12970,16 +11954,16 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont return true, err } -type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { +type evalTargetServiceProcessorListSourceEvalTargets struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} +func (p *evalTargetServiceProcessorListSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceListSourceEvalTargetsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12988,11 +11972,11 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} - var retval *BatchGetEvalTargetRecordsResponse - if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + result := EvalTargetServiceListSourceEvalTargetsResult{} + var retval *ListSourceEvalTargetsResponse + if retval, err2 = p.handler.ListSourceEvalTargets(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargets: "+err2.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13000,7 +11984,7 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("ListSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13018,16 +12002,16 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex return true, err } -type evalTargetServiceProcessorDebugEvalTarget struct { +type evalTargetServiceProcessorListSourceEvalTargetVersions struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceDebugEvalTargetArgs{} +func (p *evalTargetServiceProcessorListSourceEvalTargetVersions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceListSourceEvalTargetVersionsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13036,11 +12020,11 @@ func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceDebugEvalTargetResult{} - var retval *DebugEvalTargetResponse - if retval, err2 = p.handler.DebugEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DebugEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + result := EvalTargetServiceListSourceEvalTargetVersionsResult{} + var retval *ListSourceEvalTargetVersionsResponse + if retval, err2 = p.handler.ListSourceEvalTargetVersions(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListSourceEvalTargetVersions: "+err2.Error()) + oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13048,7 +12032,7 @@ func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("DebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("ListSourceEvalTargetVersions", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13066,16 +12050,16 @@ func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, return true, err } -type evalTargetServiceProcessorAsyncDebugEvalTarget struct { +type evalTargetServiceProcessorBatchGetSourceEvalTargets struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceAsyncDebugEvalTargetArgs{} +func (p *evalTargetServiceProcessorBatchGetSourceEvalTargets) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetSourceEvalTargetsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13084,11 +12068,11 @@ func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Con iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceAsyncDebugEvalTargetResult{} - var retval *AsyncDebugEvalTargetResponse - if retval, err2 = p.handler.AsyncDebugEvalTarget(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncDebugEvalTarget: "+err2.Error()) - oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + result := EvalTargetServiceBatchGetSourceEvalTargetsResult{} + var retval *BatchGetSourceEvalTargetsResponse + if retval, err2 = p.handler.BatchGetSourceEvalTargets(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetSourceEvalTargets: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13096,7 +12080,7 @@ func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Con } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("BatchGetSourceEvalTargets", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13114,16 +12098,16 @@ func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Con return true, err } -type evalTargetServiceProcessorPassbackEvalTargetInvokeResult_ struct { +type evalTargetServiceProcessorSearchCustomEvalTarget struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorPassbackEvalTargetInvokeResult_) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServicePassbackEvalTargetInvokeResultArgs{} +func (p *evalTargetServiceProcessorSearchCustomEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceSearchCustomEvalTargetArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13132,11 +12116,11 @@ func (p *evalTargetServiceProcessorPassbackEvalTargetInvokeResult_) Process(ctx iprot.ReadMessageEnd() var err2 error - result := EvalTargetServicePassbackEvalTargetInvokeResultResult{} - var retval *PassbackEvalTargetInvokeResultResponse - if retval, err2 = p.handler.PassbackEvalTargetInvokeResult_(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PassbackEvalTargetInvokeResult: "+err2.Error()) - oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + result := EvalTargetServiceSearchCustomEvalTargetResult{} + var retval *SearchCustomEvalTargetResponse + if retval, err2 = p.handler.SearchCustomEvalTarget(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SearchCustomEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13144,7 +12128,7 @@ func (p *evalTargetServiceProcessorPassbackEvalTargetInvokeResult_) Process(ctx } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("PassbackEvalTargetInvokeResult", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("SearchCustomEvalTarget", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13156,391 +12140,287 @@ func (p *evalTargetServiceProcessorPassbackEvalTargetInvokeResult_) Process(ctx if err2 = oprot.Flush(ctx); err == nil && err2 != nil { err = err2 } - if err != nil { - return - } - return true, err -} - -type EvalTargetServiceCreateEvalTargetArgs struct { - Request *CreateEvalTargetRequest `thrift:"request,1" frugal:"1,default,CreateEvalTargetRequest"` -} - -func NewEvalTargetServiceCreateEvalTargetArgs() *EvalTargetServiceCreateEvalTargetArgs { - return &EvalTargetServiceCreateEvalTargetArgs{} -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) InitDefault() { -} - -var EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT *CreateEvalTargetRequest - -func (p *EvalTargetServiceCreateEvalTargetArgs) GetRequest() (v *CreateEvalTargetRequest) { - if p == nil { - return - } - if !p.IsSetRequest() { - return EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT - } - return p.Request -} -func (p *EvalTargetServiceCreateEvalTargetArgs) SetRequest(val *CreateEvalTargetRequest) { - p.Request = val -} - -var fieldIDToName_EvalTargetServiceCreateEvalTargetArgs = map[int16]string{ - 1: "request", -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCreateEvalTargetRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CreateEvalTarget_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("EvalTargetServiceCreateEvalTargetArgs(%+v)", *p) - -} - -func (p *EvalTargetServiceCreateEvalTargetArgs) DeepEqual(ano *EvalTargetServiceCreateEvalTargetArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Request) { - return false + if err != nil { + return } - return true + return true, err } -func (p *EvalTargetServiceCreateEvalTargetArgs) Field1DeepEqual(src *CreateEvalTargetRequest) bool { - - if !p.Request.DeepEqual(src) { - return false - } - return true +type evalTargetServiceProcessorExecuteEvalTarget struct { + handler EvalTargetService } -type EvalTargetServiceCreateEvalTargetResult struct { - Success *CreateEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,CreateEvalTargetResponse"` -} +func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceExecuteEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func NewEvalTargetServiceCreateEvalTargetResult() *EvalTargetServiceCreateEvalTargetResult { - return &EvalTargetServiceCreateEvalTargetResult{} + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceExecuteEvalTargetResult{} + var retval *ExecuteEvalTargetResponse + if retval, err2 = p.handler.ExecuteEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ExecuteEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -func (p *EvalTargetServiceCreateEvalTargetResult) InitDefault() { +type evalTargetServiceProcessorGetEvalTargetRecord struct { + handler EvalTargetService } -var EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT *CreateEvalTargetResponse +func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceGetEvalTargetRecordArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func (p *EvalTargetServiceCreateEvalTargetResult) GetSuccess() (v *CreateEvalTargetResponse) { - if p == nil { - return + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceGetEvalTargetRecordResult{} + var retval *GetEvalTargetRecordResponse + if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if !p.IsSetSuccess() { - return EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT + if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { + err = err2 } - return p.Success -} -func (p *EvalTargetServiceCreateEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*CreateEvalTargetResponse) -} - -var fieldIDToName_EvalTargetServiceCreateEvalTargetResult = map[int16]string{ - 0: "success", + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -func (p *EvalTargetServiceCreateEvalTargetResult) IsSetSuccess() bool { - return p.Success != nil +type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { + handler EvalTargetService } -func (p *EvalTargetServiceCreateEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} + var retval *BatchGetEvalTargetRecordsResponse + if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { + err = err2 } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +type evalTargetServiceProcessorDebugEvalTarget struct { + handler EvalTargetService } -func (p *EvalTargetServiceCreateEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCreateEvalTargetResponse() - if err := _field.Read(iprot); err != nil { - return err +func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceDebugEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - p.Success = _field - return nil -} -func (p *EvalTargetServiceCreateEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CreateEvalTarget_result"); err != nil { - goto WriteStructBeginError + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceDebugEvalTargetResult{} + var retval *DebugEvalTargetResponse + if retval, err2 = p.handler.DebugEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DebugEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + if err2 = oprot.WriteMessageBegin("DebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err != nil { + return } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) + return true, err } -func (p *EvalTargetServiceCreateEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +type evalTargetServiceProcessorAsyncDebugEvalTarget struct { + handler EvalTargetService } -func (p *EvalTargetServiceCreateEvalTargetResult) String() string { - if p == nil { - return "" +func (p *evalTargetServiceProcessorAsyncDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceAsyncDebugEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - return fmt.Sprintf("EvalTargetServiceCreateEvalTargetResult(%+v)", *p) - -} -func (p *EvalTargetServiceCreateEvalTargetResult) DeepEqual(ano *EvalTargetServiceCreateEvalTargetResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceAsyncDebugEvalTargetResult{} + var retval *AsyncDebugEvalTargetResponse + if retval, err2 = p.handler.AsyncDebugEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncDebugEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if !p.Field0DeepEqual(ano.Success) { - return false + if err2 = oprot.WriteMessageBegin("AsyncDebugEvalTarget", thrift.REPLY, seqId); err2 != nil { + err = err2 } - return true -} - -func (p *EvalTargetServiceCreateEvalTargetResult) Field0DeepEqual(src *CreateEvalTargetResponse) bool { - - if !p.Success.DeepEqual(src) { - return false + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - return true + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -type EvalTargetServiceBatchGetEvalTargetsBySourceArgs struct { - Request *BatchGetEvalTargetsBySourceRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetsBySourceRequest"` +type EvalTargetServiceCreateEvalTargetArgs struct { + Request *CreateEvalTargetRequest `thrift:"request,1" frugal:"1,default,CreateEvalTargetRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetsBySourceArgs() *EvalTargetServiceBatchGetEvalTargetsBySourceArgs { - return &EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} +func NewEvalTargetServiceCreateEvalTargetArgs() *EvalTargetServiceCreateEvalTargetArgs { + return &EvalTargetServiceCreateEvalTargetArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) InitDefault() { +func (p *EvalTargetServiceCreateEvalTargetArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT *BatchGetEvalTargetsBySourceRequest +var EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT *CreateEvalTargetRequest -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) GetRequest() (v *BatchGetEvalTargetsBySourceRequest) { +func (p *EvalTargetServiceCreateEvalTargetArgs) GetRequest() (v *CreateEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT + return EvalTargetServiceCreateEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) SetRequest(val *BatchGetEvalTargetsBySourceRequest) { +func (p *EvalTargetServiceCreateEvalTargetArgs) SetRequest(val *CreateEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceCreateEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) IsSetRequest() bool { +func (p *EvalTargetServiceCreateEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13585,7 +12465,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13595,8 +12475,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetsBySourceRequest() +func (p *EvalTargetServiceCreateEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -13604,9 +12484,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thri return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_args"); err != nil { + if err = oprot.WriteStructBegin("CreateEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13632,7 +12512,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -13649,15 +12529,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) String() string { +func (p *EvalTargetServiceCreateEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceCreateEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) bool { +func (p *EvalTargetServiceCreateEvalTargetArgs) DeepEqual(ano *EvalTargetServiceCreateEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -13669,7 +12549,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src *BatchGetEvalTargetsBySourceRequest) bool { +func (p *EvalTargetServiceCreateEvalTargetArgs) Field1DeepEqual(src *CreateEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -13677,41 +12557,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src * return true } -type EvalTargetServiceBatchGetEvalTargetsBySourceResult struct { - Success *BatchGetEvalTargetsBySourceResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetsBySourceResponse"` +type EvalTargetServiceCreateEvalTargetResult struct { + Success *CreateEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,CreateEvalTargetResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetsBySourceResult() *EvalTargetServiceBatchGetEvalTargetsBySourceResult { - return &EvalTargetServiceBatchGetEvalTargetsBySourceResult{} +func NewEvalTargetServiceCreateEvalTargetResult() *EvalTargetServiceCreateEvalTargetResult { + return &EvalTargetServiceCreateEvalTargetResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) InitDefault() { +func (p *EvalTargetServiceCreateEvalTargetResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT *BatchGetEvalTargetsBySourceResponse +var EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT *CreateEvalTargetResponse -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) GetSuccess() (v *BatchGetEvalTargetsBySourceResponse) { +func (p *EvalTargetServiceCreateEvalTargetResult) GetSuccess() (v *CreateEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT + return EvalTargetServiceCreateEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetsBySourceResponse) +func (p *EvalTargetServiceCreateEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*CreateEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceCreateEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) IsSetSuccess() bool { +func (p *EvalTargetServiceCreateEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13756,7 +12636,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceCreateEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13766,8 +12646,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetsBySourceResponse() +func (p *EvalTargetServiceCreateEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -13775,9 +12655,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot th return nil } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_result"); err != nil { + if err = oprot.WriteStructBegin("CreateEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13803,7 +12683,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceCreateEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -13822,15 +12702,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) String() string { +func (p *EvalTargetServiceCreateEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceCreateEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceResult) bool { +func (p *EvalTargetServiceCreateEvalTargetResult) DeepEqual(ano *EvalTargetServiceCreateEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -13842,7 +12722,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *Eval return true } -func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src *BatchGetEvalTargetsBySourceResponse) bool { +func (p *EvalTargetServiceCreateEvalTargetResult) Field0DeepEqual(src *CreateEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -13850,41 +12730,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src return true } -type EvalTargetServiceGetEvalTargetVersionArgs struct { - Request *GetEvalTargetVersionRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetVersionRequest"` +type EvalTargetServiceBatchGetEvalTargetsBySourceArgs struct { + Request *BatchGetEvalTargetsBySourceRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetsBySourceRequest"` } -func NewEvalTargetServiceGetEvalTargetVersionArgs() *EvalTargetServiceGetEvalTargetVersionArgs { - return &EvalTargetServiceGetEvalTargetVersionArgs{} +func NewEvalTargetServiceBatchGetEvalTargetsBySourceArgs() *EvalTargetServiceBatchGetEvalTargetsBySourceArgs { + return &EvalTargetServiceBatchGetEvalTargetsBySourceArgs{} } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) InitDefault() { } -var EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT *GetEvalTargetVersionRequest +var EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT *BatchGetEvalTargetsBySourceRequest -func (p *EvalTargetServiceGetEvalTargetVersionArgs) GetRequest() (v *GetEvalTargetVersionRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) GetRequest() (v *BatchGetEvalTargetsBySourceRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT + return EvalTargetServiceBatchGetEvalTargetsBySourceArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) SetRequest(val *GetEvalTargetVersionRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) SetRequest(val *BatchGetEvalTargetsBySourceRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) IsSetRequest() bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13929,7 +12809,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13939,8 +12819,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetVersionRequest() +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetsBySourceRequest() if err := _field.Read(iprot); err != nil { return err } @@ -13948,9 +12828,9 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TPro return nil } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetVersion_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13976,7 +12856,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -13993,15 +12873,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceArgs(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionArgs) bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14013,7 +12893,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetSer return true } -func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEvalTargetVersionRequest) bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceArgs) Field1DeepEqual(src *BatchGetEvalTargetsBySourceRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -14021,41 +12901,41 @@ func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEval return true } -type EvalTargetServiceGetEvalTargetVersionResult struct { - Success *GetEvalTargetVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetVersionResponse"` +type EvalTargetServiceBatchGetEvalTargetsBySourceResult struct { + Success *BatchGetEvalTargetsBySourceResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetsBySourceResponse"` } -func NewEvalTargetServiceGetEvalTargetVersionResult() *EvalTargetServiceGetEvalTargetVersionResult { - return &EvalTargetServiceGetEvalTargetVersionResult{} +func NewEvalTargetServiceBatchGetEvalTargetsBySourceResult() *EvalTargetServiceBatchGetEvalTargetsBySourceResult { + return &EvalTargetServiceBatchGetEvalTargetsBySourceResult{} } -func (p *EvalTargetServiceGetEvalTargetVersionResult) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) InitDefault() { } -var EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT *GetEvalTargetVersionResponse +var EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT *BatchGetEvalTargetsBySourceResponse -func (p *EvalTargetServiceGetEvalTargetVersionResult) GetSuccess() (v *GetEvalTargetVersionResponse) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) GetSuccess() (v *BatchGetEvalTargetsBySourceResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT + return EvalTargetServiceBatchGetEvalTargetsBySourceResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceGetEvalTargetVersionResult) SetSuccess(x interface{}) { - p.Success = x.(*GetEvalTargetVersionResponse) +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetsBySourceResponse) } -var fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceGetEvalTargetVersionResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14100,7 +12980,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetsBySourceResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14110,8 +12990,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetVersionResponse() +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetsBySourceResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14119,9 +12999,9 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TP return nil } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetVersion_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetsBySource_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14147,7 +13027,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14166,15 +13046,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetsBySourceResult(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionResult) bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetsBySourceResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14186,7 +13066,7 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetS return true } -func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEvalTargetVersionResponse) bool { +func (p *EvalTargetServiceBatchGetEvalTargetsBySourceResult) Field0DeepEqual(src *BatchGetEvalTargetsBySourceResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -14194,41 +13074,41 @@ func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEv return true } -type EvalTargetServiceBatchGetEvalTargetVersionsArgs struct { - Request *BatchGetEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetVersionsRequest"` +type EvalTargetServiceGetEvalTargetVersionArgs struct { + Request *GetEvalTargetVersionRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetVersionRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetVersionsArgs() *EvalTargetServiceBatchGetEvalTargetVersionsArgs { - return &EvalTargetServiceBatchGetEvalTargetVersionsArgs{} +func NewEvalTargetServiceGetEvalTargetVersionArgs() *EvalTargetServiceGetEvalTargetVersionArgs { + return &EvalTargetServiceGetEvalTargetVersionArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT *BatchGetEvalTargetVersionsRequest +var EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT *GetEvalTargetVersionRequest -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) GetRequest() (v *BatchGetEvalTargetVersionsRequest) { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) GetRequest() (v *GetEvalTargetVersionRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT + return EvalTargetServiceGetEvalTargetVersionArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) SetRequest(val *BatchGetEvalTargetVersionsRequest) { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) SetRequest(val *GetEvalTargetVersionRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14273,7 +13153,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14283,8 +13163,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetVersionsRequest() +func (p *EvalTargetServiceGetEvalTargetVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetVersionRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14292,9 +13172,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) ReadField1(iprot thrif return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_args"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetVersion_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14320,7 +13200,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14337,15 +13217,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) String() string { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsArgs) bool { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14357,7 +13237,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepEqual(ano *EvalTar return true } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Field1DeepEqual(src *BatchGetEvalTargetVersionsRequest) bool { +func (p *EvalTargetServiceGetEvalTargetVersionArgs) Field1DeepEqual(src *GetEvalTargetVersionRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -14365,41 +13245,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Field1DeepEqual(src *B return true } -type EvalTargetServiceBatchGetEvalTargetVersionsResult struct { - Success *BatchGetEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetVersionsResponse"` +type EvalTargetServiceGetEvalTargetVersionResult struct { + Success *GetEvalTargetVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetVersionResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetVersionsResult() *EvalTargetServiceBatchGetEvalTargetVersionsResult { - return &EvalTargetServiceBatchGetEvalTargetVersionsResult{} +func NewEvalTargetServiceGetEvalTargetVersionResult() *EvalTargetServiceGetEvalTargetVersionResult { + return &EvalTargetServiceGetEvalTargetVersionResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetVersionResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT *BatchGetEvalTargetVersionsResponse +var EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT *GetEvalTargetVersionResponse -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) GetSuccess() (v *BatchGetEvalTargetVersionsResponse) { +func (p *EvalTargetServiceGetEvalTargetVersionResult) GetSuccess() (v *GetEvalTargetVersionResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT + return EvalTargetServiceGetEvalTargetVersionResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetVersionsResponse) +func (p *EvalTargetServiceGetEvalTargetVersionResult) SetSuccess(x interface{}) { + p.Success = x.(*GetEvalTargetVersionResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceGetEvalTargetVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14444,7 +13324,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14454,8 +13334,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetVersionsResponse() +func (p *EvalTargetServiceGetEvalTargetVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetVersionResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14463,9 +13343,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thr return nil } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_result"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetVersion_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14491,7 +13371,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14510,15 +13390,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) String() string { +func (p *EvalTargetServiceGetEvalTargetVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetVersionResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsResult) bool { +func (p *EvalTargetServiceGetEvalTargetVersionResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetVersionResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14530,7 +13410,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalT return true } -func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src *BatchGetEvalTargetVersionsResponse) bool { +func (p *EvalTargetServiceGetEvalTargetVersionResult) Field0DeepEqual(src *GetEvalTargetVersionResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -14538,41 +13418,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src return true } -type EvalTargetServiceListSourceEvalTargetsArgs struct { - Request *ListSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetsRequest"` +type EvalTargetServiceBatchGetEvalTargetVersionsArgs struct { + Request *BatchGetEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetVersionsRequest"` } -func NewEvalTargetServiceListSourceEvalTargetsArgs() *EvalTargetServiceListSourceEvalTargetsArgs { - return &EvalTargetServiceListSourceEvalTargetsArgs{} +func NewEvalTargetServiceBatchGetEvalTargetVersionsArgs() *EvalTargetServiceBatchGetEvalTargetVersionsArgs { + return &EvalTargetServiceBatchGetEvalTargetVersionsArgs{} } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT *ListSourceEvalTargetsRequest +var EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT *BatchGetEvalTargetVersionsRequest -func (p *EvalTargetServiceListSourceEvalTargetsArgs) GetRequest() (v *ListSourceEvalTargetsRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) GetRequest() (v *BatchGetEvalTargetVersionsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT + return EvalTargetServiceBatchGetEvalTargetVersionsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) SetRequest(val *ListSourceEvalTargetsRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) SetRequest(val *BatchGetEvalTargetVersionsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14617,7 +13497,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14627,8 +13507,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetsRequest() +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetVersionsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14636,9 +13516,9 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TPr return nil } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargets_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14664,7 +13544,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14681,15 +13561,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsArgs(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsArgs) bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14701,7 +13581,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetSe return true } -func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSourceEvalTargetsRequest) bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsArgs) Field1DeepEqual(src *BatchGetEvalTargetVersionsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -14709,41 +13589,41 @@ func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSo return true } -type EvalTargetServiceListSourceEvalTargetsResult struct { - Success *ListSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetsResponse"` +type EvalTargetServiceBatchGetEvalTargetVersionsResult struct { + Success *BatchGetEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetVersionsResponse"` } -func NewEvalTargetServiceListSourceEvalTargetsResult() *EvalTargetServiceListSourceEvalTargetsResult { - return &EvalTargetServiceListSourceEvalTargetsResult{} +func NewEvalTargetServiceBatchGetEvalTargetVersionsResult() *EvalTargetServiceBatchGetEvalTargetVersionsResult { + return &EvalTargetServiceBatchGetEvalTargetVersionsResult{} } -func (p *EvalTargetServiceListSourceEvalTargetsResult) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT *ListSourceEvalTargetsResponse +var EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT *BatchGetEvalTargetVersionsResponse -func (p *EvalTargetServiceListSourceEvalTargetsResult) GetSuccess() (v *ListSourceEvalTargetsResponse) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) GetSuccess() (v *BatchGetEvalTargetVersionsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT + return EvalTargetServiceBatchGetEvalTargetVersionsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceListSourceEvalTargetsResult) SetSuccess(x interface{}) { - p.Success = x.(*ListSourceEvalTargetsResponse) +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetVersionsResponse) } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceListSourceEvalTargetsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14788,7 +13668,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetVersionsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14798,8 +13678,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetsResponse() +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetVersionsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14807,9 +13687,9 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.T return nil } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargets_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetVersions_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14835,7 +13715,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14854,15 +13734,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetVersionsResult(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsResult) bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetVersionsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -14874,7 +13754,7 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTarget return true } -func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *ListSourceEvalTargetsResponse) bool { +func (p *EvalTargetServiceBatchGetEvalTargetVersionsResult) Field0DeepEqual(src *BatchGetEvalTargetVersionsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -14882,41 +13762,41 @@ func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *List return true } -type EvalTargetServiceListSourceEvalTargetVersionsArgs struct { - Request *ListSourceEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetVersionsRequest"` +type EvalTargetServiceListSourceEvalTargetsArgs struct { + Request *ListSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetsRequest"` } -func NewEvalTargetServiceListSourceEvalTargetVersionsArgs() *EvalTargetServiceListSourceEvalTargetVersionsArgs { - return &EvalTargetServiceListSourceEvalTargetVersionsArgs{} +func NewEvalTargetServiceListSourceEvalTargetsArgs() *EvalTargetServiceListSourceEvalTargetsArgs { + return &EvalTargetServiceListSourceEvalTargetsArgs{} } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT *ListSourceEvalTargetVersionsRequest +var EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT *ListSourceEvalTargetsRequest -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) GetRequest() (v *ListSourceEvalTargetVersionsRequest) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) GetRequest() (v *ListSourceEvalTargetsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT + return EvalTargetServiceListSourceEvalTargetsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) SetRequest(val *ListSourceEvalTargetVersionsRequest) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) SetRequest(val *ListSourceEvalTargetsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14961,7 +13841,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14971,8 +13851,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetVersionsRequest() +func (p *EvalTargetServiceListSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14980,9 +13860,9 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thr return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_args"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargets_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15008,7 +13888,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15025,15 +13905,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) String() string { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsArgs(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsArgs) bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15045,7 +13925,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalT return true } -func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src *ListSourceEvalTargetVersionsRequest) bool { +func (p *EvalTargetServiceListSourceEvalTargetsArgs) Field1DeepEqual(src *ListSourceEvalTargetsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -15053,41 +13933,41 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src return true } -type EvalTargetServiceListSourceEvalTargetVersionsResult struct { - Success *ListSourceEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetVersionsResponse"` +type EvalTargetServiceListSourceEvalTargetsResult struct { + Success *ListSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetsResponse"` } -func NewEvalTargetServiceListSourceEvalTargetVersionsResult() *EvalTargetServiceListSourceEvalTargetVersionsResult { - return &EvalTargetServiceListSourceEvalTargetVersionsResult{} +func NewEvalTargetServiceListSourceEvalTargetsResult() *EvalTargetServiceListSourceEvalTargetsResult { + return &EvalTargetServiceListSourceEvalTargetsResult{} } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetsResult) InitDefault() { } -var EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT *ListSourceEvalTargetVersionsResponse +var EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT *ListSourceEvalTargetsResponse -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) GetSuccess() (v *ListSourceEvalTargetVersionsResponse) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) GetSuccess() (v *ListSourceEvalTargetsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT + return EvalTargetServiceListSourceEvalTargetsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) SetSuccess(x interface{}) { - p.Success = x.(*ListSourceEvalTargetVersionsResponse) +func (p *EvalTargetServiceListSourceEvalTargetsResult) SetSuccess(x interface{}) { + p.Success = x.(*ListSourceEvalTargetsResponse) } -var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15132,7 +14012,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15142,8 +14022,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListSourceEvalTargetVersionsResponse() +func (p *EvalTargetServiceListSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15151,9 +14031,9 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot t return nil } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_result"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargets_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15179,7 +14059,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15198,15 +14078,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) String() string { +func (p *EvalTargetServiceListSourceEvalTargetsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetsResult(%+v)", *p) } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsResult) bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15218,7 +14098,7 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *Eva return true } -func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(src *ListSourceEvalTargetVersionsResponse) bool { +func (p *EvalTargetServiceListSourceEvalTargetsResult) Field0DeepEqual(src *ListSourceEvalTargetsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15226,41 +14106,41 @@ func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(sr return true } -type EvalTargetServiceBatchGetSourceEvalTargetsArgs struct { - Request *BatchGetSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,BatchGetSourceEvalTargetsRequest"` +type EvalTargetServiceListSourceEvalTargetVersionsArgs struct { + Request *ListSourceEvalTargetVersionsRequest `thrift:"request,1" frugal:"1,default,ListSourceEvalTargetVersionsRequest"` } -func NewEvalTargetServiceBatchGetSourceEvalTargetsArgs() *EvalTargetServiceBatchGetSourceEvalTargetsArgs { - return &EvalTargetServiceBatchGetSourceEvalTargetsArgs{} +func NewEvalTargetServiceListSourceEvalTargetVersionsArgs() *EvalTargetServiceListSourceEvalTargetVersionsArgs { + return &EvalTargetServiceListSourceEvalTargetVersionsArgs{} } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) InitDefault() { } -var EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT *BatchGetSourceEvalTargetsRequest +var EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT *ListSourceEvalTargetVersionsRequest -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) GetRequest() (v *BatchGetSourceEvalTargetsRequest) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) GetRequest() (v *ListSourceEvalTargetVersionsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT + return EvalTargetServiceListSourceEvalTargetVersionsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) SetRequest(val *BatchGetSourceEvalTargetsRequest) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) SetRequest(val *ListSourceEvalTargetVersionsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15305,7 +14185,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15315,8 +14195,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetSourceEvalTargetsRequest() +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetVersionsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15324,9 +14204,9 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_args"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15352,7 +14232,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15369,15 +14249,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) String() string { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsArgs) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15389,7 +14269,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTarg return true } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *BatchGetSourceEvalTargetsRequest) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsArgs) Field1DeepEqual(src *ListSourceEvalTargetVersionsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -15397,41 +14277,41 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *Ba return true } -type EvalTargetServiceBatchGetSourceEvalTargetsResult struct { - Success *BatchGetSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetSourceEvalTargetsResponse"` +type EvalTargetServiceListSourceEvalTargetVersionsResult struct { + Success *ListSourceEvalTargetVersionsResponse `thrift:"success,0,optional" frugal:"0,optional,ListSourceEvalTargetVersionsResponse"` } -func NewEvalTargetServiceBatchGetSourceEvalTargetsResult() *EvalTargetServiceBatchGetSourceEvalTargetsResult { - return &EvalTargetServiceBatchGetSourceEvalTargetsResult{} +func NewEvalTargetServiceListSourceEvalTargetVersionsResult() *EvalTargetServiceListSourceEvalTargetVersionsResult { + return &EvalTargetServiceListSourceEvalTargetVersionsResult{} } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) InitDefault() { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) InitDefault() { } -var EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT *BatchGetSourceEvalTargetsResponse +var EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT *ListSourceEvalTargetVersionsResponse -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) GetSuccess() (v *BatchGetSourceEvalTargetsResponse) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) GetSuccess() (v *ListSourceEvalTargetVersionsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT + return EvalTargetServiceListSourceEvalTargetVersionsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetSourceEvalTargetsResponse) +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) SetSuccess(x interface{}) { + p.Success = x.(*ListSourceEvalTargetVersionsResponse) } -var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15476,7 +14356,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceListSourceEvalTargetVersionsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15486,8 +14366,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetSourceEvalTargetsResponse() +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListSourceEvalTargetVersionsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15495,9 +14375,9 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thri return nil } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_result"); err != nil { + if err = oprot.WriteStructBegin("ListSourceEvalTargetVersions_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15523,7 +14403,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15542,15 +14422,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) String() string { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceListSourceEvalTargetVersionsResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsResult) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) DeepEqual(ano *EvalTargetServiceListSourceEvalTargetVersionsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15562,7 +14442,7 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src *BatchGetSourceEvalTargetsResponse) bool { +func (p *EvalTargetServiceListSourceEvalTargetVersionsResult) Field0DeepEqual(src *ListSourceEvalTargetVersionsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15570,41 +14450,41 @@ func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src * return true } -type EvalTargetServiceSearchCustomEvalTargetArgs struct { - Req *SearchCustomEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchCustomEvalTargetRequest"` +type EvalTargetServiceBatchGetSourceEvalTargetsArgs struct { + Request *BatchGetSourceEvalTargetsRequest `thrift:"request,1" frugal:"1,default,BatchGetSourceEvalTargetsRequest"` } -func NewEvalTargetServiceSearchCustomEvalTargetArgs() *EvalTargetServiceSearchCustomEvalTargetArgs { - return &EvalTargetServiceSearchCustomEvalTargetArgs{} +func NewEvalTargetServiceBatchGetSourceEvalTargetsArgs() *EvalTargetServiceBatchGetSourceEvalTargetsArgs { + return &EvalTargetServiceBatchGetSourceEvalTargetsArgs{} } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) InitDefault() { } -var EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT *SearchCustomEvalTargetRequest +var EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT *BatchGetSourceEvalTargetsRequest -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) GetReq() (v *SearchCustomEvalTargetRequest) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) GetRequest() (v *BatchGetSourceEvalTargetsRequest) { if p == nil { return } - if !p.IsSetReq() { - return EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT + if !p.IsSetRequest() { + return EvalTargetServiceBatchGetSourceEvalTargetsArgs_Request_DEFAULT } - return p.Req + return p.Request } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) SetReq(val *SearchCustomEvalTargetRequest) { - p.Req = val +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) SetRequest(val *BatchGetSourceEvalTargetsRequest) { + p.Request = val } -var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs = map[int16]string{ - 1: "req", +var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs = map[int16]string{ + 1: "request", } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) IsSetReq() bool { - return p.Req != nil +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15649,7 +14529,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15659,18 +14539,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewSearchCustomEvalTargetRequest() +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetSourceEvalTargetsRequest() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Request = _field return nil } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SearchCustomEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15696,11 +14576,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -15713,69 +14593,69 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) String() string { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsArgs(%+v)", *p) } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetArgs) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Req) { + if !p.Field1DeepEqual(ano.Request) { return false } return true } -func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Field1DeepEqual(src *SearchCustomEvalTargetRequest) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsArgs) Field1DeepEqual(src *BatchGetSourceEvalTargetsRequest) bool { - if !p.Req.DeepEqual(src) { + if !p.Request.DeepEqual(src) { return false } return true } -type EvalTargetServiceSearchCustomEvalTargetResult struct { - Success *SearchCustomEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchCustomEvalTargetResponse"` +type EvalTargetServiceBatchGetSourceEvalTargetsResult struct { + Success *BatchGetSourceEvalTargetsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetSourceEvalTargetsResponse"` } -func NewEvalTargetServiceSearchCustomEvalTargetResult() *EvalTargetServiceSearchCustomEvalTargetResult { - return &EvalTargetServiceSearchCustomEvalTargetResult{} +func NewEvalTargetServiceBatchGetSourceEvalTargetsResult() *EvalTargetServiceBatchGetSourceEvalTargetsResult { + return &EvalTargetServiceBatchGetSourceEvalTargetsResult{} } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) InitDefault() { } -var EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT *SearchCustomEvalTargetResponse +var EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT *BatchGetSourceEvalTargetsResponse -func (p *EvalTargetServiceSearchCustomEvalTargetResult) GetSuccess() (v *SearchCustomEvalTargetResponse) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) GetSuccess() (v *BatchGetSourceEvalTargetsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT + return EvalTargetServiceBatchGetSourceEvalTargetsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*SearchCustomEvalTargetResponse) +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetSourceEvalTargetsResponse) } -var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15820,7 +14700,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetSourceEvalTargetsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15830,8 +14710,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewSearchCustomEvalTargetResponse() +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetSourceEvalTargetsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15839,9 +14719,9 @@ func (p *EvalTargetServiceSearchCustomEvalTargetResult) ReadField0(iprot thrift. return nil } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SearchCustomEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetSourceEvalTargets_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15867,7 +14747,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15886,15 +14766,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) String() string { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetSourceEvalTargetsResult(%+v)", *p) } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetResult) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) DeepEqual(ano *EvalTargetServiceBatchGetSourceEvalTargetsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -15906,7 +14786,7 @@ func (p *EvalTargetServiceSearchCustomEvalTargetResult) DeepEqual(ano *EvalTarge return true } -func (p *EvalTargetServiceSearchCustomEvalTargetResult) Field0DeepEqual(src *SearchCustomEvalTargetResponse) bool { +func (p *EvalTargetServiceBatchGetSourceEvalTargetsResult) Field0DeepEqual(src *BatchGetSourceEvalTargetsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -15914,41 +14794,41 @@ func (p *EvalTargetServiceSearchCustomEvalTargetResult) Field0DeepEqual(src *Sea return true } -type EvalTargetServiceExecuteEvalTargetArgs struct { - Request *ExecuteEvalTargetRequest `thrift:"request,1" frugal:"1,default,ExecuteEvalTargetRequest"` +type EvalTargetServiceSearchCustomEvalTargetArgs struct { + Req *SearchCustomEvalTargetRequest `thrift:"req,1" frugal:"1,default,SearchCustomEvalTargetRequest"` } -func NewEvalTargetServiceExecuteEvalTargetArgs() *EvalTargetServiceExecuteEvalTargetArgs { - return &EvalTargetServiceExecuteEvalTargetArgs{} +func NewEvalTargetServiceSearchCustomEvalTargetArgs() *EvalTargetServiceSearchCustomEvalTargetArgs { + return &EvalTargetServiceSearchCustomEvalTargetArgs{} } -func (p *EvalTargetServiceExecuteEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) InitDefault() { } -var EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT *ExecuteEvalTargetRequest +var EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT *SearchCustomEvalTargetRequest -func (p *EvalTargetServiceExecuteEvalTargetArgs) GetRequest() (v *ExecuteEvalTargetRequest) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) GetReq() (v *SearchCustomEvalTargetRequest) { if p == nil { return } - if !p.IsSetRequest() { - return EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT + if !p.IsSetReq() { + return EvalTargetServiceSearchCustomEvalTargetArgs_Req_DEFAULT } - return p.Request + return p.Req } -func (p *EvalTargetServiceExecuteEvalTargetArgs) SetRequest(val *ExecuteEvalTargetRequest) { - p.Request = val +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) SetReq(val *SearchCustomEvalTargetRequest) { + p.Req = val } -var fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs = map[int16]string{ - 1: "request", +var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs = map[int16]string{ + 1: "req", } -func (p *EvalTargetServiceExecuteEvalTargetArgs) IsSetRequest() bool { - return p.Request != nil +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) IsSetReq() bool { + return p.Req != nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15993,7 +14873,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16003,18 +14883,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewExecuteEvalTargetRequest() +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSearchCustomEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } - p.Request = _field + p.Req = _field return nil } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ExecuteEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("SearchCustomEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16040,11 +14920,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Request.Write(oprot); err != nil { + if err := p.Req.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -16057,69 +14937,69 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) String() string { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetArgs) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Request) { + if !p.Field1DeepEqual(ano.Req) { return false } return true } -func (p *EvalTargetServiceExecuteEvalTargetArgs) Field1DeepEqual(src *ExecuteEvalTargetRequest) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetArgs) Field1DeepEqual(src *SearchCustomEvalTargetRequest) bool { - if !p.Request.DeepEqual(src) { + if !p.Req.DeepEqual(src) { return false } return true } -type EvalTargetServiceExecuteEvalTargetResult struct { - Success *ExecuteEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,ExecuteEvalTargetResponse"` +type EvalTargetServiceSearchCustomEvalTargetResult struct { + Success *SearchCustomEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,SearchCustomEvalTargetResponse"` } -func NewEvalTargetServiceExecuteEvalTargetResult() *EvalTargetServiceExecuteEvalTargetResult { - return &EvalTargetServiceExecuteEvalTargetResult{} +func NewEvalTargetServiceSearchCustomEvalTargetResult() *EvalTargetServiceSearchCustomEvalTargetResult { + return &EvalTargetServiceSearchCustomEvalTargetResult{} } -func (p *EvalTargetServiceExecuteEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) InitDefault() { } -var EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT *ExecuteEvalTargetResponse +var EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT *SearchCustomEvalTargetResponse -func (p *EvalTargetServiceExecuteEvalTargetResult) GetSuccess() (v *ExecuteEvalTargetResponse) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) GetSuccess() (v *SearchCustomEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT + return EvalTargetServiceSearchCustomEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceExecuteEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*ExecuteEvalTargetResponse) +func (p *EvalTargetServiceSearchCustomEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*SearchCustomEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceExecuteEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceExecuteEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16164,7 +15044,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceSearchCustomEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16174,8 +15054,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewExecuteEvalTargetResponse() +func (p *EvalTargetServiceSearchCustomEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSearchCustomEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16183,9 +15063,9 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProt return nil } -func (p *EvalTargetServiceExecuteEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ExecuteEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("SearchCustomEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16211,7 +15091,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16230,15 +15110,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceExecuteEvalTargetResult) String() string { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceSearchCustomEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetResult) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) DeepEqual(ano *EvalTargetServiceSearchCustomEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16250,7 +15130,7 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServ return true } -func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteEvalTargetResponse) bool { +func (p *EvalTargetServiceSearchCustomEvalTargetResult) Field0DeepEqual(src *SearchCustomEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -16258,41 +15138,41 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteE return true } -type EvalTargetServiceGetEvalTargetRecordArgs struct { - Request *GetEvalTargetRecordRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetRecordRequest"` +type EvalTargetServiceExecuteEvalTargetArgs struct { + Request *ExecuteEvalTargetRequest `thrift:"request,1" frugal:"1,default,ExecuteEvalTargetRequest"` } -func NewEvalTargetServiceGetEvalTargetRecordArgs() *EvalTargetServiceGetEvalTargetRecordArgs { - return &EvalTargetServiceGetEvalTargetRecordArgs{} +func NewEvalTargetServiceExecuteEvalTargetArgs() *EvalTargetServiceExecuteEvalTargetArgs { + return &EvalTargetServiceExecuteEvalTargetArgs{} } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) InitDefault() { +func (p *EvalTargetServiceExecuteEvalTargetArgs) InitDefault() { } -var EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT *GetEvalTargetRecordRequest +var EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT *ExecuteEvalTargetRequest -func (p *EvalTargetServiceGetEvalTargetRecordArgs) GetRequest() (v *GetEvalTargetRecordRequest) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) GetRequest() (v *ExecuteEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT + return EvalTargetServiceExecuteEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) SetRequest(val *GetEvalTargetRecordRequest) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) SetRequest(val *ExecuteEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) IsSetRequest() bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16337,7 +15217,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16347,8 +15227,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetRecordRequest() +func (p *EvalTargetServiceExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewExecuteEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16356,9 +15236,9 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProt return nil } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetRecord_args"); err != nil { + if err = oprot.WriteStructBegin("ExecuteEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16384,7 +15264,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16401,15 +15281,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) String() string { +func (p *EvalTargetServiceExecuteEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordArgs) bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16421,7 +15301,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServ return true } -func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalTargetRecordRequest) bool { +func (p *EvalTargetServiceExecuteEvalTargetArgs) Field1DeepEqual(src *ExecuteEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -16429,41 +15309,41 @@ func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalT return true } -type EvalTargetServiceGetEvalTargetRecordResult struct { - Success *GetEvalTargetRecordResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetRecordResponse"` +type EvalTargetServiceExecuteEvalTargetResult struct { + Success *ExecuteEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,ExecuteEvalTargetResponse"` } -func NewEvalTargetServiceGetEvalTargetRecordResult() *EvalTargetServiceGetEvalTargetRecordResult { - return &EvalTargetServiceGetEvalTargetRecordResult{} +func NewEvalTargetServiceExecuteEvalTargetResult() *EvalTargetServiceExecuteEvalTargetResult { + return &EvalTargetServiceExecuteEvalTargetResult{} } -func (p *EvalTargetServiceGetEvalTargetRecordResult) InitDefault() { +func (p *EvalTargetServiceExecuteEvalTargetResult) InitDefault() { } -var EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT *GetEvalTargetRecordResponse +var EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT *ExecuteEvalTargetResponse -func (p *EvalTargetServiceGetEvalTargetRecordResult) GetSuccess() (v *GetEvalTargetRecordResponse) { +func (p *EvalTargetServiceExecuteEvalTargetResult) GetSuccess() (v *ExecuteEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT + return EvalTargetServiceExecuteEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceGetEvalTargetRecordResult) SetSuccess(x interface{}) { - p.Success = x.(*GetEvalTargetRecordResponse) +func (p *EvalTargetServiceExecuteEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*ExecuteEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceExecuteEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceGetEvalTargetRecordResult) IsSetSuccess() bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16508,7 +15388,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceExecuteEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16518,8 +15398,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetEvalTargetRecordResponse() +func (p *EvalTargetServiceExecuteEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewExecuteEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16527,9 +15407,9 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TPr return nil } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetEvalTargetRecord_result"); err != nil { + if err = oprot.WriteStructBegin("ExecuteEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16555,7 +15435,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceExecuteEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16574,15 +15454,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) String() string { +func (p *EvalTargetServiceExecuteEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceExecuteEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordResult) bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServiceExecuteEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16594,7 +15474,7 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetSe return true } -func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEvalTargetRecordResponse) bool { +func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -16602,41 +15482,41 @@ func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEva return true } -type EvalTargetServiceBatchGetEvalTargetRecordsArgs struct { - Request *BatchGetEvalTargetRecordsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetRecordsRequest"` +type EvalTargetServiceGetEvalTargetRecordArgs struct { + Request *GetEvalTargetRecordRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetRecordRequest"` } -func NewEvalTargetServiceBatchGetEvalTargetRecordsArgs() *EvalTargetServiceBatchGetEvalTargetRecordsArgs { - return &EvalTargetServiceBatchGetEvalTargetRecordsArgs{} +func NewEvalTargetServiceGetEvalTargetRecordArgs() *EvalTargetServiceGetEvalTargetRecordArgs { + return &EvalTargetServiceGetEvalTargetRecordArgs{} } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT *BatchGetEvalTargetRecordsRequest +var EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT *GetEvalTargetRecordRequest -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) GetRequest() (v *BatchGetEvalTargetRecordsRequest) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) GetRequest() (v *GetEvalTargetRecordRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT + return EvalTargetServiceGetEvalTargetRecordArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) SetRequest(val *BatchGetEvalTargetRecordsRequest) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) SetRequest(val *GetEvalTargetRecordRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) IsSetRequest() bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16681,7 +15561,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16691,8 +15571,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetRecordsRequest() +func (p *EvalTargetServiceGetEvalTargetRecordArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetRecordRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16700,9 +15580,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) ReadField1(iprot thrift return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_args"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetRecord_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16728,7 +15608,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16745,15 +15625,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) String() string { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordArgs(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsArgs) bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16765,7 +15645,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepEqual(ano *EvalTarg return true } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Field1DeepEqual(src *BatchGetEvalTargetRecordsRequest) bool { +func (p *EvalTargetServiceGetEvalTargetRecordArgs) Field1DeepEqual(src *GetEvalTargetRecordRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -16773,41 +15653,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Field1DeepEqual(src *Ba return true } -type EvalTargetServiceBatchGetEvalTargetRecordsResult struct { - Success *BatchGetEvalTargetRecordsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetRecordsResponse"` +type EvalTargetServiceGetEvalTargetRecordResult struct { + Success *GetEvalTargetRecordResponse `thrift:"success,0,optional" frugal:"0,optional,GetEvalTargetRecordResponse"` } -func NewEvalTargetServiceBatchGetEvalTargetRecordsResult() *EvalTargetServiceBatchGetEvalTargetRecordsResult { - return &EvalTargetServiceBatchGetEvalTargetRecordsResult{} +func NewEvalTargetServiceGetEvalTargetRecordResult() *EvalTargetServiceGetEvalTargetRecordResult { + return &EvalTargetServiceGetEvalTargetRecordResult{} } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) InitDefault() { +func (p *EvalTargetServiceGetEvalTargetRecordResult) InitDefault() { } -var EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT *BatchGetEvalTargetRecordsResponse +var EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT *GetEvalTargetRecordResponse -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) GetSuccess() (v *BatchGetEvalTargetRecordsResponse) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) GetSuccess() (v *GetEvalTargetRecordResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT + return EvalTargetServiceGetEvalTargetRecordResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) SetSuccess(x interface{}) { - p.Success = x.(*BatchGetEvalTargetRecordsResponse) +func (p *EvalTargetServiceGetEvalTargetRecordResult) SetSuccess(x interface{}) { + p.Success = x.(*GetEvalTargetRecordResponse) } -var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) IsSetSuccess() bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16852,7 +15732,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceGetEvalTargetRecordResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16862,8 +15742,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewBatchGetEvalTargetRecordsResponse() +func (p *EvalTargetServiceGetEvalTargetRecordResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetEvalTargetRecordResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16871,9 +15751,9 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thri return nil } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_result"); err != nil { + if err = oprot.WriteStructBegin("GetEvalTargetRecord_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16899,7 +15779,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceGetEvalTargetRecordResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16918,15 +15798,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) String() string { +func (p *EvalTargetServiceGetEvalTargetRecordResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceGetEvalTargetRecordResult(%+v)", *p) } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsResult) bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) DeepEqual(ano *EvalTargetServiceGetEvalTargetRecordResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -16938,7 +15818,7 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTa return true } -func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Field0DeepEqual(src *BatchGetEvalTargetRecordsResponse) bool { +func (p *EvalTargetServiceGetEvalTargetRecordResult) Field0DeepEqual(src *GetEvalTargetRecordResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -16946,41 +15826,41 @@ func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Field0DeepEqual(src * return true } -type EvalTargetServiceDebugEvalTargetArgs struct { - Request *DebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,DebugEvalTargetRequest"` +type EvalTargetServiceBatchGetEvalTargetRecordsArgs struct { + Request *BatchGetEvalTargetRecordsRequest `thrift:"request,1" frugal:"1,default,BatchGetEvalTargetRecordsRequest"` } -func NewEvalTargetServiceDebugEvalTargetArgs() *EvalTargetServiceDebugEvalTargetArgs { - return &EvalTargetServiceDebugEvalTargetArgs{} +func NewEvalTargetServiceBatchGetEvalTargetRecordsArgs() *EvalTargetServiceBatchGetEvalTargetRecordsArgs { + return &EvalTargetServiceBatchGetEvalTargetRecordsArgs{} } -func (p *EvalTargetServiceDebugEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) InitDefault() { } -var EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT *DebugEvalTargetRequest +var EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT *BatchGetEvalTargetRecordsRequest -func (p *EvalTargetServiceDebugEvalTargetArgs) GetRequest() (v *DebugEvalTargetRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) GetRequest() (v *BatchGetEvalTargetRecordsRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT + return EvalTargetServiceBatchGetEvalTargetRecordsArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceDebugEvalTargetArgs) SetRequest(val *DebugEvalTargetRequest) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) SetRequest(val *BatchGetEvalTargetRecordsRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceDebugEvalTargetArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceDebugEvalTargetArgs) IsSetRequest() bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17025,7 +15905,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17035,8 +15915,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDebugEvalTargetRequest() +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetRecordsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17044,9 +15924,9 @@ func (p *EvalTargetServiceDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol return nil } -func (p *EvalTargetServiceDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DebugEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17072,7 +15952,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17089,15 +15969,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetArgs) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceDebugEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsArgs(%+v)", *p) } -func (p *EvalTargetServiceDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceDebugEvalTargetArgs) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -17109,7 +15989,7 @@ func (p *EvalTargetServiceDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceD return true } -func (p *EvalTargetServiceDebugEvalTargetArgs) Field1DeepEqual(src *DebugEvalTargetRequest) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsArgs) Field1DeepEqual(src *BatchGetEvalTargetRecordsRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -17117,41 +15997,41 @@ func (p *EvalTargetServiceDebugEvalTargetArgs) Field1DeepEqual(src *DebugEvalTar return true } -type EvalTargetServiceDebugEvalTargetResult struct { - Success *DebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,DebugEvalTargetResponse"` +type EvalTargetServiceBatchGetEvalTargetRecordsResult struct { + Success *BatchGetEvalTargetRecordsResponse `thrift:"success,0,optional" frugal:"0,optional,BatchGetEvalTargetRecordsResponse"` } -func NewEvalTargetServiceDebugEvalTargetResult() *EvalTargetServiceDebugEvalTargetResult { - return &EvalTargetServiceDebugEvalTargetResult{} +func NewEvalTargetServiceBatchGetEvalTargetRecordsResult() *EvalTargetServiceBatchGetEvalTargetRecordsResult { + return &EvalTargetServiceBatchGetEvalTargetRecordsResult{} } -func (p *EvalTargetServiceDebugEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) InitDefault() { } -var EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT *DebugEvalTargetResponse +var EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT *BatchGetEvalTargetRecordsResponse -func (p *EvalTargetServiceDebugEvalTargetResult) GetSuccess() (v *DebugEvalTargetResponse) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) GetSuccess() (v *BatchGetEvalTargetRecordsResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT + return EvalTargetServiceBatchGetEvalTargetRecordsResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceDebugEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*DebugEvalTargetResponse) +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) SetSuccess(x interface{}) { + p.Success = x.(*BatchGetEvalTargetRecordsResponse) } -var fieldIDToName_EvalTargetServiceDebugEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceDebugEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17196,7 +16076,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceBatchGetEvalTargetRecordsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17206,8 +16086,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDebugEvalTargetResponse() +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewBatchGetEvalTargetRecordsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17215,9 +16095,9 @@ func (p *EvalTargetServiceDebugEvalTargetResult) ReadField0(iprot thrift.TProtoc return nil } -func (p *EvalTargetServiceDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DebugEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("BatchGetEvalTargetRecords_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17243,7 +16123,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17262,15 +16142,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceDebugEvalTargetResult) String() string { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceDebugEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceBatchGetEvalTargetRecordsResult(%+v)", *p) } -func (p *EvalTargetServiceDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceDebugEvalTargetResult) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) DeepEqual(ano *EvalTargetServiceBatchGetEvalTargetRecordsResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -17282,7 +16162,7 @@ func (p *EvalTargetServiceDebugEvalTargetResult) DeepEqual(ano *EvalTargetServic return true } -func (p *EvalTargetServiceDebugEvalTargetResult) Field0DeepEqual(src *DebugEvalTargetResponse) bool { +func (p *EvalTargetServiceBatchGetEvalTargetRecordsResult) Field0DeepEqual(src *BatchGetEvalTargetRecordsResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -17290,41 +16170,41 @@ func (p *EvalTargetServiceDebugEvalTargetResult) Field0DeepEqual(src *DebugEvalT return true } -type EvalTargetServiceAsyncDebugEvalTargetArgs struct { - Request *AsyncDebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,AsyncDebugEvalTargetRequest"` +type EvalTargetServiceDebugEvalTargetArgs struct { + Request *DebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,DebugEvalTargetRequest"` } -func NewEvalTargetServiceAsyncDebugEvalTargetArgs() *EvalTargetServiceAsyncDebugEvalTargetArgs { - return &EvalTargetServiceAsyncDebugEvalTargetArgs{} +func NewEvalTargetServiceDebugEvalTargetArgs() *EvalTargetServiceDebugEvalTargetArgs { + return &EvalTargetServiceDebugEvalTargetArgs{} } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) InitDefault() { +func (p *EvalTargetServiceDebugEvalTargetArgs) InitDefault() { } -var EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT *AsyncDebugEvalTargetRequest +var EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT *DebugEvalTargetRequest -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) GetRequest() (v *AsyncDebugEvalTargetRequest) { +func (p *EvalTargetServiceDebugEvalTargetArgs) GetRequest() (v *DebugEvalTargetRequest) { if p == nil { return } if !p.IsSetRequest() { - return EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT + return EvalTargetServiceDebugEvalTargetArgs_Request_DEFAULT } return p.Request } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) SetRequest(val *AsyncDebugEvalTargetRequest) { +func (p *EvalTargetServiceDebugEvalTargetArgs) SetRequest(val *DebugEvalTargetRequest) { p.Request = val } -var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs = map[int16]string{ +var fieldIDToName_EvalTargetServiceDebugEvalTargetArgs = map[int16]string{ 1: "request", } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) IsSetRequest() bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) IsSetRequest() bool { return p.Request != nil } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17369,7 +16249,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17379,8 +16259,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAsyncDebugEvalTargetRequest() +func (p *EvalTargetServiceDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDebugEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17388,9 +16268,9 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) ReadField1(iprot thrift.TPro return nil } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_args"); err != nil { + if err = oprot.WriteStructBegin("DebugEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17416,7 +16296,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17433,15 +16313,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) String() string { +func (p *EvalTargetServiceDebugEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceDebugEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetArgs) bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceDebugEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -17453,7 +16333,7 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) DeepEqual(ano *EvalTargetSer return true } -func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Field1DeepEqual(src *AsyncDebugEvalTargetRequest) bool { +func (p *EvalTargetServiceDebugEvalTargetArgs) Field1DeepEqual(src *DebugEvalTargetRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -17461,41 +16341,41 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Field1DeepEqual(src *AsyncDe return true } -type EvalTargetServiceAsyncDebugEvalTargetResult struct { - Success *AsyncDebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncDebugEvalTargetResponse"` +type EvalTargetServiceDebugEvalTargetResult struct { + Success *DebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,DebugEvalTargetResponse"` } -func NewEvalTargetServiceAsyncDebugEvalTargetResult() *EvalTargetServiceAsyncDebugEvalTargetResult { - return &EvalTargetServiceAsyncDebugEvalTargetResult{} +func NewEvalTargetServiceDebugEvalTargetResult() *EvalTargetServiceDebugEvalTargetResult { + return &EvalTargetServiceDebugEvalTargetResult{} } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) InitDefault() { +func (p *EvalTargetServiceDebugEvalTargetResult) InitDefault() { } -var EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT *AsyncDebugEvalTargetResponse +var EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT *DebugEvalTargetResponse -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) GetSuccess() (v *AsyncDebugEvalTargetResponse) { +func (p *EvalTargetServiceDebugEvalTargetResult) GetSuccess() (v *DebugEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT + return EvalTargetServiceDebugEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) SetSuccess(x interface{}) { - p.Success = x.(*AsyncDebugEvalTargetResponse) +func (p *EvalTargetServiceDebugEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*DebugEvalTargetResponse) } -var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceDebugEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) IsSetSuccess() bool { +func (p *EvalTargetServiceDebugEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17540,7 +16420,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceDebugEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17550,8 +16430,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewAsyncDebugEvalTargetResponse() +func (p *EvalTargetServiceDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDebugEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17559,9 +16439,9 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetResult) ReadField0(iprot thrift.TP return nil } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_result"); err != nil { + if err = oprot.WriteStructBegin("DebugEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17587,7 +16467,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17606,15 +16486,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) String() string { +func (p *EvalTargetServiceDebugEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceDebugEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetResult) bool { +func (p *EvalTargetServiceDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceDebugEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -17626,7 +16506,7 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepEqual(ano *EvalTargetS return true } -func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Field0DeepEqual(src *AsyncDebugEvalTargetResponse) bool { +func (p *EvalTargetServiceDebugEvalTargetResult) Field0DeepEqual(src *DebugEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -17634,41 +16514,41 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Field0DeepEqual(src *Async return true } -type EvalTargetServicePassbackEvalTargetInvokeResultArgs struct { - Req *PassbackEvalTargetInvokeResultRequest `thrift:"req,1" frugal:"1,default,PassbackEvalTargetInvokeResultRequest"` +type EvalTargetServiceAsyncDebugEvalTargetArgs struct { + Request *AsyncDebugEvalTargetRequest `thrift:"request,1" frugal:"1,default,AsyncDebugEvalTargetRequest"` } -func NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() *EvalTargetServicePassbackEvalTargetInvokeResultArgs { - return &EvalTargetServicePassbackEvalTargetInvokeResultArgs{} +func NewEvalTargetServiceAsyncDebugEvalTargetArgs() *EvalTargetServiceAsyncDebugEvalTargetArgs { + return &EvalTargetServiceAsyncDebugEvalTargetArgs{} } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) InitDefault() { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) InitDefault() { } -var EvalTargetServicePassbackEvalTargetInvokeResultArgs_Req_DEFAULT *PassbackEvalTargetInvokeResultRequest +var EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT *AsyncDebugEvalTargetRequest -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) GetReq() (v *PassbackEvalTargetInvokeResultRequest) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) GetRequest() (v *AsyncDebugEvalTargetRequest) { if p == nil { return } - if !p.IsSetReq() { - return EvalTargetServicePassbackEvalTargetInvokeResultArgs_Req_DEFAULT + if !p.IsSetRequest() { + return EvalTargetServiceAsyncDebugEvalTargetArgs_Request_DEFAULT } - return p.Req + return p.Request } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) SetReq(val *PassbackEvalTargetInvokeResultRequest) { - p.Req = val +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) SetRequest(val *AsyncDebugEvalTargetRequest) { + p.Request = val } -var fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs = map[int16]string{ - 1: "req", +var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs = map[int16]string{ + 1: "request", } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) IsSetReq() bool { - return p.Req != nil +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17713,7 +16593,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17723,18 +16603,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewPassbackEvalTargetInvokeResultRequest() +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAsyncDebugEvalTargetRequest() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Request = _field return nil } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResult_args"); err != nil { + if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17760,11 +16640,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -17777,69 +16657,69 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) String() string { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServicePassbackEvalTargetInvokeResultArgs(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetArgs(%+v)", *p) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) DeepEqual(ano *EvalTargetServicePassbackEvalTargetInvokeResultArgs) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Req) { + if !p.Field1DeepEqual(ano.Request) { return false } return true } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) Field1DeepEqual(src *PassbackEvalTargetInvokeResultRequest) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) Field1DeepEqual(src *AsyncDebugEvalTargetRequest) bool { - if !p.Req.DeepEqual(src) { + if !p.Request.DeepEqual(src) { return false } return true } -type EvalTargetServicePassbackEvalTargetInvokeResultResult struct { - Success *PassbackEvalTargetInvokeResultResponse `thrift:"success,0,optional" frugal:"0,optional,PassbackEvalTargetInvokeResultResponse"` +type EvalTargetServiceAsyncDebugEvalTargetResult struct { + Success *AsyncDebugEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncDebugEvalTargetResponse"` } -func NewEvalTargetServicePassbackEvalTargetInvokeResultResult() *EvalTargetServicePassbackEvalTargetInvokeResultResult { - return &EvalTargetServicePassbackEvalTargetInvokeResultResult{} +func NewEvalTargetServiceAsyncDebugEvalTargetResult() *EvalTargetServiceAsyncDebugEvalTargetResult { + return &EvalTargetServiceAsyncDebugEvalTargetResult{} } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) InitDefault() { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) InitDefault() { } -var EvalTargetServicePassbackEvalTargetInvokeResultResult_Success_DEFAULT *PassbackEvalTargetInvokeResultResponse +var EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT *AsyncDebugEvalTargetResponse -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) GetSuccess() (v *PassbackEvalTargetInvokeResultResponse) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) GetSuccess() (v *AsyncDebugEvalTargetResponse) { if p == nil { return } if !p.IsSetSuccess() { - return EvalTargetServicePassbackEvalTargetInvokeResultResult_Success_DEFAULT + return EvalTargetServiceAsyncDebugEvalTargetResult_Success_DEFAULT } return p.Success } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) SetSuccess(x interface{}) { - p.Success = x.(*PassbackEvalTargetInvokeResultResponse) +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*AsyncDebugEvalTargetResponse) } -var fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult = map[int16]string{ +var fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult = map[int16]string{ 0: "success", } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) IsSetSuccess() bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) IsSetSuccess() bool { return p.Success != nil } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Read(iprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17884,7 +16764,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncDebugEvalTargetResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17894,8 +16774,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewPassbackEvalTargetInvokeResultResponse() +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAsyncDebugEvalTargetResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17903,9 +16783,9 @@ func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) ReadField0(iprot return nil } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Write(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PassbackEvalTargetInvokeResult_result"); err != nil { + if err = oprot.WriteStructBegin("AsyncDebugEvalTarget_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17931,7 +16811,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17950,15 +16830,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) String() string { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) String() string { if p == nil { return "" } - return fmt.Sprintf("EvalTargetServicePassbackEvalTargetInvokeResultResult(%+v)", *p) + return fmt.Sprintf("EvalTargetServiceAsyncDebugEvalTargetResult(%+v)", *p) } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) DeepEqual(ano *EvalTargetServicePassbackEvalTargetInvokeResultResult) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepEqual(ano *EvalTargetServiceAsyncDebugEvalTargetResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -17970,7 +16850,7 @@ func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) DeepEqual(ano *E return true } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) Field0DeepEqual(src *PassbackEvalTargetInvokeResultResponse) bool { +func (p *EvalTargetServiceAsyncDebugEvalTargetResult) Field0DeepEqual(src *AsyncDebugEvalTargetResponse) bool { if !p.Success.DeepEqual(src) { return false diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go index 4cf7b167c..453fca6df 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go @@ -313,29 +313,3 @@ func (p *AsyncDebugEvalTargetResponse) IsValid() error { } return nil } -func (p *PassbackEvalTargetInvokeResultRequest) IsValid() error { - if p.Output != nil { - if err := p.Output.IsValid(); err != nil { - return fmt.Errorf("field Output not valid, %w", err) - } - } - if p.Usage != nil { - if err := p.Usage.IsValid(); err != nil { - return fmt.Errorf("field Usage not valid, %w", err) - } - } - if p.Base != nil { - if err := p.Base.IsValid(); err != nil { - return fmt.Errorf("field Base not valid, %w", err) - } - } - return nil -} -func (p *PassbackEvalTargetInvokeResultResponse) IsValid() error { - if p.BaseResp != nil { - if err := p.BaseResp.IsValid(); err != nil { - return fmt.Errorf("field BaseResp not valid, %w", err) - } - } - return nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go index 44ac06dc5..6900c6697 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go @@ -24,7 +24,6 @@ type Client interface { BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) - PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -120,8 +119,3 @@ func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, req ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.AsyncDebugEvalTarget(ctx, request) } - -func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go index 926b77bb0..61c1618fa 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go @@ -104,13 +104,6 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), - "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( - passbackEvalTargetInvokeResult_Handler, - newEvalTargetServicePassbackEvalTargetInvokeResultArgs, - newEvalTargetServicePassbackEvalTargetInvokeResultResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), } var ( @@ -391,25 +384,6 @@ func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() } -func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) - realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) - success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() -} - type kClient struct { c client.Client sc client.Streaming @@ -551,13 +525,3 @@ func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target } return _result.GetSuccess(), nil } - -func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs - _args.Req = req - var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult - if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 382d96af2..961a36396 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -8373,512 +8373,6 @@ func (p *AsyncDebugEvalTargetResponse) DeepCopy(s interface{}) error { return nil } -func (p *PassbackEvalTargetInvokeResultRequest) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField11(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.WorkspaceID = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.InvokeID = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Token = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField10(buf []byte) (int, error) { - offset := 0 - _field := spi.NewInvokeEvalTargetOutput() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Output = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField11(buf []byte) (int, error) { - offset := 0 - _field := spi.NewInvokeEvalTargetUsage() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Usage = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBase() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Base = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *PassbackEvalTargetInvokeResultRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) - offset += p.fastWriteField10(buf[offset:], w) - offset += p.fastWriteField11(buf[offset:], w) - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field10Length() - l += p.field11Length() - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetWorkspaceID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) - offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInvokeID() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) - offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetToken() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetOutput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) - offset += p.Output.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetUsage() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) - offset += p.Usage.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetBase() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.Base.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *PassbackEvalTargetInvokeResultRequest) field1Length() int { - l := 0 - if p.IsSetWorkspaceID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) field2Length() int { - l := 0 - if p.IsSetInvokeID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) field3Length() int { - l := 0 - if p.IsSetToken() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Token) - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) field10Length() int { - l := 0 - if p.IsSetOutput() { - l += thrift.Binary.FieldBeginLength() - l += p.Output.BLength() - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) field11Length() int { - l := 0 - if p.IsSetUsage() { - l += thrift.Binary.FieldBeginLength() - l += p.Usage.BLength() - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) field255Length() int { - l := 0 - if p.IsSetBase() { - l += thrift.Binary.FieldBeginLength() - l += p.Base.BLength() - } - return l -} - -func (p *PassbackEvalTargetInvokeResultRequest) DeepCopy(s interface{}) error { - src, ok := s.(*PassbackEvalTargetInvokeResultRequest) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - if src.WorkspaceID != nil { - tmp := *src.WorkspaceID - p.WorkspaceID = &tmp - } - - if src.InvokeID != nil { - tmp := *src.InvokeID - p.InvokeID = &tmp - } - - if src.Token != nil { - var tmp string - if *src.Token != "" { - tmp = kutils.StringDeepCopy(*src.Token) - } - p.Token = &tmp - } - - var _output *spi.InvokeEvalTargetOutput - if src.Output != nil { - _output = &spi.InvokeEvalTargetOutput{} - if err := _output.DeepCopy(src.Output); err != nil { - return err - } - } - p.Output = _output - - var _usage *spi.InvokeEvalTargetUsage - if src.Usage != nil { - _usage = &spi.InvokeEvalTargetUsage{} - if err := _usage.DeepCopy(src.Usage); err != nil { - return err - } - } - p.Usage = _usage - - var _base *base.Base - if src.Base != nil { - _base = &base.Base{} - if err := _base.DeepCopy(src.Base); err != nil { - return err - } - } - p.Base = _base - - return nil -} - -func (p *PassbackEvalTargetInvokeResultResponse) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 255: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField255(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PassbackEvalTargetInvokeResultResponse[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *PassbackEvalTargetInvokeResultResponse) FastReadField255(buf []byte) (int, error) { - offset := 0 - _field := base.NewBaseResp() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.BaseResp = _field - return offset, nil -} - -func (p *PassbackEvalTargetInvokeResultResponse) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *PassbackEvalTargetInvokeResultResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField255(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *PassbackEvalTargetInvokeResultResponse) BLength() int { - l := 0 - if p != nil { - l += p.field255Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *PassbackEvalTargetInvokeResultResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) - offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *PassbackEvalTargetInvokeResultResponse) field255Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.BaseResp.BLength() - return l -} - -func (p *PassbackEvalTargetInvokeResultResponse) DeepCopy(s interface{}) error { - src, ok := s.(*PassbackEvalTargetInvokeResultResponse) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _baseResp *base.BaseResp - if src.BaseResp != nil { - _baseResp = &base.BaseResp{} - if err := _baseResp.DeepCopy(src.BaseResp); err != nil { - return err - } - } - p.BaseResp = _baseResp - - return nil -} - func (p *EvalTargetServiceCreateEvalTargetArgs) FastRead(buf []byte) (int, error) { var err error @@ -11921,240 +11415,6 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetResult) DeepCopy(s interface{}) er return nil } -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - _field := NewPassbackEvalTargetInvokeResultRequest() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Req = _field - return offset, nil -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) BLength() int { - l := 0 - if p != nil { - l += p.field1Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) - offset += p.Req.FastWriteNocopy(buf[offset:], w) - return offset -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += p.Req.BLength() - return l -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServicePassbackEvalTargetInvokeResultArgs) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _req *PassbackEvalTargetInvokeResultRequest - if src.Req != nil { - _req = &PassbackEvalTargetInvokeResultRequest{} - if err := _req.DeepCopy(src.Req); err != nil { - return err - } - } - p.Req = _req - - return nil -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastRead(buf []byte) (int, error) { - - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - for { - fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - return offset, nil -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServicePassbackEvalTargetInvokeResultResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - _field := NewPassbackEvalTargetInvokeResultResponse() - if l, err := _field.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = _field - return offset, nil -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastWrite(buf []byte) int { - return p.FastWriteNocopy(buf, nil) -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField0(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) BLength() int { - l := 0 - if p != nil { - l += p.field0Length() - } - l += thrift.Binary.FieldStopLength() - return l -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], w) - } - return offset -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += thrift.Binary.FieldBeginLength() - l += p.Success.BLength() - } - return l -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) DeepCopy(s interface{}) error { - src, ok := s.(*EvalTargetServicePassbackEvalTargetInvokeResultResult) - if !ok { - return fmt.Errorf("%T's type not matched %T", s, p) - } - - var _success *PassbackEvalTargetInvokeResultResponse - if src.Success != nil { - _success = &PassbackEvalTargetInvokeResultResponse{} - if err := _success.DeepCopy(src.Success); err != nil { - return err - } - } - p.Success = _success - - return nil -} - func (p *EvalTargetServiceCreateEvalTargetArgs) GetFirstArgument() interface{} { return p.Request } @@ -12258,11 +11518,3 @@ func (p *EvalTargetServiceAsyncDebugEvalTargetArgs) GetFirstArgument() interface func (p *EvalTargetServiceAsyncDebugEvalTargetResult) GetResult() interface{} { return p.Success } - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultArgs) GetFirstArgument() interface{} { - return p.Req -} - -func (p *EvalTargetServicePassbackEvalTargetInvokeResultResult) GetResult() interface{} { - return p.Success -} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/client.go new file mode 100644 index 000000000..99ffd25bc --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/client.go @@ -0,0 +1,49 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalopenapiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvalOpenAPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvalOpenAPIServiceClient struct { + *kClient +} + +func (p *kEvalOpenAPIServiceClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ReportEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/evalopenapiservice.go b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/evalopenapiservice.go new file mode 100644 index 000000000..fab4edb95 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/evalopenapiservice.go @@ -0,0 +1,96 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalopenapiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "ReportEvalTargetInvokeResult": kitex.NewMethodInfo( + reportEvalTargetInvokeResult_Handler, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evalOpenAPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evalOpenAPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvalOpenAPIService" + handlerType := (*evaluation.EvalOpenAPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "evaluation", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func reportEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) + realResult := result.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) + success, err := handler.(openapi.EvaluationOpenAPIService).ReportEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + var _args openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs + _args.Req = req + var _result openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "ReportEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/server.go new file mode 100644 index 000000000..e0baa0c4d --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalopenapiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evalopenapiservice + +import ( + server "github.com/cloudwego/kitex/server" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler evaluation.EvalOpenAPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler evaluation.EvalOpenAPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go index 44ac06dc5..6900c6697 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go @@ -24,7 +24,6 @@ type Client interface { BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncDebugEvalTargetResponse, err error) - PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -120,8 +119,3 @@ func (p *kEvalTargetServiceClient) AsyncDebugEvalTarget(ctx context.Context, req ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.AsyncDebugEvalTarget(ctx, request) } - -func (p *kEvalTargetServiceClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.PassbackEvalTargetInvokeResult_(ctx, req) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go index f97d8c6b5..92a130237 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go @@ -105,13 +105,6 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), - "PassbackEvalTargetInvokeResult": kitex.NewMethodInfo( - passbackEvalTargetInvokeResult_Handler, - newEvalTargetServicePassbackEvalTargetInvokeResultArgs, - newEvalTargetServicePassbackEvalTargetInvokeResultResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), } var ( @@ -392,25 +385,6 @@ func newEvalTargetServiceAsyncDebugEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceAsyncDebugEvalTargetResult() } -func passbackEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) - realResult := result.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) - success, err := handler.(eval_target.EvalTargetService).PassbackEvalTargetInvokeResult_(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultArgs() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultArgs() -} - -func newEvalTargetServicePassbackEvalTargetInvokeResultResult() interface{} { - return eval_target.NewEvalTargetServicePassbackEvalTargetInvokeResultResult() -} - type kClient struct { c client.Client sc client.Streaming @@ -552,13 +526,3 @@ func (p *kClient) AsyncDebugEvalTarget(ctx context.Context, request *eval_target } return _result.GetSuccess(), nil } - -func (p *kClient) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - var _args eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs - _args.Req = req - var _result eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult - if err = p.c.Call(ctx, "PassbackEvalTargetInvokeResult", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go index 902326619..d51f9b68d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go @@ -14,6 +14,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" ) var ( @@ -21,6 +22,7 @@ var ( _ = eval_target.KitexUnusedProtection _ = evaluator.KitexUnusedProtection _ = expt.KitexUnusedProtection + _ = openapi.KitexUnusedProtection ) // unused protection diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go new file mode 100644 index 000000000..e32c88ce8 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go @@ -0,0 +1,1279 @@ +// Code generated by thriftgo (0.4.1). DO NOT EDIT. + +package openapi + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" + "strings" +) + +type ReportEvalTargetInvokeResultRequest struct { + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" json:"invoke_id" form:"invoke_id" query:"invoke_id"` + Status *spi.InvokeEvalTargetStatus `thrift:"status,3,optional" frugal:"3,optional,InvokeEvalTargetStatus" form:"status" json:"status,omitempty" query:"status"` + // set output if status=SUCCESS + Output *spi.InvokeEvalTargetOutput `thrift:"output,10,optional" frugal:"10,optional,spi.InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` + // set output if status=SUCCESS + Usage *spi.InvokeEvalTargetUsage `thrift:"usage,11,optional" frugal:"11,optional,spi.InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` + // set error_message if status=FAILED + ErrorMessage *string `thrift:"error_message,20,optional" frugal:"20,optional,string" form:"error_message" json:"error_message,omitempty" query:"error_message"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` +} + +func NewReportEvalTargetInvokeResultRequest() *ReportEvalTargetInvokeResultRequest { + return &ReportEvalTargetInvokeResultRequest{} +} + +func (p *ReportEvalTargetInvokeResultRequest) InitDefault() { +} + +var ReportEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT int64 + +func (p *ReportEvalTargetInvokeResultRequest) GetWorkspaceID() (v int64) { + if p == nil { + return + } + if !p.IsSetWorkspaceID() { + return ReportEvalTargetInvokeResultRequest_WorkspaceID_DEFAULT + } + return *p.WorkspaceID +} + +var ReportEvalTargetInvokeResultRequest_InvokeID_DEFAULT int64 + +func (p *ReportEvalTargetInvokeResultRequest) GetInvokeID() (v int64) { + if p == nil { + return + } + if !p.IsSetInvokeID() { + return ReportEvalTargetInvokeResultRequest_InvokeID_DEFAULT + } + return *p.InvokeID +} + +var ReportEvalTargetInvokeResultRequest_Status_DEFAULT spi.InvokeEvalTargetStatus + +func (p *ReportEvalTargetInvokeResultRequest) GetStatus() (v spi.InvokeEvalTargetStatus) { + if p == nil { + return + } + if !p.IsSetStatus() { + return ReportEvalTargetInvokeResultRequest_Status_DEFAULT + } + return *p.Status +} + +var ReportEvalTargetInvokeResultRequest_Output_DEFAULT *spi.InvokeEvalTargetOutput + +func (p *ReportEvalTargetInvokeResultRequest) GetOutput() (v *spi.InvokeEvalTargetOutput) { + if p == nil { + return + } + if !p.IsSetOutput() { + return ReportEvalTargetInvokeResultRequest_Output_DEFAULT + } + return p.Output +} + +var ReportEvalTargetInvokeResultRequest_Usage_DEFAULT *spi.InvokeEvalTargetUsage + +func (p *ReportEvalTargetInvokeResultRequest) GetUsage() (v *spi.InvokeEvalTargetUsage) { + if p == nil { + return + } + if !p.IsSetUsage() { + return ReportEvalTargetInvokeResultRequest_Usage_DEFAULT + } + return p.Usage +} + +var ReportEvalTargetInvokeResultRequest_ErrorMessage_DEFAULT string + +func (p *ReportEvalTargetInvokeResultRequest) GetErrorMessage() (v string) { + if p == nil { + return + } + if !p.IsSetErrorMessage() { + return ReportEvalTargetInvokeResultRequest_ErrorMessage_DEFAULT + } + return *p.ErrorMessage +} + +var ReportEvalTargetInvokeResultRequest_Base_DEFAULT *base.Base + +func (p *ReportEvalTargetInvokeResultRequest) GetBase() (v *base.Base) { + if p == nil { + return + } + if !p.IsSetBase() { + return ReportEvalTargetInvokeResultRequest_Base_DEFAULT + } + return p.Base +} +func (p *ReportEvalTargetInvokeResultRequest) SetWorkspaceID(val *int64) { + p.WorkspaceID = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetInvokeID(val *int64) { + p.InvokeID = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetStatus(val *spi.InvokeEvalTargetStatus) { + p.Status = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetOutput(val *spi.InvokeEvalTargetOutput) { + p.Output = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetUsage(val *spi.InvokeEvalTargetUsage) { + p.Usage = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetErrorMessage(val *string) { + p.ErrorMessage = val +} +func (p *ReportEvalTargetInvokeResultRequest) SetBase(val *base.Base) { + p.Base = val +} + +var fieldIDToName_ReportEvalTargetInvokeResultRequest = map[int16]string{ + 1: "workspace_id", + 2: "invoke_id", + 3: "status", + 10: "output", + 11: "usage", + 20: "error_message", + 255: "Base", +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetWorkspaceID() bool { + return p.WorkspaceID != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetInvokeID() bool { + return p.InvokeID != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetStatus() bool { + return p.Status != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetOutput() bool { + return p.Output != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetUsage() bool { + return p.Usage != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetErrorMessage() bool { + return p.ErrorMessage != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *ReportEvalTargetInvokeResultRequest) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I32 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 20: + if fieldTypeId == thrift.STRING { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReportEvalTargetInvokeResultRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.WorkspaceID = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InvokeID = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *spi.InvokeEvalTargetStatus + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := spi.InvokeEvalTargetStatus(v) + _field = &tmp + } + p.Status = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField10(iprot thrift.TProtocol) error { + _field := spi.NewInvokeEvalTargetOutput() + if err := _field.Read(iprot); err != nil { + return err + } + p.Output = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField11(iprot thrift.TProtocol) error { + _field := spi.NewInvokeEvalTargetUsage() + if err := _field.Read(iprot); err != nil { + return err + } + p.Usage = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField20(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ErrorMessage = _field + return nil +} +func (p *ReportEvalTargetInvokeResultRequest) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *ReportEvalTargetInvokeResultRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ReportEvalTargetInvokeResultRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetWorkspaceID() { + if err = oprot.WriteFieldBegin("workspace_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.WorkspaceID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeID() { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetStatus() { + if err = oprot.WriteFieldBegin("status", thrift.I32, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.Status)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetOutput() { + if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.Output.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetUsage() { + if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Usage.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMessage() { + if err = oprot.WriteFieldBegin("error_message", thrift.STRING, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ErrorMessage); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} +func (p *ReportEvalTargetInvokeResultRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReportEvalTargetInvokeResultRequest(%+v)", *p) + +} + +func (p *ReportEvalTargetInvokeResultRequest) DeepEqual(ano *ReportEvalTargetInvokeResultRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field2DeepEqual(ano.InvokeID) { + return false + } + if !p.Field3DeepEqual(ano.Status) { + return false + } + if !p.Field10DeepEqual(ano.Output) { + return false + } + if !p.Field11DeepEqual(ano.Usage) { + return false + } + if !p.Field20DeepEqual(ano.ErrorMessage) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *ReportEvalTargetInvokeResultRequest) Field1DeepEqual(src *int64) bool { + + if p.WorkspaceID == src { + return true + } else if p.WorkspaceID == nil || src == nil { + return false + } + if *p.WorkspaceID != *src { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field2DeepEqual(src *int64) bool { + + if p.InvokeID == src { + return true + } else if p.InvokeID == nil || src == nil { + return false + } + if *p.InvokeID != *src { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field3DeepEqual(src *spi.InvokeEvalTargetStatus) bool { + + if p.Status == src { + return true + } else if p.Status == nil || src == nil { + return false + } + if *p.Status != *src { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field10DeepEqual(src *spi.InvokeEvalTargetOutput) bool { + + if !p.Output.DeepEqual(src) { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field11DeepEqual(src *spi.InvokeEvalTargetUsage) bool { + + if !p.Usage.DeepEqual(src) { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field20DeepEqual(src *string) bool { + + if p.ErrorMessage == src { + return true + } else if p.ErrorMessage == nil || src == nil { + return false + } + if strings.Compare(*p.ErrorMessage, *src) != 0 { + return false + } + return true +} +func (p *ReportEvalTargetInvokeResultRequest) Field255DeepEqual(src *base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type ReportEvalTargetInvokeResultResponse struct { + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` +} + +func NewReportEvalTargetInvokeResultResponse() *ReportEvalTargetInvokeResultResponse { + return &ReportEvalTargetInvokeResultResponse{} +} + +func (p *ReportEvalTargetInvokeResultResponse) InitDefault() { +} + +var ReportEvalTargetInvokeResultResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *ReportEvalTargetInvokeResultResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return ReportEvalTargetInvokeResultResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *ReportEvalTargetInvokeResultResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_ReportEvalTargetInvokeResultResponse = map[int16]string{ + 255: "BaseResp", +} + +func (p *ReportEvalTargetInvokeResultResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *ReportEvalTargetInvokeResultResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReportEvalTargetInvokeResultResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *ReportEvalTargetInvokeResultResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ReportEvalTargetInvokeResultResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ReportEvalTargetInvokeResultResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReportEvalTargetInvokeResultResponse(%+v)", *p) + +} + +func (p *ReportEvalTargetInvokeResultResponse) DeepEqual(ano *ReportEvalTargetInvokeResultResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *ReportEvalTargetInvokeResultResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type EvaluationOpenAPIService interface { + ReportEvalTargetInvokeResult_(ctx context.Context, req *ReportEvalTargetInvokeResultRequest) (r *ReportEvalTargetInvokeResultResponse, err error) +} + +type EvaluationOpenAPIServiceClient struct { + c thrift.TClient +} + +func NewEvaluationOpenAPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvaluationOpenAPIServiceClient { + return &EvaluationOpenAPIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewEvaluationOpenAPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvaluationOpenAPIServiceClient { + return &EvaluationOpenAPIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewEvaluationOpenAPIServiceClient(c thrift.TClient) *EvaluationOpenAPIServiceClient { + return &EvaluationOpenAPIServiceClient{ + c: c, + } +} + +func (p *EvaluationOpenAPIServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *EvaluationOpenAPIServiceClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *ReportEvalTargetInvokeResultRequest) (r *ReportEvalTargetInvokeResultResponse, err error) { + var _args EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs + _args.Req = req + var _result EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult + if err = p.Client_().Call(ctx, "ReportEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type EvaluationOpenAPIServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler EvaluationOpenAPIService +} + +func (p *EvaluationOpenAPIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *EvaluationOpenAPIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *EvaluationOpenAPIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewEvaluationOpenAPIServiceProcessor(handler EvaluationOpenAPIService) *EvaluationOpenAPIServiceProcessor { + self := &EvaluationOpenAPIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("ReportEvalTargetInvokeResult", &evaluationOpenAPIServiceProcessorReportEvalTargetInvokeResult_{handler: handler}) + return self +} +func (p *EvaluationOpenAPIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type evaluationOpenAPIServiceProcessorReportEvalTargetInvokeResult_ struct { + handler EvaluationOpenAPIService +} + +func (p *evaluationOpenAPIServiceProcessorReportEvalTargetInvokeResult_) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ReportEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult{} + var retval *ReportEvalTargetInvokeResultResponse + if retval, err2 = p.handler.ReportEvalTargetInvokeResult_(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ReportEvalTargetInvokeResult: "+err2.Error()) + oprot.WriteMessageBegin("ReportEvalTargetInvokeResult", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ReportEvalTargetInvokeResult", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs struct { + Req *ReportEvalTargetInvokeResultRequest `thrift:"req,1" frugal:"1,default,ReportEvalTargetInvokeResultRequest"` +} + +func NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs { + return &EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs{} +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) InitDefault() { +} + +var EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs_Req_DEFAULT *ReportEvalTargetInvokeResultRequest + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) GetReq() (v *ReportEvalTargetInvokeResultRequest) { + if p == nil { + return + } + if !p.IsSetReq() { + return EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs_Req_DEFAULT + } + return p.Req +} +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) SetReq(val *ReportEvalTargetInvokeResultRequest) { + p.Req = val +} + +var fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs = map[int16]string{ + 1: "req", +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewReportEvalTargetInvokeResultRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ReportEvalTargetInvokeResult_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs(%+v)", *p) + +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) DeepEqual(ano *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) Field1DeepEqual(src *ReportEvalTargetInvokeResultRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult struct { + Success *ReportEvalTargetInvokeResultResponse `thrift:"success,0,optional" frugal:"0,optional,ReportEvalTargetInvokeResultResponse"` +} + +func NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult { + return &EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult{} +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) InitDefault() { +} + +var EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult_Success_DEFAULT *ReportEvalTargetInvokeResultResponse + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) GetSuccess() (v *ReportEvalTargetInvokeResultResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult_Success_DEFAULT + } + return p.Success +} +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) SetSuccess(x interface{}) { + p.Success = x.(*ReportEvalTargetInvokeResultResponse) +} + +var fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult = map[int16]string{ + 0: "success", +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewReportEvalTargetInvokeResultResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ReportEvalTargetInvokeResult_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult(%+v)", *p) + +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) DeepEqual(ano *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) Field0DeepEqual(src *ReportEvalTargetInvokeResultResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi_validator.go b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi_validator.go new file mode 100644 index 000000000..25999bd66 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi_validator.go @@ -0,0 +1,49 @@ +// Code generated by Validator v0.2.6. DO NOT EDIT. + +package openapi + +import ( + "bytes" + "fmt" + "reflect" + "regexp" + "strings" + "time" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = (*regexp.Regexp)(nil) + _ = time.Nanosecond +) + +func (p *ReportEvalTargetInvokeResultRequest) IsValid() error { + if p.Output != nil { + if err := p.Output.IsValid(); err != nil { + return fmt.Errorf("field Output not valid, %w", err) + } + } + if p.Usage != nil { + if err := p.Usage.IsValid(); err != nil { + return fmt.Errorf("field Usage not valid, %w", err) + } + } + if p.Base != nil { + if err := p.Base.IsValid(); err != nil { + return fmt.Errorf("field Base not valid, %w", err) + } + } + return nil +} +func (p *ReportEvalTargetInvokeResultResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/client.go new file mode 100644 index 000000000..16ab1f6bf --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/client.go @@ -0,0 +1,49 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationopenapiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvaluationOpenAPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvaluationOpenAPIServiceClient struct { + *kClient +} + +func (p *kEvaluationOpenAPIServiceClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ReportEvalTargetInvokeResult_(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/evaluationopenapiservice.go b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/evaluationopenapiservice.go new file mode 100644 index 000000000..a580b0276 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/evaluationopenapiservice.go @@ -0,0 +1,95 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evaluationopenapiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "ReportEvalTargetInvokeResult": kitex.NewMethodInfo( + reportEvalTargetInvokeResult_Handler, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs, + newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evaluationOpenAPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evaluationOpenAPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvaluationOpenAPIService" + handlerType := (*openapi.EvaluationOpenAPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "openapi", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func reportEvalTargetInvokeResult_Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) + realResult := result.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) + success, err := handler.(openapi.EvaluationOpenAPIService).ReportEvalTargetInvokeResult_(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs() +} + +func newEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() interface{} { + return openapi.NewEvaluationOpenAPIServiceReportEvalTargetInvokeResultResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + var _args openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs + _args.Req = req + var _result openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult + if err = p.c.Call(ctx, "ReportEvalTargetInvokeResult", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/server.go new file mode 100644 index 000000000..6f5cc6a25 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/evaluationopenapiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evaluationopenapiservice + +import ( + server "github.com/cloudwego/kitex/server" + openapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler openapi.EvaluationOpenAPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler openapi.EvaluationOpenAPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/k-consts.go b/backend/kitex_gen/coze/loop/evaluation/openapi/k-consts.go new file mode 100644 index 000000000..c6e6b68d1 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/k-consts.go @@ -0,0 +1,4 @@ +package openapi + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go b/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go new file mode 100644 index 000000000..eb1c1cbaf --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go @@ -0,0 +1,833 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package openapi + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cloudwego/gopkg/protocol/thrift" + kutils "github.com/cloudwego/kitex/pkg/utils" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +var ( + _ = base.KitexUnusedProtection + _ = spi.KitexUnusedProtection +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.STOP +) + +func (p *ReportEvalTargetInvokeResultRequest) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 20: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReportEvalTargetInvokeResultRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.WorkspaceID = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InvokeID = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *spi.InvokeEvalTargetStatus + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := spi.InvokeEvalTargetStatus(v) + _field = &tmp + } + p.Status = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + _field := spi.NewInvokeEvalTargetOutput() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Output = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := spi.NewInvokeEvalTargetUsage() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Usage = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField20(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ErrorMessage = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBase() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *ReportEvalTargetInvokeResultRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field10Length() + l += p.field11Length() + l += p.field20Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetWorkspaceID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.WorkspaceID) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 2) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStatus() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 3) + offset += thrift.Binary.WriteI32(buf[offset:], int32(*p.Status)) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetOutput() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) + offset += p.Output.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUsage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.Usage.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetErrorMessage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 20) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ErrorMessage) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ReportEvalTargetInvokeResultRequest) field1Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field2Length() int { + l := 0 + if p.IsSetInvokeID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field3Length() int { + l := 0 + if p.IsSetStatus() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field10Length() int { + l := 0 + if p.IsSetOutput() { + l += thrift.Binary.FieldBeginLength() + l += p.Output.BLength() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field11Length() int { + l := 0 + if p.IsSetUsage() { + l += thrift.Binary.FieldBeginLength() + l += p.Usage.BLength() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field20Length() int { + l := 0 + if p.IsSetErrorMessage() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ErrorMessage) + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *ReportEvalTargetInvokeResultRequest) DeepCopy(s interface{}) error { + src, ok := s.(*ReportEvalTargetInvokeResultRequest) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.InvokeID != nil { + tmp := *src.InvokeID + p.InvokeID = &tmp + } + + if src.Status != nil { + tmp := *src.Status + p.Status = &tmp + } + + var _output *spi.InvokeEvalTargetOutput + if src.Output != nil { + _output = &spi.InvokeEvalTargetOutput{} + if err := _output.DeepCopy(src.Output); err != nil { + return err + } + } + p.Output = _output + + var _usage *spi.InvokeEvalTargetUsage + if src.Usage != nil { + _usage = &spi.InvokeEvalTargetUsage{} + if err := _usage.DeepCopy(src.Usage); err != nil { + return err + } + } + p.Usage = _usage + + if src.ErrorMessage != nil { + var tmp string + if *src.ErrorMessage != "" { + tmp = kutils.StringDeepCopy(*src.ErrorMessage) + } + p.ErrorMessage = &tmp + } + + var _base *base.Base + if src.Base != nil { + _base = &base.Base{} + if err := _base.DeepCopy(src.Base); err != nil { + return err + } + } + p.Base = _base + + return nil +} + +func (p *ReportEvalTargetInvokeResultResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReportEvalTargetInvokeResultResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *ReportEvalTargetInvokeResultResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *ReportEvalTargetInvokeResultResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *ReportEvalTargetInvokeResultResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *ReportEvalTargetInvokeResultResponse) BLength() int { + l := 0 + if p != nil { + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *ReportEvalTargetInvokeResultResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *ReportEvalTargetInvokeResultResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *ReportEvalTargetInvokeResultResponse) DeepCopy(s interface{}) error { + src, ok := s.(*ReportEvalTargetInvokeResultResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewReportEvalTargetInvokeResultRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _req *ReportEvalTargetInvokeResultRequest + if src.Req != nil { + _req = &ReportEvalTargetInvokeResultRequest{} + if err := _req.DeepCopy(src.Req); err != nil { + return err + } + } + p.Req = _req + + return nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewReportEvalTargetInvokeResultResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *ReportEvalTargetInvokeResultResponse + if src.Success != nil { + _success = &ReportEvalTargetInvokeResultResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) GetResult() interface{} { + return p.Success +} diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go index 7808c012a..b51b5e25d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go +++ b/backend/kitex_gen/coze/loop/evaluation/spi/coze.loop.evaluation.spi.go @@ -4,6 +4,8 @@ package spi import ( "context" + "database/sql" + "database/sql/driver" "fmt" "github.com/apache/thrift/lib/go/thrift" "github.com/coze-dev/coze-loop/backend/kitex_gen/base" @@ -18,6 +20,53 @@ const ( ContentTypeMultiPart = "multi_part" ) +type InvokeEvalTargetStatus int64 + +const ( + InvokeEvalTargetStatus_UNKNOWN InvokeEvalTargetStatus = 0 + InvokeEvalTargetStatus_SUCCESS InvokeEvalTargetStatus = 1 + InvokeEvalTargetStatus_FAILED InvokeEvalTargetStatus = 2 +) + +func (p InvokeEvalTargetStatus) String() string { + switch p { + case InvokeEvalTargetStatus_UNKNOWN: + return "UNKNOWN" + case InvokeEvalTargetStatus_SUCCESS: + return "SUCCESS" + case InvokeEvalTargetStatus_FAILED: + return "FAILED" + } + return "" +} + +func InvokeEvalTargetStatusFromString(s string) (InvokeEvalTargetStatus, error) { + switch s { + case "UNKNOWN": + return InvokeEvalTargetStatus_UNKNOWN, nil + case "SUCCESS": + return InvokeEvalTargetStatus_SUCCESS, nil + case "FAILED": + return InvokeEvalTargetStatus_FAILED, nil + } + return InvokeEvalTargetStatus(0), fmt.Errorf("not a valid InvokeEvalTargetStatus string") +} + +func InvokeEvalTargetStatusPtr(v InvokeEvalTargetStatus) *InvokeEvalTargetStatus { return &v } +func (p *InvokeEvalTargetStatus) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = InvokeEvalTargetStatus(result.Int64) + return +} + +func (p *InvokeEvalTargetStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + type ContentType = string type SearchEvalTargetRequest struct { @@ -1764,11 +1813,14 @@ func (p *InvokeEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { } type InvokeEvalTargetResponse struct { - // 输出 - Output *InvokeEvalTargetOutput `thrift:"output,1,optional" frugal:"1,optional,InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` - // 消耗 - Usage *InvokeEvalTargetUsage `thrift:"usage,2,optional" frugal:"2,optional,InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` - BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` + Status *InvokeEvalTargetStatus `thrift:"status,1,optional" frugal:"1,optional,InvokeEvalTargetStatus" form:"status" json:"status,omitempty" query:"status"` + // set output if status=SUCCESS + Output *InvokeEvalTargetOutput `thrift:"output,2,optional" frugal:"2,optional,InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` + // set usage if status=SUCCESS + Usage *InvokeEvalTargetUsage `thrift:"usage,3,optional" frugal:"3,optional,InvokeEvalTargetUsage" form:"usage" json:"usage,omitempty" query:"usage"` + // set error_message if status=FAILED + ErrorMessage *string `thrift:"error_message,10,optional" frugal:"10,optional,string" form:"error_message" json:"error_message,omitempty" query:"error_message"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"-" json:"-" query:"-"` } func NewInvokeEvalTargetResponse() *InvokeEvalTargetResponse { @@ -1778,6 +1830,18 @@ func NewInvokeEvalTargetResponse() *InvokeEvalTargetResponse { func (p *InvokeEvalTargetResponse) InitDefault() { } +var InvokeEvalTargetResponse_Status_DEFAULT InvokeEvalTargetStatus + +func (p *InvokeEvalTargetResponse) GetStatus() (v InvokeEvalTargetStatus) { + if p == nil { + return + } + if !p.IsSetStatus() { + return InvokeEvalTargetResponse_Status_DEFAULT + } + return *p.Status +} + var InvokeEvalTargetResponse_Output_DEFAULT *InvokeEvalTargetOutput func (p *InvokeEvalTargetResponse) GetOutput() (v *InvokeEvalTargetOutput) { @@ -1802,6 +1866,18 @@ func (p *InvokeEvalTargetResponse) GetUsage() (v *InvokeEvalTargetUsage) { return p.Usage } +var InvokeEvalTargetResponse_ErrorMessage_DEFAULT string + +func (p *InvokeEvalTargetResponse) GetErrorMessage() (v string) { + if p == nil { + return + } + if !p.IsSetErrorMessage() { + return InvokeEvalTargetResponse_ErrorMessage_DEFAULT + } + return *p.ErrorMessage +} + var InvokeEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp func (p *InvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { @@ -1813,22 +1889,34 @@ func (p *InvokeEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { } return p.BaseResp } +func (p *InvokeEvalTargetResponse) SetStatus(val *InvokeEvalTargetStatus) { + p.Status = val +} func (p *InvokeEvalTargetResponse) SetOutput(val *InvokeEvalTargetOutput) { p.Output = val } func (p *InvokeEvalTargetResponse) SetUsage(val *InvokeEvalTargetUsage) { p.Usage = val } +func (p *InvokeEvalTargetResponse) SetErrorMessage(val *string) { + p.ErrorMessage = val +} func (p *InvokeEvalTargetResponse) SetBaseResp(val *base.BaseResp) { p.BaseResp = val } var fieldIDToName_InvokeEvalTargetResponse = map[int16]string{ - 1: "output", - 2: "usage", + 1: "status", + 2: "output", + 3: "usage", + 10: "error_message", 255: "BaseResp", } +func (p *InvokeEvalTargetResponse) IsSetStatus() bool { + return p.Status != nil +} + func (p *InvokeEvalTargetResponse) IsSetOutput() bool { return p.Output != nil } @@ -1837,6 +1925,10 @@ func (p *InvokeEvalTargetResponse) IsSetUsage() bool { return p.Usage != nil } +func (p *InvokeEvalTargetResponse) IsSetErrorMessage() bool { + return p.ErrorMessage != nil +} + func (p *InvokeEvalTargetResponse) IsSetBaseResp() bool { return p.BaseResp != nil } @@ -1860,7 +1952,7 @@ func (p *InvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I32 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -1875,6 +1967,22 @@ func (p *InvokeEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 255: if fieldTypeId == thrift.STRUCT { if err = p.ReadField255(iprot); err != nil { @@ -1913,6 +2021,18 @@ ReadStructEndError: } func (p *InvokeEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field *InvokeEvalTargetStatus + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := InvokeEvalTargetStatus(v) + _field = &tmp + } + p.Status = _field + return nil +} +func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { _field := NewInvokeEvalTargetOutput() if err := _field.Read(iprot); err != nil { return err @@ -1920,7 +2040,7 @@ func (p *InvokeEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { p.Output = _field return nil } -func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *InvokeEvalTargetResponse) ReadField3(iprot thrift.TProtocol) error { _field := NewInvokeEvalTargetUsage() if err := _field.Read(iprot); err != nil { return err @@ -1928,6 +2048,17 @@ func (p *InvokeEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { p.Usage = _field return nil } +func (p *InvokeEvalTargetResponse) ReadField10(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ErrorMessage = _field + return nil +} func (p *InvokeEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBaseResp() if err := _field.Read(iprot); err != nil { @@ -1951,6 +2082,14 @@ func (p *InvokeEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -1974,11 +2113,11 @@ WriteStructEndError: } func (p *InvokeEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetOutput() { - if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 1); err != nil { + if p.IsSetStatus() { + if err = oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil { goto WriteFieldBeginError } - if err := p.Output.Write(oprot); err != nil { + if err := oprot.WriteI32(int32(*p.Status)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -1992,11 +2131,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } func (p *InvokeEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetUsage() { - if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 2); err != nil { + if p.IsSetOutput() { + if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 2); err != nil { goto WriteFieldBeginError } - if err := p.Usage.Write(oprot); err != nil { + if err := p.Output.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -2009,6 +2148,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } +func (p *InvokeEvalTargetResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetUsage() { + if err = oprot.WriteFieldBegin("usage", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Usage.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *InvokeEvalTargetResponse) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMessage() { + if err = oprot.WriteFieldBegin("error_message", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ErrorMessage); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} func (p *InvokeEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { goto WriteFieldBeginError @@ -2040,10 +2215,16 @@ func (p *InvokeEvalTargetResponse) DeepEqual(ano *InvokeEvalTargetResponse) bool } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Output) { + if !p.Field1DeepEqual(ano.Status) { + return false + } + if !p.Field2DeepEqual(ano.Output) { + return false + } + if !p.Field3DeepEqual(ano.Usage) { return false } - if !p.Field2DeepEqual(ano.Usage) { + if !p.Field10DeepEqual(ano.ErrorMessage) { return false } if !p.Field255DeepEqual(ano.BaseResp) { @@ -2052,20 +2233,44 @@ func (p *InvokeEvalTargetResponse) DeepEqual(ano *InvokeEvalTargetResponse) bool return true } -func (p *InvokeEvalTargetResponse) Field1DeepEqual(src *InvokeEvalTargetOutput) bool { +func (p *InvokeEvalTargetResponse) Field1DeepEqual(src *InvokeEvalTargetStatus) bool { + + if p.Status == src { + return true + } else if p.Status == nil || src == nil { + return false + } + if *p.Status != *src { + return false + } + return true +} +func (p *InvokeEvalTargetResponse) Field2DeepEqual(src *InvokeEvalTargetOutput) bool { if !p.Output.DeepEqual(src) { return false } return true } -func (p *InvokeEvalTargetResponse) Field2DeepEqual(src *InvokeEvalTargetUsage) bool { +func (p *InvokeEvalTargetResponse) Field3DeepEqual(src *InvokeEvalTargetUsage) bool { if !p.Usage.DeepEqual(src) { return false } return true } +func (p *InvokeEvalTargetResponse) Field10DeepEqual(src *string) bool { + + if p.ErrorMessage == src { + return true + } else if p.ErrorMessage == nil || src == nil { + return false + } + if strings.Compare(*p.ErrorMessage, *src) != 0 { + return false + } + return true +} func (p *InvokeEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { if !p.BaseResp.DeepEqual(src) { @@ -2396,7 +2601,6 @@ func (p *InvokeEvalTargetInput) Field20DeepEqual(src map[string]string) bool { // 新增 type InvokeEvalTargetOutput struct { - // 实际输出 ActualOutput *Content `thrift:"actual_output,1,optional" frugal:"1,optional,Content" form:"actual_output" json:"actual_output,omitempty" query:"actual_output"` // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 Ext map[string]string `thrift:"ext,20,optional" frugal:"20,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` @@ -3551,8 +3755,6 @@ type AsyncInvokeEvalTargetRequest struct { WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" form:"workspace_id" json:"workspace_id,omitempty" query:"workspace_id"` // 执行id,传递给自定义对象,在回传结果时透传 InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` - // 根据invoke_id签发的token,在回传结果时透传 - Token *string `thrift:"token,3,optional" frugal:"3,optional,string" form:"token" json:"token,omitempty" query:"token"` // 执行输入信息 Input *InvokeEvalTargetInput `thrift:"input,4,optional" frugal:"4,optional,InvokeEvalTargetInput" form:"input" json:"input,omitempty" query:"input"` // 如果创建实验时选了二级对象,则会透传二级对象信息 @@ -3591,18 +3793,6 @@ func (p *AsyncInvokeEvalTargetRequest) GetInvokeID() (v int64) { return *p.InvokeID } -var AsyncInvokeEvalTargetRequest_Token_DEFAULT string - -func (p *AsyncInvokeEvalTargetRequest) GetToken() (v string) { - if p == nil { - return - } - if !p.IsSetToken() { - return AsyncInvokeEvalTargetRequest_Token_DEFAULT - } - return *p.Token -} - var AsyncInvokeEvalTargetRequest_Input_DEFAULT *InvokeEvalTargetInput func (p *AsyncInvokeEvalTargetRequest) GetInput() (v *InvokeEvalTargetInput) { @@ -3644,9 +3834,6 @@ func (p *AsyncInvokeEvalTargetRequest) SetWorkspaceID(val *int64) { func (p *AsyncInvokeEvalTargetRequest) SetInvokeID(val *int64) { p.InvokeID = val } -func (p *AsyncInvokeEvalTargetRequest) SetToken(val *string) { - p.Token = val -} func (p *AsyncInvokeEvalTargetRequest) SetInput(val *InvokeEvalTargetInput) { p.Input = val } @@ -3660,7 +3847,6 @@ func (p *AsyncInvokeEvalTargetRequest) SetBase(val *base.Base) { var fieldIDToName_AsyncInvokeEvalTargetRequest = map[int16]string{ 1: "workspace_id", 2: "invoke_id", - 3: "token", 4: "input", 5: "custom_eval_target", 255: "Base", @@ -3674,10 +3860,6 @@ func (p *AsyncInvokeEvalTargetRequest) IsSetInvokeID() bool { return p.InvokeID != nil } -func (p *AsyncInvokeEvalTargetRequest) IsSetToken() bool { - return p.Token != nil -} - func (p *AsyncInvokeEvalTargetRequest) IsSetInput() bool { return p.Input != nil } @@ -3724,14 +3906,6 @@ func (p *AsyncInvokeEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } case 4: if fieldTypeId == thrift.STRUCT { if err = p.ReadField4(iprot); err != nil { @@ -3807,17 +3981,6 @@ func (p *AsyncInvokeEvalTargetRequest) ReadField2(iprot thrift.TProtocol) error p.InvokeID = _field return nil } -func (p *AsyncInvokeEvalTargetRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Token = _field - return nil -} func (p *AsyncInvokeEvalTargetRequest) ReadField4(iprot thrift.TProtocol) error { _field := NewInvokeEvalTargetInput() if err := _field.Read(iprot); err != nil { @@ -3857,10 +4020,6 @@ func (p *AsyncInvokeEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } if err = p.writeField4(oprot); err != nil { fieldId = 4 goto WriteFieldError @@ -3927,24 +4086,6 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *AsyncInvokeEvalTargetRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetToken() { - if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Token); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} func (p *AsyncInvokeEvalTargetRequest) writeField4(oprot thrift.TProtocol) (err error) { if p.IsSetInput() { if err = oprot.WriteFieldBegin("input", thrift.STRUCT, 4); err != nil { @@ -4020,9 +4161,6 @@ func (p *AsyncInvokeEvalTargetRequest) DeepEqual(ano *AsyncInvokeEvalTargetReque if !p.Field2DeepEqual(ano.InvokeID) { return false } - if !p.Field3DeepEqual(ano.Token) { - return false - } if !p.Field4DeepEqual(ano.Input) { return false } @@ -4059,18 +4197,6 @@ func (p *AsyncInvokeEvalTargetRequest) Field2DeepEqual(src *int64) bool { } return true } -func (p *AsyncInvokeEvalTargetRequest) Field3DeepEqual(src *string) bool { - - if p.Token == src { - return true - } else if p.Token == nil || src == nil { - return false - } - if strings.Compare(*p.Token, *src) != 0 { - return false - } - return true -} func (p *AsyncInvokeEvalTargetRequest) Field4DeepEqual(src *InvokeEvalTargetInput) bool { if !p.Input.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go index afc3bcf99..fbf9a9308 100644 --- a/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go +++ b/backend/kitex_gen/coze/loop/evaluation/spi/k-coze.loop.evaluation.spi.go @@ -1302,7 +1302,7 @@ func (p *InvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -1329,6 +1329,34 @@ func (p *InvokeEvalTargetResponse) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 3: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -1363,6 +1391,22 @@ SkipFieldError: func (p *InvokeEvalTargetResponse) FastReadField1(buf []byte) (int, error) { offset := 0 + + var _field *InvokeEvalTargetStatus + if v, l, err := thrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := InvokeEvalTargetStatus(v) + _field = &tmp + } + p.Status = _field + return offset, nil +} + +func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 _field := NewInvokeEvalTargetOutput() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err @@ -1373,7 +1417,7 @@ func (p *InvokeEvalTargetResponse) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { +func (p *InvokeEvalTargetResponse) FastReadField3(buf []byte) (int, error) { offset := 0 _field := NewInvokeEvalTargetUsage() if l, err := _field.FastRead(buf[offset:]); err != nil { @@ -1385,6 +1429,20 @@ func (p *InvokeEvalTargetResponse) FastReadField2(buf []byte) (int, error) { return offset, nil } +func (p *InvokeEvalTargetResponse) FastReadField10(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ErrorMessage = _field + return offset, nil +} + func (p *InvokeEvalTargetResponse) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBaseResp() @@ -1406,6 +1464,8 @@ func (p *InvokeEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWr if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -1417,6 +1477,8 @@ func (p *InvokeEvalTargetResponse) BLength() int { if p != nil { l += p.field1Length() l += p.field2Length() + l += p.field3Length() + l += p.field10Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -1424,23 +1486,41 @@ func (p *InvokeEvalTargetResponse) BLength() int { } func (p *InvokeEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStatus() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 1) + offset += thrift.Binary.WriteI32(buf[offset:], int32(*p.Status)) + } + return offset +} + +func (p *InvokeEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetOutput() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) offset += p.Output.FastWriteNocopy(buf[offset:], w) } return offset } -func (p *InvokeEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { +func (p *InvokeEvalTargetResponse) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetUsage() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 3) offset += p.Usage.FastWriteNocopy(buf[offset:], w) } return offset } +func (p *InvokeEvalTargetResponse) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetErrorMessage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ErrorMessage) + } + return offset +} + func (p *InvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) @@ -1449,6 +1529,15 @@ func (p *InvokeEvalTargetResponse) fastWriteField255(buf []byte, w thrift.Nocopy } func (p *InvokeEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetStatus() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + +func (p *InvokeEvalTargetResponse) field2Length() int { l := 0 if p.IsSetOutput() { l += thrift.Binary.FieldBeginLength() @@ -1457,7 +1546,7 @@ func (p *InvokeEvalTargetResponse) field1Length() int { return l } -func (p *InvokeEvalTargetResponse) field2Length() int { +func (p *InvokeEvalTargetResponse) field3Length() int { l := 0 if p.IsSetUsage() { l += thrift.Binary.FieldBeginLength() @@ -1466,6 +1555,15 @@ func (p *InvokeEvalTargetResponse) field2Length() int { return l } +func (p *InvokeEvalTargetResponse) field10Length() int { + l := 0 + if p.IsSetErrorMessage() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ErrorMessage) + } + return l +} + func (p *InvokeEvalTargetResponse) field255Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -1479,6 +1577,11 @@ func (p *InvokeEvalTargetResponse) DeepCopy(s interface{}) error { return fmt.Errorf("%T's type not matched %T", s, p) } + if src.Status != nil { + tmp := *src.Status + p.Status = &tmp + } + var _output *InvokeEvalTargetOutput if src.Output != nil { _output = &InvokeEvalTargetOutput{} @@ -1497,6 +1600,14 @@ func (p *InvokeEvalTargetResponse) DeepCopy(s interface{}) error { } p.Usage = _usage + if src.ErrorMessage != nil { + var tmp string + if *src.ErrorMessage != "" { + tmp = kutils.StringDeepCopy(*src.ErrorMessage) + } + p.ErrorMessage = &tmp + } + var _baseResp *base.BaseResp if src.BaseResp != nil { _baseResp = &base.BaseResp{} @@ -2635,20 +2746,6 @@ func (p *AsyncInvokeEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } case 4: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField4(buf[offset:]) @@ -2737,20 +2834,6 @@ func (p *AsyncInvokeEvalTargetRequest) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *AsyncInvokeEvalTargetRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - - var _field *string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Token = _field - return offset, nil -} - func (p *AsyncInvokeEvalTargetRequest) FastReadField4(buf []byte) (int, error) { offset := 0 _field := NewInvokeEvalTargetInput() @@ -2796,7 +2879,6 @@ func (p *AsyncInvokeEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Noco if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) @@ -2810,7 +2892,6 @@ func (p *AsyncInvokeEvalTargetRequest) BLength() int { if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() l += p.field4Length() l += p.field5Length() l += p.field255Length() @@ -2837,15 +2918,6 @@ func (p *AsyncInvokeEvalTargetRequest) fastWriteField2(buf []byte, w thrift.Noco return offset } -func (p *AsyncInvokeEvalTargetRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetToken() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Token) - } - return offset -} - func (p *AsyncInvokeEvalTargetRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetInput() { @@ -2891,15 +2963,6 @@ func (p *AsyncInvokeEvalTargetRequest) field2Length() int { return l } -func (p *AsyncInvokeEvalTargetRequest) field3Length() int { - l := 0 - if p.IsSetToken() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Token) - } - return l -} - func (p *AsyncInvokeEvalTargetRequest) field4Length() int { l := 0 if p.IsSetInput() { @@ -2943,14 +3006,6 @@ func (p *AsyncInvokeEvalTargetRequest) DeepCopy(s interface{}) error { p.InvokeID = &tmp } - if src.Token != nil { - var tmp string - if *src.Token != "" { - tmp = kutils.StringDeepCopy(*src.Token) - } - p.Token = &tmp - } - var _input *InvokeEvalTargetInput if src.Input != nil { _input = &InvokeEvalTargetInput{} diff --git a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go index 0f745fa4f..91ee65ea4 100644 --- a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go +++ b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go @@ -313,29 +313,6 @@ func (l *LocalEvalTargetService) AsyncDebugEvalTarget(ctx context.Context, reque return result.GetSuccess(), nil } -// PassbackEvalTargetInvokeResult_ -// 回传执行结果 -func (l *LocalEvalTargetService) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (*eval_target.PassbackEvalTargetInvokeResultResponse, error) { - chain := l.mds(func(ctx context.Context, in, out interface{}) error { - arg := in.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs) - result := out.(*eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult) - resp, err := l.impl.PassbackEvalTargetInvokeResult_(ctx, arg.Req) - if err != nil { - return err - } - result.SetSuccess(resp) - return nil - }) - - arg := &eval_target.EvalTargetServicePassbackEvalTargetInvokeResultArgs{Req: req} - result := &eval_target.EvalTargetServicePassbackEvalTargetInvokeResultResult{} - ctx = l.injectRPCInfo(ctx, "PassbackEvalTargetInvokeResult_") - if err := chain(ctx, arg, result); err != nil { - return nil, err - } - return result.GetSuccess(), nil -} - func (l *LocalEvalTargetService) injectRPCInfo(ctx context.Context, method string) context.Context { rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) ri := rpcinfo.NewRPCInfo( diff --git a/backend/loop_gen/coze/loop/evaluation/loopenapi/local_evaluationopenapiservice.go b/backend/loop_gen/coze/loop/evaluation/loopenapi/local_evaluationopenapiservice.go new file mode 100644 index 000000000..f279474eb --- /dev/null +++ b/backend/loop_gen/coze/loop/evaluation/loopenapi/local_evaluationopenapiservice.go @@ -0,0 +1,56 @@ +// Code generated by cozeloop. DO NOT EDIT. +package loopenapi // import github.com/coze-dev/coze-loop/backend/loopenapi + +import ( + "context" + + "github.com/cloudwego/kitex/client/callopt" + "github.com/cloudwego/kitex/pkg/endpoint" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" +) + +type LocalEvaluationOpenAPIService struct { + impl openapi.EvaluationOpenAPIService // the service implementation + mds endpoint.Middleware +} + +func NewLocalEvaluationOpenAPIService(impl openapi.EvaluationOpenAPIService, mds ...endpoint.Middleware) *LocalEvaluationOpenAPIService { + return &LocalEvaluationOpenAPIService{ + impl: impl, + mds: endpoint.Chain(mds...), + } +} + +func (l *LocalEvaluationOpenAPIService) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest, callOptions ...callopt.Option) (*openapi.ReportEvalTargetInvokeResultResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs) + result := out.(*openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult) + resp, err := l.impl.ReportEvalTargetInvokeResult_(ctx, arg.Req) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultArgs{Req: req} + result := &openapi.EvaluationOpenAPIServiceReportEvalTargetInvokeResultResult{} + ctx = l.injectRPCInfo(ctx, "ReportEvalTargetInvokeResult_") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + +func (l *LocalEvaluationOpenAPIService) injectRPCInfo(ctx context.Context, method string) context.Context { + rpcStats := rpcinfo.AsMutableRPCStats(rpcinfo.NewRPCStats()) + ri := rpcinfo.NewRPCInfo( + rpcinfo.NewEndpointInfo("EvaluationOpenAPIService", method, nil, nil), + rpcinfo.NewEndpointInfo("EvaluationOpenAPIService", method, nil, nil), + rpcinfo.NewServerInvocation(), + nil, + rpcStats.ImmutableView(), + ) + return rpcinfo.NewCtxWithRPCInfo(ctx, ri) +} diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record.go b/backend/modules/evaluation/application/convertor/target/eval_target_record.go index 4c98185bf..c3d57f0ca 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record.go @@ -8,8 +8,12 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" commonconvertor "github.com/coze-dev/coze-loop/backend/modules/evaluation/application/convertor/common" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" ) func EvalTargetRecordDO2DTO(src *entity.EvalTargetRecord) *eval_target.EvalTargetRecord { @@ -263,3 +267,94 @@ func getInt32Value(ptr *int32) int32 { } return 0 } + +func toSPIContentDO(spiContent *spi.Content) *entity.Content { + if spiContent == nil { + return nil + } + + var contentType *entity.ContentType + if spiContent.ContentType != nil { + ct := toSPIContentTypeDO(*spiContent.ContentType) + contentType = &ct + } + + var image *entity.Image + if spiContent.Image != nil { + image = &entity.Image{ + URL: spiContent.Image.URL, + } + } + + var multiPart []*entity.Content + if spiContent.MultiPart != nil { + multiPart = make([]*entity.Content, 0, len(spiContent.MultiPart)) + for _, part := range spiContent.MultiPart { + multiPart = append(multiPart, toSPIContentDO(part)) + } + } + + return &entity.Content{ + ContentType: contentType, + Text: spiContent.Text, + Image: image, + MultiPart: multiPart, + } +} + +func toSPIContentTypeDO(spiContentType spi.ContentType) entity.ContentType { + switch spiContentType { + case spi.ContentTypeText: + return entity.ContentTypeText + case spi.ContentTypeImage: + return entity.ContentTypeImage + case spi.ContentTypeMultiPart: + return entity.ContentTypeMultipart + default: + return entity.ContentTypeText + } +} + +func ToInvokeOutputDataDO(req *openapi.ReportEvalTargetInvokeResultRequest) *entity.EvalTargetOutputData { + switch req.GetStatus() { + case spi.InvokeEvalTargetStatus_SUCCESS: + output := req.GetOutput() + usage := req.GetUsage() + + outputFields := make(map[string]*entity.Content) + if output.ActualOutput != nil { + outputFields[consts.OutputSchemaKey] = toSPIContentDO(output.ActualOutput) + } + + var evalTargetUsage *entity.EvalTargetUsage + if usage.InputTokens != nil || usage.OutputTokens != nil { + evalTargetUsage = &entity.EvalTargetUsage{ + InputTokens: getInt64Value(usage.InputTokens), + OutputTokens: getInt64Value(usage.OutputTokens), + } + } + + return &entity.EvalTargetOutputData{ + OutputFields: outputFields, + EvalTargetUsage: evalTargetUsage, + EvalTargetRunError: nil, + } + + case spi.InvokeEvalTargetStatus_FAILED: + errorMessage := req.GetErrorMessage() + var evalTargetRunError *entity.EvalTargetRunError + if errorMessage != "" { + evalTargetRunError = &entity.EvalTargetRunError{ + Code: errno.CustomEvalTargetInvokeFailCode, + Message: errorMessage, + } + } + return &entity.EvalTargetOutputData{ + EvalTargetRunError: evalTargetRunError, + } + + default: + return nil + } + +} diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go new file mode 100644 index 000000000..86225e02f --- /dev/null +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -0,0 +1,57 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package application + +import ( + "context" + "strconv" + "time" + + "github.com/bytedance/gg/gptr" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/application/convertor/target" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/events" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" +) + +type IEvalOpenAPIApplication = evaluation.EvalOpenAPIService + +type EvalOpenAPIApplication struct { + targetSvc service.IEvalTargetService + asyncRepo repo.IExptItemTurnEvalAsyncRepo + publisher events.ExptEventPublisher +} + +func NewEvalOpenAPIApplication(asyncRepo repo.IExptItemTurnEvalAsyncRepo, publisher events.ExptEventPublisher, targetSvc service.IEvalTargetService) IEvalOpenAPIApplication { + return &EvalOpenAPIApplication{asyncRepo: asyncRepo, publisher: publisher, targetSvc: targetSvc} +} + +func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + actx, err := e.asyncRepo.GetAsyncCtx(ctx, strconv.FormatInt(req.GetInvokeID(), 10)) + if err != nil { + return nil, err + } + + outputData := target.ToInvokeOutputDataDO(req) + outputData.TimeConsumingMS = gptr.Of(time.Now().UnixMilli() - actx.AsyncUnixMS) + if err := e.targetSvc.ReportInvokeRecords(ctx, &entity.ReportTargetRecordParam{ + SpaceID: req.GetWorkspaceID(), + RecordID: req.GetInvokeID(), + OutputData: outputData, + Session: actx.Event.Session, + }); err != nil { + return nil, err + } + + if err := e.publisher.PublishExptRecordEvalEvent(ctx, actx.Event, gptr.Of(time.Second*3)); err != nil { + return nil, err + } + + return &openapi.ReportEvalTargetInvokeResultResponse{BaseResp: base.NewBaseResp()}, nil +} diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 6ebe64974..c66b57d61 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -462,8 +462,3 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req // TODO implement me panic("implement me") } - -func (e EvalTargetApplicationImpl) PassbackEvalTargetInvokeResult_(ctx context.Context, req *eval_target.PassbackEvalTargetInvokeResultRequest) (r *eval_target.PassbackEvalTargetInvokeResultResponse, err error) { - // TODO implement me - panic("implement me") -} diff --git a/backend/modules/evaluation/application/wire.go b/backend/modules/evaluation/application/wire.go index d58c938f1..c2b739b67 100644 --- a/backend/modules/evaluation/application/wire.go +++ b/backend/modules/evaluation/application/wire.go @@ -187,6 +187,16 @@ var ( targetDomainService, flagSet, ) + + evalOpenAPISet = wire.NewSet( + NewEvalOpenAPIApplication, + targetDomainService, + evaltargetmtr.NewEvalTargetMetrics, + flagSet, + rmqproducer.NewExptEventPublisher, + experiment.NewExptItemTurnEvalAsyncRepo, + exptredis.NewExptItemTurnEvalAsyncDAO, + ) ) func NewSourceTargetOperators(adapter rpc.IPromptRPCAdapter) map[entity.EvalTargetType]service.ISourceEvalTargetOperateService { @@ -281,3 +291,21 @@ func NewEvaluatorSourceServices(llmProvider componentrpc.ILLMProvider, metric mt domainservice.NewEvaluatorSourcePromptServiceImpl(llmProvider, metric, config), } } + +func InitEvalOpenAPIApplication( + ctx context.Context, + configFactory conf.IConfigLoaderFactory, + rmqFactory mq.IFactory, + cmdable redis.Cmdable, + idgen idgen.IIDGenerator, + db db.Provider, + client promptmanageservice.Client, + executeClient promptexecuteservice.Client, + authClient authservice.Client, + meter metrics.Meter, +) (IEvalOpenAPIApplication, error) { + wire.Build( + evalOpenAPISet, + ) + return nil, nil +} diff --git a/backend/modules/evaluation/application/wire_gen.go b/backend/modules/evaluation/application/wire_gen.go index 65af5d7a5..02f558717 100644 --- a/backend/modules/evaluation/application/wire_gen.go +++ b/backend/modules/evaluation/application/wire_gen.go @@ -7,6 +7,7 @@ package application import ( + "context" "github.com/coze-dev/coze-loop/backend/infra/ck" "github.com/coze-dev/coze-loop/backend/infra/db" "github.com/coze-dev/coze-loop/backend/infra/external/audit" @@ -55,7 +56,6 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/infra/rpc/tag" conf2 "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/conf" "github.com/coze-dev/coze-loop/backend/pkg/conf" - "context" "github.com/google/wire" ) @@ -208,6 +208,26 @@ func InitEvalTargetApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d return evalTargetService } +func InitEvalOpenAPIApplication(ctx context.Context, configFactory conf.IConfigLoaderFactory, rmqFactory mq.IFactory, cmdable redis.Cmdable, idgen2 idgen.IIDGenerator, db2 db.Provider, client promptmanageservice.Client, executeClient promptexecuteservice.Client, authClient authservice.Client, meter metrics.Meter) (IEvalOpenAPIApplication, error) { + iExptItemTurnEvalAsyncDAO := dao.NewExptItemTurnEvalAsyncDAO(cmdable) + iExptItemTurnEvalAsyncRepo := experiment.NewExptItemTurnEvalAsyncRepo(iExptItemTurnEvalAsyncDAO) + exptEventPublisher, err := producer.NewExptEventPublisher(ctx, configFactory, rmqFactory) + if err != nil { + return nil, err + } + evalTargetDAO := mysql3.NewEvalTargetDAO(db2) + evalTargetVersionDAO := mysql3.NewEvalTargetVersionDAO(db2) + evalTargetRecordDAO := mysql3.NewEvalTargetRecordDAO(db2) + iLatestWriteTracker := platestwrite.NewLatestWriteTracker(cmdable) + iEvalTargetRepo := target.NewEvalTargetRepo(idgen2, db2, evalTargetDAO, evalTargetVersionDAO, evalTargetRecordDAO, iLatestWriteTracker) + evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) + iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) + v := NewSourceTargetOperators(iPromptRPCAdapter) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) + v2 := NewEvalOpenAPIApplication(iExptItemTurnEvalAsyncRepo, exptEventPublisher, iEvalTargetService) + return v2, nil +} + // wire.go: var ( @@ -241,6 +261,11 @@ var ( NewEvalTargetHandlerImpl, metrics3.NewEvalTargetMetrics, foundation.NewAuthRPCProvider, targetDomainService, flagSet, ) + + evalOpenAPISet = wire.NewSet( + NewEvalOpenAPIApplication, + targetDomainService, metrics3.NewEvalTargetMetrics, flagSet, producer.NewExptEventPublisher, experiment.NewExptItemTurnEvalAsyncRepo, dao.NewExptItemTurnEvalAsyncDAO, + ) ) func NewSourceTargetOperators(adapter rpc.IPromptRPCAdapter) map[entity.EvalTargetType]service.ISourceEvalTargetOperateService { diff --git a/backend/modules/evaluation/domain/entity/expt.go b/backend/modules/evaluation/domain/entity/expt.go index cfb8e0d3b..4fa5597d5 100644 --- a/backend/modules/evaluation/domain/entity/expt.go +++ b/backend/modules/evaluation/domain/entity/expt.go @@ -8,6 +8,7 @@ import ( "fmt" "time" + "github.com/bytedance/gg/gptr" "github.com/mitchellh/mapstructure" "github.com/coze-dev/coze-loop/backend/pkg/errorx" @@ -125,6 +126,18 @@ func (e *Experiment) ToEvaluatorRefDO() []*ExptEvaluatorRef { return refs } +func (e *Experiment) AsyncExec() bool { + return e.AsyncCallTarget() || e.AsyncCallEvaluators() +} + +func (e *Experiment) AsyncCallTarget() bool { + return gptr.Indirect(e.Target.EvalTargetVersion.CustomRPCServer.IsAsync) +} + +func (e *Experiment) AsyncCallEvaluators() bool { + return false +} + type ExptEvaluatorVersionRef struct { EvaluatorID int64 EvaluatorVersionID int64 diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 014c39a36..804cefc27 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -8,6 +8,9 @@ import ( "strings" "time" + "github.com/bytedance/gg/gptr" + + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" "github.com/coze-dev/coze-loop/backend/pkg/logs" @@ -398,6 +401,26 @@ func (e *ExptTurnRunResult) GetEvaluatorRecord(evaluatorVersionID int64) *Evalua return e.EvaluatorResults[evaluatorVersionID] } +func (e *ExptTurnRunResult) AbortWithTargetResult(expt *Experiment) bool { + // invalid target result + if e.TargetResult == nil { + e.SetEvalErr(errorx.NewByCode(errno.CommonInternalErrorCode, errorx.WithExtraMsg("target result is nil"))) + return true + } + + // target exec error + if e.TargetResult.EvalTargetOutputData != nil && e.TargetResult.EvalTargetOutputData.EvalTargetRunError != nil { + return true + } + + // target async exec, with no record + if expt.AsyncCallTarget() && gptr.Indirect(e.TargetResult.Status) == EvalTargetRunStatusAsyncInvoking { + return true + } + + return false +} + //go:generate mockgen -destination ./mocks/expt_scheduler_mock.go --package mocks . ExptSchedulerMode type ExptSchedulerMode interface { Mode() ExptRunMode @@ -414,3 +437,9 @@ type CKDBConfig struct { ExptTurnResultFilterDBName string `json:"expt_turn_result_filter_db_name" mapstructure:"expt_turn_result_filter_db_name"` DatasetItemsSnapshotDBName string `json:"dataset_items_snapshot_db_name" mapstructure:"dataset_items_snapshot_db_name"` } + +type ExptItemTurnEvalAsyncCtx struct { + Event *ExptItemEvalEvent + TurnID int64 + AsyncUnixMS int64 // async call time with unix ms ts +} diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index cedbd7233..f67f559a1 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -289,3 +289,11 @@ type SearchCustomEvalTargetParam struct { PageSize *int32 PageToken *string } + +type ReportTargetRecordParam struct { + SpaceID int64 + RecordID int64 + OutputData *EvalTargetOutputData + + Session *Session +} diff --git a/backend/modules/evaluation/domain/entity/target_record.go b/backend/modules/evaluation/domain/entity/target_record.go index 0dd42ae1c..ee726bcf0 100644 --- a/backend/modules/evaluation/domain/entity/target_record.go +++ b/backend/modules/evaluation/domain/entity/target_record.go @@ -104,9 +104,10 @@ type EvalTargetRunError struct { type EvalTargetRunStatus int64 const ( - EvalTargetRunStatusUnknown EvalTargetRunStatus = 0 - EvalTargetRunStatusSuccess EvalTargetRunStatus = 1 - EvalTargetRunStatusFail EvalTargetRunStatus = 2 + EvalTargetRunStatusUnknown EvalTargetRunStatus = 0 + EvalTargetRunStatusSuccess EvalTargetRunStatus = 1 + EvalTargetRunStatusFail EvalTargetRunStatus = 2 + EvalTargetRunStatusAsyncInvoking EvalTargetRunStatus = 3 ) type ExecuteTargetCtx struct { diff --git a/backend/modules/evaluation/domain/repo/expt.go b/backend/modules/evaluation/domain/repo/expt.go index dabec1b78..e8ad3dd7f 100644 --- a/backend/modules/evaluation/domain/repo/expt.go +++ b/backend/modules/evaluation/domain/repo/expt.go @@ -134,3 +134,8 @@ type IExptResultExportRecordRepo interface { List(ctx context.Context, spaceID, exptID int64, page entity.Page, csvExportStatus *int32) ([]*entity.ExptResultExportRecord, int64, error) Get(ctx context.Context, spaceID, exportID int64) (*entity.ExptResultExportRecord, error) } + +type IExptItemTurnEvalAsyncRepo interface { + GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) + SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error +} diff --git a/backend/modules/evaluation/domain/repo/mocks/target.go b/backend/modules/evaluation/domain/repo/mocks/target.go index 7f6b58ef3..9d4c9a398 100644 --- a/backend/modules/evaluation/domain/repo/mocks/target.go +++ b/backend/modules/evaluation/domain/repo/mocks/target.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=mocks/repo.go -package=mocks . IEvalTargetRepo +// mockgen -destination=mocks/target.go -package=mocks . IEvalTargetRepo // // Package mocks is a generated GoMock package. @@ -13,10 +13,9 @@ import ( context "context" reflect "reflect" - gomock "go.uber.org/mock/gomock" - entity "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" repo "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" + gomock "go.uber.org/mock/gomock" ) // MockIEvalTargetRepo is a mock of IEvalTargetRepo interface. @@ -163,3 +162,17 @@ func (mr *MockIEvalTargetRepoMockRecorder) ListEvalTargetRecordByIDsAndSpaceID(c mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEvalTargetRecordByIDsAndSpaceID", reflect.TypeOf((*MockIEvalTargetRepo)(nil).ListEvalTargetRecordByIDsAndSpaceID), ctx, spaceID, recordIDs) } + +// SaveEvalTargetRecord mocks base method. +func (m *MockIEvalTargetRepo) SaveEvalTargetRecord(ctx context.Context, record *entity.EvalTargetRecord) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveEvalTargetRecord", ctx, record) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveEvalTargetRecord indicates an expected call of SaveEvalTargetRecord. +func (mr *MockIEvalTargetRepoMockRecorder) SaveEvalTargetRecord(ctx, record any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveEvalTargetRecord", reflect.TypeOf((*MockIEvalTargetRepo)(nil).SaveEvalTargetRecord), ctx, record) +} diff --git a/backend/modules/evaluation/domain/repo/target.go b/backend/modules/evaluation/domain/repo/target.go index 007b01134..23eb97a4e 100644 --- a/backend/modules/evaluation/domain/repo/target.go +++ b/backend/modules/evaluation/domain/repo/target.go @@ -19,6 +19,7 @@ type IEvalTargetRepo interface { // target record start CreateEvalTargetRecord(ctx context.Context, record *entity.EvalTargetRecord) (int64, error) + SaveEvalTargetRecord(ctx context.Context, record *entity.EvalTargetRecord) error GetEvalTargetRecordByIDAndSpaceID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) ListEvalTargetRecordByIDsAndSpaceID(ctx context.Context, spaceID int64, recordIDs []int64) ([]*entity.EvalTargetRecord, error) // target record end diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_impl.go index 5b8843d73..58202d8d8 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl.go @@ -103,7 +103,8 @@ func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.Ex history = append(history, buildHistoryMessage(ctx, turnRunRes)...) } - time.Sleep(time.Second * 1) // 确保日志落库 + time.Sleep(time.Second * 1) + return nil } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index f12d94816..85756a55b 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -31,7 +31,8 @@ type ExptItemTurnEvaluation interface { Eval(ctx context.Context, etec *entity.ExptTurnEvalCtx) *entity.ExptTurnRunResult } -func NewExptTurnEvaluation(metric metrics.ExptMetric, +func NewExptTurnEvaluation( + metric metrics.ExptMetric, evalTargetService IEvalTargetService, evaluatorService EvaluatorService, benefitService benefit.IBenefitService, @@ -63,44 +64,38 @@ func (e *DefaultExptTurnEvaluationImpl) Eval(ctx context.Context, etec *entity.E }() defer goroutine.Recover(ctx, &trr.EvalErr) - var targetResult *entity.EvalTargetRecord - var err error - targetResult, err = e.CallTarget(ctx, etec) + targetResult, err := e.CallTarget(ctx, etec) if err != nil { logs.CtxError(ctx, "[ExptTurnEval] call target fail, err: %v", err) return trr.SetEvalErr(err) } + logs.CtxInfo(ctx, "[ExptTurnEval] call target success, target_result: %v", json.Jsonify(targetResult)) - trr.SetTargetResult(targetResult) - if targetResult != nil && targetResult.EvalTargetOutputData != nil && targetResult.EvalTargetOutputData.EvalTargetRunError != nil { + if trr.SetTargetResult(targetResult).AbortWithTargetResult(etec.Expt) { return trr } - if targetResult == nil { - err = errorx.NewByCode(errno.CommonInternalErrorCode, errorx.WithExtraMsg("target result is nil")) - return trr.SetEvalErr(err) - - } - evaluatorResults, err := e.CallEvaluators(ctx, etec, targetResult) if err != nil { logs.CtxError(ctx, "[ExptTurnEval] call evaluators fail, err: %v", err) return trr.SetEvaluatorResults(evaluatorResults).SetEvalErr(err) } + logs.CtxInfo(ctx, "[ExptTurnEval] call evaluators success, evaluator_results: %v", json.Jsonify(evaluatorResults)) - trr.SetEvaluatorResults(evaluatorResults) - return trr + return trr.SetEvaluatorResults(evaluatorResults) } func (e *DefaultExptTurnEvaluationImpl) CallTarget(ctx context.Context, etec *entity.ExptTurnEvalCtx) (*entity.EvalTargetRecord, error) { - // Whether target is called is determined by the target info bound in expt; - // ConnectorConf.TargetConf serves as the config info for executing the target, and CheckConnector completes the validity check when creating experiment. if e.skipTargetNode(etec.Expt) { return &entity.EvalTargetRecord{EvalTargetOutputData: &entity.EvalTargetOutputData{OutputFields: make(map[string]*entity.Content)}}, nil } + if existRecord := e.existedTargetRecord(etec); existRecord != nil { + return existRecord, nil + } + if existResult := etec.ExptTurnRunResult.TargetResult; existResult != nil && existResult.Status != nil && *existResult.Status == entity.EvalTargetRunStatusSuccess { return existResult, nil } @@ -112,6 +107,8 @@ func (e *DefaultExptTurnEvaluationImpl) CallTarget(ctx context.Context, etec *en return e.callTarget(ctx, etec, etec.History, etec.Event.SpaceID) } +// skipTargetNode Whether target is called is determined by the target info bound in expt; +// ConnectorConf.TargetConf serves as the config info for executing the target, and CheckConnector completes the validity check when creating experiment. func (e *DefaultExptTurnEvaluationImpl) skipTargetNode(expt *entity.Experiment) bool { if expt.TargetVersionID == 0 { return true @@ -122,6 +119,16 @@ func (e *DefaultExptTurnEvaluationImpl) skipTargetNode(expt *entity.Experiment) return false } +func (e *DefaultExptTurnEvaluationImpl) existedTargetRecord(etec *entity.ExptTurnEvalCtx) *entity.EvalTargetRecord { + if etec == nil || etec.ExptTurnRunResult.TargetResult == nil { + return nil + } + if gptr.Indirect(etec.ExptTurnRunResult.TargetResult.Status) == entity.EvalTargetRunStatusSuccess { + return etec.ExptTurnRunResult.TargetResult + } + return nil +} + func (e *DefaultExptTurnEvaluationImpl) skipEvaluatorNode(expt *entity.Experiment) bool { return expt.EvalConf.ConnectorConf.EvaluatorsConf == nil } @@ -148,7 +155,6 @@ func (e *DefaultExptTurnEvaluationImpl) CheckBenefit(ctx context.Context, exptID } func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *entity.ExptTurnEvalCtx, history []*entity.Message, spaceID int64) (record *entity.EvalTargetRecord, err error) { - logs.CtxInfo(ctx, "[ExptTurnEval] call target, etec: %v", etec) defer e.metric.EmitTurnExecTargetResult(etec.Event.SpaceID, err != nil) turn := etec.Turn @@ -171,13 +177,13 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en } if firstField == fc.FromField { // 没有下钻字段 fields[fc.FieldName] = turnFields[fc.FromField] - continue - } - content, err := e.getContentByJsonPath(turnFields[firstField], fc.FromField) - if err != nil { - return nil, err + } else { + content, err := e.getContentByJsonPath(turnFields[firstField], fc.FromField) + if err != nil { + return nil, err + } + fields[fc.FieldName] = content } - fields[fc.FieldName] = content } ext := gmap.Clone(etec.Ext) @@ -189,17 +195,27 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en } } - targetRecord, err := e.evalTargetService.ExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, &entity.ExecuteTargetCtx{ + var targetRecord *entity.EvalTargetRecord + etc := &entity.ExecuteTargetCtx{ ExperimentRunID: gptr.Of(etec.Event.ExptRunID), ItemID: etec.EvalSetItem.ItemID, TurnID: etec.Turn.ID, - }, &entity.EvalTargetInputData{ + } + etid := &entity.EvalTargetInputData{ HistoryMessages: history, InputFields: fields, Ext: ext, - }) - if err != nil { - return nil, err + } + if etec.Expt.AsyncCallTarget() { + targetRecord, err = e.evalTargetService.ExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) + if err != nil { + return nil, err + } + } else { + targetRecord, err = e.evalTargetService.AsyncExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) + if err != nil { + return nil, err + } } return targetRecord, nil @@ -244,10 +260,7 @@ func (e *DefaultExptTurnEvaluationImpl) CallEvaluators(ctx context.Context, etec } func (e *DefaultExptTurnEvaluationImpl) callEvaluators(ctx context.Context, execEvaluatorVersionIDs []int64, etec *entity.ExptTurnEvalCtx, - targetResult *entity.EvalTargetRecord, history []*entity.Message, -) (map[int64]*entity.EvaluatorRecord, error) { - logs.CtxInfo(ctx, "[ExptTurnEval] call evaluators, etec: %v", etec) - logs.CtxInfo(ctx, "[ExptTurnEval] call evaluators, target_result: %v", json.Jsonify(targetResult)) + targetResult *entity.EvalTargetRecord, history []*entity.Message) (map[int64]*entity.EvaluatorRecord, error) { var ( recordMap sync.Map item = etec.EvalSetItem diff --git a/backend/modules/evaluation/domain/service/mocks/target.go b/backend/modules/evaluation/domain/service/mocks/target.go index 02cb31742..148b73a85 100644 --- a/backend/modules/evaluation/domain/service/mocks/target.go +++ b/backend/modules/evaluation/domain/service/mocks/target.go @@ -41,6 +41,21 @@ func (m *MockIEvalTargetService) EXPECT() *MockIEvalTargetServiceMockRecorder { return m.recorder } +// AsyncExecuteTarget mocks base method. +func (m *MockIEvalTargetService) AsyncExecuteTarget(ctx context.Context, spaceID, targetID, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AsyncExecuteTarget", ctx, spaceID, targetID, targetVersionID, param, inputData) + ret0, _ := ret[0].(*entity.EvalTargetRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AsyncExecuteTarget indicates an expected call of AsyncExecuteTarget. +func (mr *MockIEvalTargetServiceMockRecorder) AsyncExecuteTarget(ctx, spaceID, targetID, targetVersionID, param, inputData any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncExecuteTarget", reflect.TypeOf((*MockIEvalTargetService)(nil).AsyncExecuteTarget), ctx, spaceID, targetID, targetVersionID, param, inputData) +} + // BatchGetEvalTargetBySource mocks base method. func (m *MockIEvalTargetService) BatchGetEvalTargetBySource(ctx context.Context, param *entity.BatchGetEvalTargetBySourceParam) ([]*entity.EvalTarget, error) { m.ctrl.T.Helper() @@ -167,6 +182,20 @@ func (mr *MockIEvalTargetServiceMockRecorder) GetRecordByID(ctx, spaceID, record return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecordByID", reflect.TypeOf((*MockIEvalTargetService)(nil).GetRecordByID), ctx, spaceID, recordID) } +// ReportInvokeRecords mocks base method. +func (m *MockIEvalTargetService) ReportInvokeRecords(ctx context.Context, recordID2Params *entity.ReportTargetRecordParam) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReportInvokeRecords", ctx, recordID2Params) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReportInvokeRecords indicates an expected call of ReportInvokeRecords. +func (mr *MockIEvalTargetServiceMockRecorder) ReportInvokeRecords(ctx, recordID2Params any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportInvokeRecords", reflect.TypeOf((*MockIEvalTargetService)(nil).ReportInvokeRecords), ctx, recordID2Params) +} + // ValidateRuntimeParam mocks base method. func (m *MockIEvalTargetService) ValidateRuntimeParam(ctx context.Context, targetType entity.EvalTargetType, runtimeParam string) error { m.ctrl.T.Helper() diff --git a/backend/modules/evaluation/domain/service/mocks/target_source.go b/backend/modules/evaluation/domain/service/mocks/target_source.go index 2f356a570..1e459c495 100644 --- a/backend/modules/evaluation/domain/service/mocks/target_source.go +++ b/backend/modules/evaluation/domain/service/mocks/target_source.go @@ -41,6 +41,20 @@ func (m *MockISourceEvalTargetOperateService) EXPECT() *MockISourceEvalTargetOpe return m.recorder } +// AsyncExecute mocks base method. +func (m *MockISourceEvalTargetOperateService) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AsyncExecute", ctx, spaceID, param) + ret0, _ := ret[0].(error) + return ret0 +} + +// AsyncExecute indicates an expected call of AsyncExecute. +func (mr *MockISourceEvalTargetOperateServiceMockRecorder) AsyncExecute(ctx, spaceID, param any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncExecute", reflect.TypeOf((*MockISourceEvalTargetOperateService)(nil).AsyncExecute), ctx, spaceID, param) +} + // BatchGetSource mocks base method. func (m *MockISourceEvalTargetOperateService) BatchGetSource(ctx context.Context, spaceID int64, ids []string) ([]*entity.EvalTarget, error) { m.ctrl.T.Helper() diff --git a/backend/modules/evaluation/domain/service/target.go b/backend/modules/evaluation/domain/service/target.go index 2f43fac70..6edbb1c26 100644 --- a/backend/modules/evaluation/domain/service/target.go +++ b/backend/modules/evaluation/domain/service/target.go @@ -18,7 +18,9 @@ type IEvalTargetService interface { BatchGetEvalTargetVersion(ctx context.Context, spaceID int64, versionIDs []int64, needSourceInfo bool) (dos []*entity.EvalTarget, err error) ExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) + AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) BatchGetRecordByIDs(ctx context.Context, spaceID int64, recordIDs []int64) ([]*entity.EvalTargetRecord, error) + ReportInvokeRecords(ctx context.Context, recordID2Params *entity.ReportTargetRecordParam) error ValidateRuntimeParam(ctx context.Context, targetType entity.EvalTargetType, runtimeParam string) error } diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 17136b2f3..dbe5c094c 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -5,6 +5,7 @@ package service import ( "context" + "fmt" "runtime" "strconv" "time" @@ -22,6 +23,7 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" + "github.com/coze-dev/coze-loop/backend/pkg/lang/goroutine" "github.com/coze-dev/coze-loop/backend/pkg/logs" ) @@ -236,16 +238,9 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID int64 } ctx, span = looptracer.GetTracer().StartSpan(ctx, "EvalTarget", "eval_target", looptracer.WithStartNewTrace(), looptracer.WithSpanWorkspaceID(strconv.FormatInt(spaceID, 10))) - if err != nil { - logs.CtxWarn(ctx, "start span failed, err=%v", err) - } span.SetCallType("EvalTarget") - - // inject flow trace ctx = looptracer.GetTracer().Inject(ctx) - if err != nil { - logs.CtxWarn(ctx, "Inject ctx failed, err=%v", err) - } + if e.typedOperators[evalTargetDO.EvalTargetType] == nil { return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) } @@ -275,6 +270,93 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID int64 return record, nil } +func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, + param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, err error) { + if inputData == nil || param == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("AsyncExecuteTarget with invalid param")) + } + + defer func(st time.Time) { e.metric.EmitRun(spaceID, err, st) }(time.Now()) // todo(@liushengyang): async + defer goroutine.Recovery(ctx) + + evalTargetDO, err := e.GetEvalTargetVersion(ctx, spaceID, targetVersionID, false) + if err != nil { + return nil, err + } + + operator := e.typedOperators[evalTargetDO.EvalTargetType] + if operator == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) + } + + if err := operator.ValidateInput(ctx, spaceID, evalTargetDO.EvalTargetVersion.InputSchema, inputData); err != nil { + return nil, err + } + + outputData := &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{}, + EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, + TimeConsumingMS: gptr.Of(int64(0)), + } + + execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ + TargetID: targetID, + VersionID: targetVersionID, + SourceTargetID: evalTargetDO.SourceTargetID, + SourceTargetVersion: evalTargetDO.EvalTargetVersion.SourceTargetVersion, + Input: inputData, + TargetType: evalTargetDO.EvalTargetType, + EvalTarget: evalTargetDO, + }) + if execErr != nil { + logs.CtxError(ctx, "async execute target failed, spaceID=%v, targetID=%d, targetVersionID=%d, param=%v, inputData=%v, err=%v", + spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), err) + statusErr, ok := errorx.FromStatusError(err) + if ok { + outputData.EvalTargetRunError.Code = statusErr.Code() + outputData.EvalTargetRunError.Message = statusErr.Error() + } else { + outputData.EvalTargetRunError.Code = errno.CommonInternalErrorCode + outputData.EvalTargetRunError.Message = err.Error() + } + } + + userID := session.UserIDInCtxOrEmpty(ctx) + recordID, err := e.idgen.GenID(ctx) + if err != nil { + return nil, err + } + + record = &entity.EvalTargetRecord{ + ID: recordID, + SpaceID: spaceID, + TargetID: targetID, + TargetVersionID: targetVersionID, + ExperimentRunID: gptr.Indirect(param.ExperimentRunID), + ItemID: param.ItemID, + TurnID: param.TurnID, + LogID: logs.GetLogID(ctx), + EvalTargetInputData: inputData, + EvalTargetOutputData: outputData, + Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), + BaseInfo: &entity.BaseInfo{ + CreatedBy: &entity.UserInfo{ + UserID: gptr.Of(userID), + }, + UpdatedBy: &entity.UserInfo{ + UserID: gptr.Of(userID), + }, + CreatedAt: gptr.Of(time.Now().UnixMilli()), + UpdatedAt: gptr.Of(time.Now().UnixMilli()), + }, + } + if _, err := e.evalTargetRepo.CreateEvalTargetRecord(ctx, record); err != nil { + return nil, err + } + + return record, nil +} + func (e *EvalTargetServiceImpl) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) { return e.evalTargetRepo.GetEvalTargetRecordByIDAndSpaceID(ctx, spaceID, recordID) } @@ -287,6 +369,65 @@ func (e *EvalTargetServiceImpl) BatchGetRecordByIDs(ctx context.Context, spaceID return e.evalTargetRepo.ListEvalTargetRecordByIDsAndSpaceID(ctx, spaceID, recordIDs) } +func (e *EvalTargetServiceImpl) ReportInvokeRecords(ctx context.Context, param *entity.ReportTargetRecordParam) error { + record, err := e.evalTargetRepo.GetEvalTargetRecordByIDAndSpaceID(ctx, param.SpaceID, param.RecordID) + if err != nil { + return err + } + + record.EvalTargetOutputData = param.OutputData + if err := e.evalTargetRepo.SaveEvalTargetRecord(ctx, record); err != nil { + return err + } + + if err := e.emitTargetTrace(logs.SetLogID(ctx, record.LogID), record, param.Session); err != nil { + logs.CtxError(ctx, "emitTargetTrace fail, target_id: %v, target_version_id: %v, record_id: %v, err: %v", + record.TargetID, record.TargetVersionID, record.ID, err) + } + + return nil +} + +func (e *EvalTargetServiceImpl) emitTargetTrace(ctx context.Context, record *entity.EvalTargetRecord, session *entity.Session) error { + if record.EvalTargetOutputData == nil { + logs.CtxInfo(ctx, "emitTargetTrace with null data") + return nil + } + + evalTargetDO, err := e.GetEvalTargetVersion(ctx, record.SpaceID, record.TargetVersionID, false) + if err != nil { + return err + } + + ctx, span := looptracer.GetTracer().StartSpan(ctx, "EvalTarget", "eval_target", looptracer.WithStartNewTrace(), looptracer.WithSpanWorkspaceID(strconv.FormatInt(record.SpaceID, 10))) + span.SetCallType("EvalTarget") + ctx = looptracer.GetTracer().Inject(ctx) + + spanParam := &targetSpanTagsParams{ + Error: nil, + ErrCode: "", + CallType: "eval_target", + } + setSpanInputOutput(ctx, spanParam, evalTargetDO, record.EvalTargetInputData, record.EvalTargetOutputData) + + if record.EvalTargetOutputData.EvalTargetRunError != nil { + span.SetError(ctx, fmt.Errorf("code: %v, msg: %v", record.EvalTargetOutputData.EvalTargetRunError.Code, record.EvalTargetOutputData.EvalTargetRunError.Message)) + } + span.SetInput(ctx, Convert2TraceString(spanParam.Inputs)) + span.SetOutput(ctx, Convert2TraceString(spanParam.Outputs)) + span.SetInputTokens(ctx, int(spanParam.InputToken)) + span.SetOutputTokens(ctx, int(spanParam.OutputToken)) + span.SetUserID(ctx, session.UserID) + span.SetTags(ctx, map[string]any{ + "eval_target_type": spanParam.TargetType, + "eval_target_id": spanParam.TargetID, + "eval_target_version": spanParam.TargetVersion, + }) + span.Finish(ctx) + + return nil +} + func (e *EvalTargetServiceImpl) ValidateRuntimeParam(ctx context.Context, targetType entity.EvalTargetType, runtimeParam string) error { if len(runtimeParam) == 0 { return nil diff --git a/backend/modules/evaluation/domain/service/target_source.go b/backend/modules/evaluation/domain/service/target_source.go index 828eb3681..7a11ffe7b 100644 --- a/backend/modules/evaluation/domain/service/target_source.go +++ b/backend/modules/evaluation/domain/service/target_source.go @@ -28,6 +28,7 @@ type ISourceEvalTargetOperateService interface { ValidateInput(ctx context.Context, spaceID int64, inputSchema []*entity.ArgsSchema, input *entity.EvalTargetInputData) error // Execute Execute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (outputData *entity.EvalTargetOutputData, status entity.EvalTargetRunStatus, err error) + AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error RuntimeParam() entity.IRuntimeParam // 搜索自定义评测对象 SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) (targets []*entity.CustomEvalTarget, nextCursor string, hasMore bool, err error) diff --git a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go index dd83f8dfc..ef10073b7 100644 --- a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go +++ b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go @@ -33,6 +33,10 @@ type PromptSourceEvalTargetServiceImpl struct { promptRPCAdapter rpc.IPromptRPCAdapter } +func (t *PromptSourceEvalTargetServiceImpl) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error { + return errorx.New("async execute not supported") +} + func (t *PromptSourceEvalTargetServiceImpl) RuntimeParam() entity.IRuntimeParam { return entity.NewPromptRuntimeParam(nil) } diff --git a/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go new file mode 100644 index 000000000..2c46ce0cd --- /dev/null +++ b/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go @@ -0,0 +1,17 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package experiment + +import ( + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/infra/repo/experiment/redis/dao" +) + +type ExptItemTurnEvalAsyncRepoImpl struct { + dao.IExptItemTurnEvalAsyncDAO +} + +func NewExptItemTurnEvalAsyncRepo(dao dao.IExptItemTurnEvalAsyncDAO) repo.IExptItemTurnEvalAsyncRepo { + return &ExptItemTurnEvalAsyncRepoImpl{IExptItemTurnEvalAsyncDAO: dao} +} diff --git a/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go new file mode 100644 index 000000000..f7f6e873a --- /dev/null +++ b/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go @@ -0,0 +1,39 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package convert + +import ( + "github.com/samber/lo" + + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/pkg/errorx" + "github.com/coze-dev/coze-loop/backend/pkg/json" +) + +func NewExptItemTurnEvalAsyncCtx() *ExptItemTurnEvalAsyncCtxConverter { + return &ExptItemTurnEvalAsyncCtxConverter{} +} + +type ExptItemTurnEvalAsyncCtxConverter struct{} + +func (ExptItemTurnEvalAsyncCtxConverter) FromDO(actx *entity.ExptItemTurnEvalAsyncCtx) ([]byte, error) { + bytes, err := json.Marshal(actx) + if err != nil { + return nil, errorx.Wrapf(err, "ExptItemTurnEvalAsyncCtx json marshal failed") + } + return bytes, nil +} + +func (ExptItemTurnEvalAsyncCtxConverter) ToDO(b []byte) (*entity.ExptItemTurnEvalAsyncCtx, error) { + actx := &entity.ExptItemTurnEvalAsyncCtx{} + bytes := toBytes(b) + if err := lo.TernaryF( + len(bytes) > 0, + func() error { return json.Unmarshal(bytes, actx) }, + func() error { return nil }, + ); err != nil { + return nil, errorx.Wrapf(err, "QuotaSpaceExpt json unmarshal failed") + } + return actx, nil +} diff --git a/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go new file mode 100644 index 000000000..27e257044 --- /dev/null +++ b/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go @@ -0,0 +1,56 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package dao + +import ( + "context" + "fmt" + "time" + + "github.com/coze-dev/coze-loop/backend/infra/redis" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/infra/repo/experiment/redis/convert" + "github.com/coze-dev/coze-loop/backend/pkg/errorx" + "github.com/coze-dev/coze-loop/backend/pkg/lang/conv" +) + +type IExptItemTurnEvalAsyncDAO interface { + SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error + GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) +} + +func NewExptItemTurnEvalAsyncDAO(cmdable redis.Cmdable) IExptItemTurnEvalAsyncDAO { + const table = "experiment" + return &exptItemTurnEvalAsyncDAOImpl{cmdable: cmdable, table: table} +} + +type exptItemTurnEvalAsyncDAOImpl struct { + cmdable redis.Cmdable + table string +} + +func (e *exptItemTurnEvalAsyncDAOImpl) makeExptItemTurnEvalAsyncCtxKey(invokeID string) string { + return fmt.Sprintf("[%s]item_turn_eval_async_ctx:%s", e.table, invokeID) +} + +func (e *exptItemTurnEvalAsyncDAOImpl) SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error { + bytes, err := convert.NewExptItemTurnEvalAsyncCtx().FromDO(actx) + if err != nil { + return err + } + key := e.makeExptItemTurnEvalAsyncCtxKey(invokeID) + if err := e.cmdable.Set(ctx, key, bytes, time.Hour*12).Err(); err != nil { + return errorx.Wrapf(err, "redis set key: %v", key) + } + return nil +} + +func (e *exptItemTurnEvalAsyncDAOImpl) GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) { + key := e.makeExptItemTurnEvalAsyncCtxKey(invokeID) + got, err := e.cmdable.Get(ctx, key).Result() + if err != nil && !redis.IsNilError(err) { + return nil, errorx.Wrapf(err, "redis get fail, key: %v", key) + } + return convert.NewExptItemTurnEvalAsyncCtx().ToDO(conv.UnsafeStringToBytes(got)) +} diff --git a/backend/modules/evaluation/infra/repo/target/eval_target_repo_impl.go b/backend/modules/evaluation/infra/repo/target/eval_target_repo_impl.go index e6f007850..f6e22d0d2 100644 --- a/backend/modules/evaluation/infra/repo/target/eval_target_repo_impl.go +++ b/backend/modules/evaluation/infra/repo/target/eval_target_repo_impl.go @@ -257,3 +257,11 @@ func (e *EvalTargetRepoImpl) ListEvalTargetRecordByIDsAndSpaceID(ctx context.Con return res, nil } + +func (e *EvalTargetRepoImpl) SaveEvalTargetRecord(ctx context.Context, record *entity.EvalTargetRecord) error { + po, err := convertor.EvalTargetRecordDO2PO(record) + if err != nil { + return err + } + return e.evalTargetRecordDao.Save(ctx, po) +} diff --git a/backend/modules/evaluation/infra/repo/target/mysql/eval_target_record.go b/backend/modules/evaluation/infra/repo/target/mysql/eval_target_record.go index 6abe16ebd..0457aa81b 100644 --- a/backend/modules/evaluation/infra/repo/target/mysql/eval_target_record.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/eval_target_record.go @@ -20,6 +20,7 @@ import ( //go:generate mockgen -destination=mocks/eval_target_record.go -package=mocks . EvalTargetRecordDAO type EvalTargetRecordDAO interface { Create(ctx context.Context, record *model.TargetRecord) (id int64, err error) + Save(ctx context.Context, record *model.TargetRecord) error GetByIDAndSpaceID(ctx context.Context, recordID int64, spaceID int64) (*model.TargetRecord, error) ListByIDsAndSpaceID(ctx context.Context, recordIDs []int64, spaceID int64) ([]*model.TargetRecord, error) } @@ -33,6 +34,13 @@ func NewEvalTargetRecordDAO(db db.Provider) EvalTargetRecordDAO { return &EvalTargetRecordDAOImpl{db: db, query: query.Use(db.NewSession(context.Background()))} } +func (e *EvalTargetRecordDAOImpl) Save(ctx context.Context, record *model.TargetRecord) error { + if err := e.db.NewSession(ctx).Save(record).Error; err != nil { + return errorx.WrapByCode(err, errno.CommonMySqlErrorCode) + } + return nil +} + func (e *EvalTargetRecordDAOImpl) Create(ctx context.Context, record *model.TargetRecord) (id int64, err error) { // 写DB err = e.db.NewSession(ctx).Create(record).Error diff --git a/backend/modules/evaluation/infra/repo/target/mysql/mocks/eval_target_record.go b/backend/modules/evaluation/infra/repo/target/mysql/mocks/eval_target_record.go index 14e13f5ea..30f90d313 100644 --- a/backend/modules/evaluation/infra/repo/target/mysql/mocks/eval_target_record.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/mocks/eval_target_record.go @@ -85,3 +85,17 @@ func (mr *MockEvalTargetRecordDAOMockRecorder) ListByIDsAndSpaceID(ctx, recordID mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByIDsAndSpaceID", reflect.TypeOf((*MockEvalTargetRecordDAO)(nil).ListByIDsAndSpaceID), ctx, recordIDs, spaceID) } + +// Save mocks base method. +func (m *MockEvalTargetRecordDAO) Save(ctx context.Context, record *model.TargetRecord) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Save", ctx, record) + ret0, _ := ret[0].(error) + return ret0 +} + +// Save indicates an expected call of Save. +func (mr *MockEvalTargetRecordDAOMockRecorder) Save(ctx, record any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockEvalTargetRecordDAO)(nil).Save), ctx, record) +} diff --git a/backend/modules/evaluation/pkg/errno/evaluation.go b/backend/modules/evaluation/pkg/errno/evaluation.go index 8942e9199..2588f98f6 100644 --- a/backend/modules/evaluation/pkg/errno/evaluation.go +++ b/backend/modules/evaluation/pkg/errno/evaluation.go @@ -104,6 +104,10 @@ const ( exportRunningCountLimitMessage = "number of export in running has reached the maximum limit" exportRunningCountLimitNoAffectStability = true + CustomEvalTargetInvokeFailCode = 601204010 // custom eval target invoke fail + customEvalTargetInvokeFailMessage = "custom eval target invoke fail" + customEvalTargetInvokeFailNoAffectStability = true + ContentTypeNotSupportedCode = 601205000 // content type is not supported contentTypeNotSupportedMessage = "content type is not supported" contentTypeNotSupportedNoAffectStability = true @@ -359,6 +363,12 @@ func init() { code.WithAffectStability(!exportRunningCountLimitNoAffectStability), ) + code.Register( + CustomEvalTargetInvokeFailCode, + customEvalTargetInvokeFailMessage, + code.WithAffectStability(!customEvalTargetInvokeFailNoAffectStability), + ) + code.Register( ContentTypeNotSupportedCode, contentTypeNotSupportedMessage, diff --git a/backend/script/errorx/evaluation.yaml b/backend/script/errorx/evaluation.yaml index f97f31054..c65a2e58e 100644 --- a/backend/script/errorx/evaluation.yaml +++ b/backend/script/errorx/evaluation.yaml @@ -82,6 +82,12 @@ error_code: description: number of export in running has reached the maximum limit no_affect_stability: true + - name: CustomEvalTargetInvokeFail + code: 4010 + message: custom eval target invoke fail + description: custom eval target invoke fail + no_affect_stability: true + - name: ContentTypeNotSupported code: 5000 message: content type is not supported diff --git a/idl/thrift/coze/loop/apis/coze.loop.apis.thrift b/idl/thrift/coze/loop/apis/coze.loop.apis.thrift index f9cf28ecb..413c96bfe 100644 --- a/idl/thrift/coze/loop/apis/coze.loop.apis.thrift +++ b/idl/thrift/coze/loop/apis/coze.loop.apis.thrift @@ -10,6 +10,7 @@ include "../evaluation/coze.loop.evaluation.eval_set.thrift" include "../evaluation/coze.loop.evaluation.evaluator.thrift" include "../evaluation/coze.loop.evaluation.eval_target.thrift" include "../evaluation/coze.loop.evaluation.expt.thrift" +include "../evaluation/coze.loop.evaluation.openapi.thrift" include "../data/coze.loop.data.dataset.thrift" include "../prompt/coze.loop.prompt.manage.thrift" include "../prompt/coze.loop.prompt.debug.thrift" @@ -25,6 +26,7 @@ service EvaluationSetService extends coze.loop.evaluation.eval_set.EvaluationSet service EvaluatorService extends coze.loop.evaluation.evaluator.EvaluatorService{} service EvalTargetService extends coze.loop.evaluation.eval_target.EvalTargetService{} service ExperimentService extends coze.loop.evaluation.expt.ExperimentService{} +service EvalOpenAPIService extends coze.loop.evaluation.openapi.EvaluationOpenAPIService{} service DatasetService extends coze.loop.data.dataset.DatasetService{} service TagService extends coze.loop.data.tag.TagService{} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index f6d4c8e51..52866a6af 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -244,21 +244,6 @@ struct AsyncDebugEvalTargetResponse { 255: base.BaseResp BaseResp } -struct PassbackEvalTargetInvokeResultRequest { - 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') - 2: optional i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') - 3: optional string token - - 10: optional coze.loop.evaluation.spi.InvokeEvalTargetOutput output // 输出 - 11: optional coze.loop.evaluation.spi.InvokeEvalTargetUsage usage // 消耗 - - 255: optional base.Base Base (api.none="true"); -} - -struct PassbackEvalTargetInvokeResultResponse { - 255: base.BaseResp BaseResp (api.none="true") -} - service EvalTargetService { // 创建评测对象 CreateEvalTargetResponse CreateEvalTarget(1: CreateEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets") @@ -284,8 +269,4 @@ service EvalTargetService { // debug DebugEvalTargetResponse DebugEvalTarget(1: DebugEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/debug") AsyncDebugEvalTargetResponse AsyncDebugEvalTarget(1: AsyncDebugEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/async_debug") - - // 回传执行结果 - PassbackEvalTargetInvokeResultResponse PassbackEvalTargetInvokeResult(1: PassbackEvalTargetInvokeResultRequest req) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/passback_result") - } (api.js_conv="true" ) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.expt.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.expt.thrift index a555edcea..018791e2d 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.expt.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.expt.thrift @@ -451,7 +451,6 @@ struct GetExptResultExportRecordResponse { } - service ExperimentService { CheckExperimentNameResponse CheckExperimentName(1: CheckExperimentNameRequest req) (api.post = '/api/evaluation/v1/experiments/check_name') diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift new file mode 100644 index 000000000..6bf0290ae --- /dev/null +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift @@ -0,0 +1,27 @@ +namespace go coze.loop.evaluation.openapi + +include "../../../base.thrift" +include "coze.loop.evaluation.spi.thrift" + +struct ReportEvalTargetInvokeResultRequest { + 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') + 2: optional i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') + 3: optional coze.loop.evaluation.spi.InvokeEvalTargetStatus status + + // set output if status=SUCCESS + 10: optional coze.loop.evaluation.spi.InvokeEvalTargetOutput output + // set output if status=SUCCESS + 11: optional coze.loop.evaluation.spi.InvokeEvalTargetUsage usage + // set error_message if status=FAILED + 20: optional string error_message + + 255: optional base.Base Base +} + +struct ReportEvalTargetInvokeResultResponse { + 255: base.BaseResp BaseResp +} + +service EvaluationOpenAPIService { + ReportEvalTargetInvokeResultResponse ReportEvalTargetInvokeResult(1: ReportEvalTargetInvokeResultRequest req) (api.category="openapi", api.post = "/v1/loop/evaluation/eval_targets/result") +} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift index 0ca4241a7..a8e169d28 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.spi.thrift @@ -37,8 +37,13 @@ struct InvokeEvalTargetRequest { } struct InvokeEvalTargetResponse { - 1: optional InvokeEvalTargetOutput output // 输出 - 2: optional InvokeEvalTargetUsage usage // 消耗 + 1: optional InvokeEvalTargetStatus status + // set output if status=SUCCESS + 2: optional InvokeEvalTargetOutput output + // set usage if status=SUCCESS + 3: optional InvokeEvalTargetUsage usage + // set error_message if status=FAILED + 10: optional string error_message 255: base.BaseResp BaseResp (api.none="true") } @@ -49,9 +54,15 @@ struct InvokeEvalTargetInput { 20: optional map ext // 扩展字段,动态参数会通过ext字段传递 } +enum InvokeEvalTargetStatus { + UNKNOWN = 0 + SUCCESS = 1 + FAILED = 2 +} + // 新增 struct InvokeEvalTargetOutput { - 1: optional Content actual_output // 实际输出 + 1: optional Content actual_output 20: optional map ext // 扩展字段,用户如果想返回一些额外信息可以塞在这个字段 } @@ -80,7 +91,6 @@ struct InvokeEvalTargetUsage { struct AsyncInvokeEvalTargetRequest { 1: optional i64 workspace_id 2: optional i64 invoke_id // 执行id,传递给自定义对象,在回传结果时透传 - 3: optional string token // 根据invoke_id签发的token,在回传结果时透传 4: optional InvokeEvalTargetInput input // 执行输入信息 5: optional CustomEvalTarget custom_eval_target // 如果创建实验时选了二级对象,则会透传二级对象信息 @@ -91,7 +101,6 @@ struct AsyncInvokeEvalTargetResponse { 255: base.BaseResp BaseResp (api.none="true") } - service EvaluationSPIService { SearchEvalTargetResponse SearchEvalTarget(1: SearchEvalTargetRequest req) // 搜索评测对象 InvokeEvalTargetResponse InvokeEvalTarget(1: InvokeEvalTargetRequest req) // 执行 diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift index 24a6e1c45..34780abbc 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift @@ -4,6 +4,7 @@ include "coze.loop.evaluation.eval_set.thrift" include "coze.loop.evaluation.evaluator.thrift" include "coze.loop.evaluation.expt.thrift" include "coze.loop.evaluation.eval_target.thrift" +include "coze.loop.evaluation.openapi.thrift" service EvaluationSetService extends coze.loop.evaluation.eval_set.EvaluationSetService{} @@ -11,4 +12,6 @@ service EvaluatorService extends coze.loop.evaluation.evaluator.EvaluatorService service ExperimentService extends coze.loop.evaluation.expt.ExperimentService{} -service EvalTargetService extends coze.loop.evaluation.eval_target.EvalTargetService{} \ No newline at end of file +service EvalTargetService extends coze.loop.evaluation.eval_target.EvalTargetService{} + +service EvalOpenAPIService extends coze.loop.evaluation.openapi.EvaluationOpenAPIService{} \ No newline at end of file From e67bca010660e781392edf7fdfa8149591d58711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Thu, 18 Sep 2025 14:14:22 +0800 Subject: [PATCH 030/100] fix Change-Id: Id2c5b00e06032cf0a7284b11b35831a4b910ddb1 --- backend/modules/evaluation/domain/entity/expt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/evaluation/domain/entity/expt.go b/backend/modules/evaluation/domain/entity/expt.go index 4fa5597d5..5f3ba6c40 100644 --- a/backend/modules/evaluation/domain/entity/expt.go +++ b/backend/modules/evaluation/domain/entity/expt.go @@ -166,7 +166,7 @@ func (t *TargetConf) Valid(ctx context.Context, targetType EvalTargetType) error if t == nil || t.TargetVersionID == 0 { return fmt.Errorf("invalid TargetConf: %v", json.Jsonify(t)) } - if targetType == EvalTargetTypeLoopPrompt { // prompt target might receive no input + if targetType == EvalTargetTypeLoopPrompt || targetType == EvalTargetTypeCustomRPCServer { // prompt target might receive no input return nil } if t.IngressConf != nil && t.IngressConf.EvalSetAdapter != nil && len(t.IngressConf.EvalSetAdapter.FieldConfs) > 0 { From 3a64f69703313b68a55c8ed51891f0e0dc15964a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Thu, 18 Sep 2025 17:14:37 +0800 Subject: [PATCH 031/100] fix Change-Id: Id3593c7c69804d5c0a9a36f6b6f4be843bff0063 --- .../domain/eval_target/eval_target.go | 156 ++++++++++++++++++ .../domain/eval_target/k-eval_target.go | 109 ++++++++++++ .../convertor/target/eval_target.go | 2 + .../target_builtin_custom_rpc_server.go | 2 +- .../loop/evaluation/domain/eval_target.thrift | 3 + 5 files changed, 271 insertions(+), 1 deletion(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index d1ebc7d47..a1ca01ea7 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -2159,6 +2159,10 @@ type CustomRPCServer struct { CustomEvalTarget *CustomEvalTarget `thrift:"custom_eval_target,18,optional" frugal:"18,optional,CustomEvalTarget" form:"custom_eval_target" json:"custom_eval_target,omitempty" query:"custom_eval_target"` // 是否异步 IsAsync *bool `thrift:"is_async,19,optional" frugal:"19,optional,bool" form:"is_async" json:"is_async,omitempty" query:"is_async"` + // 执行区域 + ExecRegion *Region `thrift:"exec_region,20,optional" frugal:"20,optional,string" form:"exec_region" json:"exec_region,omitempty" query:"exec_region"` + // 执行环境 + ExecEnv *string `thrift:"exec_env,21,optional" frugal:"21,optional,string" form:"exec_env" json:"exec_env,omitempty" query:"exec_env"` } func NewCustomRPCServer() *CustomRPCServer { @@ -2323,6 +2327,30 @@ func (p *CustomRPCServer) GetIsAsync() (v bool) { } return *p.IsAsync } + +var CustomRPCServer_ExecRegion_DEFAULT Region + +func (p *CustomRPCServer) GetExecRegion() (v Region) { + if p == nil { + return + } + if !p.IsSetExecRegion() { + return CustomRPCServer_ExecRegion_DEFAULT + } + return *p.ExecRegion +} + +var CustomRPCServer_ExecEnv_DEFAULT string + +func (p *CustomRPCServer) GetExecEnv() (v string) { + if p == nil { + return + } + if !p.IsSetExecEnv() { + return CustomRPCServer_ExecEnv_DEFAULT + } + return *p.ExecEnv +} func (p *CustomRPCServer) SetID(val *int64) { p.ID = val } @@ -2362,6 +2390,12 @@ func (p *CustomRPCServer) SetCustomEvalTarget(val *CustomEvalTarget) { func (p *CustomRPCServer) SetIsAsync(val *bool) { p.IsAsync = val } +func (p *CustomRPCServer) SetExecRegion(val *Region) { + p.ExecRegion = val +} +func (p *CustomRPCServer) SetExecEnv(val *string) { + p.ExecEnv = val +} var fieldIDToName_CustomRPCServer = map[int16]string{ 1: "id", @@ -2377,6 +2411,8 @@ var fieldIDToName_CustomRPCServer = map[int16]string{ 17: "search_http_info", 18: "custom_eval_target", 19: "is_async", + 20: "exec_region", + 21: "exec_env", } func (p *CustomRPCServer) IsSetID() bool { @@ -2431,6 +2467,14 @@ func (p *CustomRPCServer) IsSetIsAsync() bool { return p.IsAsync != nil } +func (p *CustomRPCServer) IsSetExecRegion() bool { + return p.ExecRegion != nil +} + +func (p *CustomRPCServer) IsSetExecEnv() bool { + return p.ExecEnv != nil +} + func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -2553,6 +2597,22 @@ func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 20: + if fieldTypeId == thrift.STRING { + if err = p.ReadField20(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 21: + if fieldTypeId == thrift.STRING { + if err = p.ReadField21(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2725,6 +2785,28 @@ func (p *CustomRPCServer) ReadField19(iprot thrift.TProtocol) error { p.IsAsync = _field return nil } +func (p *CustomRPCServer) ReadField20(iprot thrift.TProtocol) error { + + var _field *Region + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ExecRegion = _field + return nil +} +func (p *CustomRPCServer) ReadField21(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.ExecEnv = _field + return nil +} func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -2784,6 +2866,14 @@ func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { fieldId = 19 goto WriteFieldError } + if err = p.writeField20(oprot); err != nil { + fieldId = 20 + goto WriteFieldError + } + if err = p.writeField21(oprot); err != nil { + fieldId = 21 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3044,6 +3134,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) } +func (p *CustomRPCServer) writeField20(oprot thrift.TProtocol) (err error) { + if p.IsSetExecRegion() { + if err = oprot.WriteFieldBegin("exec_region", thrift.STRING, 20); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ExecRegion); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 20 end error: ", p), err) +} +func (p *CustomRPCServer) writeField21(oprot thrift.TProtocol) (err error) { + if p.IsSetExecEnv() { + if err = oprot.WriteFieldBegin("exec_env", thrift.STRING, 21); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.ExecEnv); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 21 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err) +} func (p *CustomRPCServer) String() string { if p == nil { @@ -3098,6 +3224,12 @@ func (p *CustomRPCServer) DeepEqual(ano *CustomRPCServer) bool { if !p.Field19DeepEqual(ano.IsAsync) { return false } + if !p.Field20DeepEqual(ano.ExecRegion) { + return false + } + if !p.Field21DeepEqual(ano.ExecEnv) { + return false + } return true } @@ -3238,6 +3370,30 @@ func (p *CustomRPCServer) Field19DeepEqual(src *bool) bool { } return true } +func (p *CustomRPCServer) Field20DeepEqual(src *Region) bool { + + if p.ExecRegion == src { + return true + } else if p.ExecRegion == nil || src == nil { + return false + } + if strings.Compare(*p.ExecRegion, *src) != 0 { + return false + } + return true +} +func (p *CustomRPCServer) Field21DeepEqual(src *string) bool { + + if p.ExecEnv == src { + return true + } else if p.ExecEnv == nil || src == nil { + return false + } + if strings.Compare(*p.ExecEnv, *src) != 0 { + return false + } + return true +} type CustomEvalTarget struct { // 唯一键,平台不消费,仅做透传 diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 5388046ad..9e2ea0719 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -1571,6 +1571,34 @@ func (p *CustomRPCServer) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 20: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField20(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 21: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField21(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1773,6 +1801,34 @@ func (p *CustomRPCServer) FastReadField19(buf []byte) (int, error) { return offset, nil } +func (p *CustomRPCServer) FastReadField20(buf []byte) (int, error) { + offset := 0 + + var _field *Region + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ExecRegion = _field + return offset, nil +} + +func (p *CustomRPCServer) FastReadField21(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.ExecEnv = _field + return offset, nil +} + func (p *CustomRPCServer) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -1793,6 +1849,8 @@ func (p *CustomRPCServer) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int offset += p.fastWriteField15(buf[offset:], w) offset += p.fastWriteField17(buf[offset:], w) offset += p.fastWriteField18(buf[offset:], w) + offset += p.fastWriteField20(buf[offset:], w) + offset += p.fastWriteField21(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -1814,6 +1872,8 @@ func (p *CustomRPCServer) BLength() int { l += p.field17Length() l += p.field18Length() l += p.field19Length() + l += p.field20Length() + l += p.field21Length() } l += thrift.Binary.FieldStopLength() return l @@ -1943,6 +2003,24 @@ func (p *CustomRPCServer) fastWriteField19(buf []byte, w thrift.NocopyWriter) in return offset } +func (p *CustomRPCServer) fastWriteField20(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExecRegion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 20) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ExecRegion) + } + return offset +} + +func (p *CustomRPCServer) fastWriteField21(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExecEnv() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 21) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.ExecEnv) + } + return offset +} + func (p *CustomRPCServer) field1Length() int { l := 0 if p.IsSetID() { @@ -2064,6 +2142,24 @@ func (p *CustomRPCServer) field19Length() int { return l } +func (p *CustomRPCServer) field20Length() int { + l := 0 + if p.IsSetExecRegion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ExecRegion) + } + return l +} + +func (p *CustomRPCServer) field21Length() int { + l := 0 + if p.IsSetExecEnv() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.ExecEnv) + } + return l +} + func (p *CustomRPCServer) DeepCopy(s interface{}) error { src, ok := s.(*CustomRPCServer) if !ok { @@ -2167,6 +2263,19 @@ func (p *CustomRPCServer) DeepCopy(s interface{}) error { p.IsAsync = &tmp } + if src.ExecRegion != nil { + tmp := *src.ExecRegion + p.ExecRegion = &tmp + } + + if src.ExecEnv != nil { + var tmp string + if *src.ExecEnv != "" { + tmp = kutils.StringDeepCopy(*src.ExecEnv) + } + p.ExecEnv = &tmp + } + return nil } diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 3342c5faa..42c9f4f14 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -206,6 +206,8 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi SearchHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.SearchHTTPInfo), CustomEvalTarget: CustomEvalTargetDO2DTO(targetVersionDO.CustomRPCServer.CustomEvalTarget), IsAsync: targetVersionDO.CustomRPCServer.IsAsync, + ExecRegion: gptr.Of(targetVersionDO.CustomRPCServer.ExecRegion), + ExecEnv: targetVersionDO.CustomRPCServer.ExecEnv, } } default: diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go index b5483bae8..e568b7599 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go @@ -32,7 +32,7 @@ type CustomRPCServer struct { Ext map[string]string ExecRegion Region // 执行区域 - Env *string // 执行环境 + ExecEnv *string // 执行环境 } type HTTPInfo struct { diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 59bf5c942..16cecab34 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -73,6 +73,9 @@ struct CustomRPCServer { 18: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 19: optional bool is_async // 是否异步 + 20: optional Region exec_region // 执行区域 + 21: optional string exec_env // 执行环境 + } struct CustomEvalTarget { From b271cf678e280c6f5ada30bae7c94ae3ae0eed70 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 18 Sep 2025 19:42:52 +0800 Subject: [PATCH 032/100] feat(evaluation): spi service code gen --- .../loop/evaluation/coze.loop.evaluation.go | 36 ++++ .../loop/evaluation/evalspiservice/client.go | 61 +++++++ .../evalspiservice/evalspiservice.go | 168 ++++++++++++++++++ .../loop/evaluation/evalspiservice/server.go | 25 +++ .../loop/evaluation/k-coze.loop.evaluation.go | 2 + 5 files changed, 292 insertions(+) create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go diff --git a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go index 6a09b79cd..7fb7dcda2 100644 --- a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go @@ -9,6 +9,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) type EvaluationSetService interface { @@ -141,6 +142,32 @@ func NewEvalOpenAPIServiceClient(c thrift.TClient) *EvalOpenAPIServiceClient { } } +type EvalSPIService interface { + spi.EvaluationSPIService +} + +type EvalSPIServiceClient struct { + *spi.EvaluationSPIServiceClient +} + +func NewEvalSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientFactory(t, f), + } +} + +func NewEvalSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientProtocol(t, iprot, oprot), + } +} + +func NewEvalSPIServiceClient(c thrift.TClient) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClient(c), + } +} + type EvaluationSetServiceProcessor struct { *eval_set.EvaluationSetServiceProcessor } @@ -185,3 +212,12 @@ func NewEvalOpenAPIServiceProcessor(handler EvalOpenAPIService) *EvalOpenAPIServ self := &EvalOpenAPIServiceProcessor{openapi.NewEvaluationOpenAPIServiceProcessor(handler)} return self } + +type EvalSPIServiceProcessor struct { + *spi.EvaluationSPIServiceProcessor +} + +func NewEvalSPIServiceProcessor(handler EvalSPIService) *EvalSPIServiceProcessor { + self := &EvalSPIServiceProcessor{spi.NewEvaluationSPIServiceProcessor(handler)} + return self +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go new file mode 100644 index 000000000..d09738d01 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go @@ -0,0 +1,61 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalspiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) + InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) + AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvalSPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvalSPIServiceClient struct { + *kClient +} + +func (p *kEvalSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchEvalTarget(ctx, req) +} + +func (p *kEvalSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.InvokeEvalTarget(ctx, req) +} + +func (p *kEvalSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncInvokeEvalTarget(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go new file mode 100644 index 000000000..868956109 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go @@ -0,0 +1,168 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalspiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "SearchEvalTarget": kitex.NewMethodInfo( + searchEvalTargetHandler, + newEvaluationSPIServiceSearchEvalTargetArgs, + newEvaluationSPIServiceSearchEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "InvokeEvalTarget": kitex.NewMethodInfo( + invokeEvalTargetHandler, + newEvaluationSPIServiceInvokeEvalTargetArgs, + newEvaluationSPIServiceInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncInvokeEvalTarget": kitex.NewMethodInfo( + asyncInvokeEvalTargetHandler, + newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, + newEvaluationSPIServiceAsyncInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evalSPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evalSPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvalSPIService" + handlerType := (*evaluation.EvalSPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "evaluation", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() +} + +func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetResult() +} + +func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() +} + +func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceSearchEvalTargetResult + if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceInvokeEvalTargetResult + if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go new file mode 100644 index 000000000..b72ed3822 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evalspiservice + +import ( + server "github.com/cloudwego/kitex/server" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler evaluation.EvalSPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler evaluation.EvalSPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go index d51f9b68d..0281654a0 100644 --- a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go @@ -15,6 +15,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) var ( @@ -23,6 +24,7 @@ var ( _ = evaluator.KitexUnusedProtection _ = expt.KitexUnusedProtection _ = openapi.KitexUnusedProtection + _ = spi.KitexUnusedProtection ) // unused protection From 18c8c5cd470174bcbf9ccd3670e0bac231bb25c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 19 Sep 2025 11:26:26 +0800 Subject: [PATCH 033/100] fix Change-Id: Ie09dcddfb349ae728e406d144ba807df3edf737c --- .../loop/evaluation/coze.loop.evaluation.go | 36 --- .../domain/eval_target/eval_target.go | 234 ++++++++++++------ .../domain/eval_target/k-eval_target.go | 159 ++++++++---- .../loop/evaluation/evalspiservice/client.go | 61 ----- .../evalspiservice/evalspiservice.go | 168 ------------- .../loop/evaluation/evalspiservice/server.go | 25 -- .../loop/evaluation/k-coze.loop.evaluation.go | 2 - .../convertor/target/eval_target.go | 16 +- .../target_builtin_custom_rpc_server.go | 8 +- .../loop/evaluation/domain/eval_target.thrift | 3 +- 10 files changed, 278 insertions(+), 434 deletions(-) delete mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go delete mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go diff --git a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go index 7fb7dcda2..6a09b79cd 100644 --- a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go @@ -9,7 +9,6 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) type EvaluationSetService interface { @@ -142,32 +141,6 @@ func NewEvalOpenAPIServiceClient(c thrift.TClient) *EvalOpenAPIServiceClient { } } -type EvalSPIService interface { - spi.EvaluationSPIService -} - -type EvalSPIServiceClient struct { - *spi.EvaluationSPIServiceClient -} - -func NewEvalSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalSPIServiceClient { - return &EvalSPIServiceClient{ - EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientFactory(t, f), - } -} - -func NewEvalSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalSPIServiceClient { - return &EvalSPIServiceClient{ - EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientProtocol(t, iprot, oprot), - } -} - -func NewEvalSPIServiceClient(c thrift.TClient) *EvalSPIServiceClient { - return &EvalSPIServiceClient{ - EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClient(c), - } -} - type EvaluationSetServiceProcessor struct { *eval_set.EvaluationSetServiceProcessor } @@ -212,12 +185,3 @@ func NewEvalOpenAPIServiceProcessor(handler EvalOpenAPIService) *EvalOpenAPIServ self := &EvalOpenAPIServiceProcessor{openapi.NewEvaluationOpenAPIServiceProcessor(handler)} return self } - -type EvalSPIServiceProcessor struct { - *spi.EvaluationSPIServiceProcessor -} - -func NewEvalSPIServiceProcessor(handler EvalSPIService) *EvalSPIServiceProcessor { - self := &EvalSPIServiceProcessor{spi.NewEvaluationSPIServiceProcessor(handler)} - return self -} diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index a1ca01ea7..ce0966b68 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -2163,6 +2163,10 @@ type CustomRPCServer struct { ExecRegion *Region `thrift:"exec_region,20,optional" frugal:"20,optional,string" form:"exec_region" json:"exec_region,omitempty" query:"exec_region"` // 执行环境 ExecEnv *string `thrift:"exec_env,21,optional" frugal:"21,optional,string" form:"exec_env" json:"exec_env,omitempty" query:"exec_env"` + // 执行超时时间,单位ms + Timeout *int64 `thrift:"timeout,22,optional" frugal:"22,optional,i64" form:"timeout" json:"timeout,omitempty" query:"timeout"` + // 异步执行超时时间,单位ms + AsyncTimeout *int64 `thrift:"async_timeout,23,optional" frugal:"23,optional,i64" form:"async_timeout" json:"async_timeout,omitempty" query:"async_timeout"` } func NewCustomRPCServer() *CustomRPCServer { @@ -2351,6 +2355,30 @@ func (p *CustomRPCServer) GetExecEnv() (v string) { } return *p.ExecEnv } + +var CustomRPCServer_Timeout_DEFAULT int64 + +func (p *CustomRPCServer) GetTimeout() (v int64) { + if p == nil { + return + } + if !p.IsSetTimeout() { + return CustomRPCServer_Timeout_DEFAULT + } + return *p.Timeout +} + +var CustomRPCServer_AsyncTimeout_DEFAULT int64 + +func (p *CustomRPCServer) GetAsyncTimeout() (v int64) { + if p == nil { + return + } + if !p.IsSetAsyncTimeout() { + return CustomRPCServer_AsyncTimeout_DEFAULT + } + return *p.AsyncTimeout +} func (p *CustomRPCServer) SetID(val *int64) { p.ID = val } @@ -2396,6 +2424,12 @@ func (p *CustomRPCServer) SetExecRegion(val *Region) { func (p *CustomRPCServer) SetExecEnv(val *string) { p.ExecEnv = val } +func (p *CustomRPCServer) SetTimeout(val *int64) { + p.Timeout = val +} +func (p *CustomRPCServer) SetAsyncTimeout(val *int64) { + p.AsyncTimeout = val +} var fieldIDToName_CustomRPCServer = map[int16]string{ 1: "id", @@ -2413,6 +2447,8 @@ var fieldIDToName_CustomRPCServer = map[int16]string{ 19: "is_async", 20: "exec_region", 21: "exec_env", + 22: "timeout", + 23: "async_timeout", } func (p *CustomRPCServer) IsSetID() bool { @@ -2475,6 +2511,14 @@ func (p *CustomRPCServer) IsSetExecEnv() bool { return p.ExecEnv != nil } +func (p *CustomRPCServer) IsSetTimeout() bool { + return p.Timeout != nil +} + +func (p *CustomRPCServer) IsSetAsyncTimeout() bool { + return p.AsyncTimeout != nil +} + func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -2613,6 +2657,22 @@ func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 22: + if fieldTypeId == thrift.I64 { + if err = p.ReadField22(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 23: + if fieldTypeId == thrift.I64 { + if err = p.ReadField23(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2807,6 +2867,28 @@ func (p *CustomRPCServer) ReadField21(iprot thrift.TProtocol) error { p.ExecEnv = _field return nil } +func (p *CustomRPCServer) ReadField22(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Timeout = _field + return nil +} +func (p *CustomRPCServer) ReadField23(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.AsyncTimeout = _field + return nil +} func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -2874,6 +2956,14 @@ func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { fieldId = 21 goto WriteFieldError } + if err = p.writeField22(oprot); err != nil { + fieldId = 22 + goto WriteFieldError + } + if err = p.writeField23(oprot); err != nil { + fieldId = 23 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3170,6 +3260,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err) } +func (p *CustomRPCServer) writeField22(oprot thrift.TProtocol) (err error) { + if p.IsSetTimeout() { + if err = oprot.WriteFieldBegin("timeout", thrift.I64, 22); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Timeout); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 end error: ", p), err) +} +func (p *CustomRPCServer) writeField23(oprot thrift.TProtocol) (err error) { + if p.IsSetAsyncTimeout() { + if err = oprot.WriteFieldBegin("async_timeout", thrift.I64, 23); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.AsyncTimeout); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 end error: ", p), err) +} func (p *CustomRPCServer) String() string { if p == nil { @@ -3230,6 +3356,12 @@ func (p *CustomRPCServer) DeepEqual(ano *CustomRPCServer) bool { if !p.Field21DeepEqual(ano.ExecEnv) { return false } + if !p.Field22DeepEqual(ano.Timeout) { + return false + } + if !p.Field23DeepEqual(ano.AsyncTimeout) { + return false + } return true } @@ -3394,6 +3526,30 @@ func (p *CustomRPCServer) Field21DeepEqual(src *string) bool { } return true } +func (p *CustomRPCServer) Field22DeepEqual(src *int64) bool { + + if p.Timeout == src { + return true + } else if p.Timeout == nil || src == nil { + return false + } + if *p.Timeout != *src { + return false + } + return true +} +func (p *CustomRPCServer) Field23DeepEqual(src *int64) bool { + + if p.AsyncTimeout == src { + return true + } else if p.AsyncTimeout == nil || src == nil { + return false + } + if *p.AsyncTimeout != *src { + return false + } + return true +} type CustomEvalTarget struct { // 唯一键,平台不消费,仅做透传 @@ -3844,8 +4000,6 @@ func (p *CustomEvalTarget) Field10DeepEqual(src map[string]string) bool { type HTTPInfo struct { Method *HTTPMethod `thrift:"method,1,optional" frugal:"1,optional,string" form:"method" json:"method,omitempty" query:"method"` Path *string `thrift:"path,2,optional" frugal:"2,optional,string" form:"path" json:"path,omitempty" query:"path"` - // ms,默认5000,最大800,000 - Timeout *int64 `thrift:"timeout,4,optional" frugal:"4,optional,i64" form:"timeout" json:"timeout,omitempty" query:"timeout"` } func NewHTTPInfo() *HTTPInfo { @@ -3878,32 +4032,16 @@ func (p *HTTPInfo) GetPath() (v string) { } return *p.Path } - -var HTTPInfo_Timeout_DEFAULT int64 - -func (p *HTTPInfo) GetTimeout() (v int64) { - if p == nil { - return - } - if !p.IsSetTimeout() { - return HTTPInfo_Timeout_DEFAULT - } - return *p.Timeout -} func (p *HTTPInfo) SetMethod(val *HTTPMethod) { p.Method = val } func (p *HTTPInfo) SetPath(val *string) { p.Path = val } -func (p *HTTPInfo) SetTimeout(val *int64) { - p.Timeout = val -} var fieldIDToName_HTTPInfo = map[int16]string{ 1: "method", 2: "path", - 4: "timeout", } func (p *HTTPInfo) IsSetMethod() bool { @@ -3914,10 +4052,6 @@ func (p *HTTPInfo) IsSetPath() bool { return p.Path != nil } -func (p *HTTPInfo) IsSetTimeout() bool { - return p.Timeout != nil -} - func (p *HTTPInfo) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -3952,14 +4086,6 @@ func (p *HTTPInfo) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -4011,17 +4137,6 @@ func (p *HTTPInfo) ReadField2(iprot thrift.TProtocol) error { p.Path = _field return nil } -func (p *HTTPInfo) ReadField4(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.Timeout = _field - return nil -} func (p *HTTPInfo) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -4037,10 +4152,6 @@ func (p *HTTPInfo) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -4095,24 +4206,6 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *HTTPInfo) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetTimeout() { - if err = oprot.WriteFieldBegin("timeout", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.Timeout); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} func (p *HTTPInfo) String() string { if p == nil { @@ -4134,9 +4227,6 @@ func (p *HTTPInfo) DeepEqual(ano *HTTPInfo) bool { if !p.Field2DeepEqual(ano.Path) { return false } - if !p.Field4DeepEqual(ano.Timeout) { - return false - } return true } @@ -4164,18 +4254,6 @@ func (p *HTTPInfo) Field2DeepEqual(src *string) bool { } return true } -func (p *HTTPInfo) Field4DeepEqual(src *int64) bool { - - if p.Timeout == src { - return true - } else if p.Timeout == nil || src == nil { - return false - } - if *p.Timeout != *src { - return false - } - return true -} type VolcengineAgent struct { // 罗盘应用ID diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 9e2ea0719..77708438c 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -1599,6 +1599,34 @@ func (p *CustomRPCServer) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 22: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField22(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 23: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField23(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1829,6 +1857,34 @@ func (p *CustomRPCServer) FastReadField21(buf []byte) (int, error) { return offset, nil } +func (p *CustomRPCServer) FastReadField22(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Timeout = _field + return offset, nil +} + +func (p *CustomRPCServer) FastReadField23(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.AsyncTimeout = _field + return offset, nil +} + func (p *CustomRPCServer) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -1839,6 +1895,8 @@ func (p *CustomRPCServer) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField16(buf[offset:], w) offset += p.fastWriteField19(buf[offset:], w) + offset += p.fastWriteField22(buf[offset:], w) + offset += p.fastWriteField23(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) @@ -1874,6 +1932,8 @@ func (p *CustomRPCServer) BLength() int { l += p.field19Length() l += p.field20Length() l += p.field21Length() + l += p.field22Length() + l += p.field23Length() } l += thrift.Binary.FieldStopLength() return l @@ -2021,6 +2081,24 @@ func (p *CustomRPCServer) fastWriteField21(buf []byte, w thrift.NocopyWriter) in return offset } +func (p *CustomRPCServer) fastWriteField22(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTimeout() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 22) + offset += thrift.Binary.WriteI64(buf[offset:], *p.Timeout) + } + return offset +} + +func (p *CustomRPCServer) fastWriteField23(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAsyncTimeout() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 23) + offset += thrift.Binary.WriteI64(buf[offset:], *p.AsyncTimeout) + } + return offset +} + func (p *CustomRPCServer) field1Length() int { l := 0 if p.IsSetID() { @@ -2160,6 +2238,24 @@ func (p *CustomRPCServer) field21Length() int { return l } +func (p *CustomRPCServer) field22Length() int { + l := 0 + if p.IsSetTimeout() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *CustomRPCServer) field23Length() int { + l := 0 + if p.IsSetAsyncTimeout() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + func (p *CustomRPCServer) DeepCopy(s interface{}) error { src, ok := s.(*CustomRPCServer) if !ok { @@ -2276,6 +2372,16 @@ func (p *CustomRPCServer) DeepCopy(s interface{}) error { p.ExecEnv = &tmp } + if src.Timeout != nil { + tmp := *src.Timeout + p.Timeout = &tmp + } + + if src.AsyncTimeout != nil { + tmp := *src.AsyncTimeout + p.AsyncTimeout = &tmp + } + return nil } @@ -2653,20 +2759,6 @@ func (p *HTTPInfo) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 4: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2713,20 +2805,6 @@ func (p *HTTPInfo) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *HTTPInfo) FastReadField4(buf []byte) (int, error) { - offset := 0 - - var _field *int64 - if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = &v - } - p.Timeout = _field - return offset, nil -} - func (p *HTTPInfo) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -2734,7 +2812,6 @@ func (p *HTTPInfo) FastWrite(buf []byte) int { func (p *HTTPInfo) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { - offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) } @@ -2747,7 +2824,6 @@ func (p *HTTPInfo) BLength() int { if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field4Length() } l += thrift.Binary.FieldStopLength() return l @@ -2771,15 +2847,6 @@ func (p *HTTPInfo) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *HTTPInfo) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetTimeout() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 4) - offset += thrift.Binary.WriteI64(buf[offset:], *p.Timeout) - } - return offset -} - func (p *HTTPInfo) field1Length() int { l := 0 if p.IsSetMethod() { @@ -2798,15 +2865,6 @@ func (p *HTTPInfo) field2Length() int { return l } -func (p *HTTPInfo) field4Length() int { - l := 0 - if p.IsSetTimeout() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() - } - return l -} - func (p *HTTPInfo) DeepCopy(s interface{}) error { src, ok := s.(*HTTPInfo) if !ok { @@ -2826,11 +2884,6 @@ func (p *HTTPInfo) DeepCopy(s interface{}) error { p.Path = &tmp } - if src.Timeout != nil { - tmp := *src.Timeout - p.Timeout = &tmp - } - return nil } diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go deleted file mode 100644 index d09738d01..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. - -package evalspiservice - -import ( - "context" - client "github.com/cloudwego/kitex/client" - callopt "github.com/cloudwego/kitex/client/callopt" - spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. -type Client interface { - SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) - InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) - AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) -} - -// NewClient creates a client for the service defined in IDL. -func NewClient(destService string, opts ...client.Option) (Client, error) { - var options []client.Option - options = append(options, client.WithDestService(destService)) - - options = append(options, opts...) - - kc, err := client.NewClient(serviceInfo(), options...) - if err != nil { - return nil, err - } - return &kEvalSPIServiceClient{ - kClient: newServiceClient(kc), - }, nil -} - -// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. -func MustNewClient(destService string, opts ...client.Option) Client { - kc, err := NewClient(destService, opts...) - if err != nil { - panic(err) - } - return kc -} - -type kEvalSPIServiceClient struct { - *kClient -} - -func (p *kEvalSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.SearchEvalTarget(ctx, req) -} - -func (p *kEvalSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.InvokeEvalTarget(ctx, req) -} - -func (p *kEvalSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.AsyncInvokeEvalTarget(ctx, req) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go deleted file mode 100644 index 868956109..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. - -package evalspiservice - -import ( - "context" - "errors" - client "github.com/cloudwego/kitex/client" - kitex "github.com/cloudwego/kitex/pkg/serviceinfo" - evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" - spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" -) - -var errInvalidMessageType = errors.New("invalid message type for service method handler") - -var serviceMethods = map[string]kitex.MethodInfo{ - "SearchEvalTarget": kitex.NewMethodInfo( - searchEvalTargetHandler, - newEvaluationSPIServiceSearchEvalTargetArgs, - newEvaluationSPIServiceSearchEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), - "InvokeEvalTarget": kitex.NewMethodInfo( - invokeEvalTargetHandler, - newEvaluationSPIServiceInvokeEvalTargetArgs, - newEvaluationSPIServiceInvokeEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), - "AsyncInvokeEvalTarget": kitex.NewMethodInfo( - asyncInvokeEvalTargetHandler, - newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, - newEvaluationSPIServiceAsyncInvokeEvalTargetResult, - false, - kitex.WithStreamingMode(kitex.StreamingNone), - ), -} - -var ( - evalSPIServiceServiceInfo = NewServiceInfo() -) - -// for server -func serviceInfo() *kitex.ServiceInfo { - return evalSPIServiceServiceInfo -} - -// NewServiceInfo creates a new ServiceInfo -func NewServiceInfo() *kitex.ServiceInfo { - return newServiceInfo() -} - -func newServiceInfo() *kitex.ServiceInfo { - serviceName := "EvalSPIService" - handlerType := (*evaluation.EvalSPIService)(nil) - extra := map[string]interface{}{ - "PackageName": "evaluation", - } - svcInfo := &kitex.ServiceInfo{ - ServiceName: serviceName, - HandlerType: handlerType, - Methods: serviceMethods, - PayloadCodec: kitex.Thrift, - KiteXGenVersion: "v0.13.1", - Extra: extra, - } - return svcInfo -} - -func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() -} - -func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceSearchEvalTargetResult() -} - -func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() -} - -func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() -} - -func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) - realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) - success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) - if err != nil { - return err - } - realResult.Success = success - return nil -} - -func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { - return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() -} - -func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { - return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() -} - -type kClient struct { - c client.Client - sc client.Streaming -} - -func newServiceClient(c client.Client) *kClient { - return &kClient{ - c: c, - sc: c.(client.Streaming), - } -} - -func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceSearchEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceSearchEvalTargetResult - if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceInvokeEvalTargetResult - if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - -func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { - var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs - _args.Req = req - var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult - if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go deleted file mode 100644 index b72ed3822..000000000 --- a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Kitex v0.13.1. DO NOT EDIT. -package evalspiservice - -import ( - server "github.com/cloudwego/kitex/server" - evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" -) - -// NewServer creates a server.Server with the given handler and options. -func NewServer(handler evaluation.EvalSPIService, opts ...server.Option) server.Server { - var options []server.Option - - options = append(options, opts...) - options = append(options, server.WithCompatibleMiddlewareForUnary()) - - svr := server.NewServer(options...) - if err := svr.RegisterService(serviceInfo(), handler); err != nil { - panic(err) - } - return svr -} - -func RegisterService(svr server.Server, handler evaluation.EvalSPIService, opts ...server.RegisterOption) error { - return svr.RegisterService(serviceInfo(), handler, opts...) -} diff --git a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go index 0281654a0..d51f9b68d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go @@ -15,7 +15,6 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) var ( @@ -24,7 +23,6 @@ var ( _ = evaluator.KitexUnusedProtection _ = expt.KitexUnusedProtection _ = openapi.KitexUnusedProtection - _ = spi.KitexUnusedProtection ) // unused protection diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 42c9f4f14..150425b25 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -208,6 +208,8 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi IsAsync: targetVersionDO.CustomRPCServer.IsAsync, ExecRegion: gptr.Of(targetVersionDO.CustomRPCServer.ExecRegion), ExecEnv: targetVersionDO.CustomRPCServer.ExecEnv, + Timeout: targetVersionDO.CustomRPCServer.Timeout, + AsyncTimeout: targetVersionDO.CustomRPCServer.AsyncTimeout, } } default: @@ -245,6 +247,10 @@ func CustomRPCServerDTO2DO(dto *dto.CustomRPCServer) (doRes *do.CustomRPCServer) AsyncInvokeHTTPInfo: HttpInfoDTO2DO(dto.AsyncInvokeHTTPInfo), SearchHTTPInfo: HttpInfoDTO2DO(dto.SearchHTTPInfo), CustomEvalTarget: CustomEvalTargetDTO2DO(dto.CustomEvalTarget), + ExecRegion: gptr.Indirect(dto.ExecRegion), + ExecEnv: dto.ExecEnv, + Timeout: dto.Timeout, + AsyncTimeout: dto.AsyncTimeout, } } @@ -253,9 +259,8 @@ func HttpInfoDTO2DO(httpInfoDTO *dto.HTTPInfo) (httpInfoDO *do.HTTPInfo) { return nil } return &do.HTTPInfo{ - Method: gptr.Indirect(httpInfoDTO.Method), - Path: gptr.Indirect(httpInfoDTO.Path), - Timeout: httpInfoDTO.Timeout, + Method: gptr.Indirect(httpInfoDTO.Method), + Path: gptr.Indirect(httpInfoDTO.Path), } } @@ -264,9 +269,8 @@ func HttpInfoDO2DTO(httpInfoDO *do.HTTPInfo) (httpInfoDTO *dto.HTTPInfo) { return nil } return &dto.HTTPInfo{ - Method: gptr.Of(httpInfoDO.Method), - Path: gptr.Of(httpInfoDO.Path), - Timeout: httpInfoDO.Timeout, + Method: gptr.Of(httpInfoDO.Method), + Path: gptr.Of(httpInfoDO.Path), } } diff --git a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go index e568b7599..facb42d8c 100644 --- a/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go +++ b/backend/modules/evaluation/domain/entity/target_builtin_custom_rpc_server.go @@ -31,15 +31,15 @@ type CustomRPCServer struct { // 额外信息 Ext map[string]string - ExecRegion Region // 执行区域 - ExecEnv *string // 执行环境 + ExecRegion Region // 执行区域 + ExecEnv *string // 执行环境 + Timeout *int64 // 执行超时,单位ms + AsyncTimeout *int64 // 执行超时,单位ms } type HTTPInfo struct { Method HTTPMethod Path string - // ms,默认5000,最大800,000 - Timeout *int64 } type CustomEvalTarget struct { diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 16cecab34..7a3a3eb1e 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -75,6 +75,8 @@ struct CustomRPCServer { 20: optional Region exec_region // 执行区域 21: optional string exec_env // 执行环境 + 22: optional i64 timeout // 执行超时时间,单位ms + 23: optional i64 async_timeout // 异步执行超时时间,单位ms } @@ -89,7 +91,6 @@ struct CustomEvalTarget { struct HTTPInfo { 1: optional HTTPMethod method 2: optional string path - 4: optional i64 timeout // ms,默认5000,最大800,000 } typedef string Region (ts.enum="true") From f14a5edc3db84e8b5c9e30fa88a56137c533b467 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 19 Sep 2025 11:44:13 +0800 Subject: [PATCH 034/100] fix(evaluation): scheduler item zombie time --- .../evaluation/domain/entity/expt_run.go | 36 +++++++++++++------ .../service/expt_run_scheduler_event_impl.go | 6 ++-- .../expt_run_scheduler_event_impl_test.go | 2 +- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 804cefc27..7f6730101 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -88,12 +88,13 @@ const ( ) const ( - defaultDaemonInterval = 20 * time.Second - defaultZombieIntervalSecond = 60 * 60 * 24 - defaultItemEvalConcurNum = 3 - defaultItemEvalInterval = 20 * time.Second - defaultSpaceExptConcurLimit = 200 - defaultItemZombieSecond = 60 * 20 + defaultDaemonInterval = 20 * time.Second + defaultZombieIntervalSecond = 60 * 60 * 24 + defaultItemEvalConcurNum = 3 + defaultItemEvalInterval = 20 * time.Second + defaultSpaceExptConcurLimit = 200 + defaultItemZombieSecond = 60 * 20 + defaultItemAsyncZombieSecond = 60 * 60 * 3 ) type ExptConsumerConf struct { @@ -151,9 +152,10 @@ func (e *ExptExecConf) GetExptItemEvalConf() *ExptItemEvalConf { } type ExptItemEvalConf struct { - ConcurNum int `json:"concur_num" mapstructure:"concur_num"` - IntervalSecond int `json:"interval_second" mapstructure:"interval_second"` - ZombieSecond int `json:"zombie_second" mapstructure:"zombie_second"` + ConcurNum int `json:"concur_num" mapstructure:"concur_num"` + IntervalSecond int `json:"interval_second" mapstructure:"interval_second"` + ZombieSecond int `json:"zombie_second" mapstructure:"zombie_second"` + AsyncZombieSecond int `json:"async_zombie_second" mapstructure:"async_zombie_second"` } func (e *ExptItemEvalConf) GetConcurNum() int { @@ -170,13 +172,27 @@ func (e *ExptItemEvalConf) GetInterval() time.Duration { return defaultItemEvalInterval } -func (e *ExptItemEvalConf) GetZombieSecond() int { +func (e *ExptItemEvalConf) getZombieSecond() int { if e != nil && e.ZombieSecond > 0 { return e.ZombieSecond } return defaultItemZombieSecond } +func (e *ExptItemEvalConf) getAsyncZombieSecond() int { + if e != nil && e.AsyncZombieSecond > 0 { + return e.AsyncZombieSecond + } + return defaultItemAsyncZombieSecond +} + +func (e *ExptItemEvalConf) GetItemZombieSecond(isAsync bool) int { + if isAsync { + return e.getAsyncZombieSecond() + } + return e.getZombieSecond() +} + func DefaultExptConsumerConf() *ExptConsumerConf { return &ExptConsumerConf{ ExptExecWorkerNum: 50, diff --git a/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl.go b/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl.go index cc4274619..e1839e1e8 100644 --- a/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl.go @@ -239,7 +239,7 @@ func (e *ExptSchedulerImpl) schedule(ctx context.Context, event *entity.ExptSche return err } - incomplete, zombies, err := e.handleZombies(ctx, event, incomplete) + incomplete, zombies, err := e.handleZombies(ctx, event, incomplete, exptDetail) if err != nil { return err } @@ -386,8 +386,8 @@ func (e *ExptSchedulerImpl) handleToSubmits(ctx context.Context, event *entity.E return nil } -func (e *ExptSchedulerImpl) handleZombies(ctx context.Context, event *entity.ExptScheduleEvent, items []*entity.ExptEvalItem) (alives, zombies []*entity.ExptEvalItem, err error) { - zombieSecond := e.Configer.GetConsumerConf(ctx).GetExptExecConf(event.SpaceID).GetExptItemEvalConf().GetZombieSecond() +func (e *ExptSchedulerImpl) handleZombies(ctx context.Context, event *entity.ExptScheduleEvent, items []*entity.ExptEvalItem, expt *entity.Experiment) (alives, zombies []*entity.ExptEvalItem, err error) { + zombieSecond := e.Configer.GetConsumerConf(ctx).GetExptExecConf(event.SpaceID).GetExptItemEvalConf().GetItemZombieSecond(expt.AsyncExec()) for _, item := range items { if item.State == entity.ItemRunState_Processing && item.UpdatedAt != nil && !gptr.Indirect(item.UpdatedAt).IsZero() { if time.Since(gptr.Indirect(item.UpdatedAt)).Seconds() > float64(zombieSecond) { diff --git a/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl_test.go index 998c162ca..5ee8a54fb 100644 --- a/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_scheduler_event_impl_test.go @@ -1143,7 +1143,7 @@ func TestExptSchedulerImpl_handleZombies(t *testing.T) { ExptTurnResultRepo: f.exptTurnResultRepo, } - alives, zombies, err := svc.handleZombies(tt.args.ctx, tt.args.event, tt.args.items) + alives, zombies, err := svc.handleZombies(tt.args.ctx, tt.args.event, tt.args.items, nil) if tt.assertErr != nil { tt.assertErr(t, err) From b64aa315b96ba94b47d281e98b2b92d29fff5208 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 19 Sep 2025 12:06:59 +0800 Subject: [PATCH 035/100] fix(evaluation): spi kitex gen --- .../loop/evaluation/coze.loop.evaluation.go | 36 ++++ .../loop/evaluation/evalspiservice/client.go | 61 +++++++ .../evalspiservice/evalspiservice.go | 168 ++++++++++++++++++ .../loop/evaluation/evalspiservice/server.go | 25 +++ .../loop/evaluation/k-coze.loop.evaluation.go | 2 + .../evaluation/application/eval_target_app.go | 6 +- .../evaluation/coze.loop.evaluation.thrift | 5 +- 7 files changed, 298 insertions(+), 5 deletions(-) create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go create mode 100644 backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go diff --git a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go index 6a09b79cd..7fb7dcda2 100644 --- a/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/coze.loop.evaluation.go @@ -9,6 +9,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) type EvaluationSetService interface { @@ -141,6 +142,32 @@ func NewEvalOpenAPIServiceClient(c thrift.TClient) *EvalOpenAPIServiceClient { } } +type EvalSPIService interface { + spi.EvaluationSPIService +} + +type EvalSPIServiceClient struct { + *spi.EvaluationSPIServiceClient +} + +func NewEvalSPIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientFactory(t, f), + } +} + +func NewEvalSPIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClientProtocol(t, iprot, oprot), + } +} + +func NewEvalSPIServiceClient(c thrift.TClient) *EvalSPIServiceClient { + return &EvalSPIServiceClient{ + EvaluationSPIServiceClient: spi.NewEvaluationSPIServiceClient(c), + } +} + type EvaluationSetServiceProcessor struct { *eval_set.EvaluationSetServiceProcessor } @@ -185,3 +212,12 @@ func NewEvalOpenAPIServiceProcessor(handler EvalOpenAPIService) *EvalOpenAPIServ self := &EvalOpenAPIServiceProcessor{openapi.NewEvaluationOpenAPIServiceProcessor(handler)} return self } + +type EvalSPIServiceProcessor struct { + *spi.EvaluationSPIServiceProcessor +} + +func NewEvalSPIServiceProcessor(handler EvalSPIService) *EvalSPIServiceProcessor { + self := &EvalSPIServiceProcessor{spi.NewEvaluationSPIServiceProcessor(handler)} + return self +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go new file mode 100644 index 000000000..d09738d01 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/client.go @@ -0,0 +1,61 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalspiservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) + InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) + AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfo(), options...) + if err != nil { + return nil, err + } + return &kEvalSPIServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kEvalSPIServiceClient struct { + *kClient +} + +func (p *kEvalSPIServiceClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest, callOptions ...callopt.Option) (r *spi.SearchEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SearchEvalTarget(ctx, req) +} + +func (p *kEvalSPIServiceClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.InvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.InvokeEvalTarget(ctx, req) +} + +func (p *kEvalSPIServiceClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest, callOptions ...callopt.Option) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncInvokeEvalTarget(ctx, req) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go new file mode 100644 index 000000000..868956109 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/evalspiservice.go @@ -0,0 +1,168 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. + +package evalspiservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" + spi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "SearchEvalTarget": kitex.NewMethodInfo( + searchEvalTargetHandler, + newEvaluationSPIServiceSearchEvalTargetArgs, + newEvaluationSPIServiceSearchEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "InvokeEvalTarget": kitex.NewMethodInfo( + invokeEvalTargetHandler, + newEvaluationSPIServiceInvokeEvalTargetArgs, + newEvaluationSPIServiceInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AsyncInvokeEvalTarget": kitex.NewMethodInfo( + asyncInvokeEvalTargetHandler, + newEvaluationSPIServiceAsyncInvokeEvalTargetArgs, + newEvaluationSPIServiceAsyncInvokeEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + evalSPIServiceServiceInfo = NewServiceInfo() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return evalSPIServiceServiceInfo +} + +// NewServiceInfo creates a new ServiceInfo +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo() +} + +func newServiceInfo() *kitex.ServiceInfo { + serviceName := "EvalSPIService" + handlerType := (*evaluation.EvalSPIService)(nil) + extra := map[string]interface{}{ + "PackageName": "evaluation", + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: serviceMethods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.13.1", + Extra: extra, + } + return svcInfo +} + +func searchEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceSearchEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceSearchEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).SearchEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceSearchEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetArgs() +} + +func newEvaluationSPIServiceSearchEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceSearchEvalTargetResult() +} + +func invokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).InvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceInvokeEvalTargetResult() +} + +func asyncInvokeEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs) + realResult := result.(*spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult) + success, err := handler.(spi.EvaluationSPIService).AsyncInvokeEvalTarget(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetArgs() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetArgs() +} + +func newEvaluationSPIServiceAsyncInvokeEvalTargetResult() interface{} { + return spi.NewEvaluationSPIServiceAsyncInvokeEvalTargetResult() +} + +type kClient struct { + c client.Client + sc client.Streaming +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + sc: c.(client.Streaming), + } +} + +func (p *kClient) SearchEvalTarget(ctx context.Context, req *spi.SearchEvalTargetRequest) (r *spi.SearchEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceSearchEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceSearchEvalTargetResult + if err = p.c.Call(ctx, "SearchEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) InvokeEvalTarget(ctx context.Context, req *spi.InvokeEvalTargetRequest) (r *spi.InvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceInvokeEvalTargetResult + if err = p.c.Call(ctx, "InvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AsyncInvokeEvalTarget(ctx context.Context, req *spi.AsyncInvokeEvalTargetRequest) (r *spi.AsyncInvokeEvalTargetResponse, err error) { + var _args spi.EvaluationSPIServiceAsyncInvokeEvalTargetArgs + _args.Req = req + var _result spi.EvaluationSPIServiceAsyncInvokeEvalTargetResult + if err = p.c.Call(ctx, "AsyncInvokeEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go new file mode 100644 index 000000000..b72ed3822 --- /dev/null +++ b/backend/kitex_gen/coze/loop/evaluation/evalspiservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.13.1. DO NOT EDIT. +package evalspiservice + +import ( + server "github.com/cloudwego/kitex/server" + evaluation "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler evaluation.EvalSPIService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler evaluation.EvalSPIService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go index d51f9b68d..0281654a0 100644 --- a/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go +++ b/backend/kitex_gen/coze/loop/evaluation/k-coze.loop.evaluation.go @@ -15,6 +15,7 @@ import ( "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/evaluator" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/expt" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" ) var ( @@ -23,6 +24,7 @@ var ( _ = evaluator.KitexUnusedProtection _ = expt.KitexUnusedProtection _ = openapi.KitexUnusedProtection + _ = spi.KitexUnusedProtection ) // unused protection diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index c66b57d61..eca9304dc 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -454,11 +454,9 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r } func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { - // TODO implement me - panic("implement me") + return nil, errorx.New("not implement") } func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { - // TODO implement me - panic("implement me") + return nil, errorx.New("not implement") } diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift index 34780abbc..1665e9870 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.thrift @@ -5,6 +5,7 @@ include "coze.loop.evaluation.evaluator.thrift" include "coze.loop.evaluation.expt.thrift" include "coze.loop.evaluation.eval_target.thrift" include "coze.loop.evaluation.openapi.thrift" +include "coze.loop.evaluation.spi.thrift" service EvaluationSetService extends coze.loop.evaluation.eval_set.EvaluationSetService{} @@ -14,4 +15,6 @@ service ExperimentService extends coze.loop.evaluation.expt.ExperimentService{} service EvalTargetService extends coze.loop.evaluation.eval_target.EvalTargetService{} -service EvalOpenAPIService extends coze.loop.evaluation.openapi.EvaluationOpenAPIService{} \ No newline at end of file +service EvalOpenAPIService extends coze.loop.evaluation.openapi.EvaluationOpenAPIService{} + +service EvalSPIService extends coze.loop.evaluation.spi.EvaluationSPIService{} From fd77e4719082a03206e7faf9f8a7f8d23e6111d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 19 Sep 2025 14:42:18 +0800 Subject: [PATCH 036/100] fix Change-Id: I55db7249ac8993e14dc39175dae975e52838755b --- backend/infra/http/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/infra/http/http.go b/backend/infra/http/http.go index 2ede83f62..538230a53 100644 --- a/backend/infra/http/http.go +++ b/backend/infra/http/http.go @@ -22,4 +22,5 @@ type RequestParam struct { Timeout time.Duration Cluster *string + WithSD *bool } From 56ce3ae20233266966e5954f60b95e865fdf818a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 19 Sep 2025 15:51:07 +0800 Subject: [PATCH 037/100] fix Change-Id: Ie235409a243c3e0ddabac0cebda49aeeefc89caa --- .../domain/eval_target/eval_target.go | 109 +++++++++++++++++- .../domain/eval_target/k-eval_target.go | 97 ++++++++++++++++ .../convertor/target/eval_target.go | 2 + .../loop/evaluation/domain/eval_target.thrift | 3 + 4 files changed, 210 insertions(+), 1 deletion(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index ce0966b68..e75cf2e2b 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -2166,7 +2166,8 @@ type CustomRPCServer struct { // 执行超时时间,单位ms Timeout *int64 `thrift:"timeout,22,optional" frugal:"22,optional,i64" form:"timeout" json:"timeout,omitempty" query:"timeout"` // 异步执行超时时间,单位ms - AsyncTimeout *int64 `thrift:"async_timeout,23,optional" frugal:"23,optional,i64" form:"async_timeout" json:"async_timeout,omitempty" query:"async_timeout"` + AsyncTimeout *int64 `thrift:"async_timeout,23,optional" frugal:"23,optional,i64" form:"async_timeout" json:"async_timeout,omitempty" query:"async_timeout"` + Ext map[string]string `thrift:"ext,50,optional" frugal:"50,optional,map" form:"ext" json:"ext,omitempty" query:"ext"` } func NewCustomRPCServer() *CustomRPCServer { @@ -2379,6 +2380,18 @@ func (p *CustomRPCServer) GetAsyncTimeout() (v int64) { } return *p.AsyncTimeout } + +var CustomRPCServer_Ext_DEFAULT map[string]string + +func (p *CustomRPCServer) GetExt() (v map[string]string) { + if p == nil { + return + } + if !p.IsSetExt() { + return CustomRPCServer_Ext_DEFAULT + } + return p.Ext +} func (p *CustomRPCServer) SetID(val *int64) { p.ID = val } @@ -2430,6 +2443,9 @@ func (p *CustomRPCServer) SetTimeout(val *int64) { func (p *CustomRPCServer) SetAsyncTimeout(val *int64) { p.AsyncTimeout = val } +func (p *CustomRPCServer) SetExt(val map[string]string) { + p.Ext = val +} var fieldIDToName_CustomRPCServer = map[int16]string{ 1: "id", @@ -2449,6 +2465,7 @@ var fieldIDToName_CustomRPCServer = map[int16]string{ 21: "exec_env", 22: "timeout", 23: "async_timeout", + 50: "ext", } func (p *CustomRPCServer) IsSetID() bool { @@ -2519,6 +2536,10 @@ func (p *CustomRPCServer) IsSetAsyncTimeout() bool { return p.AsyncTimeout != nil } +func (p *CustomRPCServer) IsSetExt() bool { + return p.Ext != nil +} + func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -2673,6 +2694,14 @@ func (p *CustomRPCServer) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 50: + if fieldTypeId == thrift.MAP { + if err = p.ReadField50(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2889,6 +2918,35 @@ func (p *CustomRPCServer) ReadField23(iprot thrift.TProtocol) error { p.AsyncTimeout = _field return nil } +func (p *CustomRPCServer) ReadField50(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + var _val string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.Ext = _field + return nil +} func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -2964,6 +3022,10 @@ func (p *CustomRPCServer) Write(oprot thrift.TProtocol) (err error) { fieldId = 23 goto WriteFieldError } + if err = p.writeField50(oprot); err != nil { + fieldId = 50 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3296,6 +3358,35 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 23 end error: ", p), err) } +func (p *CustomRPCServer) writeField50(oprot thrift.TProtocol) (err error) { + if p.IsSetExt() { + if err = oprot.WriteFieldBegin("ext", thrift.MAP, 50); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Ext)); err != nil { + return err + } + for k, v := range p.Ext { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 50 end error: ", p), err) +} func (p *CustomRPCServer) String() string { if p == nil { @@ -3362,6 +3453,9 @@ func (p *CustomRPCServer) DeepEqual(ano *CustomRPCServer) bool { if !p.Field23DeepEqual(ano.AsyncTimeout) { return false } + if !p.Field50DeepEqual(ano.Ext) { + return false + } return true } @@ -3550,6 +3644,19 @@ func (p *CustomRPCServer) Field23DeepEqual(src *int64) bool { } return true } +func (p *CustomRPCServer) Field50DeepEqual(src map[string]string) bool { + + if len(p.Ext) != len(src) { + return false + } + for k, v := range p.Ext { + _src := src[k] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} type CustomEvalTarget struct { // 唯一键,平台不消费,仅做透传 diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go index 77708438c..fc92c906d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/k-eval_target.go @@ -1627,6 +1627,20 @@ func (p *CustomRPCServer) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 50: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField50(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1885,6 +1899,38 @@ func (p *CustomRPCServer) FastReadField23(buf []byte) (int, error) { return offset, nil } +func (p *CustomRPCServer) FastReadField50(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + var _val string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _val = v + } + + _field[_key] = _val + } + p.Ext = _field + return offset, nil +} + func (p *CustomRPCServer) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -1909,6 +1955,7 @@ func (p *CustomRPCServer) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int offset += p.fastWriteField18(buf[offset:], w) offset += p.fastWriteField20(buf[offset:], w) offset += p.fastWriteField21(buf[offset:], w) + offset += p.fastWriteField50(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -1934,6 +1981,7 @@ func (p *CustomRPCServer) BLength() int { l += p.field21Length() l += p.field22Length() l += p.field23Length() + l += p.field50Length() } l += thrift.Binary.FieldStopLength() return l @@ -2099,6 +2147,23 @@ func (p *CustomRPCServer) fastWriteField23(buf []byte, w thrift.NocopyWriter) in return offset } +func (p *CustomRPCServer) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 50) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.Ext { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRING, length) + } + return offset +} + func (p *CustomRPCServer) field1Length() int { l := 0 if p.IsSetID() { @@ -2256,6 +2321,21 @@ func (p *CustomRPCServer) field23Length() int { return l } +func (p *CustomRPCServer) field50Length() int { + l := 0 + if p.IsSetExt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.Ext { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + func (p *CustomRPCServer) DeepCopy(s interface{}) error { src, ok := s.(*CustomRPCServer) if !ok { @@ -2382,6 +2462,23 @@ func (p *CustomRPCServer) DeepCopy(s interface{}) error { p.AsyncTimeout = &tmp } + if src.Ext != nil { + p.Ext = make(map[string]string, len(src.Ext)) + for key, val := range src.Ext { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val string + if val != "" { + _val = kutils.StringDeepCopy(val) + } + + p.Ext[_key] = _val + } + } + return nil } diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 150425b25..98948329a 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -210,6 +210,7 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi ExecEnv: targetVersionDO.CustomRPCServer.ExecEnv, Timeout: targetVersionDO.CustomRPCServer.Timeout, AsyncTimeout: targetVersionDO.CustomRPCServer.AsyncTimeout, + Ext: targetVersionDO.CustomRPCServer.Ext, } } default: @@ -251,6 +252,7 @@ func CustomRPCServerDTO2DO(dto *dto.CustomRPCServer) (doRes *do.CustomRPCServer) ExecEnv: dto.ExecEnv, Timeout: dto.Timeout, AsyncTimeout: dto.AsyncTimeout, + Ext: dto.Ext, } } diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 7a3a3eb1e..22ef64837 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -73,11 +73,14 @@ struct CustomRPCServer { 18: optional CustomEvalTarget custom_eval_target // 搜索对象返回的信息 19: optional bool is_async // 是否异步 + 20: optional Region exec_region // 执行区域 21: optional string exec_env // 执行环境 22: optional i64 timeout // 执行超时时间,单位ms 23: optional i64 async_timeout // 异步执行超时时间,单位ms + 50: optional map ext + } struct CustomEvalTarget { From 563f2a4ed582031cc6961844a2f40ac9ab26f76d Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 19 Sep 2025 16:59:20 +0800 Subject: [PATCH 038/100] feat(evaluation): evaltarget debug content --- .../coze.loop.evaluation.eval_target.go | 218 +++++++++++++++++- .../k-coze.loop.evaluation.eval_target.go | 202 ++++++++++++++++ .../coze.loop.evaluation.eval_target.thrift | 2 + 3 files changed, 420 insertions(+), 2 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 883a1d865..8dccbc1b1 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -9815,7 +9815,8 @@ type DebugEvalTargetRequest struct { // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` // 环境 - Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` + InputFields map[string]*common.Content `thrift:"input_fields,13,optional" frugal:"13,optional,map" form:"input_fields" json:"input_fields,omitempty" query:"input_fields"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -9888,6 +9889,18 @@ func (p *DebugEvalTargetRequest) GetEnv() (v string) { return *p.Env } +var DebugEvalTargetRequest_InputFields_DEFAULT map[string]*common.Content + +func (p *DebugEvalTargetRequest) GetInputFields() (v map[string]*common.Content) { + if p == nil { + return + } + if !p.IsSetInputFields() { + return DebugEvalTargetRequest_InputFields_DEFAULT + } + return p.InputFields +} + var DebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *DebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -9926,6 +9939,9 @@ func (p *DebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) func (p *DebugEvalTargetRequest) SetEnv(val *string) { p.Env = val } +func (p *DebugEvalTargetRequest) SetInputFields(val map[string]*common.Content) { + p.InputFields = val +} func (p *DebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -9939,6 +9955,7 @@ var fieldIDToName_DebugEvalTargetRequest = map[int16]string{ 10: "param", 11: "target_runtime_param", 12: "env", + 13: "input_fields", 50: "custom_rpc_server", 255: "Base", } @@ -9963,6 +9980,10 @@ func (p *DebugEvalTargetRequest) IsSetEnv() bool { return p.Env != nil } +func (p *DebugEvalTargetRequest) IsSetInputFields() bool { + return p.InputFields != nil +} + func (p *DebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -10029,6 +10050,14 @@ func (p *DebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 13: + if fieldTypeId == thrift.MAP { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -10127,6 +10156,35 @@ func (p *DebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error { p.Env = _field return nil } +func (p *DebugEvalTargetRequest) ReadField13(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]*common.Content, size) + values := make([]common.Content, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + _val := &values[i] + _val.InitDefault() + if err := _val.Read(iprot); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.InputFields = _field + return nil +} func (p *DebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -10170,6 +10228,10 @@ func (p *DebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 12 goto WriteFieldError } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -10286,6 +10348,35 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } +func (p *DebugEvalTargetRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetInputFields() { + if err = oprot.WriteFieldBegin("input_fields", thrift.MAP, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.InputFields)); err != nil { + return err + } + for k, v := range p.InputFields { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} func (p *DebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -10352,6 +10443,9 @@ func (p *DebugEvalTargetRequest) DeepEqual(ano *DebugEvalTargetRequest) bool { if !p.Field12DeepEqual(ano.Env) { return false } + if !p.Field13DeepEqual(ano.InputFields) { + return false + } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -10416,6 +10510,19 @@ func (p *DebugEvalTargetRequest) Field12DeepEqual(src *string) bool { } return true } +func (p *DebugEvalTargetRequest) Field13DeepEqual(src map[string]*common.Content) bool { + + if len(p.InputFields) != len(src) { + return false + } + for k, v := range p.InputFields { + _src := src[k] + if !v.DeepEqual(_src) { + return false + } + } + return true +} func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { @@ -10680,7 +10787,8 @@ type AsyncDebugEvalTargetRequest struct { // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` // 环境 - Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` + InputFields map[string]*common.Content `thrift:"input_fields,13,optional" frugal:"13,optional,map" form:"input_fields" json:"input_fields,omitempty" query:"input_fields"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -10753,6 +10861,18 @@ func (p *AsyncDebugEvalTargetRequest) GetEnv() (v string) { return *p.Env } +var AsyncDebugEvalTargetRequest_InputFields_DEFAULT map[string]*common.Content + +func (p *AsyncDebugEvalTargetRequest) GetInputFields() (v map[string]*common.Content) { + if p == nil { + return + } + if !p.IsSetInputFields() { + return AsyncDebugEvalTargetRequest_InputFields_DEFAULT + } + return p.InputFields +} + var AsyncDebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *AsyncDebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -10791,6 +10911,9 @@ func (p *AsyncDebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeP func (p *AsyncDebugEvalTargetRequest) SetEnv(val *string) { p.Env = val } +func (p *AsyncDebugEvalTargetRequest) SetInputFields(val map[string]*common.Content) { + p.InputFields = val +} func (p *AsyncDebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -10804,6 +10927,7 @@ var fieldIDToName_AsyncDebugEvalTargetRequest = map[int16]string{ 10: "param", 11: "target_runtime_param", 12: "env", + 13: "input_fields", 50: "custom_rpc_server", 255: "Base", } @@ -10828,6 +10952,10 @@ func (p *AsyncDebugEvalTargetRequest) IsSetEnv() bool { return p.Env != nil } +func (p *AsyncDebugEvalTargetRequest) IsSetInputFields() bool { + return p.InputFields != nil +} + func (p *AsyncDebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -10894,6 +11022,14 @@ func (p *AsyncDebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 13: + if fieldTypeId == thrift.MAP { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -10992,6 +11128,35 @@ func (p *AsyncDebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error p.Env = _field return nil } +func (p *AsyncDebugEvalTargetRequest) ReadField13(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]*common.Content, size) + values := make([]common.Content, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } + + _val := &values[i] + _val.InitDefault() + if err := _val.Read(iprot); err != nil { + return err + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.InputFields = _field + return nil +} func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -11035,6 +11200,10 @@ func (p *AsyncDebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) fieldId = 12 goto WriteFieldError } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -11151,6 +11320,35 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } +func (p *AsyncDebugEvalTargetRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetInputFields() { + if err = oprot.WriteFieldBegin("input_fields", thrift.MAP, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.InputFields)); err != nil { + return err + } + for k, v := range p.InputFields { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -11217,6 +11415,9 @@ func (p *AsyncDebugEvalTargetRequest) DeepEqual(ano *AsyncDebugEvalTargetRequest if !p.Field12DeepEqual(ano.Env) { return false } + if !p.Field13DeepEqual(ano.InputFields) { + return false + } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -11281,6 +11482,19 @@ func (p *AsyncDebugEvalTargetRequest) Field12DeepEqual(src *string) bool { } return true } +func (p *AsyncDebugEvalTargetRequest) Field13DeepEqual(src map[string]*common.Content) bool { + + if len(p.InputFields) != len(src) { + return false + } + for k, v := range p.InputFields { + _src := src[k] + if !v.DeepEqual(_src) { + return false + } + } + return true +} func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 961a36396..a395aa42d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -7223,6 +7223,20 @@ func (p *DebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 13: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -7339,6 +7353,39 @@ func (p *DebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { return offset, nil } +func (p *DebugEvalTargetRequest) FastReadField13(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]*common.Content, size) + values := make([]common.Content, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + _val := &values[i] + _val.InitDefault() + if l, err := _val.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field[_key] = _val + } + p.InputFields = _field + return offset, nil +} + func (p *DebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -7375,6 +7422,7 @@ func (p *DebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWrit offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) + offset += p.fastWriteField13(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -7390,6 +7438,7 @@ func (p *DebugEvalTargetRequest) BLength() int { l += p.field10Length() l += p.field11Length() l += p.field12Length() + l += p.field13Length() l += p.field50Length() l += p.field255Length() } @@ -7442,6 +7491,23 @@ func (p *DebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.NocopyWri return offset } +func (p *DebugEvalTargetRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInputFields() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 13) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.InputFields { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) + } + return offset +} + func (p *DebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -7505,6 +7571,21 @@ func (p *DebugEvalTargetRequest) field12Length() int { return l } +func (p *DebugEvalTargetRequest) field13Length() int { + l := 0 + if p.IsSetInputFields() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.InputFields { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += v.BLength() + } + } + return l +} + func (p *DebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -7564,6 +7645,26 @@ func (p *DebugEvalTargetRequest) DeepCopy(s interface{}) error { p.Env = &tmp } + if src.InputFields != nil { + p.InputFields = make(map[string]*common.Content, len(src.InputFields)) + for key, val := range src.InputFields { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val *common.Content + if val != nil { + _val = &common.Content{} + if err := _val.DeepCopy(val); err != nil { + return err + } + } + + p.InputFields[_key] = _val + } + } + var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} @@ -7842,6 +7943,20 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 13: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -7958,6 +8073,39 @@ func (p *AsyncDebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { return offset, nil } +func (p *AsyncDebugEvalTargetRequest) FastReadField13(buf []byte) (int, error) { + offset := 0 + + _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make(map[string]*common.Content, size) + values := make([]common.Content, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _key = v + } + + _val := &values[i] + _val.InitDefault() + if l, err := _val.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field[_key] = _val + } + p.InputFields = _field + return offset, nil +} + func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -7994,6 +8142,7 @@ func (p *AsyncDebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Nocop offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) + offset += p.fastWriteField13(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -8009,6 +8158,7 @@ func (p *AsyncDebugEvalTargetRequest) BLength() int { l += p.field10Length() l += p.field11Length() l += p.field12Length() + l += p.field13Length() l += p.field50Length() l += p.field255Length() } @@ -8061,6 +8211,23 @@ func (p *AsyncDebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.Noco return offset } +func (p *AsyncDebugEvalTargetRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInputFields() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 13) + mapBeginOffset := offset + offset += thrift.Binary.MapBeginLength() + var length int + for k, v := range p.InputFields { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) + } + return offset +} + func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -8124,6 +8291,21 @@ func (p *AsyncDebugEvalTargetRequest) field12Length() int { return l } +func (p *AsyncDebugEvalTargetRequest) field13Length() int { + l := 0 + if p.IsSetInputFields() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.InputFields { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += v.BLength() + } + } + return l +} + func (p *AsyncDebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -8183,6 +8365,26 @@ func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { p.Env = &tmp } + if src.InputFields != nil { + p.InputFields = make(map[string]*common.Content, len(src.InputFields)) + for key, val := range src.InputFields { + var _key string + if key != "" { + _key = kutils.StringDeepCopy(key) + } + + var _val *common.Content + if val != nil { + _val = &common.Content{} + if err := _val.DeepCopy(val); err != nil { + return err + } + } + + p.InputFields[_key] = _val + } + } + var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index 52866a6af..a84044f95 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -213,6 +213,7 @@ struct DebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 12: optional string env // 环境 + 13: optional map input_fields 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 @@ -232,6 +233,7 @@ struct AsyncDebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 12: optional string env // 环境 + 13: optional map input_fields 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 From 143ee71e16de3f5359a06ff654beb349ffb91cd5 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 19 Sep 2025 17:44:37 +0800 Subject: [PATCH 039/100] feat(evaluation): evaltarget debug method --- .../modules/evaluation/domain/entity/param.go | 6 + .../evaluation/domain/service/target_impl.go | 103 ++++++++++++++++-- 2 files changed, 99 insertions(+), 10 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index f67f559a1..35e0f690e 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -297,3 +297,9 @@ type ReportTargetRecordParam struct { Session *Session } + +type DebugTargetParam struct { + SpaceID int64 + PatchyTarget *EvalTarget + InputData *EvalTargetInputData +} diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index dbe5c094c..d162d11a8 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -276,23 +276,32 @@ func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("AsyncExecuteTarget with invalid param")) } - defer func(st time.Time) { e.metric.EmitRun(spaceID, err, st) }(time.Now()) // todo(@liushengyang): async - defer goroutine.Recovery(ctx) - evalTargetDO, err := e.GetEvalTargetVersion(ctx, spaceID, targetVersionID, false) if err != nil { return nil, err } - operator := e.typedOperators[evalTargetDO.EvalTargetType] + return e.asyncExecuteTarget(ctx, spaceID, evalTargetDO, param, inputData) +} + +func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID int64, target *entity.EvalTarget, param *entity.ExecuteTargetCtx, + inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, err error) { + defer func(st time.Time) { e.metric.EmitRun(spaceID, err, st) }(time.Now()) // todo(@liushengyang): mtr + defer goroutine.Recovery(ctx) + + targetID := target.ID + targetVersionID := target.EvalTargetVersion.ID + + operator := e.typedOperators[target.EvalTargetType] if operator == nil { return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) } - if err := operator.ValidateInput(ctx, spaceID, evalTargetDO.EvalTargetVersion.InputSchema, inputData); err != nil { + if err := operator.ValidateInput(ctx, spaceID, target.EvalTargetVersion.InputSchema, inputData); err != nil { return nil, err } + status := entity.EvalTargetRunStatusAsyncInvoking outputData := &entity.EvalTargetOutputData{ OutputFields: map[string]*entity.Content{}, EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, @@ -302,15 +311,16 @@ func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ TargetID: targetID, VersionID: targetVersionID, - SourceTargetID: evalTargetDO.SourceTargetID, - SourceTargetVersion: evalTargetDO.EvalTargetVersion.SourceTargetVersion, + SourceTargetID: target.SourceTargetID, + SourceTargetVersion: target.EvalTargetVersion.SourceTargetVersion, Input: inputData, - TargetType: evalTargetDO.EvalTargetType, - EvalTarget: evalTargetDO, + TargetType: target.EvalTargetType, + EvalTarget: target, }) if execErr != nil { logs.CtxError(ctx, "async execute target failed, spaceID=%v, targetID=%d, targetVersionID=%d, param=%v, inputData=%v, err=%v", spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), err) + status = entity.EvalTargetRunStatusFail statusErr, ok := errorx.FromStatusError(err) if ok { outputData.EvalTargetRunError.Code = statusErr.Code() @@ -338,7 +348,76 @@ func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID LogID: logs.GetLogID(ctx), EvalTargetInputData: inputData, EvalTargetOutputData: outputData, - Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), + Status: gptr.Of(status), + BaseInfo: &entity.BaseInfo{ + CreatedBy: &entity.UserInfo{ + UserID: gptr.Of(userID), + }, + UpdatedBy: &entity.UserInfo{ + UserID: gptr.Of(userID), + }, + CreatedAt: gptr.Of(time.Now().UnixMilli()), + UpdatedAt: gptr.Of(time.Now().UnixMilli()), + }, + } + if _, err := e.evalTargetRepo.CreateEvalTargetRecord(ctx, record); err != nil { + return nil, err + } + + return record, nil +} + +func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { + defer func(st time.Time) { e.metric.EmitRun(param.SpaceID, err, st) }(time.Now()) // todo(@liushengyang): mtr + defer goroutine.Recovery(ctx) + + operator := e.typedOperators[param.PatchyTarget.EvalTargetType] + if operator == nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) + } + + if err := operator.ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData); err != nil { + return nil, err + } + + status := entity.EvalTargetRunStatusSuccess + outputData := &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{}, + EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, + TimeConsumingMS: gptr.Of(int64(0)), + } + + execErr := operator.AsyncExecute(ctx, param.SpaceID, &entity.ExecuteEvalTargetParam{ + Input: param.InputData, + TargetType: param.PatchyTarget.EvalTargetType, + EvalTarget: param.PatchyTarget, + }) + if execErr != nil { + logs.CtxError(ctx, "async execute target failed, param=%v, err=%v", json.Jsonify(param), err) + status = entity.EvalTargetRunStatusFail + statusErr, ok := errorx.FromStatusError(err) + if ok { + outputData.EvalTargetRunError.Code = statusErr.Code() + outputData.EvalTargetRunError.Message = statusErr.Error() + } else { + outputData.EvalTargetRunError.Code = errno.CommonInternalErrorCode + outputData.EvalTargetRunError.Message = err.Error() + } + } + + userID := session.UserIDInCtxOrEmpty(ctx) + recordID, err := e.idgen.GenID(ctx) + if err != nil { + return nil, err + } + + record = &entity.EvalTargetRecord{ + ID: recordID, + SpaceID: param.SpaceID, + LogID: logs.GetLogID(ctx), + EvalTargetInputData: param.InputData, + EvalTargetOutputData: outputData, + Status: gptr.Of(status), BaseInfo: &entity.BaseInfo{ CreatedBy: &entity.UserInfo{ UserID: gptr.Of(userID), @@ -357,6 +436,10 @@ func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID return record, nil } +func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { + return e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) +} + func (e *EvalTargetServiceImpl) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) { return e.evalTargetRepo.GetEvalTargetRecordByIDAndSpaceID(ctx, spaceID, recordID) } From 014427eee348f2346b693749a3aad98fbaa751a8 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 19 Sep 2025 18:06:35 +0800 Subject: [PATCH 040/100] feat(evaluation): evaltarget asyncdebug method --- .../evaluation/application/eval_target_app.go | 47 ++++++++++++++++++- .../evaluation/domain/service/mocks/target.go | 30 ++++++++++++ .../evaluation/domain/service/target.go | 2 + 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index eca9304dc..9c50e25b2 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -10,6 +10,7 @@ import ( "github.com/bytedance/gg/gptr" + "github.com/coze-dev/coze-loop/backend/kitex_gen/base" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" eval_target_dto "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" @@ -454,9 +455,51 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r } func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { - return nil, errorx.New("not implement") + switch request.GetEvalTargetType() { + case eval_target_dto.EvalTargetType_CustomRPCServer: + record, err := e.evalTargetService.DebugTarget(ctx, &entity.DebugTargetParam{ + SpaceID: request.GetWorkspaceID(), + PatchyTarget: &entity.EvalTarget{}, + InputData: &entity.EvalTargetInputData{ + InputFields: target.ContentDTO2DOs(request.GetInputFields()), + Ext: map[string]string{ + consts.FieldAdapterBuiltinFieldNameRuntimeParam: request.GetTargetRuntimeParam().GetJSONValue(), + }, + }, + }) + if err != nil { + return nil, err + } + return &eval_target.DebugEvalTargetResponse{ + EvalTargetRecord: target.EvalTargetRecordDO2DTO(record), + BaseResp: base.NewBaseResp(), + }, err + default: + return nil, errorx.New("unsupported eval target type %v", request.GetEvalTargetType()) + } } func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { - return nil, errorx.New("not implement") + switch request.GetEvalTargetType() { + case eval_target_dto.EvalTargetType_CustomRPCServer: + record, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ + SpaceID: request.GetWorkspaceID(), + PatchyTarget: &entity.EvalTarget{}, + InputData: &entity.EvalTargetInputData{ + InputFields: target.ContentDTO2DOs(request.GetInputFields()), + Ext: map[string]string{ + consts.FieldAdapterBuiltinFieldNameRuntimeParam: request.GetTargetRuntimeParam().GetJSONValue(), + }, + }, + }) + if err != nil { + return nil, err + } + return &eval_target.AsyncDebugEvalTargetResponse{ + InvokeID: record.ID, + BaseResp: base.NewBaseResp(), + }, err + default: + return nil, errorx.New("unsupported eval target type %v", request.GetEvalTargetType()) + } } diff --git a/backend/modules/evaluation/domain/service/mocks/target.go b/backend/modules/evaluation/domain/service/mocks/target.go index 148b73a85..bcaccb2cb 100644 --- a/backend/modules/evaluation/domain/service/mocks/target.go +++ b/backend/modules/evaluation/domain/service/mocks/target.go @@ -41,6 +41,21 @@ func (m *MockIEvalTargetService) EXPECT() *MockIEvalTargetServiceMockRecorder { return m.recorder } +// AsyncDebugTarget mocks base method. +func (m *MockIEvalTargetService) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (*entity.EvalTargetRecord, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AsyncDebugTarget", ctx, param) + ret0, _ := ret[0].(*entity.EvalTargetRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AsyncDebugTarget indicates an expected call of AsyncDebugTarget. +func (mr *MockIEvalTargetServiceMockRecorder) AsyncDebugTarget(ctx, param any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncDebugTarget", reflect.TypeOf((*MockIEvalTargetService)(nil).AsyncDebugTarget), ctx, param) +} + // AsyncExecuteTarget mocks base method. func (m *MockIEvalTargetService) AsyncExecuteTarget(ctx context.Context, spaceID, targetID, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) { m.ctrl.T.Helper() @@ -122,6 +137,21 @@ func (mr *MockIEvalTargetServiceMockRecorder) CreateEvalTarget(ctx, spaceID, sou return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateEvalTarget", reflect.TypeOf((*MockIEvalTargetService)(nil).CreateEvalTarget), varargs...) } +// DebugTarget mocks base method. +func (m *MockIEvalTargetService) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (*entity.EvalTargetRecord, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DebugTarget", ctx, param) + ret0, _ := ret[0].(*entity.EvalTargetRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DebugTarget indicates an expected call of DebugTarget. +func (mr *MockIEvalTargetServiceMockRecorder) DebugTarget(ctx, param any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugTarget", reflect.TypeOf((*MockIEvalTargetService)(nil).DebugTarget), ctx, param) +} + // ExecuteTarget mocks base method. func (m *MockIEvalTargetService) ExecuteTarget(ctx context.Context, spaceID, targetID, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) { m.ctrl.T.Helper() diff --git a/backend/modules/evaluation/domain/service/target.go b/backend/modules/evaluation/domain/service/target.go index 6edbb1c26..64e33d63f 100644 --- a/backend/modules/evaluation/domain/service/target.go +++ b/backend/modules/evaluation/domain/service/target.go @@ -19,6 +19,8 @@ type IEvalTargetService interface { ExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) + DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) + AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) BatchGetRecordByIDs(ctx context.Context, spaceID int64, recordIDs []int64) ([]*entity.EvalTargetRecord, error) ReportInvokeRecords(ctx context.Context, recordID2Params *entity.ReportTargetRecordParam) error From c5c3e2e07e363cb133210a495c6be871b5fc41f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 19 Sep 2025 18:45:28 +0800 Subject: [PATCH 041/100] fix Change-Id: If2d50e3d915fef80f5300a9e293cda7c843b6955 --- backend/modules/evaluation/application/eval_target_app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 9c50e25b2..f558260e8 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -441,6 +441,7 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r ApplicationID: req.ApplicationID, CustomRPCServer: target.CustomRPCServerDTO2DO(req.CustomRPCServer), Region: req.Region, + Env: req.Env, PageSize: req.PageSize, PageToken: req.PageToken, }) From 4b25d7c1922b7bba08c57027d07a4bc6de557558 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 12:46:08 +0800 Subject: [PATCH 042/100] feat(evaluation): target service with async execute --- .../loop/apis/evaltargetservice/client.go | 6 + .../evaltargetservice/evaltargetservice.go | 36 + .../coze.loop.evaluation.eval_target.go | 706 +++++++++++++++++- ...e.loop.evaluation.eval_target_validator.go | 8 + .../eval_target/evaltargetservice/client.go | 6 + .../evaltargetservice/evaltargetservice.go | 36 + .../k-coze.loop.evaluation.eval_target.go | 410 ++++++++++ .../evaluation/evaltargetservice/client.go | 6 + .../evaltargetservice/evaltargetservice.go | 36 + .../loeval_target/local_evaltargetservice.go | 21 + .../evaluation/application/eval_target_app.go | 22 + .../coze.loop.evaluation.eval_target.thrift | 9 + 12 files changed, 1278 insertions(+), 24 deletions(-) diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go index 6900c6697..987abf3ab 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/client.go @@ -20,6 +20,7 @@ type Client interface { BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) + AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) @@ -100,6 +101,11 @@ func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, reques return p.kClient.ExecuteEvalTarget(ctx, request) } +func (p *kEvalTargetServiceClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncExecuteEvalTarget(ctx, request) +} + func (p *kEvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetEvalTargetRecord(ctx, request) diff --git a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go index d872f4fd3..5cad352a3 100644 --- a/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/apis/evaltargetservice/evaltargetservice.go @@ -77,6 +77,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "AsyncExecuteEvalTarget": kitex.NewMethodInfo( + asyncExecuteEvalTargetHandler, + newEvalTargetServiceAsyncExecuteEvalTargetArgs, + newEvalTargetServiceAsyncExecuteEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "GetEvalTargetRecord": kitex.NewMethodInfo( getEvalTargetRecordHandler, newEvalTargetServiceGetEvalTargetRecordArgs, @@ -309,6 +316,25 @@ func newEvalTargetServiceExecuteEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceExecuteEvalTargetResult() } +func asyncExecuteEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncExecuteEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncExecuteEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetArgs() +} + +func newEvalTargetServiceAsyncExecuteEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetResult() +} + func getEvalTargetRecordHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceGetEvalTargetRecordArgs) realResult := result.(*eval_target.EvalTargetServiceGetEvalTargetRecordResult) @@ -487,6 +513,16 @@ func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.Ex return _result.GetSuccess(), nil } +func (p *kClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult + if err = p.c.Call(ctx, "AsyncExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest) (r *eval_target.GetEvalTargetRecordResponse, err error) { var _args eval_target.EvalTargetServiceGetEvalTargetRecordArgs _args.Request = request diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 8dccbc1b1..1de5c5846 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -12,6 +12,12 @@ import ( "strings" ) +type AsyncExecuteEvalTargetRequest = ExecuteEvalTargetRequest + +func NewAsyncExecuteEvalTargetRequest() *AsyncExecuteEvalTargetRequest { + return (*AsyncExecuteEvalTargetRequest)(NewExecuteEvalTargetRequest()) +} + type CreateEvalTargetRequest struct { WorkspaceID int64 `thrift:"workspace_id,1,required" frugal:"1,required,i64" json:"workspace_id" form:"workspace_id,required" query:"workspace_id,required"` Param *CreateEvalTargetParam `thrift:"param,2,optional" frugal:"2,optional,CreateEvalTargetParam" form:"param" json:"param,omitempty" query:"param"` @@ -4150,6 +4156,254 @@ func (p *ExecuteEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { return true } +type AsyncExecuteEvalTargetResponse struct { + InvokeID *int64 `thrift:"invoke_id,1,optional" frugal:"1,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` + BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` +} + +func NewAsyncExecuteEvalTargetResponse() *AsyncExecuteEvalTargetResponse { + return &AsyncExecuteEvalTargetResponse{} +} + +func (p *AsyncExecuteEvalTargetResponse) InitDefault() { +} + +var AsyncExecuteEvalTargetResponse_InvokeID_DEFAULT int64 + +func (p *AsyncExecuteEvalTargetResponse) GetInvokeID() (v int64) { + if p == nil { + return + } + if !p.IsSetInvokeID() { + return AsyncExecuteEvalTargetResponse_InvokeID_DEFAULT + } + return *p.InvokeID +} + +var AsyncExecuteEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp + +func (p *AsyncExecuteEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { + if p == nil { + return + } + if !p.IsSetBaseResp() { + return AsyncExecuteEvalTargetResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *AsyncExecuteEvalTargetResponse) SetInvokeID(val *int64) { + p.InvokeID = val +} +func (p *AsyncExecuteEvalTargetResponse) SetBaseResp(val *base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_AsyncExecuteEvalTargetResponse = map[int16]string{ + 1: "invoke_id", + 255: "BaseResp", +} + +func (p *AsyncExecuteEvalTargetResponse) IsSetInvokeID() bool { + return p.InvokeID != nil +} + +func (p *AsyncExecuteEvalTargetResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *AsyncExecuteEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncExecuteEvalTargetResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AsyncExecuteEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.InvokeID = _field + return nil +} +func (p *AsyncExecuteEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { + _field := base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *AsyncExecuteEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncExecuteEvalTargetResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *AsyncExecuteEvalTargetResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetInvokeID() { + if err = oprot.WriteFieldBegin("invoke_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.InvokeID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *AsyncExecuteEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *AsyncExecuteEvalTargetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AsyncExecuteEvalTargetResponse(%+v)", *p) + +} + +func (p *AsyncExecuteEvalTargetResponse) DeepEqual(ano *AsyncExecuteEvalTargetResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.InvokeID) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *AsyncExecuteEvalTargetResponse) Field1DeepEqual(src *int64) bool { + + if p.InvokeID == src { + return true + } else if p.InvokeID == nil || src == nil { + return false + } + if *p.InvokeID != *src { + return false + } + return true +} +func (p *AsyncExecuteEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + type ListEvalTargetRecordRequest struct { WorkspaceID int64 `thrift:"workspace_id,1,required" frugal:"1,required,i64" json:"workspace_id" form:"workspace_id,required" query:"workspace_id,required"` EvalTargetID int64 `thrift:"eval_target_id,2,required" frugal:"2,required,i64" json:"eval_target_id" form:"eval_target_id,required" query:"eval_target_id,required"` @@ -11770,6 +12024,8 @@ type EvalTargetService interface { // 执行 ExecuteEvalTarget(ctx context.Context, request *ExecuteEvalTargetRequest) (r *ExecuteEvalTargetResponse, err error) + AsyncExecuteEvalTarget(ctx context.Context, request *AsyncExecuteEvalTargetRequest) (r *AsyncExecuteEvalTargetResponse, err error) + GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *BatchGetEvalTargetRecordsRequest) (r *BatchGetEvalTargetRecordsResponse, err error) @@ -11886,6 +12142,15 @@ func (p *EvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, request } return _result.GetSuccess(), nil } +func (p *EvalTargetServiceClient) AsyncExecuteEvalTarget(ctx context.Context, request *AsyncExecuteEvalTargetRequest) (r *AsyncExecuteEvalTargetResponse, err error) { + var _args EvalTargetServiceAsyncExecuteEvalTargetArgs + _args.Request = request + var _result EvalTargetServiceAsyncExecuteEvalTargetResult + if err = p.Client_().Call(ctx, "AsyncExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} func (p *EvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *GetEvalTargetRecordRequest) (r *GetEvalTargetRecordResponse, err error) { var _args EvalTargetServiceGetEvalTargetRecordArgs _args.Request = request @@ -11952,6 +12217,7 @@ func NewEvalTargetServiceProcessor(handler EvalTargetService) *EvalTargetService self.AddToProcessorMap("BatchGetSourceEvalTargets", &evalTargetServiceProcessorBatchGetSourceEvalTargets{handler: handler}) self.AddToProcessorMap("SearchCustomEvalTarget", &evalTargetServiceProcessorSearchCustomEvalTarget{handler: handler}) self.AddToProcessorMap("ExecuteEvalTarget", &evalTargetServiceProcessorExecuteEvalTarget{handler: handler}) + self.AddToProcessorMap("AsyncExecuteEvalTarget", &evalTargetServiceProcessorAsyncExecuteEvalTarget{handler: handler}) self.AddToProcessorMap("GetEvalTargetRecord", &evalTargetServiceProcessorGetEvalTargetRecord{handler: handler}) self.AddToProcessorMap("BatchGetEvalTargetRecords", &evalTargetServiceProcessorBatchGetEvalTargetRecords{handler: handler}) self.AddToProcessorMap("DebugEvalTarget", &evalTargetServiceProcessorDebugEvalTarget{handler: handler}) @@ -12408,16 +12674,16 @@ func (p *evalTargetServiceProcessorExecuteEvalTarget) Process(ctx context.Contex return true, err } -type evalTargetServiceProcessorGetEvalTargetRecord struct { +type evalTargetServiceProcessorAsyncExecuteEvalTarget struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceGetEvalTargetRecordArgs{} +func (p *evalTargetServiceProcessorAsyncExecuteEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceAsyncExecuteEvalTargetArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("AsyncExecuteEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12426,11 +12692,11 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceGetEvalTargetRecordResult{} - var retval *GetEvalTargetRecordResponse - if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) - oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) + result := EvalTargetServiceAsyncExecuteEvalTargetResult{} + var retval *AsyncExecuteEvalTargetResponse + if retval, err2 = p.handler.AsyncExecuteEvalTarget(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AsyncExecuteEvalTarget: "+err2.Error()) + oprot.WriteMessageBegin("AsyncExecuteEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12438,7 +12704,7 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("AsyncExecuteEvalTarget", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12456,16 +12722,16 @@ func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Cont return true, err } -type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { +type evalTargetServiceProcessorGetEvalTargetRecord struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} +func (p *evalTargetServiceProcessorGetEvalTargetRecord) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceGetEvalTargetRecordArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12474,11 +12740,11 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex iprot.ReadMessageEnd() var err2 error - result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} - var retval *BatchGetEvalTargetRecordsResponse - if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) - oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + result := EvalTargetServiceGetEvalTargetRecordResult{} + var retval *GetEvalTargetRecordResponse + if retval, err2 = p.handler.GetEvalTargetRecord(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEvalTargetRecord: "+err2.Error()) + oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12486,7 +12752,7 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetEvalTargetRecord", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12504,16 +12770,64 @@ func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx contex return true, err } -type evalTargetServiceProcessorDebugEvalTarget struct { +type evalTargetServiceProcessorBatchGetEvalTargetRecords struct { handler EvalTargetService } -func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := EvalTargetServiceDebugEvalTargetArgs{} +func (p *evalTargetServiceProcessorBatchGetEvalTargetRecords) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceBatchGetEvalTargetRecordsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := EvalTargetServiceBatchGetEvalTargetRecordsResult{} + var retval *BatchGetEvalTargetRecordsResponse + if retval, err2 = p.handler.BatchGetEvalTargetRecords(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing BatchGetEvalTargetRecords: "+err2.Error()) + oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("BatchGetEvalTargetRecords", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type evalTargetServiceProcessorDebugEvalTarget struct { + handler EvalTargetService +} + +func (p *evalTargetServiceProcessorDebugEvalTarget) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := EvalTargetServiceDebugEvalTargetArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DebugEvalTarget", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -15696,6 +16010,350 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) Field0DeepEqual(src *ExecuteE return true } +type EvalTargetServiceAsyncExecuteEvalTargetArgs struct { + Request *AsyncExecuteEvalTargetRequest `thrift:"request,1" frugal:"1,default,ExecuteEvalTargetRequest"` +} + +func NewEvalTargetServiceAsyncExecuteEvalTargetArgs() *EvalTargetServiceAsyncExecuteEvalTargetArgs { + return &EvalTargetServiceAsyncExecuteEvalTargetArgs{} +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) InitDefault() { +} + +var EvalTargetServiceAsyncExecuteEvalTargetArgs_Request_DEFAULT *AsyncExecuteEvalTargetRequest + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) GetRequest() (v *AsyncExecuteEvalTargetRequest) { + if p == nil { + return + } + if !p.IsSetRequest() { + return EvalTargetServiceAsyncExecuteEvalTargetArgs_Request_DEFAULT + } + return p.Request +} +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) SetRequest(val *AsyncExecuteEvalTargetRequest) { + p.Request = val +} + +var fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetArgs = map[int16]string{ + 1: "request", +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAsyncExecuteEvalTargetRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncExecuteEvalTarget_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceAsyncExecuteEvalTargetArgs(%+v)", *p) + +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) DeepEqual(ano *EvalTargetServiceAsyncExecuteEvalTargetArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) Field1DeepEqual(src *AsyncExecuteEvalTargetRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type EvalTargetServiceAsyncExecuteEvalTargetResult struct { + Success *AsyncExecuteEvalTargetResponse `thrift:"success,0,optional" frugal:"0,optional,AsyncExecuteEvalTargetResponse"` +} + +func NewEvalTargetServiceAsyncExecuteEvalTargetResult() *EvalTargetServiceAsyncExecuteEvalTargetResult { + return &EvalTargetServiceAsyncExecuteEvalTargetResult{} +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) InitDefault() { +} + +var EvalTargetServiceAsyncExecuteEvalTargetResult_Success_DEFAULT *AsyncExecuteEvalTargetResponse + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) GetSuccess() (v *AsyncExecuteEvalTargetResponse) { + if p == nil { + return + } + if !p.IsSetSuccess() { + return EvalTargetServiceAsyncExecuteEvalTargetResult_Success_DEFAULT + } + return p.Success +} +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) SetSuccess(x interface{}) { + p.Success = x.(*AsyncExecuteEvalTargetResponse) +} + +var fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetResult = map[int16]string{ + 0: "success", +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) Read(iprot thrift.TProtocol) (err error) { + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAsyncExecuteEvalTargetResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AsyncExecuteEvalTarget_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EvalTargetServiceAsyncExecuteEvalTargetResult(%+v)", *p) + +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) DeepEqual(ano *EvalTargetServiceAsyncExecuteEvalTargetResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) Field0DeepEqual(src *AsyncExecuteEvalTargetResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + type EvalTargetServiceGetEvalTargetRecordArgs struct { Request *GetEvalTargetRecordRequest `thrift:"request,1" frugal:"1,default,GetEvalTargetRecordRequest"` } diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go index 453fca6df..61fdbd655 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go @@ -129,6 +129,14 @@ func (p *ExecuteEvalTargetResponse) IsValid() error { } return nil } +func (p *AsyncExecuteEvalTargetResponse) IsValid() error { + if p.BaseResp != nil { + if err := p.BaseResp.IsValid(); err != nil { + return fmt.Errorf("field BaseResp not valid, %w", err) + } + } + return nil +} func (p *ListEvalTargetRecordRequest) IsValid() error { if p.Base != nil { if err := p.Base.IsValid(); err != nil { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go index 6900c6697..987abf3ab 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/client.go @@ -20,6 +20,7 @@ type Client interface { BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) + AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) @@ -100,6 +101,11 @@ func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, reques return p.kClient.ExecuteEvalTarget(ctx, request) } +func (p *kEvalTargetServiceClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncExecuteEvalTarget(ctx, request) +} + func (p *kEvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetEvalTargetRecord(ctx, request) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go index 61c1618fa..2778131c0 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/evaltargetservice/evaltargetservice.go @@ -76,6 +76,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "AsyncExecuteEvalTarget": kitex.NewMethodInfo( + asyncExecuteEvalTargetHandler, + newEvalTargetServiceAsyncExecuteEvalTargetArgs, + newEvalTargetServiceAsyncExecuteEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "GetEvalTargetRecord": kitex.NewMethodInfo( getEvalTargetRecordHandler, newEvalTargetServiceGetEvalTargetRecordArgs, @@ -308,6 +315,25 @@ func newEvalTargetServiceExecuteEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceExecuteEvalTargetResult() } +func asyncExecuteEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncExecuteEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncExecuteEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetArgs() +} + +func newEvalTargetServiceAsyncExecuteEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetResult() +} + func getEvalTargetRecordHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceGetEvalTargetRecordArgs) realResult := result.(*eval_target.EvalTargetServiceGetEvalTargetRecordResult) @@ -486,6 +512,16 @@ func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.Ex return _result.GetSuccess(), nil } +func (p *kClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult + if err = p.c.Call(ctx, "AsyncExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest) (r *eval_target.GetEvalTargetRecordResponse, err error) { var _args eval_target.EvalTargetServiceGetEvalTargetRecordArgs _args.Request = request diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index a395aa42d..13f388a57 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -3011,6 +3011,174 @@ func (p *ExecuteEvalTargetResponse) DeepCopy(s interface{}) error { return nil } +func (p *AsyncExecuteEvalTargetResponse) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AsyncExecuteEvalTargetResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AsyncExecuteEvalTargetResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InvokeID = _field + return offset, nil +} + +func (p *AsyncExecuteEvalTargetResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + _field := base.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = _field + return offset, nil +} + +func (p *AsyncExecuteEvalTargetResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AsyncExecuteEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField255(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *AsyncExecuteEvalTargetResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AsyncExecuteEvalTargetResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInvokeID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 1) + offset += thrift.Binary.WriteI64(buf[offset:], *p.InvokeID) + } + return offset +} + +func (p *AsyncExecuteEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *AsyncExecuteEvalTargetResponse) field1Length() int { + l := 0 + if p.IsSetInvokeID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *AsyncExecuteEvalTargetResponse) field255Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.BaseResp.BLength() + return l +} + +func (p *AsyncExecuteEvalTargetResponse) DeepCopy(s interface{}) error { + src, ok := s.(*AsyncExecuteEvalTargetResponse) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.InvokeID != nil { + tmp := *src.InvokeID + p.InvokeID = &tmp + } + + var _baseResp *base.BaseResp + if src.BaseResp != nil { + _baseResp = &base.BaseResp{} + if err := _baseResp.DeepCopy(src.BaseResp); err != nil { + return err + } + } + p.BaseResp = _baseResp + + return nil +} + func (p *ListEvalTargetRecordRequest) FastRead(buf []byte) (int, error) { var err error @@ -10681,6 +10849,240 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) DeepCopy(s interface{}) error return nil } +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncExecuteEvalTargetRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceAsyncExecuteEvalTargetArgs) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _request *AsyncExecuteEvalTargetRequest + if src.Request != nil { + _request = &AsyncExecuteEvalTargetRequest{} + if err := _request.DeepCopy(src.Request); err != nil { + return err + } + } + p.Request = _request + + return nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EvalTargetServiceAsyncExecuteEvalTargetResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewAsyncExecuteEvalTargetResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) DeepCopy(s interface{}) error { + src, ok := s.(*EvalTargetServiceAsyncExecuteEvalTargetResult) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _success *AsyncExecuteEvalTargetResponse + if src.Success != nil { + _success = &AsyncExecuteEvalTargetResponse{} + if err := _success.DeepCopy(src.Success); err != nil { + return err + } + } + p.Success = _success + + return nil +} + func (p *EvalTargetServiceGetEvalTargetRecordArgs) FastRead(buf []byte) (int, error) { var err error @@ -11689,6 +12091,14 @@ func (p *EvalTargetServiceExecuteEvalTargetResult) GetResult() interface{} { return p.Success } +func (p *EvalTargetServiceAsyncExecuteEvalTargetArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *EvalTargetServiceAsyncExecuteEvalTargetResult) GetResult() interface{} { + return p.Success +} + func (p *EvalTargetServiceGetEvalTargetRecordArgs) GetFirstArgument() interface{} { return p.Request } diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go index 6900c6697..987abf3ab 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/client.go @@ -20,6 +20,7 @@ type Client interface { BatchGetSourceEvalTargets(ctx context.Context, request *eval_target.BatchGetSourceEvalTargetsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetSourceEvalTargetsResponse, err error) SearchCustomEvalTarget(ctx context.Context, req *eval_target.SearchCustomEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.SearchCustomEvalTargetResponse, err error) ExecuteEvalTarget(ctx context.Context, request *eval_target.ExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.ExecuteEvalTargetResponse, err error) + AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) BatchGetEvalTargetRecords(ctx context.Context, request *eval_target.BatchGetEvalTargetRecordsRequest, callOptions ...callopt.Option) (r *eval_target.BatchGetEvalTargetRecordsResponse, err error) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.DebugEvalTargetResponse, err error) @@ -100,6 +101,11 @@ func (p *kEvalTargetServiceClient) ExecuteEvalTarget(ctx context.Context, reques return p.kClient.ExecuteEvalTarget(ctx, request) } +func (p *kEvalTargetServiceClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AsyncExecuteEvalTarget(ctx, request) +} + func (p *kEvalTargetServiceClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (r *eval_target.GetEvalTargetRecordResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetEvalTargetRecord(ctx, request) diff --git a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go index 92a130237..e2fd9a2da 100644 --- a/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go +++ b/backend/kitex_gen/coze/loop/evaluation/evaltargetservice/evaltargetservice.go @@ -77,6 +77,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "AsyncExecuteEvalTarget": kitex.NewMethodInfo( + asyncExecuteEvalTargetHandler, + newEvalTargetServiceAsyncExecuteEvalTargetArgs, + newEvalTargetServiceAsyncExecuteEvalTargetResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), "GetEvalTargetRecord": kitex.NewMethodInfo( getEvalTargetRecordHandler, newEvalTargetServiceGetEvalTargetRecordArgs, @@ -309,6 +316,25 @@ func newEvalTargetServiceExecuteEvalTargetResult() interface{} { return eval_target.NewEvalTargetServiceExecuteEvalTargetResult() } +func asyncExecuteEvalTargetHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs) + realResult := result.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult) + success, err := handler.(eval_target.EvalTargetService).AsyncExecuteEvalTarget(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} + +func newEvalTargetServiceAsyncExecuteEvalTargetArgs() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetArgs() +} + +func newEvalTargetServiceAsyncExecuteEvalTargetResult() interface{} { + return eval_target.NewEvalTargetServiceAsyncExecuteEvalTargetResult() +} + func getEvalTargetRecordHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*eval_target.EvalTargetServiceGetEvalTargetRecordArgs) realResult := result.(*eval_target.EvalTargetServiceGetEvalTargetRecordResult) @@ -487,6 +513,16 @@ func (p *kClient) ExecuteEvalTarget(ctx context.Context, request *eval_target.Ex return _result.GetSuccess(), nil } +func (p *kClient) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + var _args eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs + _args.Request = request + var _result eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult + if err = p.c.Call(ctx, "AsyncExecuteEvalTarget", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest) (r *eval_target.GetEvalTargetRecordResponse, err error) { var _args eval_target.EvalTargetServiceGetEvalTargetRecordArgs _args.Request = request diff --git a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go index 91ee65ea4..25a9e1d7b 100644 --- a/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go +++ b/backend/loop_gen/coze/loop/evaluation/loeval_target/local_evaltargetservice.go @@ -227,6 +227,27 @@ func (l *LocalEvalTargetService) ExecuteEvalTarget(ctx context.Context, request return result.GetSuccess(), nil } +func (l *LocalEvalTargetService) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest, callOptions ...callopt.Option) (*eval_target.AsyncExecuteEvalTargetResponse, error) { + chain := l.mds(func(ctx context.Context, in, out interface{}) error { + arg := in.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs) + result := out.(*eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult) + resp, err := l.impl.AsyncExecuteEvalTarget(ctx, arg.Request) + if err != nil { + return err + } + result.SetSuccess(resp) + return nil + }) + + arg := &eval_target.EvalTargetServiceAsyncExecuteEvalTargetArgs{Request: request} + result := &eval_target.EvalTargetServiceAsyncExecuteEvalTargetResult{} + ctx = l.injectRPCInfo(ctx, "AsyncExecuteEvalTarget") + if err := chain(ctx, arg, result); err != nil { + return nil, err + } + return result.GetSuccess(), nil +} + func (l *LocalEvalTargetService) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest, callOptions ...callopt.Option) (*eval_target.GetEvalTargetRecordResponse, error) { chain := l.mds(func(ctx context.Context, in, out interface{}) error { arg := in.(*eval_target.EvalTargetServiceGetEvalTargetRecordArgs) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index f558260e8..46973f0d4 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -324,6 +324,28 @@ func (e EvalTargetApplicationImpl) ExecuteEvalTarget(ctx context.Context, reques return resp, nil } +func (e EvalTargetApplicationImpl) AsyncExecuteEvalTarget(ctx context.Context, request *eval_target.AsyncExecuteEvalTargetRequest) (r *eval_target.AsyncExecuteEvalTargetResponse, err error) { + if err = e.auth.Authorization(ctx, &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(request.EvalTargetID, 10), + SpaceID: request.WorkspaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.Run), EntityType: gptr.Of(rpc.AuthEntityType_EvaluationTarget)}}, + }); err != nil { + return nil, err + } + + record, err := e.evalTargetService.AsyncExecuteTarget(ctx, request.WorkspaceID, request.EvalTargetID, request.EvalTargetVersionID, &entity.ExecuteTargetCtx{ + ExperimentRunID: request.ExperimentRunID, + }, target.InputDTO2ToDO(request.InputData)) + if err != nil { + return nil, err + } + + return &eval_target.AsyncExecuteEvalTargetResponse{ + InvokeID: gptr.Of(record.ID), + BaseResp: base.NewBaseResp(), + }, nil +} + func (e EvalTargetApplicationImpl) GetEvalTargetRecord(ctx context.Context, request *eval_target.GetEvalTargetRecordRequest) (r *eval_target.GetEvalTargetRecordResponse, err error) { if request == nil { return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("req is nil")) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index a84044f95..7e28e8202 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -89,6 +89,14 @@ struct ExecuteEvalTargetResponse { 255: base.BaseResp BaseResp } +typedef ExecuteEvalTargetRequest AsyncExecuteEvalTargetRequest + +struct AsyncExecuteEvalTargetResponse { + 1: optional i64 invoke_id + + 255: base.BaseResp BaseResp +} + struct ListEvalTargetRecordRequest { 1: required i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') 2: required i64 eval_target_id (api.js_conv="true", go.tag = 'json:"eval_target_id"') @@ -265,6 +273,7 @@ service EvalTargetService { // 执行 ExecuteEvalTargetResponse ExecuteEvalTarget(1: ExecuteEvalTargetRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_targets/:eval_target_id/versions/:eval_target_version_id/execute") + AsyncExecuteEvalTargetResponse AsyncExecuteEvalTarget(1: AsyncExecuteEvalTargetRequest request) GetEvalTargetRecordResponse GetEvalTargetRecord(1: GetEvalTargetRecordRequest request) (api.category="eval_target", api.get = "/api/evaluation/v1/eval_target_records/:eval_target_record_id") BatchGetEvalTargetRecordsResponse BatchGetEvalTargetRecords(1: BatchGetEvalTargetRecordsRequest request) (api.category="eval_target", api.post = "/api/evaluation/v1/eval_target_records/batch_get") From 4ffed2254048168459c6d9b42a88d06cd8d1d862 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 13:20:53 +0800 Subject: [PATCH 043/100] fix(evaluation): debug target auth --- .../evaluation/application/eval_target_app.go | 42 +++++++++++++++++-- .../modules/evaluation/consts/experiment.go | 2 + 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 46973f0d4..d255697d0 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -478,11 +478,28 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r } func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request *eval_target.DebugEvalTargetRequest) (r *eval_target.DebugEvalTargetResponse, err error) { + //err = e.auth.Authorization(ctx, &rpc.AuthorizationParam{ + // ObjectID: strconv.FormatInt(request.GetWorkspaceID(), 10), + // SpaceID: request.GetWorkspaceID(), + // ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.ActionDebugEvalTarget), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + //}) + //if err != nil { + // return nil, err + //} + switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: record, err := e.evalTargetService.DebugTarget(ctx, &entity.DebugTargetParam{ - SpaceID: request.GetWorkspaceID(), - PatchyTarget: &entity.EvalTarget{}, + SpaceID: request.GetWorkspaceID(), + PatchyTarget: &entity.EvalTarget{ + SpaceID: request.GetWorkspaceID(), + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + EvalTargetVersion: &entity.EvalTargetVersion{ + SpaceID: request.GetWorkspaceID(), + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + CustomRPCServer: target.CustomRPCServerDTO2DO(request.GetCustomRPCServer()), + }, + }, InputData: &entity.EvalTargetInputData{ InputFields: target.ContentDTO2DOs(request.GetInputFields()), Ext: map[string]string{ @@ -503,11 +520,28 @@ func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request } func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, request *eval_target.AsyncDebugEvalTargetRequest) (r *eval_target.AsyncDebugEvalTargetResponse, err error) { + //err = e.auth.Authorization(ctx, &rpc.AuthorizationParam{ + // ObjectID: strconv.FormatInt(request.GetWorkspaceID(), 10), + // SpaceID: request.GetWorkspaceID(), + // ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.ActionDebugEvalTarget), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + //}) + //if err != nil { + // return nil, err + //} + switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: record, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ - SpaceID: request.GetWorkspaceID(), - PatchyTarget: &entity.EvalTarget{}, + SpaceID: request.GetWorkspaceID(), + PatchyTarget: &entity.EvalTarget{ + SpaceID: request.GetWorkspaceID(), + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + EvalTargetVersion: &entity.EvalTargetVersion{ + SpaceID: request.GetWorkspaceID(), + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + CustomRPCServer: target.CustomRPCServerDTO2DO(request.GetCustomRPCServer()), + }, + }, InputData: &entity.EvalTargetInputData{ InputFields: target.ContentDTO2DOs(request.GetInputFields()), Ext: map[string]string{ diff --git a/backend/modules/evaluation/consts/experiment.go b/backend/modules/evaluation/consts/experiment.go index 0255813a7..8b3f866bd 100644 --- a/backend/modules/evaluation/consts/experiment.go +++ b/backend/modules/evaluation/consts/experiment.go @@ -6,6 +6,8 @@ package consts const ( ActionCreateExpt = "createLoopEvaluationExperiment" ActionReadExpt = "listLoopEvaluationExperiment" + + ActionDebugEvalTarget = "debugLoopEvalTarget" ) const ( From 5557d1956e47172fbba9ce8d9c4e1ae94ff45903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 22 Sep 2025 20:09:19 +0800 Subject: [PATCH 044/100] fix Change-Id: I3a6d36c15b2862ec925aa7c84689fcd5f08070ab --- .../convertor/target/eval_target.go | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 98948329a..55d2fa921 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -192,26 +192,7 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi OutputSchemas: make([]*commondto.ArgsSchema, 0), } if targetVersionDO.CustomRPCServer != nil { - targetVersionDTO.EvalTargetContent.CustomRPCServer = &dto.CustomRPCServer{ - ID: &targetVersionDO.CustomRPCServer.ID, - Name: &targetVersionDO.CustomRPCServer.Name, - Description: &targetVersionDO.CustomRPCServer.Description, - ServerName: &targetVersionDO.CustomRPCServer.ServerName, - AccessProtocol: &targetVersionDO.CustomRPCServer.AccessProtocol, - Regions: targetVersionDO.CustomRPCServer.Regions, - Cluster: &targetVersionDO.CustomRPCServer.Cluster, - InvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.InvokeHTTPInfo), - AsyncInvokeHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.AsyncInvokeHTTPInfo), - NeedSearchTarget: targetVersionDO.CustomRPCServer.NeedSearchTarget, - SearchHTTPInfo: HttpInfoDO2DTO(targetVersionDO.CustomRPCServer.SearchHTTPInfo), - CustomEvalTarget: CustomEvalTargetDO2DTO(targetVersionDO.CustomRPCServer.CustomEvalTarget), - IsAsync: targetVersionDO.CustomRPCServer.IsAsync, - ExecRegion: gptr.Of(targetVersionDO.CustomRPCServer.ExecRegion), - ExecEnv: targetVersionDO.CustomRPCServer.ExecEnv, - Timeout: targetVersionDO.CustomRPCServer.Timeout, - AsyncTimeout: targetVersionDO.CustomRPCServer.AsyncTimeout, - Ext: targetVersionDO.CustomRPCServer.Ext, - } + targetVersionDTO.EvalTargetContent.CustomRPCServer = CustomRPCServerDO2DTO(targetVersionDO.CustomRPCServer) } default: targetVersionDTO.EvalTargetContent = &dto.EvalTargetContent{ @@ -230,6 +211,29 @@ func EvalTargetVersionDO2DTO(targetVersionDO *do.EvalTargetVersion) (targetVersi return targetVersionDTO } +func CustomRPCServerDO2DTO(do *do.CustomRPCServer) (dtoRes *dto.CustomRPCServer) { + return &dto.CustomRPCServer{ + ID: &do.ID, + Name: &do.Name, + Description: &do.Description, + ServerName: &do.ServerName, + AccessProtocol: &do.AccessProtocol, + Regions: do.Regions, + Cluster: &do.Cluster, + InvokeHTTPInfo: HttpInfoDO2DTO(do.InvokeHTTPInfo), + AsyncInvokeHTTPInfo: HttpInfoDO2DTO(do.AsyncInvokeHTTPInfo), + NeedSearchTarget: do.NeedSearchTarget, + SearchHTTPInfo: HttpInfoDO2DTO(do.SearchHTTPInfo), + CustomEvalTarget: CustomEvalTargetDO2DTO(do.CustomEvalTarget), + IsAsync: do.IsAsync, + ExecRegion: gptr.Of(do.ExecRegion), + ExecEnv: do.ExecEnv, + Timeout: do.Timeout, + AsyncTimeout: do.AsyncTimeout, + Ext: do.Ext, + } +} + func CustomRPCServerDTO2DO(dto *dto.CustomRPCServer) (doRes *do.CustomRPCServer) { if dto == nil { return nil From 10730c26e0ee913cc4eeb958fd2ff26e9341816c Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 21:11:00 +0800 Subject: [PATCH 045/100] fix(evaluation): panic --- .../evaluation/domain/service/target_impl.go | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index d162d11a8..8e3dc93f7 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -160,12 +160,16 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID int64 } statusErr, ok := errorx.FromStatusError(err) if ok { - outputData.EvalTargetRunError.Code = statusErr.Code() - outputData.EvalTargetRunError.Message = statusErr.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: statusErr.Code(), + Message: statusErr.Error(), + } spanParam.ErrCode = strconv.FormatInt(int64(statusErr.Code()), 10) } else { - outputData.EvalTargetRunError.Code = errno.CommonInternalErrorCode - outputData.EvalTargetRunError.Message = err.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: errno.CommonInternalErrorCode, + Message: err.Error(), + } } } @@ -323,11 +327,15 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID status = entity.EvalTargetRunStatusFail statusErr, ok := errorx.FromStatusError(err) if ok { - outputData.EvalTargetRunError.Code = statusErr.Code() - outputData.EvalTargetRunError.Message = statusErr.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: statusErr.Code(), + Message: statusErr.Error(), + } } else { - outputData.EvalTargetRunError.Code = errno.CommonInternalErrorCode - outputData.EvalTargetRunError.Message = err.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: errno.CommonInternalErrorCode, + Message: err.Error(), + } } } @@ -397,11 +405,15 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D status = entity.EvalTargetRunStatusFail statusErr, ok := errorx.FromStatusError(err) if ok { - outputData.EvalTargetRunError.Code = statusErr.Code() - outputData.EvalTargetRunError.Message = statusErr.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: statusErr.Code(), + Message: statusErr.Error(), + } } else { - outputData.EvalTargetRunError.Code = errno.CommonInternalErrorCode - outputData.EvalTargetRunError.Message = err.Error() + outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + Code: errno.CommonInternalErrorCode, + Message: err.Error(), + } } } From 308a5ee8030100267c53544e941c04fd4bbff6aa Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 21:16:07 +0800 Subject: [PATCH 046/100] fix(evaluation): target exec err --- .../modules/evaluation/domain/service/target_impl.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 8e3dc93f7..7a00835db 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -323,9 +323,9 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID }) if execErr != nil { logs.CtxError(ctx, "async execute target failed, spaceID=%v, targetID=%d, targetVersionID=%d, param=%v, inputData=%v, err=%v", - spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), err) + spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), execErr) status = entity.EvalTargetRunStatusFail - statusErr, ok := errorx.FromStatusError(err) + statusErr, ok := errorx.FromStatusError(execErr) if ok { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ Code: statusErr.Code(), @@ -334,7 +334,7 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID } else { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ Code: errno.CommonInternalErrorCode, - Message: err.Error(), + Message: execErr.Error(), } } } @@ -401,9 +401,9 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D EvalTarget: param.PatchyTarget, }) if execErr != nil { - logs.CtxError(ctx, "async execute target failed, param=%v, err=%v", json.Jsonify(param), err) + logs.CtxError(ctx, "async execute target failed, param=%v, err=%v", json.Jsonify(param), execErr) status = entity.EvalTargetRunStatusFail - statusErr, ok := errorx.FromStatusError(err) + statusErr, ok := errorx.FromStatusError(execErr) if ok { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ Code: statusErr.Code(), @@ -412,7 +412,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D } else { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ Code: errno.CommonInternalErrorCode, - Message: err.Error(), + Message: execErr.Error(), } } } From 21431537f6bee01b70fa62594703e4b95d34ab5c Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 21:26:14 +0800 Subject: [PATCH 047/100] fix(evaluation): target debug --- backend/modules/evaluation/domain/service/target_impl.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 7a00835db..7308e91bc 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -388,14 +388,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D return nil, err } - status := entity.EvalTargetRunStatusSuccess - outputData := &entity.EvalTargetOutputData{ - OutputFields: map[string]*entity.Content{}, - EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, - TimeConsumingMS: gptr.Of(int64(0)), - } - - execErr := operator.AsyncExecute(ctx, param.SpaceID, &entity.ExecuteEvalTargetParam{ + outputData, status, execErr := operator.Execute(ctx, param.SpaceID, &entity.ExecuteEvalTargetParam{ Input: param.InputData, TargetType: param.PatchyTarget.EvalTargetType, EvalTarget: param.PatchyTarget, From 0a4c367a5a1b4a336cb011c0f2ca04c07541cbb4 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 22 Sep 2025 22:58:04 +0800 Subject: [PATCH 048/100] fix(evaluation): debug target --- backend/modules/evaluation/domain/service/target_impl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 7308e91bc..3305950f7 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -396,6 +396,12 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D if execErr != nil { logs.CtxError(ctx, "async execute target failed, param=%v, err=%v", json.Jsonify(param), execErr) status = entity.EvalTargetRunStatusFail + outputData = &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{}, + EvalTargetUsage: &entity.EvalTargetUsage{}, + EvalTargetRunError: &entity.EvalTargetRunError{}, + TimeConsumingMS: gptr.Of(int64(0)), + } statusErr, ok := errorx.FromStatusError(execErr) if ok { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ From 0e3defe905c693dcc60965c173f9a463cbdbcc85 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 11:52:24 +0800 Subject: [PATCH 049/100] fix(evaluation): target asyncdebug abort err --- .../evaluation/domain/service/target_impl.go | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 3305950f7..276adadac 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -324,19 +324,20 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID if execErr != nil { logs.CtxError(ctx, "async execute target failed, spaceID=%v, targetID=%d, targetVersionID=%d, param=%v, inputData=%v, err=%v", spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), execErr) - status = entity.EvalTargetRunStatusFail - statusErr, ok := errorx.FromStatusError(execErr) - if ok { - outputData.EvalTargetRunError = &entity.EvalTargetRunError{ - Code: statusErr.Code(), - Message: statusErr.Error(), - } - } else { - outputData.EvalTargetRunError = &entity.EvalTargetRunError{ - Code: errno.CommonInternalErrorCode, - Message: execErr.Error(), - } - } + //status = entity.EvalTargetRunStatusFail + //statusErr, ok := errorx.FromStatusError(execErr) + //if ok { + // outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + // Code: statusErr.Code(), + // Message: statusErr.Error(), + // } + //} else { + // outputData.EvalTargetRunError = &entity.EvalTargetRunError{ + // Code: errno.CommonInternalErrorCode, + // Message: execErr.Error(), + // } + //} + return nil, execErr } userID := session.UserIDInCtxOrEmpty(ctx) @@ -394,7 +395,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D EvalTarget: param.PatchyTarget, }) if execErr != nil { - logs.CtxError(ctx, "async execute target failed, param=%v, err=%v", json.Jsonify(param), execErr) + logs.CtxError(ctx, "execute target failed, param=%v, err=%v", json.Jsonify(param), execErr) status = entity.EvalTargetRunStatusFail outputData = &entity.EvalTargetOutputData{ OutputFields: map[string]*entity.Content{}, From c2c3aecbc14d5fcc131b26b8a5b3dddab491b68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 23 Sep 2025 15:28:40 +0800 Subject: [PATCH 050/100] fix Change-Id: Id08349ac29a8862f3e2fc5e69eb1b23e45ef1e72 --- idl/thrift/coze/loop/evaluation/domain/eval_target.thrift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 22ef64837..794fa4116 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -104,8 +104,8 @@ const Region Region_I18N = "i18n" typedef string AccessProtocol (ts.enum="true") const AccessProtocol AccessProtocol_RPC = "rpc" const AccessProtocol AccessProtocol_RPCOld = "rpc_old" -const AccessProtocol AccessProtocol_faasHTTP = "faas_http" -const AccessProtocol AccessProtocol_faasHTTPOld = "faas_http_old" +const AccessProtocol AccessProtocol_FaasHTTP = "faas_http" +const AccessProtocol AccessProtocol_FaasHTTPOld = "faas_http_old" typedef string HTTPMethod (ts.enum="true") const HTTPMethod HTTPMethod_Get = "get" From 31414ed0829fe92c7bba3f787752b5c2f5221ebb Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 16:21:14 +0800 Subject: [PATCH 051/100] fix(evaluation): proxy path --- .../coze/loop/evaluation/coze.loop.evaluation.openapi.thrift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift index 6bf0290ae..cbb421117 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift @@ -23,5 +23,5 @@ struct ReportEvalTargetInvokeResultResponse { } service EvaluationOpenAPIService { - ReportEvalTargetInvokeResultResponse ReportEvalTargetInvokeResult(1: ReportEvalTargetInvokeResultRequest req) (api.category="openapi", api.post = "/v1/loop/evaluation/eval_targets/result") + ReportEvalTargetInvokeResultResponse ReportEvalTargetInvokeResult(1: ReportEvalTargetInvokeResultRequest req) (api.category="openapi", api.post = "/v1/loop/eval_targets/result") } From 5117afa21172512994f31af29c5404a0d3271524 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 17:54:08 +0800 Subject: [PATCH 052/100] fix(evaluation): evalasyncrepo --- .../application/eval_openapi_app.go | 14 +++-- .../modules/evaluation/application/wire.go | 10 +++- .../evaluation/application/wire_gen.go | 24 +++++--- .../evaluation/domain/entity/expt_run.go | 3 +- .../modules/evaluation/domain/repo/expt.go | 8 +-- .../evaluation/domain/repo/mocks/expt.go | 57 ++++++++++++++++++- .../service/expt_run_item_event_impl.go | 5 +- .../service/expt_run_item_event_impl_test.go | 1 + .../domain/service/expt_run_item_impl.go | 5 +- .../domain/service/expt_run_item_impl_test.go | 6 ++ .../domain/service/expt_run_item_turn_impl.go | 30 +++++++--- .../service/expt_run_item_turn_impl_test.go | 4 +- .../evaluation/domain/service/target_impl.go | 20 ++++++- .../domain/service/target_impl_test.go | 10 +++- .../repo/experiment/item_turn_eval_async.go | 8 +-- .../redis/convert/item_turn_eval_async.go | 8 +-- .../redis/dao/item_turn_eval_async.go | 20 +++---- 17 files changed, 178 insertions(+), 55 deletions(-) diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go index 86225e02f..ef67f6059 100644 --- a/backend/modules/evaluation/application/eval_openapi_app.go +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -24,16 +24,16 @@ type IEvalOpenAPIApplication = evaluation.EvalOpenAPIService type EvalOpenAPIApplication struct { targetSvc service.IEvalTargetService - asyncRepo repo.IExptItemTurnEvalAsyncRepo + asyncRepo repo.IEvalAsyncRepo publisher events.ExptEventPublisher } -func NewEvalOpenAPIApplication(asyncRepo repo.IExptItemTurnEvalAsyncRepo, publisher events.ExptEventPublisher, targetSvc service.IEvalTargetService) IEvalOpenAPIApplication { +func NewEvalOpenAPIApplication(asyncRepo repo.IEvalAsyncRepo, publisher events.ExptEventPublisher, targetSvc service.IEvalTargetService) IEvalOpenAPIApplication { return &EvalOpenAPIApplication{asyncRepo: asyncRepo, publisher: publisher, targetSvc: targetSvc} } func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { - actx, err := e.asyncRepo.GetAsyncCtx(ctx, strconv.FormatInt(req.GetInvokeID(), 10)) + actx, err := e.asyncRepo.GetEvalAsyncCtx(ctx, strconv.FormatInt(req.GetInvokeID(), 10)) if err != nil { return nil, err } @@ -44,13 +44,15 @@ func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Conte SpaceID: req.GetWorkspaceID(), RecordID: req.GetInvokeID(), OutputData: outputData, - Session: actx.Event.Session, + Session: actx.Session, }); err != nil { return nil, err } - if err := e.publisher.PublishExptRecordEvalEvent(ctx, actx.Event, gptr.Of(time.Second*3)); err != nil { - return nil, err + if actx.Event != nil { + if err := e.publisher.PublishExptRecordEvalEvent(ctx, actx.Event, gptr.Of(time.Second*3)); err != nil { + return nil, err + } } return &openapi.ReportEvalTargetInvokeResultResponse{BaseResp: base.NewBaseResp()}, nil diff --git a/backend/modules/evaluation/application/wire.go b/backend/modules/evaluation/application/wire.go index c2b739b67..985fc517e 100644 --- a/backend/modules/evaluation/application/wire.go +++ b/backend/modules/evaluation/application/wire.go @@ -119,6 +119,7 @@ var ( targetDomainService, evaluatorDomainService, flagSet, + evalAsyncRepoSet, ) evaluatorDomainService = wire.NewSet( @@ -186,6 +187,12 @@ var ( foundation.NewAuthRPCProvider, targetDomainService, flagSet, + evalAsyncRepoSet, + ) + + evalAsyncRepoSet = wire.NewSet( + experiment.NewEvalAsyncRepo, + exptredis.NewEvalAsyncDAO, ) evalOpenAPISet = wire.NewSet( @@ -194,8 +201,7 @@ var ( evaltargetmtr.NewEvalTargetMetrics, flagSet, rmqproducer.NewExptEventPublisher, - experiment.NewExptItemTurnEvalAsyncRepo, - exptredis.NewExptItemTurnEvalAsyncDAO, + evalAsyncRepoSet, ) ) diff --git a/backend/modules/evaluation/application/wire_gen.go b/backend/modules/evaluation/application/wire_gen.go index 02f558717..51993a198 100644 --- a/backend/modules/evaluation/application/wire_gen.go +++ b/backend/modules/evaluation/application/wire_gen.go @@ -120,7 +120,9 @@ func InitExperimentApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(pms, pes) v2 := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v2) + iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) + iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v2, iEvalAsyncRepo) iDatasetRPCAdapter := data.NewDatasetRPCAdapter(sds) evaluationSetVersionService := service.NewEvaluationSetVersionServiceImpl(iDatasetRPCAdapter) iEvaluationSetService := service.NewEvaluationSetServiceImpl(iDatasetRPCAdapter) @@ -134,7 +136,7 @@ func InitExperimentApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d iExptManager := service.NewExptManager(exptResultService, iExperimentRepo, iExptRunLogRepo, iExptStatsRepo, iExptItemResultRepo, iExptTurnResultRepo, componentIConfiger, quotaRepo, iLocker, idempotentService, exptEventPublisher, auditClient, idgen2, exptMetric, iLatestWriteTracker, evaluationSetVersionService, iEvaluationSetService, iEvalTargetService, serviceEvaluatorService, benefitSvc, exptAggrResultService) schedulerModeFactory := service.NewSchedulerModeFactory(iExptManager, iExptItemResultRepo, iExptStatsRepo, iExptTurnResultRepo, idgen2, evaluationSetItemService, iExperimentRepo, idempotentService, componentIConfiger, exptEventPublisher, evaluatorRecordService, exptResultService) exptSchedulerEvent := service.NewExptSchedulerSvc(iExptManager, iExperimentRepo, iExptItemResultRepo, iExptTurnResultRepo, iExptStatsRepo, iExptRunLogRepo, idempotentService, componentIConfiger, quotaRepo, iLocker, exptEventPublisher, auditClient, exptMetric, exptResultService, idgen2, evaluationSetItemService, schedulerModeFactory) - exptItemEvalEvent := service.NewExptRecordEvalService(iExptManager, componentIConfiger, exptEventPublisher, iExptItemResultRepo, iExptTurnResultRepo, iExptStatsRepo, iExperimentRepo, quotaRepo, iLocker, idempotentService, auditClient, exptMetric, exptResultService, iEvalTargetService, evaluationSetItemService, evaluatorRecordService, serviceEvaluatorService, idgen2, benefitSvc) + exptItemEvalEvent := service.NewExptRecordEvalService(iExptManager, componentIConfiger, exptEventPublisher, iExptItemResultRepo, iExptTurnResultRepo, iExptStatsRepo, iExperimentRepo, quotaRepo, iLocker, idempotentService, auditClient, exptMetric, exptResultService, iEvalTargetService, evaluationSetItemService, evaluatorRecordService, serviceEvaluatorService, idgen2, benefitSvc, iEvalAsyncRepo) iAuthProvider := foundation.NewAuthRPCProvider(authClient) iExptAnnotateService := service.NewExptAnnotateService(db2, iExptAnnotateRepo, iExptTurnResultRepo, exptEventPublisher, evaluationSetItemService, iExperimentRepo, exptResultService, iExptTurnResultFilterRepo, iExptAggrResultRepo) exptResultExportRecordDAO := mysql.NewExptResultExportRecordDAO(db2) @@ -203,14 +205,16 @@ func InitEvalTargetApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) v := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) + iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) + iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v, iEvalAsyncRepo) evalTargetService := NewEvalTargetHandlerImpl(iAuthProvider, iEvalTargetService, v) return evalTargetService } func InitEvalOpenAPIApplication(ctx context.Context, configFactory conf.IConfigLoaderFactory, rmqFactory mq.IFactory, cmdable redis.Cmdable, idgen2 idgen.IIDGenerator, db2 db.Provider, client promptmanageservice.Client, executeClient promptexecuteservice.Client, authClient authservice.Client, meter metrics.Meter) (IEvalOpenAPIApplication, error) { - iExptItemTurnEvalAsyncDAO := dao.NewExptItemTurnEvalAsyncDAO(cmdable) - iExptItemTurnEvalAsyncRepo := experiment.NewExptItemTurnEvalAsyncRepo(iExptItemTurnEvalAsyncDAO) + iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) + iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) exptEventPublisher, err := producer.NewExptEventPublisher(ctx, configFactory, rmqFactory) if err != nil { return nil, err @@ -223,8 +227,8 @@ func InitEvalOpenAPIApplication(ctx context.Context, configFactory conf.IConfigL evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) v := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) - v2 := NewEvalOpenAPIApplication(iExptItemTurnEvalAsyncRepo, exptEventPublisher, iEvalTargetService) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v, iEvalAsyncRepo) + v2 := NewEvalOpenAPIApplication(iEvalAsyncRepo, exptEventPublisher, iEvalTargetService) return v2, nil } @@ -239,6 +243,7 @@ var ( targetDomainService, evaluatorDomainService, flagSet, + evalAsyncRepoSet, ) evaluatorDomainService = wire.NewSet(service.NewEvaluatorServiceImpl, service.NewEvaluatorRecordServiceImpl, NewEvaluatorSourceServices, llm.NewLLMRPCProvider, evaluator.NewEvaluatorRepo, evaluator.NewEvaluatorRecordRepo, mysql2.NewEvaluatorDAO, mysql2.NewEvaluatorVersionDAO, mysql2.NewEvaluatorRecordDAO, evaluator.NewRateLimiterImpl, conf2.NewEvaluatorConfiger, evaluator2.NewEvaluatorMetrics, producer.NewEvaluatorEventPublisher) @@ -260,11 +265,14 @@ var ( evalTargetSet = wire.NewSet( NewEvalTargetHandlerImpl, metrics3.NewEvalTargetMetrics, foundation.NewAuthRPCProvider, targetDomainService, flagSet, + evalAsyncRepoSet, ) + evalAsyncRepoSet = wire.NewSet(experiment.NewEvalAsyncRepo, dao.NewEvalAsyncDAO) + evalOpenAPISet = wire.NewSet( NewEvalOpenAPIApplication, - targetDomainService, metrics3.NewEvalTargetMetrics, flagSet, producer.NewExptEventPublisher, experiment.NewExptItemTurnEvalAsyncRepo, dao.NewExptItemTurnEvalAsyncDAO, + targetDomainService, metrics3.NewEvalTargetMetrics, flagSet, producer.NewExptEventPublisher, evalAsyncRepoSet, ) ) diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 7f6730101..40e19152f 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -454,8 +454,9 @@ type CKDBConfig struct { DatasetItemsSnapshotDBName string `json:"dataset_items_snapshot_db_name" mapstructure:"dataset_items_snapshot_db_name"` } -type ExptItemTurnEvalAsyncCtx struct { +type EvalAsyncCtx struct { Event *ExptItemEvalEvent TurnID int64 AsyncUnixMS int64 // async call time with unix ms ts + Session *Session } diff --git a/backend/modules/evaluation/domain/repo/expt.go b/backend/modules/evaluation/domain/repo/expt.go index e8ad3dd7f..cbf87954f 100644 --- a/backend/modules/evaluation/domain/repo/expt.go +++ b/backend/modules/evaluation/domain/repo/expt.go @@ -10,7 +10,7 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" ) -//go:generate mockgen -destination ./mocks/expt.go --package mocks . IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo +//go:generate mockgen -destination ./mocks/expt.go --package mocks . IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo,IEvalAsyncRepo type IExperimentRepo interface { Create(ctx context.Context, expt *entity.Experiment, exptEvaluatorRefs []*entity.ExptEvaluatorRef) error Update(ctx context.Context, expt *entity.Experiment) error @@ -135,7 +135,7 @@ type IExptResultExportRecordRepo interface { Get(ctx context.Context, spaceID, exportID int64) (*entity.ExptResultExportRecord, error) } -type IExptItemTurnEvalAsyncRepo interface { - GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) - SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error +type IEvalAsyncRepo interface { + GetEvalAsyncCtx(ctx context.Context, invokeID string) (*entity.EvalAsyncCtx, error) + SetEvalAsyncCtx(ctx context.Context, invokeID string, actx *entity.EvalAsyncCtx) error } diff --git a/backend/modules/evaluation/domain/repo/mocks/expt.go b/backend/modules/evaluation/domain/repo/mocks/expt.go index f8cee62d8..cfbb25c6d 100644 --- a/backend/modules/evaluation/domain/repo/mocks/expt.go +++ b/backend/modules/evaluation/domain/repo/mocks/expt.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo (interfaces: IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo) +// Source: github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo (interfaces: IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo,IEvalAsyncRepo) // // Generated by this command: // -// mockgen -destination ./mocks/expt.go --package mocks . IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo +// mockgen -destination ./mocks/expt.go --package mocks . IExperimentRepo,IExptStatsRepo,IExptItemResultRepo,IExptTurnResultRepo,IExptRunLogRepo,IExptAggrResultRepo,QuotaRepo,IExptTurnResultFilterRepo,IExptAnnotateRepo,IExptResultExportRecordRepo,IEvalAsyncRepo // // Package mocks is a generated GoMock package. @@ -1603,3 +1603,56 @@ func (mr *MockIExptResultExportRecordRepoMockRecorder) Update(ctx, exportRecord varargs := append([]any{ctx, exportRecord}, opts...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockIExptResultExportRecordRepo)(nil).Update), varargs...) } + +// MockIEvalAsyncRepo is a mock of IEvalAsyncRepo interface. +type MockIEvalAsyncRepo struct { + ctrl *gomock.Controller + recorder *MockIEvalAsyncRepoMockRecorder + isgomock struct{} +} + +// MockIEvalAsyncRepoMockRecorder is the mock recorder for MockIEvalAsyncRepo. +type MockIEvalAsyncRepoMockRecorder struct { + mock *MockIEvalAsyncRepo +} + +// NewMockIEvalAsyncRepo creates a new mock instance. +func NewMockIEvalAsyncRepo(ctrl *gomock.Controller) *MockIEvalAsyncRepo { + mock := &MockIEvalAsyncRepo{ctrl: ctrl} + mock.recorder = &MockIEvalAsyncRepoMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIEvalAsyncRepo) EXPECT() *MockIEvalAsyncRepoMockRecorder { + return m.recorder +} + +// GetEvalAsyncCtx mocks base method. +func (m *MockIEvalAsyncRepo) GetEvalAsyncCtx(ctx context.Context, invokeID string) (*entity.EvalAsyncCtx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEvalAsyncCtx", ctx, invokeID) + ret0, _ := ret[0].(*entity.EvalAsyncCtx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEvalAsyncCtx indicates an expected call of GetEvalAsyncCtx. +func (mr *MockIEvalAsyncRepoMockRecorder) GetEvalAsyncCtx(ctx, invokeID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEvalAsyncCtx", reflect.TypeOf((*MockIEvalAsyncRepo)(nil).GetEvalAsyncCtx), ctx, invokeID) +} + +// SetEvalAsyncCtx mocks base method. +func (m *MockIEvalAsyncRepo) SetEvalAsyncCtx(ctx context.Context, invokeID string, actx *entity.EvalAsyncCtx) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetEvalAsyncCtx", ctx, invokeID, actx) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetEvalAsyncCtx indicates an expected call of SetEvalAsyncCtx. +func (mr *MockIEvalAsyncRepoMockRecorder) SetEvalAsyncCtx(ctx, invokeID, actx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetEvalAsyncCtx", reflect.TypeOf((*MockIEvalAsyncRepo)(nil).SetEvalAsyncCtx), ctx, invokeID, actx) +} diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go index 7c5f51a00..ab513451f 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go @@ -51,6 +51,7 @@ type ExptItemEventEvalServiceImpl struct { evaluatorRecordService EvaluatorRecordService idgen idgen.IIDGenerator benefitService benefit.IBenefitService + evalAsyncRepo repo.IEvalAsyncRepo } func NewExptRecordEvalService( @@ -73,6 +74,7 @@ func NewExptRecordEvalService( evaluatorService EvaluatorService, idgen idgen.IIDGenerator, benefitService benefit.IBenefitService, + evalAsyncRepo repo.IEvalAsyncRepo, ) ExptItemEvalEvent { i := &ExptItemEventEvalServiceImpl{ manager: manager, @@ -94,6 +96,7 @@ func NewExptRecordEvalService( evaluatorService: evaluatorService, idgen: idgen, benefitService: benefitService, + evalAsyncRepo: evalAsyncRepo, } i.endpoints = RecordEvalChain( @@ -252,7 +255,7 @@ func (e *ExptItemEventEvalServiceImpl) eval(ctx context.Context, event *entity.E return err } - if err := NewExptItemEvaluation(e.exptTurnResultRepo, e.exptItemResultRepo, e.configer, e.metric, e.evaTargetService, e.evaluatorRecordService, e.evaluatorService, e.benefitService). + if err := NewExptItemEvaluation(e.exptTurnResultRepo, e.exptItemResultRepo, e.configer, e.metric, e.evaTargetService, e.evaluatorRecordService, e.evaluatorService, e.benefitService, e.evalAsyncRepo). Eval(ctx, eiec); err != nil { return err } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go index a84d46791..49714408e 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go @@ -47,6 +47,7 @@ func TestNewExptRecordEvalService(t *testing.T) { svcmocks.NewMockEvaluatorService(ctrl), idgenmocks.NewMockIIDGenerator(ctrl), benefitmocks.NewMockIBenefitService(ctrl), + repoMocks.NewMockIEvalAsyncRepo(ctrl), ) assert.NotNil(t, service) } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_impl.go index 58202d8d8..2bd27f29a 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl.go @@ -38,6 +38,7 @@ func NewExptItemEvaluation( evaluatorRecordService EvaluatorRecordService, evaluatorService EvaluatorService, benefitService benefit.IBenefitService, + evalAsyncRepo repo.IEvalAsyncRepo, ) ExptItemEvaluation { return &ExptItemEvalCtxExecutor{ TurnResultRepo: turnResultRepo, @@ -48,6 +49,7 @@ func NewExptItemEvaluation( evaluatorRecordService: evaluatorRecordService, evaluatorService: evaluatorService, benefitService: benefitService, + evalAsyncRepo: evalAsyncRepo, } } @@ -60,6 +62,7 @@ type ExptItemEvalCtxExecutor struct { evaluatorService EvaluatorService evaluatorRecordService EvaluatorRecordService benefitService benefit.IBenefitService + evalAsyncRepo repo.IEvalAsyncRepo } func (e *ExptItemEvalCtxExecutor) Eval(ctx context.Context, eiec *entity.ExptItemEvalCtx) error { @@ -90,7 +93,7 @@ func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.Ex ctx = context.WithValue(ctx, consts.CtxKeyLogID, etec.GetTurnEvalLogID(ctx, turn.ID)) //nolint:staticcheck,SA1029 - turnRunRes := NewExptTurnEvaluation(e.Metric, e.evalTargetService, e.evaluatorService, e.benefitService).Eval(ctx, etec) + turnRunRes := NewExptTurnEvaluation(e.Metric, e.evalTargetService, e.evaluatorService, e.benefitService, e.evalAsyncRepo).Eval(ctx, etec) if err := e.storeTurnRunResult(ctx, etec, turnRunRes); err != nil { return err diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go index 009680d4f..4e929a315 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go @@ -37,6 +37,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { mockEvaluatorRecordService := servicemocks.NewMockEvaluatorRecordService(ctrl) mockEvaluatorService := servicemocks.NewMockEvaluatorService(ctrl) mockBenefitService := benefitmocks.NewMockIBenefitService(ctrl) + mockEvalAsyncRepo := repomocks.NewMockIEvalAsyncRepo(ctrl) tests := []struct { name string @@ -48,6 +49,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { evaluatorRecordService EvaluatorRecordService evaluatorService EvaluatorService benefitService benefit.IBenefitService + evalAsyncRepo repo.IEvalAsyncRepo }{ { name: "所有参数有效", @@ -59,6 +61,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { evaluatorRecordService: mockEvaluatorRecordService, evaluatorService: mockEvaluatorService, benefitService: mockBenefitService, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "部分参数为nil", @@ -70,6 +73,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { evaluatorRecordService: mockEvaluatorRecordService, evaluatorService: mockEvaluatorService, benefitService: mockBenefitService, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "全部为nil", @@ -81,6 +85,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { evaluatorRecordService: nil, evaluatorService: nil, benefitService: nil, + evalAsyncRepo: nil, }, } @@ -95,6 +100,7 @@ func Test_NewExptItemEvaluation(t *testing.T) { tt.evaluatorRecordService, tt.evaluatorService, tt.benefitService, + tt.evalAsyncRepo, ) assert.NotNil(t, inst) }) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 85756a55b..544754fc2 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -18,6 +18,7 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/metrics" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" @@ -36,12 +37,14 @@ func NewExptTurnEvaluation( evalTargetService IEvalTargetService, evaluatorService EvaluatorService, benefitService benefit.IBenefitService, + evalAsyncRepo repo.IEvalAsyncRepo, ) ExptItemTurnEvaluation { return &DefaultExptTurnEvaluationImpl{ metric: metric, evalTargetService: evalTargetService, evaluatorService: evaluatorService, benefitService: benefitService, + evalAsyncRepo: evalAsyncRepo, } } @@ -50,6 +53,7 @@ type DefaultExptTurnEvaluationImpl struct { evalTargetService IEvalTargetService evaluatorService EvaluatorService benefitService benefit.IBenefitService + evalAsyncRepo repo.IEvalAsyncRepo } func (e *DefaultExptTurnEvaluationImpl) Eval(ctx context.Context, etec *entity.ExptTurnEvalCtx) (trr *entity.ExptTurnRunResult) { @@ -206,16 +210,24 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en InputFields: fields, Ext: ext, } + if etec.Expt.AsyncCallTarget() { - targetRecord, err = e.evalTargetService.ExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) - if err != nil { - return nil, err - } - } else { - targetRecord, err = e.evalTargetService.AsyncExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) - if err != nil { - return nil, err - } + return e.evalTargetService.ExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) + } + + ts := time.Now() + targetRecord, err = e.evalTargetService.AsyncExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) + if err != nil { + return nil, err + } + + if err := e.evalAsyncRepo.SetEvalAsyncCtx(ctx, strconv.FormatInt(targetRecord.ID, 10), &entity.EvalAsyncCtx{ + Event: etec.Event, + TurnID: targetRecord.ID, + AsyncUnixMS: ts.UnixMilli(), + Session: etec.Event.Session, + }); err != nil { + return nil, err } return targetRecord, nil diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go index 991981303..486a4d3cd 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go @@ -16,6 +16,7 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" metricsmocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/metrics/mocks" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + repomocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo/mocks" svcmocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service/mocks" ) @@ -29,8 +30,9 @@ func TestNewExptTurnEvaluation(t *testing.T) { mockEvalTargetService := svcmocks.NewMockIEvalTargetService(ctrl) mockEvaluatorService := svcmocks.NewMockEvaluatorService(ctrl) mockBenefitService := benefitmocks.NewMockIBenefitService(ctrl) + mockEvalAsyncRepo := repomocks.NewMockIEvalAsyncRepo(ctrl) - eval := NewExptTurnEvaluation(mockMetric, mockEvalTargetService, mockEvaluatorService, mockBenefitService) + eval := NewExptTurnEvaluation(mockMetric, mockEvalTargetService, mockEvaluatorService, mockBenefitService, mockEvalAsyncRepo) assert.NotNil(t, eval) } diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 276adadac..bf5f8714a 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -32,18 +32,21 @@ type EvalTargetServiceImpl struct { metric metrics.EvalTargetMetrics evalTargetRepo repo.IEvalTargetRepo typedOperators map[entity.EvalTargetType]ISourceEvalTargetOperateService + evalAsyncRepo repo.IEvalAsyncRepo } func NewEvalTargetServiceImpl(evalTargetRepo repo.IEvalTargetRepo, idgen idgen.IIDGenerator, metric metrics.EvalTargetMetrics, typedOperators map[entity.EvalTargetType]ISourceEvalTargetOperateService, + evalAsyncRepo repo.IEvalAsyncRepo, ) IEvalTargetService { singletonEvalTargetService := &EvalTargetServiceImpl{ evalTargetRepo: evalTargetRepo, idgen: idgen, metric: metric, typedOperators: typedOperators, + evalAsyncRepo: evalAsyncRepo, } return singletonEvalTargetService } @@ -449,7 +452,22 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D } func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { - return e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) + st := time.Now() + + record, err = e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) + if err != nil { + return nil, err + } + + if err := e.evalAsyncRepo.SetEvalAsyncCtx(ctx, strconv.FormatInt(record.ID, 10), &entity.EvalAsyncCtx{ + TurnID: record.ID, + AsyncUnixMS: st.UnixMilli(), + Session: &entity.Session{UserID: session.UserIDInCtxOrEmpty(ctx)}, + }); err != nil { + return nil, err + } + + return record, err } func (e *EvalTargetServiceImpl) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) { diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 85d24f7c9..0ef0f1866 100644 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -32,6 +32,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { mockMetric := metrics_mocks.NewMockEvalTargetMetrics(ctrl) mockIdgen := idgenmocks.NewMockIIDGenerator(ctrl) mockOperator := mocks.NewMockISourceEvalTargetOperateService(ctrl) + mockEvalAsyncRepo := repo_mocks.NewMockIEvalAsyncRepo(ctrl) // 定义测试用例 tests := []struct { @@ -42,6 +43,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { metric metrics.EvalTargetMetrics typedOperators map[entity.EvalTargetType]ISourceEvalTargetOperateService wantInstance *EvalTargetServiceImpl + evalAsyncRepo repo.IEvalAsyncRepo }{ { name: "正常场景 - 所有参数有效", @@ -59,6 +61,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { entity.EvalTargetType(1): mockOperator, }, }, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "边界场景 - typedOperators为空map", @@ -72,6 +75,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { metric: mockMetric, typedOperators: map[entity.EvalTargetType]ISourceEvalTargetOperateService{}, }, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "边界场景 - typedOperators为nil", @@ -85,6 +89,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { metric: mockMetric, typedOperators: nil, }, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "边界场景 - evalTargetRepo为nil", @@ -102,6 +107,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { entity.EvalTargetType(1): mockOperator, }, }, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "边界场景 - idgen为nil", @@ -119,6 +125,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { entity.EvalTargetType(1): mockOperator, }, }, + evalAsyncRepo: mockEvalAsyncRepo, }, { name: "边界场景 - metric为nil", @@ -136,6 +143,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { entity.EvalTargetType(1): mockOperator, }, }, + evalAsyncRepo: mockEvalAsyncRepo, }, } @@ -145,7 +153,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { tt.mockSetup() } - serviceInstance := NewEvalTargetServiceImpl(tt.evalTargetRepo, tt.idgen, tt.metric, tt.typedOperators) + serviceInstance := NewEvalTargetServiceImpl(tt.evalTargetRepo, tt.idgen, tt.metric, tt.typedOperators, tt.evalAsyncRepo) actualInstance, ok := serviceInstance.(*EvalTargetServiceImpl) assert.True(t, ok) diff --git a/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go index 2c46ce0cd..ee585f45d 100644 --- a/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go +++ b/backend/modules/evaluation/infra/repo/experiment/item_turn_eval_async.go @@ -8,10 +8,10 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/infra/repo/experiment/redis/dao" ) -type ExptItemTurnEvalAsyncRepoImpl struct { - dao.IExptItemTurnEvalAsyncDAO +type EvalAsyncRepoImpl struct { + dao.IEvalAsyncDAO } -func NewExptItemTurnEvalAsyncRepo(dao dao.IExptItemTurnEvalAsyncDAO) repo.IExptItemTurnEvalAsyncRepo { - return &ExptItemTurnEvalAsyncRepoImpl{IExptItemTurnEvalAsyncDAO: dao} +func NewEvalAsyncRepo(dao dao.IEvalAsyncDAO) repo.IEvalAsyncRepo { + return &EvalAsyncRepoImpl{IEvalAsyncDAO: dao} } diff --git a/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go index f7f6e873a..2ab20b7ae 100644 --- a/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go +++ b/backend/modules/evaluation/infra/repo/experiment/redis/convert/item_turn_eval_async.go @@ -17,16 +17,16 @@ func NewExptItemTurnEvalAsyncCtx() *ExptItemTurnEvalAsyncCtxConverter { type ExptItemTurnEvalAsyncCtxConverter struct{} -func (ExptItemTurnEvalAsyncCtxConverter) FromDO(actx *entity.ExptItemTurnEvalAsyncCtx) ([]byte, error) { +func (ExptItemTurnEvalAsyncCtxConverter) FromDO(actx *entity.EvalAsyncCtx) ([]byte, error) { bytes, err := json.Marshal(actx) if err != nil { - return nil, errorx.Wrapf(err, "ExptItemTurnEvalAsyncCtx json marshal failed") + return nil, errorx.Wrapf(err, "EvalAsyncCtx json marshal failed") } return bytes, nil } -func (ExptItemTurnEvalAsyncCtxConverter) ToDO(b []byte) (*entity.ExptItemTurnEvalAsyncCtx, error) { - actx := &entity.ExptItemTurnEvalAsyncCtx{} +func (ExptItemTurnEvalAsyncCtxConverter) ToDO(b []byte) (*entity.EvalAsyncCtx, error) { + actx := &entity.EvalAsyncCtx{} bytes := toBytes(b) if err := lo.TernaryF( len(bytes) > 0, diff --git a/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go b/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go index 27e257044..985f88836 100644 --- a/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go +++ b/backend/modules/evaluation/infra/repo/experiment/redis/dao/item_turn_eval_async.go @@ -15,26 +15,26 @@ import ( "github.com/coze-dev/coze-loop/backend/pkg/lang/conv" ) -type IExptItemTurnEvalAsyncDAO interface { - SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error - GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) +type IEvalAsyncDAO interface { + SetEvalAsyncCtx(ctx context.Context, invokeID string, actx *entity.EvalAsyncCtx) error + GetEvalAsyncCtx(ctx context.Context, invokeID string) (*entity.EvalAsyncCtx, error) } -func NewExptItemTurnEvalAsyncDAO(cmdable redis.Cmdable) IExptItemTurnEvalAsyncDAO { +func NewEvalAsyncDAO(cmdable redis.Cmdable) IEvalAsyncDAO { const table = "experiment" - return &exptItemTurnEvalAsyncDAOImpl{cmdable: cmdable, table: table} + return &evalAsyncDAOImpl{cmdable: cmdable, table: table} } -type exptItemTurnEvalAsyncDAOImpl struct { +type evalAsyncDAOImpl struct { cmdable redis.Cmdable table string } -func (e *exptItemTurnEvalAsyncDAOImpl) makeExptItemTurnEvalAsyncCtxKey(invokeID string) string { +func (e *evalAsyncDAOImpl) makeExptItemTurnEvalAsyncCtxKey(invokeID string) string { return fmt.Sprintf("[%s]item_turn_eval_async_ctx:%s", e.table, invokeID) } -func (e *exptItemTurnEvalAsyncDAOImpl) SetAsyncCtx(ctx context.Context, invokeID string, actx *entity.ExptItemTurnEvalAsyncCtx) error { +func (e *evalAsyncDAOImpl) SetEvalAsyncCtx(ctx context.Context, invokeID string, actx *entity.EvalAsyncCtx) error { bytes, err := convert.NewExptItemTurnEvalAsyncCtx().FromDO(actx) if err != nil { return err @@ -46,10 +46,10 @@ func (e *exptItemTurnEvalAsyncDAOImpl) SetAsyncCtx(ctx context.Context, invokeID return nil } -func (e *exptItemTurnEvalAsyncDAOImpl) GetAsyncCtx(ctx context.Context, invokeID string) (*entity.ExptItemTurnEvalAsyncCtx, error) { +func (e *evalAsyncDAOImpl) GetEvalAsyncCtx(ctx context.Context, invokeID string) (*entity.EvalAsyncCtx, error) { key := e.makeExptItemTurnEvalAsyncCtxKey(invokeID) got, err := e.cmdable.Get(ctx, key).Result() - if err != nil && !redis.IsNilError(err) { + if err != nil { return nil, errorx.Wrapf(err, "redis get fail, key: %v", key) } return convert.NewExptItemTurnEvalAsyncCtx().ToDO(conv.UnsafeStringToBytes(got)) From 078303c9679c6012aa471dab6336a0ce87210bf6 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 18:09:44 +0800 Subject: [PATCH 053/100] fix(evaluation): debug trace --- .../evaluation/domain/service/target_impl.go | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index bf5f8714a..0ad361130 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -272,7 +272,10 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID int64 return nil, errorx.NewByCode(errno.CommonInternalErrorCode, errorx.WithExtraMsg("[ExecuteTarget]outputData is nil")) } // setSpan - setSpanInputOutput(ctx, spanParam, evalTargetDO, inputData, outputData) + spanParam.TargetType = evalTargetDO.EvalTargetType.String() + spanParam.TargetID = strconv.FormatInt(targetID, 10) + spanParam.TargetVersion = strconv.FormatInt(targetVersionID, 10) + setSpanInputOutput(ctx, spanParam, inputData, outputData) return record, nil } @@ -507,21 +510,26 @@ func (e *EvalTargetServiceImpl) emitTargetTrace(ctx context.Context, record *ent return nil } - evalTargetDO, err := e.GetEvalTargetVersion(ctx, record.SpaceID, record.TargetVersionID, false) - if err != nil { - return err - } - ctx, span := looptracer.GetTracer().StartSpan(ctx, "EvalTarget", "eval_target", looptracer.WithStartNewTrace(), looptracer.WithSpanWorkspaceID(strconv.FormatInt(record.SpaceID, 10))) span.SetCallType("EvalTarget") ctx = looptracer.GetTracer().Inject(ctx) spanParam := &targetSpanTagsParams{ - Error: nil, - ErrCode: "", - CallType: "eval_target", + Error: nil, + ErrCode: "", + CallType: "eval_target", + TargetID: strconv.FormatInt(record.TargetID, 10), + TargetVersion: strconv.FormatInt(record.TargetVersionID, 10), + } + setSpanInputOutput(ctx, spanParam, record.EvalTargetInputData, record.EvalTargetOutputData) + + if record.TargetVersionID > 0 { + evalTargetDO, err := e.GetEvalTargetVersion(ctx, record.SpaceID, record.TargetVersionID, false) + if err != nil { + return err + } + spanParam.TargetType = evalTargetDO.EvalTargetType.String() } - setSpanInputOutput(ctx, spanParam, evalTargetDO, record.EvalTargetInputData, record.EvalTargetOutputData) if record.EvalTargetOutputData.EvalTargetRunError != nil { span.SetError(ctx, fmt.Errorf("code: %v, msg: %v", record.EvalTargetOutputData.EvalTargetRunError.Code, record.EvalTargetOutputData.EvalTargetRunError.Message)) @@ -563,11 +571,7 @@ func (e *EvalTargetServiceImpl) sourceTargetOperator(targetType entity.EvalTarge return o, nil } -func setSpanInputOutput(ctx context.Context, spanParam *targetSpanTagsParams, do *entity.EvalTarget, inputData *entity.EvalTargetInputData, outputData *entity.EvalTargetOutputData) { - spanParam.TargetType = do.EvalTargetType.String() - spanParam.TargetID = do.SourceTargetID - spanParam.TargetVersion = do.EvalTargetVersion.SourceTargetVersion - +func setSpanInputOutput(ctx context.Context, spanParam *targetSpanTagsParams, inputData *entity.EvalTargetInputData, outputData *entity.EvalTargetOutputData) { if inputData != nil { spanParam.Inputs = map[string][]*tracespec.ModelMessagePart{} for key, content := range inputData.InputFields { From 26efc075addc939ae0bd47682a1c6266174d0710 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 20:37:31 +0800 Subject: [PATCH 054/100] fix(evaluation): target debug param --- .../router/coze/loop/apis/coze.loop.apis.go | 7 +- .../domain/eval_target/eval_target.go | 11 +- .../coze.loop.evaluation.eval_target.go | 218 +----------------- .../k-coze.loop.evaluation.eval_target.go | 202 ---------------- .../convertor/target/eval_target_record.go | 6 +- .../evaluation/application/eval_target_app.go | 21 +- 6 files changed, 34 insertions(+), 431 deletions(-) diff --git a/backend/api/router/coze/loop/apis/coze.loop.apis.go b/backend/api/router/coze/loop/apis/coze.loop.apis.go index 2394fd81b..e3a938ee9 100644 --- a/backend/api/router/coze/loop/apis/coze.loop.apis.go +++ b/backend/api/router/coze/loop/apis/coze.loop.apis.go @@ -341,11 +341,8 @@ func Register(r *server.Hertz, handler *apis.APIHandler) { { _loop := _v16.Group("/loop", _loopMw(handler)...) { - _evaluation0 := _loop.Group("/evaluation", _evaluation0Mw(handler)...) - { - _eval_targets0 := _evaluation0.Group("/eval_targets", _eval_targets0Mw(handler)...) - _eval_targets0.POST("/result", append(_reportevaltargetinvokeresultMw(handler), apis.ReportEvalTargetInvokeResult)...) - } + _eval_targets0 := _loop.Group("/eval_targets", _eval_targets0Mw(handler)...) + _eval_targets0.POST("/result", append(_reportevaltargetinvokeresultMw(handler), apis.ReportEvalTargetInvokeResult)...) } { _files := _loop.Group("/files", _filesMw(handler)...) diff --git a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go index e75cf2e2b..3cd44c78f 100644 --- a/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/domain/eval_target/eval_target.go @@ -241,9 +241,10 @@ func (p *ModelPlatform) Value() (driver.Value, error) { type EvalTargetRunStatus int64 const ( - EvalTargetRunStatus_Unknown EvalTargetRunStatus = 0 - EvalTargetRunStatus_Success EvalTargetRunStatus = 1 - EvalTargetRunStatus_Fail EvalTargetRunStatus = 2 + EvalTargetRunStatus_Unknown EvalTargetRunStatus = 0 + EvalTargetRunStatus_Success EvalTargetRunStatus = 1 + EvalTargetRunStatus_Fail EvalTargetRunStatus = 2 + EvalTargetRunStatus_AsyncInvoking EvalTargetRunStatus = 3 ) func (p EvalTargetRunStatus) String() string { @@ -254,6 +255,8 @@ func (p EvalTargetRunStatus) String() string { return "Success" case EvalTargetRunStatus_Fail: return "Fail" + case EvalTargetRunStatus_AsyncInvoking: + return "AsyncInvoking" } return "" } @@ -266,6 +269,8 @@ func EvalTargetRunStatusFromString(s string) (EvalTargetRunStatus, error) { return EvalTargetRunStatus_Success, nil case "Fail": return EvalTargetRunStatus_Fail, nil + case "AsyncInvoking": + return EvalTargetRunStatus_AsyncInvoking, nil } return EvalTargetRunStatus(0), fmt.Errorf("not a valid EvalTargetRunStatus string") } diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 1de5c5846..a824f8546 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -10069,8 +10069,7 @@ type DebugEvalTargetRequest struct { // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` // 环境 - Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` - InputFields map[string]*common.Content `thrift:"input_fields,13,optional" frugal:"13,optional,map" form:"input_fields" json:"input_fields,omitempty" query:"input_fields"` + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -10143,18 +10142,6 @@ func (p *DebugEvalTargetRequest) GetEnv() (v string) { return *p.Env } -var DebugEvalTargetRequest_InputFields_DEFAULT map[string]*common.Content - -func (p *DebugEvalTargetRequest) GetInputFields() (v map[string]*common.Content) { - if p == nil { - return - } - if !p.IsSetInputFields() { - return DebugEvalTargetRequest_InputFields_DEFAULT - } - return p.InputFields -} - var DebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *DebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -10193,9 +10180,6 @@ func (p *DebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeParam) func (p *DebugEvalTargetRequest) SetEnv(val *string) { p.Env = val } -func (p *DebugEvalTargetRequest) SetInputFields(val map[string]*common.Content) { - p.InputFields = val -} func (p *DebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -10209,7 +10193,6 @@ var fieldIDToName_DebugEvalTargetRequest = map[int16]string{ 10: "param", 11: "target_runtime_param", 12: "env", - 13: "input_fields", 50: "custom_rpc_server", 255: "Base", } @@ -10234,10 +10217,6 @@ func (p *DebugEvalTargetRequest) IsSetEnv() bool { return p.Env != nil } -func (p *DebugEvalTargetRequest) IsSetInputFields() bool { - return p.InputFields != nil -} - func (p *DebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -10304,14 +10283,6 @@ func (p *DebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 13: - if fieldTypeId == thrift.MAP { - if err = p.ReadField13(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -10410,35 +10381,6 @@ func (p *DebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error { p.Env = _field return nil } -func (p *DebugEvalTargetRequest) ReadField13(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]*common.Content, size) - values := make([]common.Content, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - _val := &values[i] - _val.InitDefault() - if err := _val.Read(iprot); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.InputFields = _field - return nil -} func (p *DebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -10482,10 +10424,6 @@ func (p *DebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 12 goto WriteFieldError } - if err = p.writeField13(oprot); err != nil { - fieldId = 13 - goto WriteFieldError - } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -10602,35 +10540,6 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } -func (p *DebugEvalTargetRequest) writeField13(oprot thrift.TProtocol) (err error) { - if p.IsSetInputFields() { - if err = oprot.WriteFieldBegin("input_fields", thrift.MAP, 13); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.InputFields)); err != nil { - return err - } - for k, v := range p.InputFields { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) -} func (p *DebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -10697,9 +10606,6 @@ func (p *DebugEvalTargetRequest) DeepEqual(ano *DebugEvalTargetRequest) bool { if !p.Field12DeepEqual(ano.Env) { return false } - if !p.Field13DeepEqual(ano.InputFields) { - return false - } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -10764,19 +10670,6 @@ func (p *DebugEvalTargetRequest) Field12DeepEqual(src *string) bool { } return true } -func (p *DebugEvalTargetRequest) Field13DeepEqual(src map[string]*common.Content) bool { - - if len(p.InputFields) != len(src) { - return false - } - for k, v := range p.InputFields { - _src := src[k] - if !v.DeepEqual(_src) { - return false - } - } - return true -} func (p *DebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { @@ -11041,8 +10934,7 @@ type AsyncDebugEvalTargetRequest struct { // 动态参数 TargetRuntimeParam *common.RuntimeParam `thrift:"target_runtime_param,11,optional" frugal:"11,optional,common.RuntimeParam" form:"target_runtime_param" json:"target_runtime_param,omitempty" query:"target_runtime_param"` // 环境 - Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` - InputFields map[string]*common.Content `thrift:"input_fields,13,optional" frugal:"13,optional,map" form:"input_fields" json:"input_fields,omitempty" query:"input_fields"` + Env *string `thrift:"env,12,optional" frugal:"12,optional,string" form:"env" json:"env,omitempty" query:"env"` // 如果type=6,需要前端传入自定义服务相关信息 CustomRPCServer *eval_target.CustomRPCServer `thrift:"custom_rpc_server,50,optional" frugal:"50,optional,eval_target.CustomRPCServer" form:"custom_rpc_server" json:"custom_rpc_server,omitempty" query:"custom_rpc_server"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` @@ -11115,18 +11007,6 @@ func (p *AsyncDebugEvalTargetRequest) GetEnv() (v string) { return *p.Env } -var AsyncDebugEvalTargetRequest_InputFields_DEFAULT map[string]*common.Content - -func (p *AsyncDebugEvalTargetRequest) GetInputFields() (v map[string]*common.Content) { - if p == nil { - return - } - if !p.IsSetInputFields() { - return AsyncDebugEvalTargetRequest_InputFields_DEFAULT - } - return p.InputFields -} - var AsyncDebugEvalTargetRequest_CustomRPCServer_DEFAULT *eval_target.CustomRPCServer func (p *AsyncDebugEvalTargetRequest) GetCustomRPCServer() (v *eval_target.CustomRPCServer) { @@ -11165,9 +11045,6 @@ func (p *AsyncDebugEvalTargetRequest) SetTargetRuntimeParam(val *common.RuntimeP func (p *AsyncDebugEvalTargetRequest) SetEnv(val *string) { p.Env = val } -func (p *AsyncDebugEvalTargetRequest) SetInputFields(val map[string]*common.Content) { - p.InputFields = val -} func (p *AsyncDebugEvalTargetRequest) SetCustomRPCServer(val *eval_target.CustomRPCServer) { p.CustomRPCServer = val } @@ -11181,7 +11058,6 @@ var fieldIDToName_AsyncDebugEvalTargetRequest = map[int16]string{ 10: "param", 11: "target_runtime_param", 12: "env", - 13: "input_fields", 50: "custom_rpc_server", 255: "Base", } @@ -11206,10 +11082,6 @@ func (p *AsyncDebugEvalTargetRequest) IsSetEnv() bool { return p.Env != nil } -func (p *AsyncDebugEvalTargetRequest) IsSetInputFields() bool { - return p.InputFields != nil -} - func (p *AsyncDebugEvalTargetRequest) IsSetCustomRPCServer() bool { return p.CustomRPCServer != nil } @@ -11276,14 +11148,6 @@ func (p *AsyncDebugEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 13: - if fieldTypeId == thrift.MAP { - if err = p.ReadField13(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } case 50: if fieldTypeId == thrift.STRUCT { if err = p.ReadField50(iprot); err != nil { @@ -11382,35 +11246,6 @@ func (p *AsyncDebugEvalTargetRequest) ReadField12(iprot thrift.TProtocol) error p.Env = _field return nil } -func (p *AsyncDebugEvalTargetRequest) ReadField13(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]*common.Content, size) - values := make([]common.Content, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - _val := &values[i] - _val.InitDefault() - if err := _val.Read(iprot); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.InputFields = _field - return nil -} func (p *AsyncDebugEvalTargetRequest) ReadField50(iprot thrift.TProtocol) error { _field := eval_target.NewCustomRPCServer() if err := _field.Read(iprot); err != nil { @@ -11454,10 +11289,6 @@ func (p *AsyncDebugEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) fieldId = 12 goto WriteFieldError } - if err = p.writeField13(oprot); err != nil { - fieldId = 13 - goto WriteFieldError - } if err = p.writeField50(oprot); err != nil { fieldId = 50 goto WriteFieldError @@ -11574,35 +11405,6 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } -func (p *AsyncDebugEvalTargetRequest) writeField13(oprot thrift.TProtocol) (err error) { - if p.IsSetInputFields() { - if err = oprot.WriteFieldBegin("input_fields", thrift.MAP, 13); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.InputFields)); err != nil { - return err - } - for k, v := range p.InputFields { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) -} func (p *AsyncDebugEvalTargetRequest) writeField50(oprot thrift.TProtocol) (err error) { if p.IsSetCustomRPCServer() { if err = oprot.WriteFieldBegin("custom_rpc_server", thrift.STRUCT, 50); err != nil { @@ -11669,9 +11471,6 @@ func (p *AsyncDebugEvalTargetRequest) DeepEqual(ano *AsyncDebugEvalTargetRequest if !p.Field12DeepEqual(ano.Env) { return false } - if !p.Field13DeepEqual(ano.InputFields) { - return false - } if !p.Field50DeepEqual(ano.CustomRPCServer) { return false } @@ -11736,19 +11535,6 @@ func (p *AsyncDebugEvalTargetRequest) Field12DeepEqual(src *string) bool { } return true } -func (p *AsyncDebugEvalTargetRequest) Field13DeepEqual(src map[string]*common.Content) bool { - - if len(p.InputFields) != len(src) { - return false - } - for k, v := range p.InputFields { - _src := src[k] - if !v.DeepEqual(_src) { - return false - } - } - return true -} func (p *AsyncDebugEvalTargetRequest) Field50DeepEqual(src *eval_target.CustomRPCServer) bool { if !p.CustomRPCServer.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 13f388a57..c64ed78a6 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -7391,20 +7391,6 @@ func (p *DebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 13: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField13(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -7521,39 +7507,6 @@ func (p *DebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { return offset, nil } -func (p *DebugEvalTargetRequest) FastReadField13(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]*common.Content, size) - values := make([]common.Content, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - _val := &values[i] - _val.InitDefault() - if l, err := _val.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _field[_key] = _val - } - p.InputFields = _field - return offset, nil -} - func (p *DebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -7590,7 +7543,6 @@ func (p *DebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWrit offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) - offset += p.fastWriteField13(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -7606,7 +7558,6 @@ func (p *DebugEvalTargetRequest) BLength() int { l += p.field10Length() l += p.field11Length() l += p.field12Length() - l += p.field13Length() l += p.field50Length() l += p.field255Length() } @@ -7659,23 +7610,6 @@ func (p *DebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.NocopyWri return offset } -func (p *DebugEvalTargetRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInputFields() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 13) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.InputFields { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += v.FastWriteNocopy(buf[offset:], w) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) - } - return offset -} - func (p *DebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -7739,21 +7673,6 @@ func (p *DebugEvalTargetRequest) field12Length() int { return l } -func (p *DebugEvalTargetRequest) field13Length() int { - l := 0 - if p.IsSetInputFields() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.InputFields { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += v.BLength() - } - } - return l -} - func (p *DebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -7813,26 +7732,6 @@ func (p *DebugEvalTargetRequest) DeepCopy(s interface{}) error { p.Env = &tmp } - if src.InputFields != nil { - p.InputFields = make(map[string]*common.Content, len(src.InputFields)) - for key, val := range src.InputFields { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val *common.Content - if val != nil { - _val = &common.Content{} - if err := _val.DeepCopy(val); err != nil { - return err - } - } - - p.InputFields[_key] = _val - } - } - var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} @@ -8111,20 +8010,6 @@ func (p *AsyncDebugEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 13: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField13(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } case 50: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField50(buf[offset:]) @@ -8241,39 +8126,6 @@ func (p *AsyncDebugEvalTargetRequest) FastReadField12(buf []byte) (int, error) { return offset, nil } -func (p *AsyncDebugEvalTargetRequest) FastReadField13(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := thrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _field := make(map[string]*common.Content, size) - values := make([]common.Content, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _key = v - } - - _val := &values[i] - _val.InitDefault() - if l, err := _val.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _field[_key] = _val - } - p.InputFields = _field - return offset, nil -} - func (p *AsyncDebugEvalTargetRequest) FastReadField50(buf []byte) (int, error) { offset := 0 _field := eval_target.NewCustomRPCServer() @@ -8310,7 +8162,6 @@ func (p *AsyncDebugEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.Nocop offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) - offset += p.fastWriteField13(buf[offset:], w) offset += p.fastWriteField50(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -8326,7 +8177,6 @@ func (p *AsyncDebugEvalTargetRequest) BLength() int { l += p.field10Length() l += p.field11Length() l += p.field12Length() - l += p.field13Length() l += p.field50Length() l += p.field255Length() } @@ -8379,23 +8229,6 @@ func (p *AsyncDebugEvalTargetRequest) fastWriteField12(buf []byte, w thrift.Noco return offset } -func (p *AsyncDebugEvalTargetRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p.IsSetInputFields() { - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.MAP, 13) - mapBeginOffset := offset - offset += thrift.Binary.MapBeginLength() - var length int - for k, v := range p.InputFields { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, k) - offset += v.FastWriteNocopy(buf[offset:], w) - } - thrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) - } - return offset -} - func (p *AsyncDebugEvalTargetRequest) fastWriteField50(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetCustomRPCServer() { @@ -8459,21 +8292,6 @@ func (p *AsyncDebugEvalTargetRequest) field12Length() int { return l } -func (p *AsyncDebugEvalTargetRequest) field13Length() int { - l := 0 - if p.IsSetInputFields() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.InputFields { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += v.BLength() - } - } - return l -} - func (p *AsyncDebugEvalTargetRequest) field50Length() int { l := 0 if p.IsSetCustomRPCServer() { @@ -8533,26 +8351,6 @@ func (p *AsyncDebugEvalTargetRequest) DeepCopy(s interface{}) error { p.Env = &tmp } - if src.InputFields != nil { - p.InputFields = make(map[string]*common.Content, len(src.InputFields)) - for key, val := range src.InputFields { - var _key string - if key != "" { - _key = kutils.StringDeepCopy(key) - } - - var _val *common.Content - if val != nil { - _val = &common.Content{} - if err := _val.DeepCopy(val); err != nil { - return err - } - } - - p.InputFields[_key] = _val - } - } - var _customRPCServer *eval_target.CustomRPCServer if src.CustomRPCServer != nil { _customRPCServer = &eval_target.CustomRPCServer{} diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record.go b/backend/modules/evaluation/application/convertor/target/eval_target_record.go index c3d57f0ca..ad064ccb0 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record.go @@ -268,7 +268,7 @@ func getInt32Value(ptr *int32) int32 { return 0 } -func toSPIContentDO(spiContent *spi.Content) *entity.Content { +func ToSPIContentDO(spiContent *spi.Content) *entity.Content { if spiContent == nil { return nil } @@ -290,7 +290,7 @@ func toSPIContentDO(spiContent *spi.Content) *entity.Content { if spiContent.MultiPart != nil { multiPart = make([]*entity.Content, 0, len(spiContent.MultiPart)) for _, part := range spiContent.MultiPart { - multiPart = append(multiPart, toSPIContentDO(part)) + multiPart = append(multiPart, ToSPIContentDO(part)) } } @@ -323,7 +323,7 @@ func ToInvokeOutputDataDO(req *openapi.ReportEvalTargetInvokeResultRequest) *ent outputFields := make(map[string]*entity.Content) if output.ActualOutput != nil { - outputFields[consts.OutputSchemaKey] = toSPIContentDO(output.ActualOutput) + outputFields[consts.OutputSchemaKey] = ToSPIContentDO(output.ActualOutput) } var evalTargetUsage *entity.EvalTargetUsage diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index d255697d0..140dd052a 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -8,12 +8,14 @@ import ( "strconv" "sync" + "github.com/bytedance/gg/gmap" "github.com/bytedance/gg/gptr" "github.com/coze-dev/coze-loop/backend/kitex_gen/base" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" eval_target_dto "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" "github.com/coze-dev/coze-loop/backend/modules/evaluation/application/convertor/target" "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/rpc" @@ -21,6 +23,7 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" + "github.com/coze-dev/coze-loop/backend/pkg/json" ) var _ evaluation.EvalTargetService = &EvalTargetApplicationImpl{} @@ -487,6 +490,11 @@ func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request // return nil, err //} + inputFields := make(map[string]*spi.Content) + if err := json.Unmarshal([]byte(request.GetParam()), &inputFields); err != nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("param json unmarshal fail")) + } + switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: record, err := e.evalTargetService.DebugTarget(ctx, &entity.DebugTargetParam{ @@ -501,7 +509,9 @@ func (e EvalTargetApplicationImpl) DebugEvalTarget(ctx context.Context, request }, }, InputData: &entity.EvalTargetInputData{ - InputFields: target.ContentDTO2DOs(request.GetInputFields()), + InputFields: gmap.Map(inputFields, func(k string, v *spi.Content) (string, *entity.Content) { + return k, target.ToSPIContentDO(v) + }), Ext: map[string]string{ consts.FieldAdapterBuiltinFieldNameRuntimeParam: request.GetTargetRuntimeParam().GetJSONValue(), }, @@ -529,6 +539,11 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req // return nil, err //} + inputFields := make(map[string]*spi.Content) + if err := json.Unmarshal([]byte(request.GetParam()), &inputFields); err != nil { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("param json unmarshal fail")) + } + switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: record, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ @@ -543,7 +558,9 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req }, }, InputData: &entity.EvalTargetInputData{ - InputFields: target.ContentDTO2DOs(request.GetInputFields()), + InputFields: gmap.Map(inputFields, func(k string, v *spi.Content) (string, *entity.Content) { + return k, target.ToSPIContentDO(v) + }), Ext: map[string]string{ consts.FieldAdapterBuiltinFieldNameRuntimeParam: request.GetTargetRuntimeParam().GetJSONValue(), }, From 5dbbca2317a8e20196d7ca46b2d680c38ace544e Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 20:43:38 +0800 Subject: [PATCH 055/100] fix(evaluation): target debug param --- .../loop/evaluation/coze.loop.evaluation.eval_target.thrift | 2 -- idl/thrift/coze/loop/evaluation/domain/eval_target.thrift | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index 7e28e8202..d92d7e020 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -221,7 +221,6 @@ struct DebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 12: optional string env // 环境 - 13: optional map input_fields 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 @@ -241,7 +240,6 @@ struct AsyncDebugEvalTargetRequest { 10: optional string param // 执行参数:如果type=6,则传spi request json序列化结果 11: optional common.RuntimeParam target_runtime_param // 动态参数 12: optional string env // 环境 - 13: optional map input_fields 50: optional eval_target.CustomRPCServer custom_rpc_server // 如果type=6,需要前端传入自定义服务相关信息 diff --git a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift index 794fa4116..b69d7a4fe 100644 --- a/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/domain/eval_target.thrift @@ -209,6 +209,7 @@ enum EvalTargetRunStatus { Unknown = 0 Success = 1 Fail = 2 + AsyncInvoking = 3 } struct EvalTargetInputData { From e2c5f014f63acaf6f7a7dcf252b6c6a4e20e0704 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 20:53:53 +0800 Subject: [PATCH 056/100] fix(evaluation): report status --- .../convertor/target/eval_target_record.go | 11 +++++++++++ .../evaluation/application/eval_openapi_app.go | 1 + backend/modules/evaluation/domain/entity/param.go | 1 + .../modules/evaluation/domain/service/target_impl.go | 1 + 4 files changed, 14 insertions(+) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record.go b/backend/modules/evaluation/application/convertor/target/eval_target_record.go index ad064ccb0..6e615899d 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record.go @@ -315,6 +315,17 @@ func toSPIContentTypeDO(spiContentType spi.ContentType) entity.ContentType { } } +func ToTargetRunStatsDO(status spi.InvokeEvalTargetStatus) entity.EvalTargetRunStatus { + switch status { + case spi.InvokeEvalTargetStatus_FAILED: + return entity.EvalTargetRunStatusFail + case spi.InvokeEvalTargetStatus_SUCCESS: + return entity.EvalTargetRunStatusSuccess + default: + return entity.EvalTargetRunStatusUnknown + } +} + func ToInvokeOutputDataDO(req *openapi.ReportEvalTargetInvokeResultRequest) *entity.EvalTargetOutputData { switch req.GetStatus() { case spi.InvokeEvalTargetStatus_SUCCESS: diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go index ef67f6059..617ed69be 100644 --- a/backend/modules/evaluation/application/eval_openapi_app.go +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -44,6 +44,7 @@ func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Conte SpaceID: req.GetWorkspaceID(), RecordID: req.GetInvokeID(), OutputData: outputData, + Status: target.ToTargetRunStatsDO(req.GetStatus()), Session: actx.Session, }); err != nil { return nil, err diff --git a/backend/modules/evaluation/domain/entity/param.go b/backend/modules/evaluation/domain/entity/param.go index 35e0f690e..7b8e7aebb 100644 --- a/backend/modules/evaluation/domain/entity/param.go +++ b/backend/modules/evaluation/domain/entity/param.go @@ -293,6 +293,7 @@ type SearchCustomEvalTargetParam struct { type ReportTargetRecordParam struct { SpaceID int64 RecordID int64 + Status EvalTargetRunStatus OutputData *EvalTargetOutputData Session *Session diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 0ad361130..14d44c92c 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -492,6 +492,7 @@ func (e *EvalTargetServiceImpl) ReportInvokeRecords(ctx context.Context, param * } record.EvalTargetOutputData = param.OutputData + record.Status = gptr.Of(param.Status) if err := e.evalTargetRepo.SaveEvalTargetRecord(ctx, record); err != nil { return err } From 51e289c674f2abc532c8edf34101f227722386cc Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 22:29:42 +0800 Subject: [PATCH 057/100] fix(evaluation): async call --- .../evaluation/domain/service/expt_run_item_turn_impl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 544754fc2..8d60ee241 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -211,7 +211,7 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en Ext: ext, } - if etec.Expt.AsyncCallTarget() { + if !etec.Expt.AsyncCallTarget() { return e.evalTargetService.ExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) } From bd98de684ac0783e5c57434b4ee820463dcb365a Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 22:50:50 +0800 Subject: [PATCH 058/100] fix(evaluation): expt async exec --- .../evaluation/domain/entity/expt_run.go | 1 + .../domain/service/expt_run_item_impl.go | 27 +++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 40e19152f..790b11905 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -386,6 +386,7 @@ type ExptTurnRunResult struct { TargetResult *EvalTargetRecord EvaluatorResults map[int64]*EvaluatorRecord EvalErr error + AsyncAbort bool } func (e *ExptTurnRunResult) SetTargetResult(er *EvalTargetRecord) *ExptTurnRunResult { diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_impl.go index 2bd27f29a..54b33d8aa 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl.go @@ -9,6 +9,7 @@ import ( "strconv" "time" + "github.com/bytedance/gg/gcond" "github.com/bytedance/gg/gptr" "github.com/jinzhu/copier" @@ -71,36 +72,46 @@ func (e *ExptItemEvalCtxExecutor) Eval(ctx context.Context, eiec *entity.ExptIte // if err := e.SetItemRunProcessing(ctx, event.ExptID, event.ExptRunID, event.EvalSetItemID, event.SpaceID, event.Session); err != nil { // return err // } - if err := e.CompleteItemRun(ctx, event, e.EvalTurns(ctx, eiec)); err != nil { + + asyncAbort, evalErr := e.EvalTurns(ctx, eiec) + if asyncAbort { + return nil + } + + if err := e.CompleteItemRun(ctx, event, evalErr); err != nil { return err } return nil } -func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.ExptItemEvalCtx) error { +func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.ExptItemEvalCtx) (asyncAbort bool, err error) { var history []*entity.Message if eiec.EvalSetItem == nil { - return fmt.Errorf("EvalTurns with invalid empty eval_set_item") + return false, fmt.Errorf("EvalTurns with invalid empty eval_set_item") } for _, turn := range eiec.EvalSetItem.Turns { etec, err := e.buildExptTurnEvalCtx(ctx, turn, eiec, history) if err != nil { - return err + return false, err } ctx = context.WithValue(ctx, consts.CtxKeyLogID, etec.GetTurnEvalLogID(ctx, turn.ID)) //nolint:staticcheck,SA1029 turnRunRes := NewExptTurnEvaluation(e.Metric, e.evalTargetService, e.evaluatorService, e.benefitService, e.evalAsyncRepo).Eval(ctx, etec) + if turnRunRes.AsyncAbort { + return true, nil + } + if err := e.storeTurnRunResult(ctx, etec, turnRunRes); err != nil { - return err + return false, err } if err := turnRunRes.GetEvalErr(); err != nil { - return err + return false, err } history = append(history, buildHistoryMessage(ctx, turnRunRes)...) @@ -108,7 +119,7 @@ func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.Ex time.Sleep(time.Second * 1) - return nil + return false, nil } func (e *ExptItemEvalCtxExecutor) storeTurnRunResult(ctx context.Context, etec *entity.ExptTurnEvalCtx, result *entity.ExptTurnRunResult) error { @@ -169,7 +180,7 @@ func (e *ExptItemEvalCtxExecutor) storeTurnRunResult(ctx context.Context, etec * clone.Status = entity.TurnRunState_Fail clone.ErrMsg = errno.SerializeErr(evalErr) } else { - clone.Status = entity.TurnRunState_Success + clone.Status = gcond.If(result.AsyncAbort, clone.Status, entity.TurnRunState_Success) } result.SetEvalErr(evalErr) From 0b4aa2e88059c892ab1cb7023afdd1f3a9e3a8d8 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 22:58:04 +0800 Subject: [PATCH 059/100] fix(evaluation): expt async exec --- backend/modules/evaluation/domain/entity/expt_run.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 790b11905..112c035cc 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -432,6 +432,7 @@ func (e *ExptTurnRunResult) AbortWithTargetResult(expt *Experiment) bool { // target async exec, with no record if expt.AsyncCallTarget() && gptr.Indirect(e.TargetResult.Status) == EvalTargetRunStatusAsyncInvoking { + e.AsyncAbort = true return true } From 85d42fc40c9bd062a722570b44deaddbdd5d66ff Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 23:18:10 +0800 Subject: [PATCH 060/100] fix(evaluation): async return invoke_id --- .../evaluation/domain/service/expt_run_item_impl_test.go | 4 ++-- .../evaluation/domain/service/mocks/target_source.go | 7 ++++--- backend/modules/evaluation/domain/service/target_impl.go | 9 ++------- .../modules/evaluation/domain/service/target_source.go | 2 +- .../domain/service/target_source_loopprompt_impl.go | 4 ++-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go index 4e929a315..76832a33a 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl_test.go @@ -275,14 +275,14 @@ func Test_ExptItemEvalCtxExecutor_EvalTurns(t *testing.T) { t.Run("参数校验失败-EvalSetItem为nil", func(t *testing.T) { execCtx := &entity.ExptItemEvalCtx{EvalSetItem: nil} - err := executor.EvalTurns(context.Background(), execCtx) + _, err := executor.EvalTurns(context.Background(), execCtx) assert.Error(t, err) assert.Contains(t, err.Error(), "invalid empty eval_set_item") }) t.Run("正常流程-无turns", func(t *testing.T) { execCtx := &entity.ExptItemEvalCtx{EvalSetItem: &entity.EvaluationSetItem{Turns: []*entity.Turn{}}} - err := executor.EvalTurns(context.Background(), execCtx) + _, err := executor.EvalTurns(context.Background(), execCtx) assert.NoError(t, err) }) } diff --git a/backend/modules/evaluation/domain/service/mocks/target_source.go b/backend/modules/evaluation/domain/service/mocks/target_source.go index 1e459c495..894f9c877 100644 --- a/backend/modules/evaluation/domain/service/mocks/target_source.go +++ b/backend/modules/evaluation/domain/service/mocks/target_source.go @@ -42,11 +42,12 @@ func (m *MockISourceEvalTargetOperateService) EXPECT() *MockISourceEvalTargetOpe } // AsyncExecute mocks base method. -func (m *MockISourceEvalTargetOperateService) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error { +func (m *MockISourceEvalTargetOperateService) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AsyncExecute", ctx, spaceID, param) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 } // AsyncExecute indicates an expected call of AsyncExecute. diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 14d44c92c..483f72ab4 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -318,7 +318,7 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID TimeConsumingMS: gptr.Of(int64(0)), } - execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ + invokeID, execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ TargetID: targetID, VersionID: targetVersionID, SourceTargetID: target.SourceTargetID, @@ -347,13 +347,8 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID } userID := session.UserIDInCtxOrEmpty(ctx) - recordID, err := e.idgen.GenID(ctx) - if err != nil { - return nil, err - } - record = &entity.EvalTargetRecord{ - ID: recordID, + ID: invokeID, SpaceID: spaceID, TargetID: targetID, TargetVersionID: targetVersionID, diff --git a/backend/modules/evaluation/domain/service/target_source.go b/backend/modules/evaluation/domain/service/target_source.go index 7a11ffe7b..847414d75 100644 --- a/backend/modules/evaluation/domain/service/target_source.go +++ b/backend/modules/evaluation/domain/service/target_source.go @@ -28,7 +28,7 @@ type ISourceEvalTargetOperateService interface { ValidateInput(ctx context.Context, spaceID int64, inputSchema []*entity.ArgsSchema, input *entity.EvalTargetInputData) error // Execute Execute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (outputData *entity.EvalTargetOutputData, status entity.EvalTargetRunStatus, err error) - AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error + AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) RuntimeParam() entity.IRuntimeParam // 搜索自定义评测对象 SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) (targets []*entity.CustomEvalTarget, nextCursor string, hasMore bool, err error) diff --git a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go index ef10073b7..dccc2886b 100644 --- a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go +++ b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go @@ -33,8 +33,8 @@ type PromptSourceEvalTargetServiceImpl struct { promptRPCAdapter rpc.IPromptRPCAdapter } -func (t *PromptSourceEvalTargetServiceImpl) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) error { - return errorx.New("async execute not supported") +func (t *PromptSourceEvalTargetServiceImpl) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) { + return 0, errorx.New("async execute not supported") } func (t *PromptSourceEvalTargetServiceImpl) RuntimeParam() entity.IRuntimeParam { From d8a38757f114807c91cedcee22eb91050f90c246 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 23 Sep 2025 23:40:29 +0800 Subject: [PATCH 061/100] fix(evaluation): async abort --- .../evaluation/domain/service/expt_run_item_impl.go | 8 ++++---- backend/modules/evaluation/domain/service/target_impl.go | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_impl.go index 54b33d8aa..d57a0efed 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl.go @@ -102,14 +102,14 @@ func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.Ex turnRunRes := NewExptTurnEvaluation(e.Metric, e.evalTargetService, e.evaluatorService, e.benefitService, e.evalAsyncRepo).Eval(ctx, etec) - if turnRunRes.AsyncAbort { - return true, nil - } - if err := e.storeTurnRunResult(ctx, etec, turnRunRes); err != nil { return false, err } + if turnRunRes.AsyncAbort { + return true, nil + } + if err := turnRunRes.GetEvalErr(); err != nil { return false, err } diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 483f72ab4..c001717d8 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -346,6 +346,8 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID return nil, execErr } + logs.CtxInfo(ctx, "AsyncExecute with invoke_id: %v", invokeID) + userID := session.UserIDInCtxOrEmpty(ctx) record = &entity.EvalTargetRecord{ ID: invokeID, From cf9e4df1590596aae03a63eddf8da5b224f49a6b Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 00:03:21 +0800 Subject: [PATCH 062/100] fix(evaluation): async reentry --- .../service/expt_run_item_event_impl.go | 22 ++++++++----------- .../domain/service/expt_run_item_turn_impl.go | 4 ---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go index ab513451f..61f78c364 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go @@ -387,6 +387,15 @@ func (e *ExptRecordEvalModeSubmit) PreEval(ctx context.Context, eiec *entity.Exp // return err // } + got, err := e.exptTurnResultRepo.GetItemTurnRunLogs(ctx, event.ExptID, event.ExptRunID, event.EvalSetItemID, event.SpaceID) + if err != nil { + return err + } + + for _, turnResult := range got { + eiec.ExistItemEvalResult.TurnResultRunLogs[turnResult.TurnID] = turnResult + } + absentRunLogTurnIDs := make([]int64, 0, len(turns)) for _, turn := range turns { if turn == nil { @@ -423,19 +432,6 @@ func (e *ExptRecordEvalModeSubmit) PreEval(ctx context.Context, eiec *entity.Exp return err } - // turnRunLogDOs := make([]*entity.ExptTurnResultRunLog, 0, len(turnRunResults)) - // for _, trr := range turnRunResults { - // _, err := convert2.NewExptTurnResultRunLogConvertor().ConvertModelToEntity(trr) - // if err != nil { - // return err - // } - // turnRunLogDOs = append(turnRunLogDOs, nil) - // } - // - // eiec.ExistItemEvalResult.TurnResultRunLogs = gslice.ToMap(turnRunLogDOs, func(t *entity.ExptTurnResultRunLog) (int64, *entity.ExptTurnResultRunLog) { - // return t.TurnID, t - // }) - eiec.ExistItemEvalResult.TurnResultRunLogs = gslice.ToMap(turnRunResults, func(t *entity.ExptTurnResultRunLog) (int64, *entity.ExptTurnResultRunLog) { return t.TurnID, t }) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 8d60ee241..e8d5f446e 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -100,10 +100,6 @@ func (e *DefaultExptTurnEvaluationImpl) CallTarget(ctx context.Context, etec *en return existRecord, nil } - if existResult := etec.ExptTurnRunResult.TargetResult; existResult != nil && existResult.Status != nil && *existResult.Status == entity.EvalTargetRunStatusSuccess { - return existResult, nil - } - if err := e.CheckBenefit(ctx, etec.Event.ExptID, etec.Event.SpaceID, etec.Expt.CreditCost == entity.CreditCostFree, etec.Event.Session); err != nil { return nil, err } From 36dafce4bfadb4adb17f8794b54324315fc9efff Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 00:18:38 +0800 Subject: [PATCH 063/100] dev: commit --- backend/modules/evaluation/domain/service/target_impl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index c001717d8..c1706a8e7 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -346,7 +346,7 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID return nil, execErr } - logs.CtxInfo(ctx, "AsyncExecute with invoke_id: %v", invokeID) + logs.CtxInfo(ctx, "AsyncExecute with invoke_id %v", invokeID) userID := session.UserIDInCtxOrEmpty(ctx) record = &entity.EvalTargetRecord{ From d52f78dff019f72a9f037c1d832599f62427f436 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 12:05:24 +0800 Subject: [PATCH 064/100] fix(evaluation): target async callee --- .../application/eval_openapi_app.go | 4 +++ .../evaluation/application/eval_target_app.go | 2 +- .../evaluation/domain/entity/expt_run.go | 1 + .../service/expt_run_item_event_impl.go | 4 +-- .../domain/service/expt_run_item_impl.go | 5 ++-- .../domain/service/expt_run_item_turn_impl.go | 4 ++- .../evaluation/domain/service/mocks/target.go | 7 +++--- .../domain/service/mocks/target_source.go | 7 +++--- .../evaluation/domain/service/target.go | 2 +- .../evaluation/domain/service/target_impl.go | 25 ++++++++++--------- .../domain/service/target_source.go | 2 +- .../service/target_source_loopprompt_impl.go | 4 +-- 12 files changed, 39 insertions(+), 28 deletions(-) diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go index 617ed69be..2b2b67597 100644 --- a/backend/modules/evaluation/application/eval_openapi_app.go +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -18,6 +18,8 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/events" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" + "github.com/coze-dev/coze-loop/backend/pkg/json" + "github.com/coze-dev/coze-loop/backend/pkg/logs" ) type IEvalOpenAPIApplication = evaluation.EvalOpenAPIService @@ -33,6 +35,8 @@ func NewEvalOpenAPIApplication(asyncRepo repo.IEvalAsyncRepo, publisher events.E } func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Context, req *openapi.ReportEvalTargetInvokeResultRequest) (r *openapi.ReportEvalTargetInvokeResultResponse, err error) { + logs.CtxInfo(ctx, "ReportEvalTargetInvokeResult receive req: %v", json.Jsonify(req)) + actx, err := e.asyncRepo.GetEvalAsyncCtx(ctx, strconv.FormatInt(req.GetInvokeID(), 10)) if err != nil { return nil, err diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 140dd052a..16dd759b2 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -336,7 +336,7 @@ func (e EvalTargetApplicationImpl) AsyncExecuteEvalTarget(ctx context.Context, r return nil, err } - record, err := e.evalTargetService.AsyncExecuteTarget(ctx, request.WorkspaceID, request.EvalTargetID, request.EvalTargetVersionID, &entity.ExecuteTargetCtx{ + record, _, err := e.evalTargetService.AsyncExecuteTarget(ctx, request.WorkspaceID, request.EvalTargetID, request.EvalTargetVersionID, &entity.ExecuteTargetCtx{ ExperimentRunID: request.ExperimentRunID, }, target.InputDTO2ToDO(request.InputData)) if err != nil { diff --git a/backend/modules/evaluation/domain/entity/expt_run.go b/backend/modules/evaluation/domain/entity/expt_run.go index 112c035cc..e3bd4ca86 100644 --- a/backend/modules/evaluation/domain/entity/expt_run.go +++ b/backend/modules/evaluation/domain/entity/expt_run.go @@ -461,4 +461,5 @@ type EvalAsyncCtx struct { TurnID int64 AsyncUnixMS int64 // async call time with unix ms ts Session *Session + Callee string } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go index 61f78c364..de8aa2f15 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl.go @@ -113,7 +113,7 @@ func (e *ExptItemEventEvalServiceImpl) Eval(ctx context.Context, event *entity.E ctx = ctxcache.Init(ctx) if err := e.endpoints(ctx, event); err != nil { - logs.CtxError(ctx, "[ExptRecordEval] expt record eval fail, event: %v, err: %v", json.Jsonify(event), err) + logs.CtxError(ctx, "[ExptTurnEval] expt record eval fail, event: %v, err: %v", json.Jsonify(event), err) return err } @@ -164,7 +164,7 @@ func (e *ExptItemEventEvalServiceImpl) HandleEventErr(next RecordEvalEndPoint) R e.metric.EmitItemExecResult(event.SpaceID, int64(event.ExptRunMode), nextErr != nil, needRetry, stable, int64(code), event.CreateAt) }() - logs.CtxInfo(ctx, "[ExptRecordEval] handle event done, success: %v, retry: %v, retry_times: %v, err: %v, indebt: %v, event: %v", + logs.CtxInfo(ctx, "[ExptTurnEval] handle event done, success: %v, retry: %v, retry_times: %v, err: %v, indebt: %v, event: %v", nextErr == nil, needRetry, retryConf.GetRetryTimes(), nextErr, retryConf.IsInDebt, json.Jsonify(event)) if nextErr == nil { diff --git a/backend/modules/evaluation/domain/service/expt_run_item_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_impl.go index d57a0efed..3c99fa5d5 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_impl.go @@ -107,6 +107,7 @@ func (e *ExptItemEvalCtxExecutor) EvalTurns(ctx context.Context, eiec *entity.Ex } if turnRunRes.AsyncAbort { + logs.CtxInfo(ctx, "[ExptTurnEval] eval async abort, expt_id: %v, item_id: %v, turn_id: %v", eiec.Event.ExptID, eiec.Event.EvalSetItemID, turn.ID) return true, nil } @@ -273,11 +274,11 @@ func (e *ExptItemEvalCtxExecutor) CompleteItemRun(ctx context.Context, event *en } if e.evalErrNeedTerminateExpt(ctx, event.SpaceID, evalErr) { - logs.CtxWarn(ctx, "[ExptRecordEval] found error which should terminate expt, expt_id: %v, expt_run_id: %v, item_id: %v, err: %v", event.ExptID, event.ExptRunID, event.EvalSetItemID, evalErr) + logs.CtxWarn(ctx, "[ExptTurnEval] found error which should terminate expt, expt_id: %v, expt_run_id: %v, item_id: %v, err: %v", event.ExptID, event.ExptRunID, event.EvalSetItemID, evalErr) return evalErr } - logs.CtxInfo(ctx, "[ExptRecordEval] expt item eval finished, expt_id: %v, expt_run_id: %v, success: %v, update_fields: %v", event.ExptID, event.ExptRunID, evalErr == nil, ufields) + logs.CtxInfo(ctx, "[ExptTurnEval] expt item eval finished, expt_id: %v, expt_run_id: %v, success: %v, update_fields: %v", event.ExptID, event.ExptRunID, evalErr == nil, ufields) time.Sleep(time.Second * 2) // 确保日志落库 return nil } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index e8d5f446e..630eaf9b7 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -97,6 +97,7 @@ func (e *DefaultExptTurnEvaluationImpl) CallTarget(ctx context.Context, etec *en } if existRecord := e.existedTargetRecord(etec); existRecord != nil { + logs.CtxInfo(ctx, "CallTarget return with existed target record, record_id: %v", existRecord.ID) return existRecord, nil } @@ -212,7 +213,7 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en } ts := time.Now() - targetRecord, err = e.evalTargetService.AsyncExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) + targetRecord, callee, err := e.evalTargetService.AsyncExecuteTarget(ctx, spaceID, etec.Expt.Target.ID, etec.Expt.Target.EvalTargetVersion.ID, etc, etid) if err != nil { return nil, err } @@ -222,6 +223,7 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en TurnID: targetRecord.ID, AsyncUnixMS: ts.UnixMilli(), Session: etec.Event.Session, + Callee: callee, }); err != nil { return nil, err } diff --git a/backend/modules/evaluation/domain/service/mocks/target.go b/backend/modules/evaluation/domain/service/mocks/target.go index bcaccb2cb..f7aaf2c54 100644 --- a/backend/modules/evaluation/domain/service/mocks/target.go +++ b/backend/modules/evaluation/domain/service/mocks/target.go @@ -57,12 +57,13 @@ func (mr *MockIEvalTargetServiceMockRecorder) AsyncDebugTarget(ctx, param any) * } // AsyncExecuteTarget mocks base method. -func (m *MockIEvalTargetService) AsyncExecuteTarget(ctx context.Context, spaceID, targetID, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) { +func (m *MockIEvalTargetService) AsyncExecuteTarget(ctx context.Context, spaceID, targetID, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AsyncExecuteTarget", ctx, spaceID, targetID, targetVersionID, param, inputData) ret0, _ := ret[0].(*entity.EvalTargetRecord) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // AsyncExecuteTarget indicates an expected call of AsyncExecuteTarget. diff --git a/backend/modules/evaluation/domain/service/mocks/target_source.go b/backend/modules/evaluation/domain/service/mocks/target_source.go index 894f9c877..76f4bc2f5 100644 --- a/backend/modules/evaluation/domain/service/mocks/target_source.go +++ b/backend/modules/evaluation/domain/service/mocks/target_source.go @@ -42,12 +42,13 @@ func (m *MockISourceEvalTargetOperateService) EXPECT() *MockISourceEvalTargetOpe } // AsyncExecute mocks base method. -func (m *MockISourceEvalTargetOperateService) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) { +func (m *MockISourceEvalTargetOperateService) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AsyncExecute", ctx, spaceID, param) ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // AsyncExecute indicates an expected call of AsyncExecute. diff --git a/backend/modules/evaluation/domain/service/target.go b/backend/modules/evaluation/domain/service/target.go index 64e33d63f..883d19a49 100644 --- a/backend/modules/evaluation/domain/service/target.go +++ b/backend/modules/evaluation/domain/service/target.go @@ -18,7 +18,7 @@ type IEvalTargetService interface { BatchGetEvalTargetVersion(ctx context.Context, spaceID int64, versionIDs []int64, needSourceInfo bool) (dos []*entity.EvalTarget, err error) ExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) - AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) + AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index c1706a8e7..42bbe50a3 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -281,21 +281,21 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID int64 } func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, - param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, err error) { + param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) { if inputData == nil || param == nil { - return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("AsyncExecuteTarget with invalid param")) + return nil, "", errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("AsyncExecuteTarget with invalid param")) } evalTargetDO, err := e.GetEvalTargetVersion(ctx, spaceID, targetVersionID, false) if err != nil { - return nil, err + return nil, "", err } return e.asyncExecuteTarget(ctx, spaceID, evalTargetDO, param, inputData) } func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID int64, target *entity.EvalTarget, param *entity.ExecuteTargetCtx, - inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, err error) { + inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) { defer func(st time.Time) { e.metric.EmitRun(spaceID, err, st) }(time.Now()) // todo(@liushengyang): mtr defer goroutine.Recovery(ctx) @@ -304,11 +304,11 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID operator := e.typedOperators[target.EvalTargetType] if operator == nil { - return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) + return nil, "", errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("target type not support")) } if err := operator.ValidateInput(ctx, spaceID, target.EvalTargetVersion.InputSchema, inputData); err != nil { - return nil, err + return nil, "", err } status := entity.EvalTargetRunStatusAsyncInvoking @@ -318,7 +318,7 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID TimeConsumingMS: gptr.Of(int64(0)), } - invokeID, execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ + invokeID, callee, execErr := operator.AsyncExecute(ctx, spaceID, &entity.ExecuteEvalTargetParam{ TargetID: targetID, VersionID: targetVersionID, SourceTargetID: target.SourceTargetID, @@ -343,10 +343,10 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID // Message: execErr.Error(), // } //} - return nil, execErr + return nil, callee, execErr } - logs.CtxInfo(ctx, "AsyncExecute with invoke_id %v", invokeID) + logs.CtxInfo(ctx, "AsyncExecute with invoke_id %v, callee: %v, target_id: %v, target_version_id: %v", invokeID, callee, targetID, targetVersionID) userID := session.UserIDInCtxOrEmpty(ctx) record = &entity.EvalTargetRecord{ @@ -373,10 +373,10 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID }, } if _, err := e.evalTargetRepo.CreateEvalTargetRecord(ctx, record); err != nil { - return nil, err + return nil, callee, err } - return record, nil + return record, callee, nil } func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { @@ -454,7 +454,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { st := time.Now() - record, err = e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) + record, callee, err := e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) if err != nil { return nil, err } @@ -463,6 +463,7 @@ func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *ent TurnID: record.ID, AsyncUnixMS: st.UnixMilli(), Session: &entity.Session{UserID: session.UserIDInCtxOrEmpty(ctx)}, + Callee: callee, }); err != nil { return nil, err } diff --git a/backend/modules/evaluation/domain/service/target_source.go b/backend/modules/evaluation/domain/service/target_source.go index 847414d75..87cc8c834 100644 --- a/backend/modules/evaluation/domain/service/target_source.go +++ b/backend/modules/evaluation/domain/service/target_source.go @@ -28,7 +28,7 @@ type ISourceEvalTargetOperateService interface { ValidateInput(ctx context.Context, spaceID int64, inputSchema []*entity.ArgsSchema, input *entity.EvalTargetInputData) error // Execute Execute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (outputData *entity.EvalTargetOutputData, status entity.EvalTargetRunStatus, err error) - AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) + AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (invokeID int64, callee string, err error) RuntimeParam() entity.IRuntimeParam // 搜索自定义评测对象 SearchCustomEvalTarget(ctx context.Context, param *entity.SearchCustomEvalTargetParam) (targets []*entity.CustomEvalTarget, nextCursor string, hasMore bool, err error) diff --git a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go index dccc2886b..feec8ab32 100644 --- a/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go +++ b/backend/modules/evaluation/domain/service/target_source_loopprompt_impl.go @@ -33,8 +33,8 @@ type PromptSourceEvalTargetServiceImpl struct { promptRPCAdapter rpc.IPromptRPCAdapter } -func (t *PromptSourceEvalTargetServiceImpl) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, error) { - return 0, errorx.New("async execute not supported") +func (t *PromptSourceEvalTargetServiceImpl) AsyncExecute(ctx context.Context, spaceID int64, param *entity.ExecuteEvalTargetParam) (int64, string, error) { + return 0, "", errorx.New("async execute not supported") } func (t *PromptSourceEvalTargetServiceImpl) RuntimeParam() entity.IRuntimeParam { From 368b10db2d7adcdd23bbdc13ddf85bb11b50cfc4 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 12:08:49 +0800 Subject: [PATCH 065/100] fix(evaluation): AsyncExecuteEvalTargetResponse with callee --- .../coze.loop.evaluation.eval_target.go | 77 +++++++++++++++++++ .../k-coze.loop.evaluation.eval_target.go | 56 ++++++++++++++ .../coze.loop.evaluation.eval_target.thrift | 1 + 3 files changed, 134 insertions(+) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index a824f8546..cb0cdb534 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -4158,6 +4158,7 @@ func (p *ExecuteEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { type AsyncExecuteEvalTargetResponse struct { InvokeID *int64 `thrift:"invoke_id,1,optional" frugal:"1,optional,i64" form:"invoke_id" json:"invoke_id,omitempty" query:"invoke_id"` + Callee *string `thrift:"callee,2,optional" frugal:"2,optional,string" form:"callee" json:"callee,omitempty" query:"callee"` BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` } @@ -4180,6 +4181,18 @@ func (p *AsyncExecuteEvalTargetResponse) GetInvokeID() (v int64) { return *p.InvokeID } +var AsyncExecuteEvalTargetResponse_Callee_DEFAULT string + +func (p *AsyncExecuteEvalTargetResponse) GetCallee() (v string) { + if p == nil { + return + } + if !p.IsSetCallee() { + return AsyncExecuteEvalTargetResponse_Callee_DEFAULT + } + return *p.Callee +} + var AsyncExecuteEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp func (p *AsyncExecuteEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { @@ -4194,12 +4207,16 @@ func (p *AsyncExecuteEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { func (p *AsyncExecuteEvalTargetResponse) SetInvokeID(val *int64) { p.InvokeID = val } +func (p *AsyncExecuteEvalTargetResponse) SetCallee(val *string) { + p.Callee = val +} func (p *AsyncExecuteEvalTargetResponse) SetBaseResp(val *base.BaseResp) { p.BaseResp = val } var fieldIDToName_AsyncExecuteEvalTargetResponse = map[int16]string{ 1: "invoke_id", + 2: "callee", 255: "BaseResp", } @@ -4207,6 +4224,10 @@ func (p *AsyncExecuteEvalTargetResponse) IsSetInvokeID() bool { return p.InvokeID != nil } +func (p *AsyncExecuteEvalTargetResponse) IsSetCallee() bool { + return p.Callee != nil +} + func (p *AsyncExecuteEvalTargetResponse) IsSetBaseResp() bool { return p.BaseResp != nil } @@ -4237,6 +4258,14 @@ func (p *AsyncExecuteEvalTargetResponse) Read(iprot thrift.TProtocol) (err error } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 255: if fieldTypeId == thrift.STRUCT { if err = p.ReadField255(iprot); err != nil { @@ -4285,6 +4314,17 @@ func (p *AsyncExecuteEvalTargetResponse) ReadField1(iprot thrift.TProtocol) erro p.InvokeID = _field return nil } +func (p *AsyncExecuteEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Callee = _field + return nil +} func (p *AsyncExecuteEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBaseResp() if err := _field.Read(iprot); err != nil { @@ -4304,6 +4344,10 @@ func (p *AsyncExecuteEvalTargetResponse) Write(oprot thrift.TProtocol) (err erro fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -4344,6 +4388,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } +func (p *AsyncExecuteEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCallee() { + if err = oprot.WriteFieldBegin("callee", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Callee); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} func (p *AsyncExecuteEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { goto WriteFieldBeginError @@ -4378,6 +4440,9 @@ func (p *AsyncExecuteEvalTargetResponse) DeepEqual(ano *AsyncExecuteEvalTargetRe if !p.Field1DeepEqual(ano.InvokeID) { return false } + if !p.Field2DeepEqual(ano.Callee) { + return false + } if !p.Field255DeepEqual(ano.BaseResp) { return false } @@ -4396,6 +4461,18 @@ func (p *AsyncExecuteEvalTargetResponse) Field1DeepEqual(src *int64) bool { } return true } +func (p *AsyncExecuteEvalTargetResponse) Field2DeepEqual(src *string) bool { + + if p.Callee == src { + return true + } else if p.Callee == nil || src == nil { + return false + } + if strings.Compare(*p.Callee, *src) != 0 { + return false + } + return true +} func (p *AsyncExecuteEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { if !p.BaseResp.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index c64ed78a6..622110acd 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -3042,6 +3042,20 @@ func (p *AsyncExecuteEvalTargetResponse) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -3088,6 +3102,20 @@ func (p *AsyncExecuteEvalTargetResponse) FastReadField1(buf []byte) (int, error) return offset, nil } +func (p *AsyncExecuteEvalTargetResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Callee = _field + return offset, nil +} + func (p *AsyncExecuteEvalTargetResponse) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBaseResp() @@ -3108,6 +3136,7 @@ func (p *AsyncExecuteEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.No offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -3118,6 +3147,7 @@ func (p *AsyncExecuteEvalTargetResponse) BLength() int { l := 0 if p != nil { l += p.field1Length() + l += p.field2Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -3133,6 +3163,15 @@ func (p *AsyncExecuteEvalTargetResponse) fastWriteField1(buf []byte, w thrift.No return offset } +func (p *AsyncExecuteEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCallee() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Callee) + } + return offset +} + func (p *AsyncExecuteEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) @@ -3149,6 +3188,15 @@ func (p *AsyncExecuteEvalTargetResponse) field1Length() int { return l } +func (p *AsyncExecuteEvalTargetResponse) field2Length() int { + l := 0 + if p.IsSetCallee() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Callee) + } + return l +} + func (p *AsyncExecuteEvalTargetResponse) field255Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -3167,6 +3215,14 @@ func (p *AsyncExecuteEvalTargetResponse) DeepCopy(s interface{}) error { p.InvokeID = &tmp } + if src.Callee != nil { + var tmp string + if *src.Callee != "" { + tmp = kutils.StringDeepCopy(*src.Callee) + } + p.Callee = &tmp + } + var _baseResp *base.BaseResp if src.BaseResp != nil { _baseResp = &base.BaseResp{} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index d92d7e020..fb3ebdfb3 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -93,6 +93,7 @@ typedef ExecuteEvalTargetRequest AsyncExecuteEvalTargetRequest struct AsyncExecuteEvalTargetResponse { 1: optional i64 invoke_id + 2: optional string callee 255: base.BaseResp BaseResp } From 6cca2e9bd18761a118afce88b454d8fbe705def4 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 12:34:21 +0800 Subject: [PATCH 066/100] feat(evaluation): ReportEvalTargetInvokeResult with callee --- .../openapi/coze.loop.evaluation.openapi.go | 77 +++++++++++++++++++ .../openapi/k-coze.loop.evaluation.openapi.go | 56 ++++++++++++++ .../coze.loop.evaluation.openapi.thrift | 1 + 3 files changed, 134 insertions(+) diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go index e32c88ce8..65c9cb601 100644 --- a/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/coze.loop.evaluation.openapi.go @@ -15,6 +15,7 @@ type ReportEvalTargetInvokeResultRequest struct { WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` InvokeID *int64 `thrift:"invoke_id,2,optional" frugal:"2,optional,i64" json:"invoke_id" form:"invoke_id" query:"invoke_id"` Status *spi.InvokeEvalTargetStatus `thrift:"status,3,optional" frugal:"3,optional,InvokeEvalTargetStatus" form:"status" json:"status,omitempty" query:"status"` + Callee *string `thrift:"callee,4,optional" frugal:"4,optional,string" form:"callee" json:"callee,omitempty" query:"callee"` // set output if status=SUCCESS Output *spi.InvokeEvalTargetOutput `thrift:"output,10,optional" frugal:"10,optional,spi.InvokeEvalTargetOutput" form:"output" json:"output,omitempty" query:"output"` // set output if status=SUCCESS @@ -67,6 +68,18 @@ func (p *ReportEvalTargetInvokeResultRequest) GetStatus() (v spi.InvokeEvalTarge return *p.Status } +var ReportEvalTargetInvokeResultRequest_Callee_DEFAULT string + +func (p *ReportEvalTargetInvokeResultRequest) GetCallee() (v string) { + if p == nil { + return + } + if !p.IsSetCallee() { + return ReportEvalTargetInvokeResultRequest_Callee_DEFAULT + } + return *p.Callee +} + var ReportEvalTargetInvokeResultRequest_Output_DEFAULT *spi.InvokeEvalTargetOutput func (p *ReportEvalTargetInvokeResultRequest) GetOutput() (v *spi.InvokeEvalTargetOutput) { @@ -123,6 +136,9 @@ func (p *ReportEvalTargetInvokeResultRequest) SetInvokeID(val *int64) { func (p *ReportEvalTargetInvokeResultRequest) SetStatus(val *spi.InvokeEvalTargetStatus) { p.Status = val } +func (p *ReportEvalTargetInvokeResultRequest) SetCallee(val *string) { + p.Callee = val +} func (p *ReportEvalTargetInvokeResultRequest) SetOutput(val *spi.InvokeEvalTargetOutput) { p.Output = val } @@ -140,6 +156,7 @@ var fieldIDToName_ReportEvalTargetInvokeResultRequest = map[int16]string{ 1: "workspace_id", 2: "invoke_id", 3: "status", + 4: "callee", 10: "output", 11: "usage", 20: "error_message", @@ -158,6 +175,10 @@ func (p *ReportEvalTargetInvokeResultRequest) IsSetStatus() bool { return p.Status != nil } +func (p *ReportEvalTargetInvokeResultRequest) IsSetCallee() bool { + return p.Callee != nil +} + func (p *ReportEvalTargetInvokeResultRequest) IsSetOutput() bool { return p.Output != nil } @@ -216,6 +237,14 @@ func (p *ReportEvalTargetInvokeResultRequest) Read(iprot thrift.TProtocol) (err } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 10: if fieldTypeId == thrift.STRUCT { if err = p.ReadField10(iprot); err != nil { @@ -311,6 +340,17 @@ func (p *ReportEvalTargetInvokeResultRequest) ReadField3(iprot thrift.TProtocol) p.Status = _field return nil } +func (p *ReportEvalTargetInvokeResultRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Callee = _field + return nil +} func (p *ReportEvalTargetInvokeResultRequest) ReadField10(iprot thrift.TProtocol) error { _field := spi.NewInvokeEvalTargetOutput() if err := _field.Read(iprot); err != nil { @@ -365,6 +405,10 @@ func (p *ReportEvalTargetInvokeResultRequest) Write(oprot thrift.TProtocol) (err fieldId = 3 goto WriteFieldError } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } if err = p.writeField10(oprot); err != nil { fieldId = 10 goto WriteFieldError @@ -453,6 +497,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } +func (p *ReportEvalTargetInvokeResultRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetCallee() { + if err = oprot.WriteFieldBegin("callee", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Callee); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} func (p *ReportEvalTargetInvokeResultRequest) writeField10(oprot thrift.TProtocol) (err error) { if p.IsSetOutput() { if err = oprot.WriteFieldBegin("output", thrift.STRUCT, 10); err != nil { @@ -549,6 +611,9 @@ func (p *ReportEvalTargetInvokeResultRequest) DeepEqual(ano *ReportEvalTargetInv if !p.Field3DeepEqual(ano.Status) { return false } + if !p.Field4DeepEqual(ano.Callee) { + return false + } if !p.Field10DeepEqual(ano.Output) { return false } @@ -600,6 +665,18 @@ func (p *ReportEvalTargetInvokeResultRequest) Field3DeepEqual(src *spi.InvokeEva } return true } +func (p *ReportEvalTargetInvokeResultRequest) Field4DeepEqual(src *string) bool { + + if p.Callee == src { + return true + } else if p.Callee == nil || src == nil { + return false + } + if strings.Compare(*p.Callee, *src) != 0 { + return false + } + return true +} func (p *ReportEvalTargetInvokeResultRequest) Field10DeepEqual(src *spi.InvokeEvalTargetOutput) bool { if !p.Output.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go b/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go index eb1c1cbaf..81d5fc56d 100644 --- a/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go +++ b/backend/kitex_gen/coze/loop/evaluation/openapi/k-coze.loop.evaluation.openapi.go @@ -88,6 +88,20 @@ func (p *ReportEvalTargetInvokeResultRequest) FastRead(buf []byte) (int, error) goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 10: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField10(buf[offset:]) @@ -206,6 +220,20 @@ func (p *ReportEvalTargetInvokeResultRequest) FastReadField3(buf []byte) (int, e return offset, nil } +func (p *ReportEvalTargetInvokeResultRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Callee = _field + return offset, nil +} + func (p *ReportEvalTargetInvokeResultRequest) FastReadField10(buf []byte) (int, error) { offset := 0 _field := spi.NewInvokeEvalTargetOutput() @@ -266,6 +294,7 @@ func (p *ReportEvalTargetInvokeResultRequest) FastWriteNocopy(buf []byte, w thri offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField20(buf[offset:], w) @@ -281,6 +310,7 @@ func (p *ReportEvalTargetInvokeResultRequest) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() l += p.field10Length() l += p.field11Length() l += p.field20Length() @@ -317,6 +347,15 @@ func (p *ReportEvalTargetInvokeResultRequest) fastWriteField3(buf []byte, w thri return offset } +func (p *ReportEvalTargetInvokeResultRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCallee() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Callee) + } + return offset +} + func (p *ReportEvalTargetInvokeResultRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetOutput() { @@ -380,6 +419,15 @@ func (p *ReportEvalTargetInvokeResultRequest) field3Length() int { return l } +func (p *ReportEvalTargetInvokeResultRequest) field4Length() int { + l := 0 + if p.IsSetCallee() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Callee) + } + return l +} + func (p *ReportEvalTargetInvokeResultRequest) field10Length() int { l := 0 if p.IsSetOutput() { @@ -437,6 +485,14 @@ func (p *ReportEvalTargetInvokeResultRequest) DeepCopy(s interface{}) error { p.Status = &tmp } + if src.Callee != nil { + var tmp string + if *src.Callee != "" { + tmp = kutils.StringDeepCopy(*src.Callee) + } + p.Callee = &tmp + } + var _output *spi.InvokeEvalTargetOutput if src.Output != nil { _output = &spi.InvokeEvalTargetOutput{} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift index cbb421117..8527a3ef0 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.openapi.thrift @@ -7,6 +7,7 @@ struct ReportEvalTargetInvokeResultRequest { 1: optional i64 workspace_id (api.js_conv="true", go.tag = 'json:"workspace_id"') 2: optional i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') 3: optional coze.loop.evaluation.spi.InvokeEvalTargetStatus status + 4: optional string callee // set output if status=SUCCESS 10: optional coze.loop.evaluation.spi.InvokeEvalTargetOutput output From 6a6f44d7e3f8df3610da3ce4072b3255b6003a3d Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 12:40:58 +0800 Subject: [PATCH 067/100] fix(evaluation): ReportEvalTargetInvokeResult check --- backend/modules/evaluation/application/eval_openapi_app.go | 7 +++++++ backend/modules/evaluation/domain/service/target_impl.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go index 2b2b67597..8e08f095d 100644 --- a/backend/modules/evaluation/application/eval_openapi_app.go +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -5,6 +5,7 @@ package application import ( "context" + "fmt" "strconv" "time" @@ -18,6 +19,8 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/events" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" + "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" "github.com/coze-dev/coze-loop/backend/pkg/logs" ) @@ -42,6 +45,10 @@ func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Conte return nil, err } + if req.GetCallee() != actx.Callee { + return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg(fmt.Sprintf("callee not match: %v", req.GetCallee()))) + } + outputData := target.ToInvokeOutputDataDO(req) outputData.TimeConsumingMS = gptr.Of(time.Now().UnixMilli() - actx.AsyncUnixMS) if err := e.targetSvc.ReportInvokeRecords(ctx, &entity.ReportTargetRecordParam{ diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 42bbe50a3..54bc7a18e 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -489,6 +489,10 @@ func (e *EvalTargetServiceImpl) ReportInvokeRecords(ctx context.Context, param * return err } + if gptr.Indirect(record.Status) != entity.EvalTargetRunStatusAsyncInvoking { + return errorx.NewByCode(errno.CommonBadRequestCode, errorx.WithExtraMsg(fmt.Sprintf("unexpected target result status %v", record.Status))) + } + record.EvalTargetOutputData = param.OutputData record.Status = gptr.Of(param.Status) if err := e.evalTargetRepo.SaveEvalTargetRecord(ctx, record); err != nil { From 0563ec8f03fc75209b86605c7a1a711261da0ea1 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Wed, 24 Sep 2025 12:44:36 +0800 Subject: [PATCH 068/100] fix(evaluation): log --- backend/modules/evaluation/domain/service/target_impl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 54bc7a18e..55258d948 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -489,8 +489,8 @@ func (e *EvalTargetServiceImpl) ReportInvokeRecords(ctx context.Context, param * return err } - if gptr.Indirect(record.Status) != entity.EvalTargetRunStatusAsyncInvoking { - return errorx.NewByCode(errno.CommonBadRequestCode, errorx.WithExtraMsg(fmt.Sprintf("unexpected target result status %v", record.Status))) + if status := gptr.Indirect(record.Status); status != entity.EvalTargetRunStatusAsyncInvoking { + return errorx.NewByCode(errno.CommonBadRequestCode, errorx.WithExtraMsg(fmt.Sprintf("unexpected target result status %d", status))) } record.EvalTargetOutputData = param.OutputData From 615196da4d99bdb455b61c81f3f3992affcac122 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 12:24:56 +0800 Subject: [PATCH 069/100] fix(evaluation): calltarget inputfields --- .../application/eval_openapi_app.go | 7 ---- .../domain/service/expt_run_item_turn_impl.go | 42 ++++++++++++------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/backend/modules/evaluation/application/eval_openapi_app.go b/backend/modules/evaluation/application/eval_openapi_app.go index 8e08f095d..2b2b67597 100644 --- a/backend/modules/evaluation/application/eval_openapi_app.go +++ b/backend/modules/evaluation/application/eval_openapi_app.go @@ -5,7 +5,6 @@ package application import ( "context" - "fmt" "strconv" "time" @@ -19,8 +18,6 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/events" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" - "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" - "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" "github.com/coze-dev/coze-loop/backend/pkg/logs" ) @@ -45,10 +42,6 @@ func (e *EvalOpenAPIApplication) ReportEvalTargetInvokeResult_(ctx context.Conte return nil, err } - if req.GetCallee() != actx.Callee { - return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg(fmt.Sprintf("callee not match: %v", req.GetCallee()))) - } - outputData := target.ToInvokeOutputDataDO(req) outputData.TimeConsumingMS = gptr.Of(time.Now().UnixMilli() - actx.AsyncUnixMS) if err := e.targetSvc.ReportInvokeRecords(ctx, &entity.ReportTargetRecordParam{ diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 630eaf9b7..fbdb03184 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -169,22 +169,34 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en return t.Name, t.Content }) - fieldConfs := targetConf.IngressConf.EvalSetAdapter.FieldConfs - fields := make(map[string]*entity.Content, len(fieldConfs)) - for _, fc := range fieldConfs { - firstField, err := json.GetFirstJSONPathField(fc.FromField) - if err != nil { - return nil, err - } - if firstField == fc.FromField { // 没有下钻字段 - fields[fc.FieldName] = turnFields[fc.FromField] - } else { - content, err := e.getContentByJsonPath(turnFields[firstField], fc.FromField) - if err != nil { - return nil, err + buildInputFields := func(fieldConfs []*entity.FieldConf) (map[string]*entity.Content, error) { + fields := make(map[string]*entity.Content, len(fieldConfs)) + switch etec.Expt.Target.EvalTargetType { + case entity.EvalTargetTypeCustomRPCServer: + return turnFields, nil + default: + for _, fc := range fieldConfs { + firstField, err := json.GetFirstJSONPathField(fc.FromField) + if err != nil { + return nil, err + } + if firstField == fc.FromField { // 没有下钻字段 + fields[fc.FieldName] = turnFields[fc.FromField] + } else { + content, err := e.getContentByJsonPath(turnFields[firstField], fc.FromField) + if err != nil { + return nil, err + } + fields[fc.FieldName] = content + } } - fields[fc.FieldName] = content } + return fields, nil + } + + inputFields, err := buildInputFields(targetConf.IngressConf.EvalSetAdapter.FieldConfs) + if err != nil { + return nil, err } ext := gmap.Clone(etec.Ext) @@ -204,7 +216,7 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en } etid := &entity.EvalTargetInputData{ HistoryMessages: history, - InputFields: fields, + InputFields: inputFields, Ext: ext, } From 06e0b06c8b4e73a750e1ee385b53d2acb9294ab3 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 14:13:24 +0800 Subject: [PATCH 070/100] feat(evaluation): ExecuteEvalTargetRequest --- .../coze.loop.evaluation.eval_target.go | 69 +++++++++++++++++++ ...e.loop.evaluation.eval_target_validator.go | 5 ++ .../k-coze.loop.evaluation.eval_target.go | 55 +++++++++++++++ .../coze.loop.evaluation.eval_target.thrift | 2 + 4 files changed, 131 insertions(+) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index cb0cdb534..7433dae7c 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -3387,6 +3387,7 @@ type ExecuteEvalTargetRequest struct { EvalTargetVersionID int64 `thrift:"eval_target_version_id,3,required" frugal:"3,required,i64" json:"eval_target_version_id" path:"eval_target_version_id,required" ` InputData *eval_target.EvalTargetInputData `thrift:"input_data,4,required" frugal:"4,required,eval_target.EvalTargetInputData" form:"input_data,required" json:"input_data,required" query:"input_data,required"` ExperimentRunID *int64 `thrift:"experiment_run_id,5,optional" frugal:"5,optional,i64" json:"experiment_run_id" form:"experiment_run_id" query:"experiment_run_id"` + EvalTarget *eval_target.EvalTarget `thrift:"eval_target,10,optional" frugal:"10,optional,eval_target.EvalTarget" form:"eval_target" json:"eval_target,omitempty" query:"eval_target"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -3442,6 +3443,18 @@ func (p *ExecuteEvalTargetRequest) GetExperimentRunID() (v int64) { return *p.ExperimentRunID } +var ExecuteEvalTargetRequest_EvalTarget_DEFAULT *eval_target.EvalTarget + +func (p *ExecuteEvalTargetRequest) GetEvalTarget() (v *eval_target.EvalTarget) { + if p == nil { + return + } + if !p.IsSetEvalTarget() { + return ExecuteEvalTargetRequest_EvalTarget_DEFAULT + } + return p.EvalTarget +} + var ExecuteEvalTargetRequest_Base_DEFAULT *base.Base func (p *ExecuteEvalTargetRequest) GetBase() (v *base.Base) { @@ -3468,6 +3481,9 @@ func (p *ExecuteEvalTargetRequest) SetInputData(val *eval_target.EvalTargetInput func (p *ExecuteEvalTargetRequest) SetExperimentRunID(val *int64) { p.ExperimentRunID = val } +func (p *ExecuteEvalTargetRequest) SetEvalTarget(val *eval_target.EvalTarget) { + p.EvalTarget = val +} func (p *ExecuteEvalTargetRequest) SetBase(val *base.Base) { p.Base = val } @@ -3478,6 +3494,7 @@ var fieldIDToName_ExecuteEvalTargetRequest = map[int16]string{ 3: "eval_target_version_id", 4: "input_data", 5: "experiment_run_id", + 10: "eval_target", 255: "Base", } @@ -3489,6 +3506,10 @@ func (p *ExecuteEvalTargetRequest) IsSetExperimentRunID() bool { return p.ExperimentRunID != nil } +func (p *ExecuteEvalTargetRequest) IsSetEvalTarget() bool { + return p.EvalTarget != nil +} + func (p *ExecuteEvalTargetRequest) IsSetBase() bool { return p.Base != nil } @@ -3559,6 +3580,14 @@ func (p *ExecuteEvalTargetRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 10: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 255: if fieldTypeId == thrift.STRUCT { if err = p.ReadField255(iprot); err != nil { @@ -3669,6 +3698,14 @@ func (p *ExecuteEvalTargetRequest) ReadField5(iprot thrift.TProtocol) error { p.ExperimentRunID = _field return nil } +func (p *ExecuteEvalTargetRequest) ReadField10(iprot thrift.TProtocol) error { + _field := eval_target.NewEvalTarget() + if err := _field.Read(iprot); err != nil { + return err + } + p.EvalTarget = _field + return nil +} func (p *ExecuteEvalTargetRequest) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBase() if err := _field.Read(iprot); err != nil { @@ -3704,6 +3741,10 @@ func (p *ExecuteEvalTargetRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 5 goto WriteFieldError } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -3808,6 +3849,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } +func (p *ExecuteEvalTargetRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetEvalTarget() { + if err = oprot.WriteFieldBegin("eval_target", thrift.STRUCT, 10); err != nil { + goto WriteFieldBeginError + } + if err := p.EvalTarget.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} func (p *ExecuteEvalTargetRequest) writeField255(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { @@ -3856,6 +3915,9 @@ func (p *ExecuteEvalTargetRequest) DeepEqual(ano *ExecuteEvalTargetRequest) bool if !p.Field5DeepEqual(ano.ExperimentRunID) { return false } + if !p.Field10DeepEqual(ano.EvalTarget) { + return false + } if !p.Field255DeepEqual(ano.Base) { return false } @@ -3902,6 +3964,13 @@ func (p *ExecuteEvalTargetRequest) Field5DeepEqual(src *int64) bool { } return true } +func (p *ExecuteEvalTargetRequest) Field10DeepEqual(src *eval_target.EvalTarget) bool { + + if !p.EvalTarget.DeepEqual(src) { + return false + } + return true +} func (p *ExecuteEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { if !p.Base.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go index 61fdbd655..9ddbab888 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target_validator.go @@ -109,6 +109,11 @@ func (p *ExecuteEvalTargetRequest) IsValid() error { return fmt.Errorf("field InputData not valid, %w", err) } } + if p.EvalTarget != nil { + if err := p.EvalTarget.IsValid(); err != nil { + return fmt.Errorf("field EvalTarget not valid, %w", err) + } + } if p.Base != nil { if err := p.Base.IsValid(); err != nil { return fmt.Errorf("field Base not valid, %w", err) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 622110acd..7b73cd09a 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -2542,6 +2542,20 @@ func (p *ExecuteEvalTargetRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 10: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -2663,6 +2677,18 @@ func (p *ExecuteEvalTargetRequest) FastReadField5(buf []byte) (int, error) { return offset, nil } +func (p *ExecuteEvalTargetRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + _field := eval_target.NewEvalTarget() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.EvalTarget = _field + return offset, nil +} + func (p *ExecuteEvalTargetRequest) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBase() @@ -2687,6 +2713,7 @@ func (p *ExecuteEvalTargetRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWr offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -2701,6 +2728,7 @@ func (p *ExecuteEvalTargetRequest) BLength() int { l += p.field3Length() l += p.field4Length() l += p.field5Length() + l += p.field10Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -2744,6 +2772,15 @@ func (p *ExecuteEvalTargetRequest) fastWriteField5(buf []byte, w thrift.NocopyWr return offset } +func (p *ExecuteEvalTargetRequest) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvalTarget() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) + offset += p.EvalTarget.FastWriteNocopy(buf[offset:], w) + } + return offset +} + func (p *ExecuteEvalTargetRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetBase() { @@ -2790,6 +2827,15 @@ func (p *ExecuteEvalTargetRequest) field5Length() int { return l } +func (p *ExecuteEvalTargetRequest) field10Length() int { + l := 0 + if p.IsSetEvalTarget() { + l += thrift.Binary.FieldBeginLength() + l += p.EvalTarget.BLength() + } + return l +} + func (p *ExecuteEvalTargetRequest) field255Length() int { l := 0 if p.IsSetBase() { @@ -2825,6 +2871,15 @@ func (p *ExecuteEvalTargetRequest) DeepCopy(s interface{}) error { p.ExperimentRunID = &tmp } + var _evalTarget *eval_target.EvalTarget + if src.EvalTarget != nil { + _evalTarget = &eval_target.EvalTarget{} + if err := _evalTarget.DeepCopy(src.EvalTarget); err != nil { + return err + } + } + p.EvalTarget = _evalTarget + var _base *base.Base if src.Base != nil { _base = &base.Base{} diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index fb3ebdfb3..ea0799624 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -79,6 +79,8 @@ struct ExecuteEvalTargetRequest { 4: required eval_target.EvalTargetInputData input_data 5: optional i64 experiment_run_id (api.js_conv="true", go.tag = 'json:"experiment_run_id"') + 10: optional eval_target.EvalTarget eval_target + 255: optional base.Base Base } From ace44ad414d6a4687010e499d1370b5c0cf0ebaf Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 14:32:32 +0800 Subject: [PATCH 071/100] fix(evaluation): AsyncDebugTarget with callee --- .../modules/evaluation/application/eval_target_app.go | 2 +- .../modules/evaluation/domain/service/mocks/target.go | 7 ++++--- backend/modules/evaluation/domain/service/target.go | 2 +- .../modules/evaluation/domain/service/target_impl.go | 11 +++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index 16dd759b2..f85d45ff2 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -546,7 +546,7 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: - record, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ + record, _, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ SpaceID: request.GetWorkspaceID(), PatchyTarget: &entity.EvalTarget{ SpaceID: request.GetWorkspaceID(), diff --git a/backend/modules/evaluation/domain/service/mocks/target.go b/backend/modules/evaluation/domain/service/mocks/target.go index f7aaf2c54..223b699ff 100644 --- a/backend/modules/evaluation/domain/service/mocks/target.go +++ b/backend/modules/evaluation/domain/service/mocks/target.go @@ -42,12 +42,13 @@ func (m *MockIEvalTargetService) EXPECT() *MockIEvalTargetServiceMockRecorder { } // AsyncDebugTarget mocks base method. -func (m *MockIEvalTargetService) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (*entity.EvalTargetRecord, error) { +func (m *MockIEvalTargetService) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (*entity.EvalTargetRecord, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AsyncDebugTarget", ctx, param) ret0, _ := ret[0].(*entity.EvalTargetRecord) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // AsyncDebugTarget indicates an expected call of AsyncDebugTarget. diff --git a/backend/modules/evaluation/domain/service/target.go b/backend/modules/evaluation/domain/service/target.go index 883d19a49..ba5ef7af5 100644 --- a/backend/modules/evaluation/domain/service/target.go +++ b/backend/modules/evaluation/domain/service/target.go @@ -20,7 +20,7 @@ type IEvalTargetService interface { ExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (*entity.EvalTargetRecord, error) AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) - AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) + AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, callee string, err error) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) BatchGetRecordByIDs(ctx context.Context, spaceID int64, recordIDs []int64) ([]*entity.EvalTargetRecord, error) ReportInvokeRecords(ctx context.Context, recordID2Params *entity.ReportTargetRecordParam) error diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 55258d948..2c6ac51e0 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -451,12 +451,11 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D return record, nil } -func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) { +func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, callee string, err error) { st := time.Now() - - record, callee, err := e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) + record, callee, err = e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) if err != nil { - return nil, err + return nil, "", err } if err := e.evalAsyncRepo.SetEvalAsyncCtx(ctx, strconv.FormatInt(record.ID, 10), &entity.EvalAsyncCtx{ @@ -465,10 +464,10 @@ func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *ent Session: &entity.Session{UserID: session.UserIDInCtxOrEmpty(ctx)}, Callee: callee, }); err != nil { - return nil, err + return nil, callee, err } - return record, err + return record, callee, nil } func (e *EvalTargetServiceImpl) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) { From db6ab8e50a81948922272d05df821195bcf23c23 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 15:55:55 +0800 Subject: [PATCH 072/100] fix(evaluation): panic --- .../convertor/target/eval_target_record.go | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record.go b/backend/modules/evaluation/application/convertor/target/eval_target_record.go index 6e615899d..ffcd49feb 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record.go @@ -43,7 +43,11 @@ func EvalTargetRecordDO2DTO(src *entity.EvalTargetRecord) *eval_target.EvalTarge DeletedAt: src.BaseInfo.DeletedAt, }, } - + if src.BaseInfo != nil { + res.BaseInfo.CreatedAt = src.BaseInfo.CreatedAt + res.BaseInfo.UpdatedAt = src.BaseInfo.UpdatedAt + res.BaseInfo.DeletedAt = src.BaseInfo.DeletedAt + } return res } @@ -53,7 +57,7 @@ func RecordDTO2DO(src *eval_target.EvalTargetRecord) *entity.EvalTargetRecord { return nil } - return &entity.EvalTargetRecord{ + record := &entity.EvalTargetRecord{ ID: getInt64Value(src.ID), SpaceID: getInt64Value(src.WorkspaceID), TargetID: getInt64Value(src.TargetID), @@ -66,15 +70,14 @@ func RecordDTO2DO(src *eval_target.EvalTargetRecord) *entity.EvalTargetRecord { EvalTargetInputData: InputDTO2ToDO(src.EvalTargetInputData), EvalTargetOutputData: OutputDTO2ToDO(src.EvalTargetOutputData), Status: StatusDTO2DO(src.Status), - BaseInfo: &entity.BaseInfo{ - // todo - // CreatedBy: src.GetBaseInfo().GetCreatedBy(), - // UpdatedBy: src.GetBaseInfo().GetUpdatedBy(), - CreatedAt: src.BaseInfo.CreatedAt, - UpdatedAt: src.BaseInfo.UpdatedAt, - DeletedAt: src.BaseInfo.DeletedAt, - }, + BaseInfo: &entity.BaseInfo{}, + } + if src.BaseInfo != nil { + record.BaseInfo.CreatedAt = src.BaseInfo.CreatedAt + record.BaseInfo.UpdatedAt = src.BaseInfo.UpdatedAt + record.BaseInfo.DeletedAt = src.BaseInfo.DeletedAt } + return record } func UnixMsPtr2Time(ms *int64) time.Time { From d9f20745d245833a937f8ecbdabc6747eb55a0a7 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 16:45:26 +0800 Subject: [PATCH 073/100] fix(evaluation): EvalTargetVersionDTO2DO panic --- .../evaluation/application/convertor/target/eval_target.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target.go b/backend/modules/evaluation/application/convertor/target/eval_target.go index 55d2fa921..0eed636f6 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target.go @@ -70,6 +70,7 @@ func EvalTargetVersionDTO2DO(targetVersionDTO *dto.EvalTargetVersion) (targetVer Description: targetVersionDTO.GetEvalTargetContent().GetPrompt().GetDescription(), } } + targetVersionDO.CustomRPCServer = CustomRPCServerDTO2DO(targetVersionDTO.GetEvalTargetContent().GetCustomRPCServer()) targetVersionDO.RuntimeParamDemo = gptr.Of(targetVersionDTO.GetEvalTargetContent().GetRuntimeParamJSONDemo()) } From 3812a8374a72afdc3e9564b77ebb198312ed149e Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 18:43:25 +0800 Subject: [PATCH 074/100] fix(evaluation): record nil --- backend/modules/evaluation/domain/service/target_impl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 2c6ac51e0..c0cdf5a2e 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -488,6 +488,10 @@ func (e *EvalTargetServiceImpl) ReportInvokeRecords(ctx context.Context, param * return err } + if record == nil { + return errorx.NewByCode(errno.CommonBadRequestCode, errorx.WithExtraMsg(fmt.Sprintf("target record not found %d, space_id %d", param.RecordID, param.SpaceID))) + } + if status := gptr.Indirect(record.Status); status != entity.EvalTargetRunStatusAsyncInvoking { return errorx.NewByCode(errno.CommonBadRequestCode, errorx.WithExtraMsg(fmt.Sprintf("unexpected target result status %d", status))) } From c1eac3991ce11e26c1c851b29eac1051c82e198f Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 20:27:33 +0800 Subject: [PATCH 075/100] fix(evaluation): target service createrecord --- .../evaluation/domain/service/mocks/target.go | 14 ++++++++++++++ .../modules/evaluation/domain/service/target.go | 1 + .../evaluation/domain/service/target_impl.go | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/backend/modules/evaluation/domain/service/mocks/target.go b/backend/modules/evaluation/domain/service/mocks/target.go index 223b699ff..ad0ebf42e 100644 --- a/backend/modules/evaluation/domain/service/mocks/target.go +++ b/backend/modules/evaluation/domain/service/mocks/target.go @@ -139,6 +139,20 @@ func (mr *MockIEvalTargetServiceMockRecorder) CreateEvalTarget(ctx, spaceID, sou return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateEvalTarget", reflect.TypeOf((*MockIEvalTargetService)(nil).CreateEvalTarget), varargs...) } +// CreateRecord mocks base method. +func (m *MockIEvalTargetService) CreateRecord(ctx context.Context, record *entity.EvalTargetRecord) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRecord", ctx, record) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateRecord indicates an expected call of CreateRecord. +func (mr *MockIEvalTargetServiceMockRecorder) CreateRecord(ctx, record any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRecord", reflect.TypeOf((*MockIEvalTargetService)(nil).CreateRecord), ctx, record) +} + // DebugTarget mocks base method. func (m *MockIEvalTargetService) DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (*entity.EvalTargetRecord, error) { m.ctrl.T.Helper() diff --git a/backend/modules/evaluation/domain/service/target.go b/backend/modules/evaluation/domain/service/target.go index ba5ef7af5..96690d11d 100644 --- a/backend/modules/evaluation/domain/service/target.go +++ b/backend/modules/evaluation/domain/service/target.go @@ -22,6 +22,7 @@ type IEvalTargetService interface { DebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, err error) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, callee string, err error) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) + CreateRecord(ctx context.Context, record *entity.EvalTargetRecord) error BatchGetRecordByIDs(ctx context.Context, spaceID int64, recordIDs []int64) ([]*entity.EvalTargetRecord, error) ReportInvokeRecords(ctx context.Context, recordID2Params *entity.ReportTargetRecordParam) error ValidateRuntimeParam(ctx context.Context, targetType entity.EvalTargetType, runtimeParam string) error diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index c0cdf5a2e..21483471d 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -470,6 +470,11 @@ func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *ent return record, callee, nil } +func (e *EvalTargetServiceImpl) CreateRecord(ctx context.Context, record *entity.EvalTargetRecord) error { + _, err := e.evalTargetRepo.CreateEvalTargetRecord(ctx, record) + return err +} + func (e *EvalTargetServiceImpl) GetRecordByID(ctx context.Context, spaceID int64, recordID int64) (*entity.EvalTargetRecord, error) { return e.evalTargetRepo.GetEvalTargetRecordByIDAndSpaceID(ctx, spaceID, recordID) } From eb73f9fc5e7e7bb85cd4a0ad879817846f1e666a Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 25 Sep 2025 21:59:38 +0800 Subject: [PATCH 076/100] fix(evaluation): asyncevalctx --- .../coze.loop.evaluation.eval_target.go | 77 +++++++++++++++++++ .../k-coze.loop.evaluation.eval_target.go | 56 ++++++++++++++ .../evaluation/application/eval_target_app.go | 3 +- .../modules/evaluation/application/wire.go | 1 - .../evaluation/application/wire_gen.go | 13 ++-- .../evaluation/domain/service/target_impl.go | 20 +---- .../domain/service/target_impl_test.go | 2 +- .../coze.loop.evaluation.eval_target.thrift | 1 + 8 files changed, 143 insertions(+), 30 deletions(-) diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go index 7433dae7c..962ad6eb0 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/coze.loop.evaluation.eval_target.go @@ -11698,6 +11698,7 @@ func (p *AsyncDebugEvalTargetRequest) Field255DeepEqual(src *base.Base) bool { type AsyncDebugEvalTargetResponse struct { InvokeID int64 `thrift:"invoke_id,1,required" frugal:"1,required,i64" json:"invoke_id" form:"invoke_id,required" query:"invoke_id,required"` + Callee *string `thrift:"callee,2,optional" frugal:"2,optional,string" form:"callee" json:"callee,omitempty" query:"callee"` BaseResp *base.BaseResp `thrift:"BaseResp,255" frugal:"255,default,base.BaseResp" form:"BaseResp" json:"BaseResp" query:"BaseResp"` } @@ -11715,6 +11716,18 @@ func (p *AsyncDebugEvalTargetResponse) GetInvokeID() (v int64) { return } +var AsyncDebugEvalTargetResponse_Callee_DEFAULT string + +func (p *AsyncDebugEvalTargetResponse) GetCallee() (v string) { + if p == nil { + return + } + if !p.IsSetCallee() { + return AsyncDebugEvalTargetResponse_Callee_DEFAULT + } + return *p.Callee +} + var AsyncDebugEvalTargetResponse_BaseResp_DEFAULT *base.BaseResp func (p *AsyncDebugEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { @@ -11729,15 +11742,23 @@ func (p *AsyncDebugEvalTargetResponse) GetBaseResp() (v *base.BaseResp) { func (p *AsyncDebugEvalTargetResponse) SetInvokeID(val int64) { p.InvokeID = val } +func (p *AsyncDebugEvalTargetResponse) SetCallee(val *string) { + p.Callee = val +} func (p *AsyncDebugEvalTargetResponse) SetBaseResp(val *base.BaseResp) { p.BaseResp = val } var fieldIDToName_AsyncDebugEvalTargetResponse = map[int16]string{ 1: "invoke_id", + 2: "callee", 255: "BaseResp", } +func (p *AsyncDebugEvalTargetResponse) IsSetCallee() bool { + return p.Callee != nil +} + func (p *AsyncDebugEvalTargetResponse) IsSetBaseResp() bool { return p.BaseResp != nil } @@ -11770,6 +11791,14 @@ func (p *AsyncDebugEvalTargetResponse) Read(iprot thrift.TProtocol) (err error) } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 255: if fieldTypeId == thrift.STRUCT { if err = p.ReadField255(iprot); err != nil { @@ -11824,6 +11853,17 @@ func (p *AsyncDebugEvalTargetResponse) ReadField1(iprot thrift.TProtocol) error p.InvokeID = _field return nil } +func (p *AsyncDebugEvalTargetResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Callee = _field + return nil +} func (p *AsyncDebugEvalTargetResponse) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBaseResp() if err := _field.Read(iprot); err != nil { @@ -11843,6 +11883,10 @@ func (p *AsyncDebugEvalTargetResponse) Write(oprot thrift.TProtocol) (err error) fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -11881,6 +11925,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } +func (p *AsyncDebugEvalTargetResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCallee() { + if err = oprot.WriteFieldBegin("callee", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Callee); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} func (p *AsyncDebugEvalTargetResponse) writeField255(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { goto WriteFieldBeginError @@ -11915,6 +11977,9 @@ func (p *AsyncDebugEvalTargetResponse) DeepEqual(ano *AsyncDebugEvalTargetRespon if !p.Field1DeepEqual(ano.InvokeID) { return false } + if !p.Field2DeepEqual(ano.Callee) { + return false + } if !p.Field255DeepEqual(ano.BaseResp) { return false } @@ -11928,6 +11993,18 @@ func (p *AsyncDebugEvalTargetResponse) Field1DeepEqual(src int64) bool { } return true } +func (p *AsyncDebugEvalTargetResponse) Field2DeepEqual(src *string) bool { + + if p.Callee == src { + return true + } else if p.Callee == nil || src == nil { + return false + } + if strings.Compare(*p.Callee, *src) != 0 { + return false + } + return true +} func (p *AsyncDebugEvalTargetResponse) Field255DeepEqual(src *base.BaseResp) bool { if !p.BaseResp.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go index 7b73cd09a..c413ca259 100644 --- a/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go +++ b/backend/kitex_gen/coze/loop/evaluation/eval_target/k-coze.loop.evaluation.eval_target.go @@ -8516,6 +8516,20 @@ func (p *AsyncDebugEvalTargetResponse) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -8568,6 +8582,20 @@ func (p *AsyncDebugEvalTargetResponse) FastReadField1(buf []byte) (int, error) { return offset, nil } +func (p *AsyncDebugEvalTargetResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Callee = _field + return offset, nil +} + func (p *AsyncDebugEvalTargetResponse) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBaseResp() @@ -8588,6 +8616,7 @@ func (p *AsyncDebugEvalTargetResponse) FastWriteNocopy(buf []byte, w thrift.Noco offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -8598,6 +8627,7 @@ func (p *AsyncDebugEvalTargetResponse) BLength() int { l := 0 if p != nil { l += p.field1Length() + l += p.field2Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -8611,6 +8641,15 @@ func (p *AsyncDebugEvalTargetResponse) fastWriteField1(buf []byte, w thrift.Noco return offset } +func (p *AsyncDebugEvalTargetResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCallee() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Callee) + } + return offset +} + func (p *AsyncDebugEvalTargetResponse) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 255) @@ -8625,6 +8664,15 @@ func (p *AsyncDebugEvalTargetResponse) field1Length() int { return l } +func (p *AsyncDebugEvalTargetResponse) field2Length() int { + l := 0 + if p.IsSetCallee() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Callee) + } + return l +} + func (p *AsyncDebugEvalTargetResponse) field255Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -8640,6 +8688,14 @@ func (p *AsyncDebugEvalTargetResponse) DeepCopy(s interface{}) error { p.InvokeID = src.InvokeID + if src.Callee != nil { + var tmp string + if *src.Callee != "" { + tmp = kutils.StringDeepCopy(*src.Callee) + } + p.Callee = &tmp + } + var _baseResp *base.BaseResp if src.BaseResp != nil { _baseResp = &base.BaseResp{} diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index f85d45ff2..ef3cfa024 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -546,7 +546,7 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req switch request.GetEvalTargetType() { case eval_target_dto.EvalTargetType_CustomRPCServer: - record, _, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ + record, callee, err := e.evalTargetService.AsyncDebugTarget(ctx, &entity.DebugTargetParam{ SpaceID: request.GetWorkspaceID(), PatchyTarget: &entity.EvalTarget{ SpaceID: request.GetWorkspaceID(), @@ -571,6 +571,7 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req } return &eval_target.AsyncDebugEvalTargetResponse{ InvokeID: record.ID, + Callee: gptr.Of(callee), BaseResp: base.NewBaseResp(), }, err default: diff --git a/backend/modules/evaluation/application/wire.go b/backend/modules/evaluation/application/wire.go index 985fc517e..4c17716cc 100644 --- a/backend/modules/evaluation/application/wire.go +++ b/backend/modules/evaluation/application/wire.go @@ -187,7 +187,6 @@ var ( foundation.NewAuthRPCProvider, targetDomainService, flagSet, - evalAsyncRepoSet, ) evalAsyncRepoSet = wire.NewSet( diff --git a/backend/modules/evaluation/application/wire_gen.go b/backend/modules/evaluation/application/wire_gen.go index 51993a198..4ee9fd80f 100644 --- a/backend/modules/evaluation/application/wire_gen.go +++ b/backend/modules/evaluation/application/wire_gen.go @@ -120,9 +120,7 @@ func InitExperimentApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(pms, pes) v2 := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) - iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v2, iEvalAsyncRepo) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v2) iDatasetRPCAdapter := data.NewDatasetRPCAdapter(sds) evaluationSetVersionService := service.NewEvaluationSetVersionServiceImpl(iDatasetRPCAdapter) iEvaluationSetService := service.NewEvaluationSetServiceImpl(iDatasetRPCAdapter) @@ -136,6 +134,8 @@ func InitExperimentApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d iExptManager := service.NewExptManager(exptResultService, iExperimentRepo, iExptRunLogRepo, iExptStatsRepo, iExptItemResultRepo, iExptTurnResultRepo, componentIConfiger, quotaRepo, iLocker, idempotentService, exptEventPublisher, auditClient, idgen2, exptMetric, iLatestWriteTracker, evaluationSetVersionService, iEvaluationSetService, iEvalTargetService, serviceEvaluatorService, benefitSvc, exptAggrResultService) schedulerModeFactory := service.NewSchedulerModeFactory(iExptManager, iExptItemResultRepo, iExptStatsRepo, iExptTurnResultRepo, idgen2, evaluationSetItemService, iExperimentRepo, idempotentService, componentIConfiger, exptEventPublisher, evaluatorRecordService, exptResultService) exptSchedulerEvent := service.NewExptSchedulerSvc(iExptManager, iExperimentRepo, iExptItemResultRepo, iExptTurnResultRepo, iExptStatsRepo, iExptRunLogRepo, idempotentService, componentIConfiger, quotaRepo, iLocker, exptEventPublisher, auditClient, exptMetric, exptResultService, idgen2, evaluationSetItemService, schedulerModeFactory) + iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) + iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) exptItemEvalEvent := service.NewExptRecordEvalService(iExptManager, componentIConfiger, exptEventPublisher, iExptItemResultRepo, iExptTurnResultRepo, iExptStatsRepo, iExperimentRepo, quotaRepo, iLocker, idempotentService, auditClient, exptMetric, exptResultService, iEvalTargetService, evaluationSetItemService, evaluatorRecordService, serviceEvaluatorService, idgen2, benefitSvc, iEvalAsyncRepo) iAuthProvider := foundation.NewAuthRPCProvider(authClient) iExptAnnotateService := service.NewExptAnnotateService(db2, iExptAnnotateRepo, iExptTurnResultRepo, exptEventPublisher, evaluationSetItemService, iExperimentRepo, exptResultService, iExptTurnResultFilterRepo, iExptAggrResultRepo) @@ -205,9 +205,7 @@ func InitEvalTargetApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) v := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) - iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v, iEvalAsyncRepo) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) evalTargetService := NewEvalTargetHandlerImpl(iAuthProvider, iEvalTargetService, v) return evalTargetService } @@ -227,7 +225,7 @@ func InitEvalOpenAPIApplication(ctx context.Context, configFactory conf.IConfigL evalTargetMetrics := metrics3.NewEvalTargetMetrics(meter) iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) v := NewSourceTargetOperators(iPromptRPCAdapter) - iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v, iEvalAsyncRepo) + iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) v2 := NewEvalOpenAPIApplication(iEvalAsyncRepo, exptEventPublisher, iEvalTargetService) return v2, nil } @@ -265,7 +263,6 @@ var ( evalTargetSet = wire.NewSet( NewEvalTargetHandlerImpl, metrics3.NewEvalTargetMetrics, foundation.NewAuthRPCProvider, targetDomainService, flagSet, - evalAsyncRepoSet, ) evalAsyncRepoSet = wire.NewSet(experiment.NewEvalAsyncRepo, dao.NewEvalAsyncDAO) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 21483471d..1c6a63c2b 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -32,21 +32,18 @@ type EvalTargetServiceImpl struct { metric metrics.EvalTargetMetrics evalTargetRepo repo.IEvalTargetRepo typedOperators map[entity.EvalTargetType]ISourceEvalTargetOperateService - evalAsyncRepo repo.IEvalAsyncRepo } func NewEvalTargetServiceImpl(evalTargetRepo repo.IEvalTargetRepo, idgen idgen.IIDGenerator, metric metrics.EvalTargetMetrics, typedOperators map[entity.EvalTargetType]ISourceEvalTargetOperateService, - evalAsyncRepo repo.IEvalAsyncRepo, ) IEvalTargetService { singletonEvalTargetService := &EvalTargetServiceImpl{ evalTargetRepo: evalTargetRepo, idgen: idgen, metric: metric, typedOperators: typedOperators, - evalAsyncRepo: evalAsyncRepo, } return singletonEvalTargetService } @@ -452,22 +449,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D } func (e *EvalTargetServiceImpl) AsyncDebugTarget(ctx context.Context, param *entity.DebugTargetParam) (record *entity.EvalTargetRecord, callee string, err error) { - st := time.Now() - record, callee, err = e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) - if err != nil { - return nil, "", err - } - - if err := e.evalAsyncRepo.SetEvalAsyncCtx(ctx, strconv.FormatInt(record.ID, 10), &entity.EvalAsyncCtx{ - TurnID: record.ID, - AsyncUnixMS: st.UnixMilli(), - Session: &entity.Session{UserID: session.UserIDInCtxOrEmpty(ctx)}, - Callee: callee, - }); err != nil { - return nil, callee, err - } - - return record, callee, nil + return e.asyncExecuteTarget(ctx, param.SpaceID, param.PatchyTarget, &entity.ExecuteTargetCtx{}, param.InputData) } func (e *EvalTargetServiceImpl) CreateRecord(ctx context.Context, record *entity.EvalTargetRecord) error { diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 0ef0f1866..619ba4c74 100644 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -153,7 +153,7 @@ func Test_NewEvalTargetServiceImpl(t *testing.T) { tt.mockSetup() } - serviceInstance := NewEvalTargetServiceImpl(tt.evalTargetRepo, tt.idgen, tt.metric, tt.typedOperators, tt.evalAsyncRepo) + serviceInstance := NewEvalTargetServiceImpl(tt.evalTargetRepo, tt.idgen, tt.metric, tt.typedOperators) actualInstance, ok := serviceInstance.(*EvalTargetServiceImpl) assert.True(t, ok) diff --git a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift index ea0799624..2a1691629 100644 --- a/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift +++ b/idl/thrift/coze/loop/evaluation/coze.loop.evaluation.eval_target.thrift @@ -251,6 +251,7 @@ struct AsyncDebugEvalTargetRequest { struct AsyncDebugEvalTargetResponse { 1: required i64 invoke_id (api.js_conv="true", go.tag = 'json:"invoke_id"') + 2: optional string callee 255: base.BaseResp BaseResp } From 3b27fd14d92f8b5b0a8eefff0b0c111041879707 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 10 Oct 2025 12:49:46 +0800 Subject: [PATCH 077/100] fix(evaluation): target async debug record --- .../api/handler/coze/loop/apis/wire_gen.go | 4 +- .../evaluation/application/eval_target_app.go | 45 ++++++++++++++++++- .../modules/evaluation/application/wire.go | 1 + .../evaluation/application/wire_gen.go | 5 ++- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/backend/api/handler/coze/loop/apis/wire_gen.go b/backend/api/handler/coze/loop/apis/wire_gen.go index 7fec4ce70..22ae5790a 100644 --- a/backend/api/handler/coze/loop/apis/wire_gen.go +++ b/backend/api/handler/coze/loop/apis/wire_gen.go @@ -8,10 +8,7 @@ package apis import ( "context" - "github.com/cloudwego/kitex/pkg/endpoint" - "github.com/google/wire" - "github.com/coze-dev/coze-loop/backend/infra/ck" "github.com/coze-dev/coze-loop/backend/infra/db" "github.com/coze-dev/coze-loop/backend/infra/external/audit" @@ -44,6 +41,7 @@ import ( application6 "github.com/coze-dev/coze-loop/backend/modules/observability/application" application2 "github.com/coze-dev/coze-loop/backend/modules/prompt/application" "github.com/coze-dev/coze-loop/backend/pkg/conf" + "github.com/google/wire" ) // Injectors from wire.go: diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index ef3cfa024..da22b6ed9 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -7,10 +7,12 @@ import ( "context" "strconv" "sync" + "time" "github.com/bytedance/gg/gmap" "github.com/bytedance/gg/gptr" + "github.com/coze-dev/coze-loop/backend/infra/middleware/session" "github.com/coze-dev/coze-loop/backend/kitex_gen/base" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation" eval_target_dto "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" @@ -20,10 +22,12 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/rpc" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" + "github.com/coze-dev/coze-loop/backend/pkg/logs" ) var _ evaluation.EvalTargetService = &EvalTargetApplicationImpl{} @@ -32,6 +36,7 @@ type EvalTargetApplicationImpl struct { auth rpc.IAuthProvider evalTargetService service.IEvalTargetService typedOperators map[entity.EvalTargetType]service.ISourceEvalTargetOperateService + evalAsyncRepo repo.IEvalAsyncRepo } var ( @@ -39,14 +44,18 @@ var ( evalTargetHandler evaluation.EvalTargetService ) -func NewEvalTargetHandlerImpl(auth rpc.IAuthProvider, evalTargetService service.IEvalTargetService, +func NewEvalTargetHandlerImpl( + auth rpc.IAuthProvider, + evalTargetService service.IEvalTargetService, typedOperators map[entity.EvalTargetType]service.ISourceEvalTargetOperateService, + evalAsyncRepo repo.IEvalAsyncRepo, ) evaluation.EvalTargetService { evalTargetHandlerOnce.Do(func() { evalTargetHandler = &EvalTargetApplicationImpl{ auth: auth, evalTargetService: evalTargetService, typedOperators: typedOperators, + evalAsyncRepo: evalAsyncRepo, } }) return evalTargetHandler @@ -539,6 +548,8 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req // return nil, err //} + startTime := time.Now() + userID := session.UserIDInCtxOrEmpty(ctx) inputFields := make(map[string]*spi.Content) if err := json.Unmarshal([]byte(request.GetParam()), &inputFields); err != nil { return nil, errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("param json unmarshal fail")) @@ -569,6 +580,38 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req if err != nil { return nil, err } + + recordID := record.ID + if err := e.evalAsyncRepo.SetEvalAsyncCtx(ctx, strconv.FormatInt(recordID, 10), &entity.EvalAsyncCtx{ + TurnID: recordID, + AsyncUnixMS: startTime.UnixMilli(), + Session: &entity.Session{UserID: userID}, + Callee: callee, + }); err != nil { + return nil, err + } + + if err := e.evalTargetService.CreateRecord(ctx, &entity.EvalTargetRecord{ + ID: recordID, + SpaceID: request.GetWorkspaceID(), + LogID: logs.GetLogID(ctx), + EvalTargetInputData: &entity.EvalTargetInputData{InputFields: gmap.Map(inputFields, func(k string, v *spi.Content) (string, *entity.Content) { return k, target.ToSPIContentDO(v) })}, + EvalTargetOutputData: &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{}, + EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, + TimeConsumingMS: gptr.Of(int64(0)), + }, + Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), + BaseInfo: &entity.BaseInfo{ + CreatedBy: &entity.UserInfo{UserID: gptr.Of(userID)}, + UpdatedBy: &entity.UserInfo{UserID: gptr.Of(userID)}, + CreatedAt: gptr.Of(time.Now().UnixMilli()), + UpdatedAt: gptr.Of(time.Now().UnixMilli()), + }, + }); err != nil { + return nil, err + } + return &eval_target.AsyncDebugEvalTargetResponse{ InvokeID: record.ID, Callee: gptr.Of(callee), diff --git a/backend/modules/evaluation/application/wire.go b/backend/modules/evaluation/application/wire.go index 4c17716cc..985fc517e 100644 --- a/backend/modules/evaluation/application/wire.go +++ b/backend/modules/evaluation/application/wire.go @@ -187,6 +187,7 @@ var ( foundation.NewAuthRPCProvider, targetDomainService, flagSet, + evalAsyncRepoSet, ) evalAsyncRepoSet = wire.NewSet( diff --git a/backend/modules/evaluation/application/wire_gen.go b/backend/modules/evaluation/application/wire_gen.go index 4ee9fd80f..7795a7336 100644 --- a/backend/modules/evaluation/application/wire_gen.go +++ b/backend/modules/evaluation/application/wire_gen.go @@ -206,7 +206,9 @@ func InitEvalTargetApplication(ctx context.Context, idgen2 idgen.IIDGenerator, d iPromptRPCAdapter := prompt.NewPromptRPCAdapter(client, executeClient) v := NewSourceTargetOperators(iPromptRPCAdapter) iEvalTargetService := service.NewEvalTargetServiceImpl(iEvalTargetRepo, idgen2, evalTargetMetrics, v) - evalTargetService := NewEvalTargetHandlerImpl(iAuthProvider, iEvalTargetService, v) + iEvalAsyncDAO := dao.NewEvalAsyncDAO(cmdable) + iEvalAsyncRepo := experiment.NewEvalAsyncRepo(iEvalAsyncDAO) + evalTargetService := NewEvalTargetHandlerImpl(iAuthProvider, iEvalTargetService, v, iEvalAsyncRepo) return evalTargetService } @@ -263,6 +265,7 @@ var ( evalTargetSet = wire.NewSet( NewEvalTargetHandlerImpl, metrics3.NewEvalTargetMetrics, foundation.NewAuthRPCProvider, targetDomainService, flagSet, + evalAsyncRepoSet, ) evalAsyncRepoSet = wire.NewSet(experiment.NewEvalAsyncRepo, dao.NewEvalAsyncDAO) From e15df7d66ab2cfe33897c9edf969727abad8d85e Mon Sep 17 00:00:00 2001 From: liushengyang Date: Fri, 10 Oct 2025 12:51:37 +0800 Subject: [PATCH 078/100] fix(evaluation): target async debug record --- .../evaluation/application/eval_target_app.go | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index da22b6ed9..5b74d05f4 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -27,7 +27,6 @@ import ( "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" "github.com/coze-dev/coze-loop/backend/pkg/errorx" "github.com/coze-dev/coze-loop/backend/pkg/json" - "github.com/coze-dev/coze-loop/backend/pkg/logs" ) var _ evaluation.EvalTargetService = &EvalTargetApplicationImpl{} @@ -591,27 +590,6 @@ func (e EvalTargetApplicationImpl) AsyncDebugEvalTarget(ctx context.Context, req return nil, err } - if err := e.evalTargetService.CreateRecord(ctx, &entity.EvalTargetRecord{ - ID: recordID, - SpaceID: request.GetWorkspaceID(), - LogID: logs.GetLogID(ctx), - EvalTargetInputData: &entity.EvalTargetInputData{InputFields: gmap.Map(inputFields, func(k string, v *spi.Content) (string, *entity.Content) { return k, target.ToSPIContentDO(v) })}, - EvalTargetOutputData: &entity.EvalTargetOutputData{ - OutputFields: map[string]*entity.Content{}, - EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 0, OutputTokens: 0}, - TimeConsumingMS: gptr.Of(int64(0)), - }, - Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), - BaseInfo: &entity.BaseInfo{ - CreatedBy: &entity.UserInfo{UserID: gptr.Of(userID)}, - UpdatedBy: &entity.UserInfo{UserID: gptr.Of(userID)}, - CreatedAt: gptr.Of(time.Now().UnixMilli()), - UpdatedAt: gptr.Of(time.Now().UnixMilli()), - }, - }); err != nil { - return nil, err - } - return &eval_target.AsyncDebugEvalTargetResponse{ InvokeID: record.ID, Callee: gptr.Of(callee), From 31cac6e1e59fa07b5644b475de09ad5146708f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 10 Oct 2025 19:25:51 +0800 Subject: [PATCH 079/100] add test Change-Id: Ic9e5644f0aa580a0331ea4e44db72a044002246c --- .../coze/loop/apis/eval_open_apiservice.go | 3 + .../convertor/target/eval_target_test.go | 85 +++++++++++++++++++ .../application/experiment_app_test.go | 3 + 3 files changed, 91 insertions(+) diff --git a/backend/api/handler/coze/loop/apis/eval_open_apiservice.go b/backend/api/handler/coze/loop/apis/eval_open_apiservice.go index 830dc7d66..80d836f98 100644 --- a/backend/api/handler/coze/loop/apis/eval_open_apiservice.go +++ b/backend/api/handler/coze/loop/apis/eval_open_apiservice.go @@ -1,3 +1,6 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + // Code generated by hertz generator. package apis diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_test.go index c0d334a7e..232add112 100755 --- a/backend/modules/evaluation/application/convertor/target/eval_target_test.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_test.go @@ -117,12 +117,50 @@ func TestEvalTargetVersionDTO2DO(t *testing.T) { SourceTargetVersion: "v1.0", }, }, + { + name: "自定义对象转换", + targetVersionDTO: &dto.EvalTargetVersion{ + ID: gptr.Of(int64(1)), + WorkspaceID: gptr.Of(int64(2)), + TargetID: gptr.Of(int64(3)), + SourceTargetVersion: gptr.Of("v1.0"), + EvalTargetContent: &dto.EvalTargetContent{ + CustomRPCServer: &dto.CustomRPCServer{ + ID: gptr.Of(int64(4)), + Name: gptr.Of("test"), + InvokeHTTPInfo: &dto.HTTPInfo{ + Method: gptr.Of(""), + Path: gptr.Of(""), + }, + CustomEvalTarget: &dto.CustomEvalTarget{ + ID: gptr.Of(""), + Name: gptr.Of(""), + AvatarURL: gptr.Of(""), + }, + }, + }, + }, + expected: &do.EvalTargetVersion{ + ID: 1, + SpaceID: 2, + TargetID: 3, + SourceTargetVersion: "v1.0", + CustomRPCServer: &do.CustomRPCServer{ + ID: 4, + Name: "test", + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { t.Parallel() result := EvalTargetVersionDTO2DO(tt.targetVersionDTO) + if tt.name == "自定义对象转换" { + assert.Equal(t, result.CustomRPCServer.Name, tt.expected.CustomRPCServer.Name) + return + } assert.Equal(t, tt.expected, result) }) } @@ -311,6 +349,53 @@ func TestEvalTargetVersionDO2DTO(t *testing.T) { }, }, }, + { + name: "自定义对象转换", + targetVersionDO: &do.EvalTargetVersion{ + ID: 1, + SpaceID: 2, + TargetID: 3, + SourceTargetVersion: "v1.0", + EvalTargetType: do.EvalTargetTypeCustomRPCServer, + CustomRPCServer: &do.CustomRPCServer{ + Name: "test", + Description: "test", + InvokeHTTPInfo: &do.HTTPInfo{ + Method: "GET", + Path: "/test", + }, + AsyncInvokeHTTPInfo: &do.HTTPInfo{ + Method: "GET", + Path: "/test", + }, + SearchHTTPInfo: &do.HTTPInfo{ + Method: "GET", + Path: "/test", + }, + CustomEvalTarget: &do.CustomEvalTarget{ + Name: gptr.Of("test"), + }, + IsAsync: gptr.Of(true), + Ext: map[string]string{ + "test": "test", + }, + }, + VolcengineAgent: &do.VolcengineAgent{ + VolcengineAgentEndpoints: []*do.VolcengineAgentEndpoint{ + { + EndpointID: "test", + APIKey: "test", + }, + }, + }, + }, + expected: &dto.EvalTargetVersion{ + ID: gptr.Of(int64(1)), + WorkspaceID: gptr.Of(int64(2)), + TargetID: gptr.Of(int64(3)), + SourceTargetVersion: gptr.Of("v1.0"), + }, + }, } for _, tt := range tests { diff --git a/backend/modules/evaluation/application/experiment_app_test.go b/backend/modules/evaluation/application/experiment_app_test.go index cd439d55e..f585afd31 100644 --- a/backend/modules/evaluation/application/experiment_app_test.go +++ b/backend/modules/evaluation/application/experiment_app_test.go @@ -74,6 +74,9 @@ func TestExperimentApplication_CreateExperiment(t *testing.T) { Desc: gptr.Of("test description"), CreateEvalTargetParam: &eval_target.CreateEvalTargetParam{ EvalTargetType: gptr.Of(domain_eval_target.EvalTargetType_CozeBot), + CustomEvalTarget: &domain_eval_target.CustomEvalTarget{ + Name: gptr.Of("test"), + }, }, Session: &common.Session{ UserID: gptr.Of(int64(789)), From 98ac15f663b5f1d187deffe65abf06dc636c4a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 10 Oct 2025 21:38:09 +0800 Subject: [PATCH 080/100] fix Change-Id: I0d43dc00d3efb12c9661e1b7f4576dcb22ed5ed1 --- .../convertor/target/eval_target_test.go | 8 ---- .../application/eval_target_app_test.go | 3 ++ .../mysql/convertor/eval_target_test.go | 37 +++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_test.go index 232add112..ff3b19e0e 100755 --- a/backend/modules/evaluation/application/convertor/target/eval_target_test.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_test.go @@ -380,14 +380,6 @@ func TestEvalTargetVersionDO2DTO(t *testing.T) { "test": "test", }, }, - VolcengineAgent: &do.VolcengineAgent{ - VolcengineAgentEndpoints: []*do.VolcengineAgentEndpoint{ - { - EndpointID: "test", - APIKey: "test", - }, - }, - }, }, expected: &dto.EvalTargetVersion{ ID: gptr.Of(int64(1)), diff --git a/backend/modules/evaluation/application/eval_target_app_test.go b/backend/modules/evaluation/application/eval_target_app_test.go index 8af27f320..c32f53556 100644 --- a/backend/modules/evaluation/application/eval_target_app_test.go +++ b/backend/modules/evaluation/application/eval_target_app_test.go @@ -64,6 +64,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { EvalTargetType: &validEvalTargetType, BotInfoType: &validBotInfoType, BotPublishVersion: &validBotPublishVersion, + CustomEvalTarget: &domain_eval_target.CustomEvalTarget{ + Name: gptr.Of("test"), + }, }, }, mockSetup: func() { diff --git a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target_test.go b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target_test.go index 757994820..5824d387c 100755 --- a/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target_test.go +++ b/backend/modules/evaluation/infra/repo/target/mysql/convertor/eval_target_test.go @@ -158,6 +158,26 @@ func TestEvalTargetVersionDO2PO(t *testing.T) { assert.NotNil(t, po.TargetMeta) }, }, + { + name: "自定义对象版本转换", + do: &entity.EvalTargetVersion{ + ID: 1, + SpaceID: 2, + TargetID: 3, + SourceTargetVersion: "v2.0", + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + CustomRPCServer: &entity.CustomRPCServer{ + Name: "Test Prompt", + Description: "Test prompt description", + }, + }, + expectError: false, + checkResult: func(t *testing.T, po *model.TargetVersion) { + assert.Equal(t, int64(1), po.ID) + assert.Equal(t, "v2.0", po.SourceTargetVersion) + assert.NotNil(t, po.TargetMeta) + }, + }, } for _, tt := range tests { @@ -356,6 +376,23 @@ func TestEvalTargetVersionPO2DO(t *testing.T) { assert.Equal(t, int64(1), do.ID) }, }, + { + name: "自定义对象的版本转换", + targetVersionPO: &model.TargetVersion{ + ID: 1, + SpaceID: 2, + TargetID: 3, + SourceTargetVersion: "v2.0", + TargetMeta: gptr.Of([]byte(`{"id":1}`)), + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + }, + targetType: entity.EvalTargetTypeCustomRPCServer, + checkResult: func(t *testing.T, do *entity.EvalTargetVersion) { + assert.NotNil(t, do) + assert.Equal(t, int64(1), do.ID) + }, + }, } for _, tt := range tests { From 0d7bc0e6a37c60a828bb0c578c97e71c94275dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 10 Oct 2025 21:49:00 +0800 Subject: [PATCH 081/100] fix Change-Id: I4d7713ab45e038d8e11f2d89a4b054281392a08b --- .../application/eval_target_app_test.go | 298 ++++++++++++++++++ 1 file changed, 298 insertions(+) diff --git a/backend/modules/evaluation/application/eval_target_app_test.go b/backend/modules/evaluation/application/eval_target_app_test.go index c32f53556..eda4aa31c 100644 --- a/backend/modules/evaluation/application/eval_target_app_test.go +++ b/backend/modules/evaluation/application/eval_target_app_test.go @@ -1131,6 +1131,304 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { } } +func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + // Setup mocks + mockAuth := rpcmocks.NewMockIAuthProvider(ctrl) + mockTypedOperator := mocks.NewMockISourceEvalTargetOperateService(ctrl) + + app := &EvalTargetApplicationImpl{ + auth: mockAuth, + typedOperators: map[entity.EvalTargetType]service.ISourceEvalTargetOperateService{ + entity.EvalTargetTypeCustomRPCServer: mockTypedOperator, + }, + } + + // Test data + validSpaceID := int64(123) + validApplicationID := int64(456) + validKeyword := "test keyword" + validRegion := "cn" + validEnv := "prod" + validPageSize := int32(10) + validPageToken := "token123" + validCustomRPCServer := &domain_eval_target.CustomRPCServer{ + ID: gptr.Of(int64(789)), + Name: gptr.Of("test server"), + Description: gptr.Of("test description"), + ServerName: gptr.Of("test-server"), + AccessProtocol: gptr.Of("rpc"), + Cluster: gptr.Of("test-cluster"), + } + + validCustomEvalTargets := []*entity.CustomEvalTarget{ + { + ID: gptr.Of("target-1"), + Name: gptr.Of("Test Target 1"), + AvatarURL: gptr.Of("http://example.com/avatar1.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + { + ID: gptr.Of("target-2"), + Name: gptr.Of("Test Target 2"), + AvatarURL: gptr.Of("http://example.com/avatar2.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + } + + tests := []struct { + name string + req *eval_target.SearchCustomEvalTargetRequest + mockSetup func() + wantResp *eval_target.SearchCustomEvalTargetResponse + wantErr bool + wantErrCode int32 + }{ + { + name: "success - normal request with applicationID", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + Env: &validEnv, + PageSize: &validPageSize, + PageToken: &validPageToken, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(validSpaceID, 10), + SpaceID: validSpaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of("listLoopEvaluationTarget"), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + }).Return(nil) + + mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), &entity.SearchCustomEvalTargetParam{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + CustomRPCServer: nil, + Region: &validRegion, + Env: &validEnv, + PageSize: &validPageSize, + PageToken: &validPageToken, + }).Return(validCustomEvalTargets, "next-token", true, nil) + }, + wantResp: &eval_target.SearchCustomEvalTargetResponse{ + CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{ + { + ID: gptr.Of("target-1"), + Name: gptr.Of("Test Target 1"), + AvatarURL: gptr.Of("http://example.com/avatar1.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + { + ID: gptr.Of("target-2"), + Name: gptr.Of("Test Target 2"), + AvatarURL: gptr.Of("http://example.com/avatar2.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + }, + NextPageToken: gptr.Of("next-token"), + HasMore: gptr.Of(true), + }, + wantErr: false, + }, + { + name: "success - normal request with customRPCServer", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + CustomRPCServer: validCustomRPCServer, + Region: &validRegion, + Env: &validEnv, + PageSize: &validPageSize, + PageToken: &validPageToken, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(validSpaceID, 10), + SpaceID: validSpaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of("listLoopEvaluationTarget"), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + }).Return(nil) + + mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), gomock.Any()).Return(validCustomEvalTargets, "next-token", true, nil) + }, + wantResp: &eval_target.SearchCustomEvalTargetResponse{ + CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{ + { + ID: gptr.Of("target-1"), + Name: gptr.Of("Test Target 1"), + AvatarURL: gptr.Of("http://example.com/avatar1.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + { + ID: gptr.Of("target-2"), + Name: gptr.Of("Test Target 2"), + AvatarURL: gptr.Of("http://example.com/avatar2.jpg"), + Ext: map[string]string{"type": "custom"}, + }, + }, + NextPageToken: gptr.Of("next-token"), + HasMore: gptr.Of(true), + }, + wantErr: false, + }, + { + name: "error - nil request", + req: nil, + mockSetup: func() {}, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "error - nil workspaceID", + req: &eval_target.SearchCustomEvalTargetRequest{ + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + }, + mockSetup: func() {}, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "error - both applicationID and customRPCServer are nil", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + Region: &validRegion, + }, + mockSetup: func() {}, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "error - nil region", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + }, + mockSetup: func() {}, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "error - target type not support", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + }, + mockSetup: func() { + // Create app without typedOperators for CustomRPCServer + app.typedOperators = map[entity.EvalTargetType]service.ISourceEvalTargetOperateService{} + }, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "error - auth failed", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()). + Return(errorx.NewByCode(errno.CommonNoPermissionCode)) + }, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonNoPermissionCode, + }, + { + name: "error - service failure", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(nil) + mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), gomock.Any()). + Return(nil, "", false, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantResp: nil, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "success - empty results", + req: &eval_target.SearchCustomEvalTargetRequest{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(validSpaceID, 10), + SpaceID: validSpaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of("listLoopEvaluationTarget"), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + }).Return(nil) + + mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), &entity.SearchCustomEvalTargetParam{ + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + CustomRPCServer: nil, + Region: &validRegion, + Env: nil, + PageSize: nil, + PageToken: nil, + }).Return([]*entity.CustomEvalTarget{}, "", false, nil) + }, + wantResp: &eval_target.SearchCustomEvalTargetResponse{ + CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{}, + NextPageToken: gptr.Of(""), + HasMore: gptr.Of(false), + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Reset typedOperators for each test + app.typedOperators = map[entity.EvalTargetType]service.ISourceEvalTargetOperateService{ + entity.EvalTargetTypeCustomRPCServer: mockTypedOperator, + } + + tt.mockSetup() + + resp, err := app.SearchCustomEvalTarget(context.Background(), tt.req) + + if tt.wantErr { + assert.Error(t, err) + if tt.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tt.wantErrCode, statusErr.Code()) + } + } else { + assert.NoError(t, err) + assert.Equal(t, tt.wantResp, resp) + } + }) + } +} + func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() From d784688055cee2751d2046c4df348d72ac30cc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Fri, 10 Oct 2025 22:12:12 +0800 Subject: [PATCH 082/100] fix Change-Id: Id81ce7c9149fa4b21bd843cfa50f662c7742ba64 --- .../modules/evaluation/domain/service/expt_manage_impl_test.go | 2 +- .../evaluation/domain/service/expt_run_item_event_impl_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/modules/evaluation/domain/service/expt_manage_impl_test.go b/backend/modules/evaluation/domain/service/expt_manage_impl_test.go index f54f187c4..04395717c 100644 --- a/backend/modules/evaluation/domain/service/expt_manage_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_manage_impl_test.go @@ -147,7 +147,7 @@ func TestExptMangerImpl_CreateExpt(t *testing.T) { mgr.evalTargetService.(*svcMocks.MockIEvalTargetService). EXPECT(). - CreateEvalTarget(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + CreateEvalTarget(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). Return(int64(100), int64(101), nil).AnyTimes() mgr.evalTargetService.(*svcMocks.MockIEvalTargetService). EXPECT(). diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go index 49714408e..253ee2efe 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go @@ -716,6 +716,7 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { prepare: func() { mockIdgen.EXPECT().GenMultiIDs(gomock.Any(), gomock.Any()).Return([]int64{1}, nil) mockExptTurnResultRepo.EXPECT().BatchCreateNXRunLog(gomock.Any(), gomock.Any()).Return(nil) + mockExptTurnResultRepo.EXPECT().GetItemTurnRunLogs(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]*entity.ExptTurnResultRunLog{}, nil) }, eiec: &entity.ExptItemEvalCtx{ Event: &entity.ExptItemEvalEvent{ From 9f85e6f3b597548626af2f56d7f9884ecd1f1816 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Sat, 11 Oct 2025 11:59:05 +0800 Subject: [PATCH 083/100] fix(evaluation): spi exec err --- .../evaluation/domain/service/target_impl.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index cdf8d0ca4..7585ca9a0 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -389,21 +389,10 @@ func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID EvalTarget: target, }) if execErr != nil { + // If an asynchronous call fails, return immediately without logging the error or propagating the exception. + // Avoid triggering a follow-up process via an asynchronous callback after a successful return. logs.CtxError(ctx, "async execute target failed, spaceID=%v, targetID=%d, targetVersionID=%d, param=%v, inputData=%v, err=%v", spaceID, targetID, targetVersionID, json.Jsonify(param), json.Jsonify(inputData), execErr) - // status = entity.EvalTargetRunStatusFail - // statusErr, ok := errorx.FromStatusError(execErr) - // if ok { - // outputData.EvalTargetRunError = &entity.EvalTargetRunError{ - // Code: statusErr.Code(), - // Message: statusErr.Error(), - // } - // } else { - // outputData.EvalTargetRunError = &entity.EvalTargetRunError{ - // Code: errno.CommonInternalErrorCode, - // Message: execErr.Error(), - // } - // } return nil, callee, execErr } @@ -471,7 +460,7 @@ func (e *EvalTargetServiceImpl) DebugTarget(ctx context.Context, param *entity.D if ok { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ Code: statusErr.Code(), - Message: statusErr.Error(), + Message: errorx.ErrorWithoutStack(execErr), } } else { outputData.EvalTargetRunError = &entity.EvalTargetRunError{ From 72765636615c064d6a2bf32366db814ecdd1190d Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 13 Oct 2025 17:16:36 +0800 Subject: [PATCH 084/100] fix(evaluation): EvalTarget span error --- backend/modules/evaluation/domain/service/target_impl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 7585ca9a0..11f5e1ab6 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -5,6 +5,7 @@ package service import ( "context" + "errors" "fmt" "runtime" "strconv" @@ -336,6 +337,9 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID, targ spanParam.TargetType = evalTargetDO.EvalTargetType.String() spanParam.TargetID = strconv.FormatInt(targetID, 10) spanParam.TargetVersion = strconv.FormatInt(targetVersionID, 10) + if outputData.EvalTargetRunError != nil { + span.SetError(ctx, errors.New(outputData.EvalTargetRunError.Message)) + } setSpanInputOutput(ctx, spanParam, inputData, outputData) return record, nil From 9d35c7bd3d4281540e9a9ba3742ef7d216294c96 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 13 Oct 2025 20:51:23 +0800 Subject: [PATCH 085/100] fix(evaluation): ut --- .../modules/evaluation/domain/entity/expt.go | 3 ++ .../service/expt_run_item_event_impl_test.go | 51 +++++++++++-------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/backend/modules/evaluation/domain/entity/expt.go b/backend/modules/evaluation/domain/entity/expt.go index 5f3ba6c40..69f7266e1 100644 --- a/backend/modules/evaluation/domain/entity/expt.go +++ b/backend/modules/evaluation/domain/entity/expt.go @@ -131,6 +131,9 @@ func (e *Experiment) AsyncExec() bool { } func (e *Experiment) AsyncCallTarget() bool { + if e == nil || e.Target == nil || e.Target.EvalTargetVersion == nil || e.Target.EvalTargetVersion.CustomRPCServer == nil { + return false + } return gptr.Indirect(e.Target.EvalTargetVersion.CustomRPCServer.IsAsync) } diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go index 253ee2efe..7483c88a6 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go @@ -685,19 +685,6 @@ func TestNewRecordEvalMode(t *testing.T) { } func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockExptItemResultRepo := repoMocks.NewMockIExptItemResultRepo(ctrl) - mockExptTurnResultRepo := repoMocks.NewMockIExptTurnResultRepo(ctrl) - mockIdgen := idgenmocks.NewMockIIDGenerator(ctrl) - - mode := &ExptRecordEvalModeSubmit{ - exptItemResultRepo: mockExptItemResultRepo, - exptTurnResultRepo: mockExptTurnResultRepo, - idgen: mockIdgen, - } - mockEvalSetItem := &entity.EvaluationSetItem{ ID: 1, Turns: []*entity.Turn{ @@ -707,22 +694,21 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { tests := []struct { name string - prepare func() + prepare func(mockExptItemResultRepo *repoMocks.MockIExptItemResultRepo, mockExptTurnResultRepo *repoMocks.MockIExptTurnResultRepo, mockIdgen *idgenmocks.MockIIDGenerator) eiec *entity.ExptItemEvalCtx wantErr bool }{ { name: "正常流程", - prepare: func() { - mockIdgen.EXPECT().GenMultiIDs(gomock.Any(), gomock.Any()).Return([]int64{1}, nil) - mockExptTurnResultRepo.EXPECT().BatchCreateNXRunLog(gomock.Any(), gomock.Any()).Return(nil) - mockExptTurnResultRepo.EXPECT().GetItemTurnRunLogs(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]*entity.ExptTurnResultRunLog{}, nil) + prepare: func(_ *repoMocks.MockIExptItemResultRepo, mockExptTurnResultRepo *repoMocks.MockIExptTurnResultRepo, _ *idgenmocks.MockIIDGenerator) { + // placeholder to satisfy type; real expectations set below per-correct types }, eiec: &entity.ExptItemEvalCtx{ Event: &entity.ExptItemEvalEvent{ ExptID: 1, ExptRunID: 2, SpaceID: 3, + EvalSetItemID: 1, }, EvalSetItem: mockEvalSetItem, ExistItemEvalResult: &entity.ExptItemEvalResult{ @@ -733,7 +719,8 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { }, { name: "生成ID失败", - prepare: func() { + prepare: func(_ *repoMocks.MockIExptItemResultRepo, mockExptTurnResultRepo *repoMocks.MockIExptTurnResultRepo, mockIdgen *idgenmocks.MockIIDGenerator) { + mockExptTurnResultRepo.EXPECT().GetItemTurnRunLogs(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]*entity.ExptTurnResultRunLog{}, nil) mockIdgen.EXPECT().GenMultiIDs(gomock.Any(), gomock.Any()).Return(nil, errors.New("mock error")) }, eiec: &entity.ExptItemEvalCtx{ @@ -747,7 +734,8 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { }, { name: "创建运行日志失败", - prepare: func() { + prepare: func(_ *repoMocks.MockIExptItemResultRepo, mockExptTurnResultRepo *repoMocks.MockIExptTurnResultRepo, mockIdgen *idgenmocks.MockIIDGenerator) { + mockExptTurnResultRepo.EXPECT().GetItemTurnRunLogs(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]*entity.ExptTurnResultRunLog{}, nil) mockIdgen.EXPECT().GenMultiIDs(gomock.Any(), gomock.Any()).Return([]int64{1}, nil) mockExptTurnResultRepo.EXPECT().BatchCreateNXRunLog(gomock.Any(), gomock.Any()).Return(errors.New("mock error")) }, @@ -764,7 +752,28 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tt.prepare() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockExptItemResultRepo := repoMocks.NewMockIExptItemResultRepo(ctrl) + mockExptTurnResultRepo := repoMocks.NewMockIExptTurnResultRepo(ctrl) + mockIdgen := idgenmocks.NewMockIIDGenerator(ctrl) + + // 每个子用例独立设置期望 + if tt.name == "正常流程" { + mockExptTurnResultRepo.EXPECT().GetItemTurnRunLogs(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return([]*entity.ExptTurnResultRunLog{}, nil) + mockIdgen.EXPECT().GenMultiIDs(gomock.Any(), gomock.Any()).Return([]int64{1}, nil) + mockExptTurnResultRepo.EXPECT().BatchCreateNXRunLog(gomock.Any(), gomock.Any()).Return(nil) + } else { + tt.prepare(mockExptItemResultRepo, mockExptTurnResultRepo, mockIdgen) + } + + mode := &ExptRecordEvalModeSubmit{ + exptItemResultRepo: mockExptItemResultRepo, + exptTurnResultRepo: mockExptTurnResultRepo, + idgen: mockIdgen, + } + err := mode.PreEval(context.Background(), tt.eiec) if tt.wantErr { assert.Error(t, err) From 2d4ffca4470f0f476699283bb073fc5a919c45ac Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 13 Oct 2025 21:28:21 +0800 Subject: [PATCH 086/100] fix(evaluation): ut panic --- .../domain/service/expt_run_item_turn_impl.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 73529563f..19a802347 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -195,13 +195,16 @@ func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *en return fields, nil } - inputFields, err := buildInputFields(targetConf.IngressConf.EvalSetAdapter.FieldConfs) - if err != nil { - return nil, err + var inputFields map[string]*entity.Content + if targetConf.IngressConf != nil && targetConf.IngressConf.EvalSetAdapter != nil { + inputFields, err = buildInputFields(targetConf.IngressConf.EvalSetAdapter.FieldConfs) + if err != nil { + return nil, err + } } ext := gmap.Clone(etec.Ext) - if targetConf.IngressConf.CustomConf != nil { + if targetConf.IngressConf != nil && targetConf.IngressConf.CustomConf != nil { for _, fc := range targetConf.IngressConf.CustomConf.FieldConfs { if fc.FieldName == consts.FieldAdapterBuiltinFieldNameRuntimeParam { ext[consts.TargetExecuteExtRuntimeParamKey] = fc.Value From 36d401c5777aab7890a87ff07118683a082a0009 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Thu, 16 Oct 2025 12:44:47 +0800 Subject: [PATCH 087/100] fix(evaluation): ut --- .../evaluation/domain/service/expt_run_item_turn_impl.go | 2 +- .../domain/service/expt_run_item_turn_impl_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 19a802347..45bcb566b 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -156,7 +156,7 @@ func (e *DefaultExptTurnEvaluationImpl) CheckBenefit(ctx context.Context, exptID } func (e *DefaultExptTurnEvaluationImpl) callTarget(ctx context.Context, etec *entity.ExptTurnEvalCtx, history []*entity.Message, spaceID int64) (record *entity.EvalTargetRecord, err error) { - defer e.metric.EmitTurnExecTargetResult(etec.Event.SpaceID, err != nil) + defer func() { e.metric.EmitTurnExecTargetResult(etec.Event.SpaceID, err != nil) }() turn := etec.Turn targetConf := etec.Expt.EvalConf.ConnectorConf.TargetConf diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go index d99dc21e4..c844aef19 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go @@ -1737,7 +1737,7 @@ func TestDefaultExptTurnEvaluationImpl_callTarget_EdgeCases(t *testing.T) { Target: &entity.EvalTarget{ ID: 1, EvalTargetVersion: &entity.EvalTargetVersion{ID: 1}, - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetType: entity.EvalTargetTypeCozeBot, }, EvalConf: &entity.EvaluationConfiguration{ ConnectorConf: entity.Connector{ @@ -1849,14 +1849,14 @@ func TestDefaultExptTurnEvaluationImpl_callTarget_EdgeCases(t *testing.T) { // Setup mocks based on test case switch tt.name { case "execute target service fails": - mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), false) + mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), true) mockEvalTargetService.EXPECT().ExecuteTarget(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, errors.New("execute target failed")) case "target config validation fails": // For target config validation fails, no ExecuteTarget call should be made - mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), false) + mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), true) default: // For json path parsing error case - mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), false) + mockMetric.EXPECT().EmitTurnExecTargetResult(gomock.Any(), true) } _, err := service.callTarget(context.Background(), tt.etec, tt.history, tt.spaceID) From e83adf93c949e00623944c7f7f66c3ffdc2aab24 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Sun, 19 Oct 2025 23:31:11 +0800 Subject: [PATCH 088/100] test: [Coda] add eval target async debug tests (LogID: 20251019223217192168001011361AB57) Co-Authored-By: Coda --- .../convertor/target/eval_target_test.go | 114 +++++ .../application/eval_target_app_test.go | 402 +++++++++++++++++- 2 files changed, 498 insertions(+), 18 deletions(-) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_test.go index ff3b19e0e..be50802bf 100755 --- a/backend/modules/evaluation/application/convertor/target/eval_target_test.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_test.go @@ -404,3 +404,117 @@ func TestEvalTargetVersionDO2DTO(t *testing.T) { }) } } + +func TestCustomRPCServerConversions(t *testing.T) { + t.Parallel() + + trueVal := true + timeout := int64(1000) + asyncTimeout := int64(2000) + execEnv := "prod" + doValue := &do.CustomRPCServer{ + ID: 123, + Name: "custom", + Description: "desc", + ServerName: "svc", + AccessProtocol: do.AccessProtocolFaasHTTP, + Regions: []do.Region{"cn"}, + Cluster: "default", + InvokeHTTPInfo: &do.HTTPInfo{Method: do.HTTPMethodPost, Path: "/invoke"}, + AsyncInvokeHTTPInfo: &do.HTTPInfo{Method: do.HTTPMethodGet, Path: "/async"}, + NeedSearchTarget: &trueVal, + SearchHTTPInfo: &do.HTTPInfo{Method: do.HTTPMethodGet, Path: "/search"}, + CustomEvalTarget: &do.CustomEvalTarget{ID: gptr.Of("id"), Name: gptr.Of("target"), AvatarURL: gptr.Of("avatar"), Ext: map[string]string{"k": "v"}}, + IsAsync: &trueVal, + ExecRegion: do.RegionCN, + ExecEnv: &execEnv, + Timeout: &timeout, + AsyncTimeout: &asyncTimeout, + Ext: map[string]string{"extra": "value"}, + } + + dtoValue := CustomRPCServerDO2DTO(doValue) + assert.NotNil(t, dtoValue) + assert.Equal(t, doValue.ID, gptr.Indirect(dtoValue.ID)) + assert.Equal(t, doValue.Name, gptr.Indirect(dtoValue.Name)) + assert.Equal(t, doValue.Description, gptr.Indirect(dtoValue.Description)) + assert.Equal(t, doValue.ServerName, gptr.Indirect(dtoValue.ServerName)) + assert.Equal(t, doValue.AccessProtocol, gptr.Indirect(dtoValue.AccessProtocol)) + assert.Equal(t, []string(doValue.Regions), dtoValue.Regions) + assert.Equal(t, doValue.Cluster, gptr.Indirect(dtoValue.Cluster)) + assert.Equal(t, doValue.InvokeHTTPInfo.Path, gptr.Indirect(dtoValue.InvokeHTTPInfo.Path)) + assert.Equal(t, doValue.AsyncInvokeHTTPInfo.Method, gptr.Indirect(dtoValue.AsyncInvokeHTTPInfo.Method)) + assert.Equal(t, doValue.NeedSearchTarget, dtoValue.NeedSearchTarget) + assert.Equal(t, doValue.SearchHTTPInfo.Path, gptr.Indirect(dtoValue.SearchHTTPInfo.Path)) + assert.Equal(t, doValue.CustomEvalTarget.Name, dtoValue.CustomEvalTarget.Name) + assert.Equal(t, doValue.IsAsync, dtoValue.IsAsync) + assert.Equal(t, do.Region(gptr.Indirect(dtoValue.ExecRegion)), doValue.ExecRegion) + assert.Equal(t, doValue.ExecEnv, dtoValue.ExecEnv) + assert.Equal(t, doValue.Timeout, dtoValue.Timeout) + assert.Equal(t, doValue.AsyncTimeout, dtoValue.AsyncTimeout) + assert.Equal(t, doValue.Ext, dtoValue.Ext) + + roundtrip := CustomRPCServerDTO2DO(dtoValue) + assert.Equal(t, doValue.ID, roundtrip.ID) + assert.Equal(t, doValue.Name, roundtrip.Name) + assert.Equal(t, doValue.Description, roundtrip.Description) + assert.Equal(t, doValue.ServerName, roundtrip.ServerName) + assert.Equal(t, doValue.AccessProtocol, roundtrip.AccessProtocol) + assert.Equal(t, doValue.Regions, roundtrip.Regions) + assert.Equal(t, doValue.Cluster, roundtrip.Cluster) + assert.Equal(t, doValue.InvokeHTTPInfo.Method, roundtrip.InvokeHTTPInfo.Method) + assert.Equal(t, doValue.AsyncInvokeHTTPInfo.Path, roundtrip.AsyncInvokeHTTPInfo.Path) + assert.Equal(t, doValue.NeedSearchTarget, roundtrip.NeedSearchTarget) + assert.Equal(t, doValue.SearchHTTPInfo.Method, roundtrip.SearchHTTPInfo.Method) + assert.Equal(t, doValue.CustomEvalTarget.Ext, roundtrip.CustomEvalTarget.Ext) + assert.Equal(t, doValue.IsAsync, roundtrip.IsAsync) + assert.Equal(t, doValue.ExecRegion, roundtrip.ExecRegion) + assert.Equal(t, doValue.ExecEnv, roundtrip.ExecEnv) + assert.Equal(t, doValue.Timeout, roundtrip.Timeout) + assert.Equal(t, doValue.AsyncTimeout, roundtrip.AsyncTimeout) + assert.Equal(t, doValue.Ext, roundtrip.Ext) + + assert.Nil(t, CustomRPCServerDTO2DO(nil)) +} + +func TestCustomEvalTargetConversions(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + dos []*do.CustomEvalTarget + }{ + { + name: "包含nil元素", + dos: []*do.CustomEvalTarget{ + {ID: gptr.Of("1"), Name: gptr.Of("a")}, + nil, + }, + }, + { + name: "nil输入", + dos: nil, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + dtos := CustomEvalTargetDO2DTOs(tt.dos) + if tt.dos == nil { + assert.Nil(t, dtos) + return + } + assert.Len(t, dtos, 1) + assert.Equal(t, gptr.Indirect(tt.dos[0].ID), gptr.Indirect(dtos[0].ID)) + }) + } + + dtoValue := &dto.CustomEvalTarget{ID: gptr.Of("id"), Name: gptr.Of("name"), AvatarURL: gptr.Of("avatar")} + doValue := CustomEvalTargetDTO2DO(dtoValue) + assert.Equal(t, gptr.Indirect(dtoValue.ID), gptr.Indirect(doValue.ID)) + assert.Equal(t, gptr.Indirect(dtoValue.Name), gptr.Indirect(doValue.Name)) + assert.Equal(t, gptr.Indirect(dtoValue.AvatarURL), gptr.Indirect(doValue.AvatarURL)) + assert.Nil(t, CustomEvalTargetDTO2DO(nil)) + assert.Nil(t, CustomEvalTargetDO2DTO(nil)) +} diff --git a/backend/modules/evaluation/application/eval_target_app_test.go b/backend/modules/evaluation/application/eval_target_app_test.go index eda4aa31c..605d3e9c1 100644 --- a/backend/modules/evaluation/application/eval_target_app_test.go +++ b/backend/modules/evaluation/application/eval_target_app_test.go @@ -5,6 +5,7 @@ package application import ( "context" + stdjson "encoding/json" "strconv" "testing" @@ -12,13 +13,16 @@ import ( "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" + domaincommon "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" domain_eval_target "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" "github.com/coze-dev/coze-loop/backend/modules/evaluation/application/convertor/target" "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/rpc" rpcmocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/rpc/mocks" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + repomocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo/mocks" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service/mocks" "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" @@ -1205,14 +1209,14 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }).Return(nil) mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), &entity.SearchCustomEvalTargetParam{ - WorkspaceID: &validSpaceID, - Keyword: &validKeyword, - ApplicationID: &validApplicationID, + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, CustomRPCServer: nil, - Region: &validRegion, - Env: &validEnv, - PageSize: &validPageSize, - PageToken: &validPageToken, + Region: &validRegion, + Env: &validEnv, + PageSize: &validPageSize, + PageToken: &validPageToken, }).Return(validCustomEvalTargets, "next-token", true, nil) }, wantResp: &eval_target.SearchCustomEvalTargetResponse{ @@ -1286,9 +1290,9 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { { name: "error - nil workspaceID", req: &eval_target.SearchCustomEvalTargetRequest{ - Keyword: &validKeyword, - ApplicationID: &validApplicationID, - Region: &validRegion, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, + Region: &validRegion, }, mockSetup: func() {}, wantResp: nil, @@ -1384,14 +1388,14 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }).Return(nil) mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), &entity.SearchCustomEvalTargetParam{ - WorkspaceID: &validSpaceID, - Keyword: &validKeyword, - ApplicationID: &validApplicationID, + WorkspaceID: &validSpaceID, + Keyword: &validKeyword, + ApplicationID: &validApplicationID, CustomRPCServer: nil, - Region: &validRegion, - Env: nil, - PageSize: nil, - PageToken: nil, + Region: &validRegion, + Env: nil, + PageSize: nil, + PageToken: nil, }).Return([]*entity.CustomEvalTarget{}, "", false, nil) }, wantResp: &eval_target.SearchCustomEvalTargetResponse{ @@ -1409,7 +1413,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { app.typedOperators = map[entity.EvalTargetType]service.ISourceEvalTargetOperateService{ entity.EvalTargetTypeCustomRPCServer: mockTypedOperator, } - + tt.mockSetup() resp, err := app.SearchCustomEvalTarget(context.Background(), tt.req) @@ -1682,3 +1686,365 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }) } } + +func TestEvalTargetApplicationImpl_AsyncExecuteEvalTarget(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockAuth := rpcmocks.NewMockIAuthProvider(ctrl) + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + + app := &EvalTargetApplicationImpl{ + auth: mockAuth, + evalTargetService: mockEvalTargetService, + } + + workspaceID := int64(101) + targetID := int64(202) + versionID := int64(303) + inputData := &domain_eval_target.EvalTargetInputData{} + record := &entity.EvalTargetRecord{ID: 888} + + tests := []struct { + name string + req *eval_target.AsyncExecuteEvalTargetRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "success", + req: &eval_target.AsyncExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(targetID, 10), + SpaceID: workspaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.Run), EntityType: gptr.Of(rpc.AuthEntityType_EvaluationTarget)}}, + }).Return(nil) + mockEvalTargetService.EXPECT().AsyncExecuteTarget( + gomock.Any(), + workspaceID, + targetID, + versionID, + gomock.Any(), + gomock.Any(), + ).Return(record, "callee", nil) + }, + }, + { + name: "auth failure", + req: &eval_target.AsyncExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(errorx.NewByCode(errno.CommonNoPermissionCode)) + }, + wantErr: true, + wantErrCode: errno.CommonNoPermissionCode, + }, + { + name: "service failure", + req: &eval_target.AsyncExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(nil) + mockEvalTargetService.EXPECT().AsyncExecuteTarget(gomock.Any(), workspaceID, targetID, versionID, gomock.Any(), gomock.Any()). + Return(nil, "", errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.AsyncExecuteEvalTarget(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + } else { + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.InvokeID) + assert.Equal(t, record.ID, *resp.InvokeID) + assert.NotNil(t, resp.BaseResp) + } + }) + } +} + +func TestEvalTargetApplicationImpl_DebugEvalTarget(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + + app := &EvalTargetApplicationImpl{ + evalTargetService: mockEvalTargetService, + } + + workspaceID := int64(1001) + targetType := domain_eval_target.EvalTargetType_CustomRPCServer + runtimeParamJSON := "{}" + content := map[string]*spi.Content{ + "input": { + ContentType: gptr.Of(spi.ContentType("text")), + Text: gptr.Of("hello"), + }, + } + paramBytes, _ := stdjson.Marshal(content) + customRPC := &domain_eval_target.CustomRPCServer{Name: gptr.Of("debug")} + record := &entity.EvalTargetRecord{ + ID: 909, + EvalTargetOutputData: &entity.EvalTargetOutputData{}, + BaseInfo: &entity.BaseInfo{ + CreatedAt: gptr.Of(int64(1)), + UpdatedAt: gptr.Of(int64(1)), + }, + } + + tests := []struct { + name string + req *eval_target.DebugEvalTargetRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "success", + req: &eval_target.DebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of(string(paramBytes)), + TargetRuntimeParam: &domaincommon.RuntimeParam{ + JSONValue: gptr.Of(runtimeParamJSON), + }, + CustomRPCServer: customRPC, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().DebugTarget(gomock.Any(), gomock.Any()).Return(record, nil) + }, + }, + { + name: "invalid json", + req: &eval_target.DebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of("{"), + }, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "service failure", + req: &eval_target.DebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of(string(paramBytes)), + TargetRuntimeParam: &domaincommon.RuntimeParam{JSONValue: gptr.Of(runtimeParamJSON)}, + CustomRPCServer: customRPC, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().DebugTarget(gomock.Any(), gomock.Any()). + Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "unsupported type", + req: &eval_target.DebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: gptr.Of(domain_eval_target.EvalTargetType(0)), + Param: gptr.Of(string(paramBytes)), + }, + mockSetup: func() {}, + wantErr: true, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.DebugEvalTarget(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + } else { + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.EvalTargetRecord) + } + }) + } +} + +func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + mockEvalAsyncRepo := repomocks.NewMockIEvalAsyncRepo(ctrl) + + app := &EvalTargetApplicationImpl{ + evalTargetService: mockEvalTargetService, + evalAsyncRepo: mockEvalAsyncRepo, + } + + workspaceID := int64(2001) + targetType := domain_eval_target.EvalTargetType_CustomRPCServer + runtimeParamJSON := "{}" + content := map[string]*spi.Content{ + "input": { + ContentType: gptr.Of(spi.ContentType("text")), + Text: gptr.Of("world"), + }, + } + paramBytes, _ := stdjson.Marshal(content) + customRPC := &domain_eval_target.CustomRPCServer{Name: gptr.Of("async")} + record := &entity.EvalTargetRecord{ + ID: 707, + EvalTargetOutputData: &entity.EvalTargetOutputData{}, + BaseInfo: &entity.BaseInfo{ + CreatedAt: gptr.Of(int64(1)), + UpdatedAt: gptr.Of(int64(1)), + }, + } + + tests := []struct { + name string + req *eval_target.AsyncDebugEvalTargetRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "success", + req: &eval_target.AsyncDebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of(string(paramBytes)), + TargetRuntimeParam: &domaincommon.RuntimeParam{ + JSONValue: gptr.Of(runtimeParamJSON), + }, + CustomRPCServer: customRPC, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().AsyncDebugTarget(gomock.Any(), gomock.Any()).Return(record, "callee", nil) + mockEvalAsyncRepo.EXPECT().SetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(record.ID, 10), gomock.Any()).Return(nil) + }, + }, + { + name: "invalid json", + req: &eval_target.AsyncDebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of("{"), + }, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "service failure", + req: &eval_target.AsyncDebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of(string(paramBytes)), + TargetRuntimeParam: &domaincommon.RuntimeParam{JSONValue: gptr.Of(runtimeParamJSON)}, + CustomRPCServer: customRPC, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().AsyncDebugTarget(gomock.Any(), gomock.Any()). + Return(nil, "", errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "set async ctx failure", + req: &eval_target.AsyncDebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: &targetType, + Param: gptr.Of(string(paramBytes)), + TargetRuntimeParam: &domaincommon.RuntimeParam{JSONValue: gptr.Of(runtimeParamJSON)}, + CustomRPCServer: customRPC, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().AsyncDebugTarget(gomock.Any(), gomock.Any()).Return(record, "callee", nil) + mockEvalAsyncRepo.EXPECT().SetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(record.ID, 10), gomock.Any()). + Return(errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "unsupported type", + req: &eval_target.AsyncDebugEvalTargetRequest{ + WorkspaceID: &workspaceID, + EvalTargetType: gptr.Of(domain_eval_target.EvalTargetType(0)), + Param: gptr.Of(string(paramBytes)), + }, + mockSetup: func() {}, + wantErr: true, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.AsyncDebugEvalTarget(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + } else { + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Equal(t, record.ID, resp.InvokeID) + assert.Equal(t, gptr.Of("callee"), resp.Callee) + assert.NotNil(t, resp.BaseResp) + } + }) + } +} From 0bdbc865edc596341c379aee147f3508a2671da5 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 20 Oct 2025 00:14:48 +0800 Subject: [PATCH 089/100] test: [Coda] add eval target service unit tests (LogID: 20251019235519192168001011515D01D) Co-Authored-By: Coda --- .../domain/service/target_impl_test.go | 1808 +++++------------ 1 file changed, 485 insertions(+), 1323 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 5272fb75f..6d2a06fa9 100755 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -1,178 +1,168 @@ -// Copyright (c) 2025 coze-dev Authors -// SPDX-License-Identifier: Apache-2.0 - package service import ( "context" - "errors" + "encoding/json" "testing" + "github.com/bytedance/gg/gptr" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" - "github.com/bytedance/gg/gptr" - idgenmocks "github.com/coze-dev/coze-loop/backend/infra/idgen/mocks" - "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/metrics/mocks" + metricsmocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/component/metrics/mocks" "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" repomocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo/mocks" servicemocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service/mocks" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" + "github.com/coze-dev/coze-loop/backend/pkg/errorx" ) -func TestEvaluatorTargetServiceImpl_CreateEvalTarget(t *testing.T) { +type evalTargetServiceTestDeps struct { + repo *repomocks.MockIEvalTargetRepo + idgen *idgenmocks.MockIIDGenerator + metric *metricsmocks.MockEvalTargetMetrics + operator *servicemocks.MockISourceEvalTargetOperateService +} + +func TestEvalTargetServiceImpl_CreateEvalTarget(t *testing.T) { t.Parallel() - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) + type args struct { spaceID int64 sourceTargetID string sourceTargetVersion string targetType entity.EvalTargetType - wantID int64 - wantVersionID int64 - wantErr bool + } + + tests := []struct { + name string + args args + prepare func(ctx context.Context, deps *evalTargetServiceTestDeps) map[entity.EvalTargetType]ISourceEvalTargetOperateService + wantErr bool + wantErrCode int32 + wantID int64 + wantVersion int64 }{ { - name: "成功创建评估目标", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - evalTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockOperator.EXPECT().BuildBySource(gomock.Any(), int64(1), "target_123", "v1.0").Return(evalTarget, nil) - mockRepo.EXPECT().CreateEvalTarget(gomock.Any(), evalTarget).Return(int64(123), int64(456), nil) - mockMetric.EXPECT().EmitCreate(int64(1), nil) - - return mockRepo, mockIDGen, mockMetric, mockOperator + name: "unsupported target type", + args: args{ + spaceID: 1, + sourceTargetID: "src", + sourceTargetVersion: "v1", + targetType: entity.EvalTargetTypeLoopPrompt, }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - wantID: 123, - wantVersionID: 456, - wantErr: false, - }, - { - name: "不支持的目标类型", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - mockMetric.EXPECT().EmitCreate(int64(1), gomock.Any()) - - return mockRepo, mockIDGen, mockMetric, mockOperator + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps) map[entity.EvalTargetType]ISourceEvalTargetOperateService { + return map[entity.EvalTargetType]ISourceEvalTargetOperateService{} }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: 99, // 不支持的类型 - wantErr: true, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, }, { - name: "BuildBySource返回错误", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - mockOperator.EXPECT().BuildBySource(gomock.Any(), int64(1), "target_123", "v1.0").Return(nil, errors.New("build error")) - mockMetric.EXPECT().EmitCreate(int64(1), gomock.Any()) - - return mockRepo, mockIDGen, mockMetric, mockOperator + name: "build by source error", + args: args{ + spaceID: 1, + sourceTargetID: "src", + sourceTargetVersion: "v1", + targetType: entity.EvalTargetTypeLoopPrompt, }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - wantErr: true, + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps) map[entity.EvalTargetType]ISourceEvalTargetOperateService { + deps.operator.EXPECT().BuildBySource(ctx, int64(1), "src", "v1").Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + return map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + entity.EvalTargetTypeLoopPrompt: deps.operator, + } + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, }, { - name: "BuildBySource返回nil", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - mockOperator.EXPECT().BuildBySource(gomock.Any(), int64(1), "target_123", "v1.0").Return(nil, nil) - mockMetric.EXPECT().EmitCreate(int64(1), gomock.Any()) - - return mockRepo, mockIDGen, mockMetric, mockOperator + name: "build by source returns nil", + args: args{ + spaceID: 1, + sourceTargetID: "src", + sourceTargetVersion: "v1", + targetType: entity.EvalTargetTypeLoopPrompt, + }, + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps) map[entity.EvalTargetType]ISourceEvalTargetOperateService { + deps.operator.EXPECT().BuildBySource(ctx, int64(1), "src", "v1").Return(nil, nil) + return map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + entity.EvalTargetTypeLoopPrompt: deps.operator, + } }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - wantErr: true, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, }, { - name: "CreateEvalTarget失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *idgenmocks.MockIIDGenerator, *mocks.MockEvalTargetMetrics, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - evalTarget := &entity.EvalTarget{ - ID: 123, + name: "success", + args: args{ + spaceID: 1, + sourceTargetID: "src", + sourceTargetVersion: "v1", + targetType: entity.EvalTargetTypeLoopPrompt, + }, + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps) map[entity.EvalTargetType]ISourceEvalTargetOperateService { + expectDO := &entity.EvalTarget{ SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, + SourceTargetID: "src", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + } + deps.operator.EXPECT().BuildBySource(ctx, int64(1), "src", "v1").Return(expectDO, nil) + deps.repo.EXPECT().CreateEvalTarget(ctx, expectDO).Return(int64(11), int64(22), nil) + return map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + entity.EvalTargetTypeLoopPrompt: deps.operator, } - - mockOperator.EXPECT().BuildBySource(gomock.Any(), int64(1), "target_123", "v1.0").Return(evalTarget, nil) - mockRepo.EXPECT().CreateEvalTarget(gomock.Any(), evalTarget).Return(int64(0), int64(0), errors.New("repo error")) - mockMetric.EXPECT().EmitCreate(int64(1), gomock.Any()) - - return mockRepo, mockIDGen, mockMetric, mockOperator }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - wantErr: true, + wantID: 11, + wantVersion: 22, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() + ctx := context.Background() ctrl := gomock.NewController(t) defer ctrl.Finish() - mockRepo, mockIDGen, mockMetric, mockOperator := tt.setupMocks(ctrl) + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), + } - typedOperators := make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - if tt.targetType == entity.EvalTargetTypeCozeBot { - typedOperators[entity.EvalTargetTypeCozeBot] = mockOperator + typedOps := map[entity.EvalTargetType]ISourceEvalTargetOperateService{} + if tt.prepare != nil { + typedOps = tt.prepare(ctx, deps) } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) + deps.metric.EXPECT().EmitCreate(tt.args.spaceID, gomock.Any()).Times(1) + + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: typedOps, + } - id, versionID, err := service.CreateEvalTarget(context.Background(), tt.spaceID, tt.sourceTargetID, tt.sourceTargetVersion, tt.targetType) + gotID, gotVersion, err := svc.CreateEvalTarget(ctx, tt.args.spaceID, tt.args.sourceTargetID, tt.args.sourceTargetVersion, tt.args.targetType) if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.wantID, id) - assert.Equal(t, tt.wantVersionID, versionID) + require.Error(t, err) + if tt.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + require.True(t, ok) + assert.Equal(t, tt.wantErrCode, statusErr.Code()) + } + return } + + require.NoError(t, err) + assert.Equal(t, tt.wantID, gotID) + assert.Equal(t, tt.wantVersion, gotVersion) }) } } @@ -180,1330 +170,574 @@ func TestEvaluatorTargetServiceImpl_CreateEvalTarget(t *testing.T) { func TestEvalTargetServiceImpl_GetEvalTargetVersion(t *testing.T) { t.Parallel() - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) + ctx := context.Background() + type args struct { spaceID int64 versionID int64 needSourceInfo bool - want *entity.EvalTarget - wantErr bool - }{ - { - name: "成功获取版本信息_不需要源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - return mockRepo, mockOperator - }, - spaceID: 1, - versionID: 456, - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - }, - wantErr: false, - }, - { - name: "成功获取版本信息_需要源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - mockOperator.EXPECT().PackSourceVersionInfo(gomock.Any(), int64(1), []*entity.EvalTarget{expectedTarget}).Return(nil) - - return mockRepo, mockOperator - }, - spaceID: 1, - versionID: 456, - needSourceInfo: true, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - }, - wantErr: false, - }, - { - name: "获取版本失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(999)).Return(nil, errors.New("version not found")) - return mockRepo, mockOperator - }, - spaceID: 1, - versionID: 999, - needSourceInfo: false, - wantErr: true, - }, - { - name: "打包源信息失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - mockOperator.EXPECT().PackSourceVersionInfo(gomock.Any(), int64(1), []*entity.EvalTarget{expectedTarget}).Return(errors.New("pack error")) - - return mockRepo, mockOperator - }, - spaceID: 1, - versionID: 456, - needSourceInfo: true, - wantErr: true, - }, } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo, mockOperator := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - typedOperators := map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, - } - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - result, err := service.GetEvalTargetVersion(context.Background(), tt.spaceID, tt.versionID, tt.needSourceInfo) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } - }) - } -} - -func TestEvalTargetServiceImpl_GetEvalTargetVersionBySourceTarget(t *testing.T) { - t.Parallel() - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) - spaceID int64 - sourceTargetID string - sourceTargetVersion string - targetType entity.EvalTargetType - needSourceInfo bool - want *entity.EvalTarget - wantErr bool + name string + args args + prepare func(deps *evalTargetServiceTestDeps, expectDo *entity.EvalTarget) + wantErr bool }{ { - name: "成功通过源目标获取版本_不需要源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersionBySourceTarget(gomock.Any(), int64(1), "target_123", "v1.0", entity.EvalTargetTypeCozeBot).Return(expectedTarget, nil) - return mockRepo, mockOperator - }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, + name: "repo error", + args: args{spaceID: 1, versionID: 2, needSourceInfo: false}, + prepare: func(deps *evalTargetServiceTestDeps, expectDo *entity.EvalTarget) { + deps.repo.EXPECT().GetEvalTargetVersion(ctx, int64(1), int64(2)).Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) }, - wantErr: false, + wantErr: true, }, { - name: "成功通过源目标获取版本_需要源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersionBySourceTarget(gomock.Any(), int64(1), "target_123", "v1.0", entity.EvalTargetTypeCozeBot).Return(expectedTarget, nil) - mockOperator.EXPECT().PackSourceVersionInfo(gomock.Any(), int64(1), []*entity.EvalTarget{expectedTarget}).Return(nil) - - return mockRepo, mockOperator - }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - needSourceInfo: true, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, + name: "need source info", + args: args{spaceID: 1, versionID: 2, needSourceInfo: true}, + prepare: func(deps *evalTargetServiceTestDeps, expectDo *entity.EvalTarget) { + deps.repo.EXPECT().GetEvalTargetVersion(ctx, int64(1), int64(2)).Return(expectDo, nil) + deps.operator.EXPECT().PackSourceVersionInfo(ctx, int64(1), []*entity.EvalTarget{expectDo}).Return(nil) }, - wantErr: false, }, { - name: "通过源目标获取失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, *servicemocks.MockISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - mockRepo.EXPECT().GetEvalTargetVersionBySourceTarget(gomock.Any(), int64(1), "invalid_target", "v1.0", entity.EvalTargetTypeCozeBot).Return(nil, errors.New("target not found")) - return mockRepo, mockOperator + name: "without source info", + args: args{spaceID: 1, versionID: 2, needSourceInfo: false}, + prepare: func(deps *evalTargetServiceTestDeps, expectDo *entity.EvalTarget) { + deps.repo.EXPECT().GetEvalTargetVersion(ctx, int64(1), int64(2)).Return(expectDo, nil) }, - spaceID: 1, - sourceTargetID: "invalid_target", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - needSourceInfo: false, - wantErr: true, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() ctrl := gomock.NewController(t) defer ctrl.Finish() - mockRepo, mockOperator := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - typedOperators := map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - result, err := service.GetEvalTargetVersionBySourceTarget(context.Background(), tt.spaceID, tt.sourceTargetID, tt.sourceTargetVersion, tt.targetType, tt.needSourceInfo) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) + expectDo := &entity.EvalTarget{ + ID: 3, + SpaceID: tt.args.spaceID, + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: tt.args.versionID, + }, } - }) - } -} - -func TestEvalTargetServiceImpl_GetEvalTarget(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - setupMocks func(*gomock.Controller) *repomocks.MockIEvalTargetRepo - targetID int64 - want *entity.EvalTarget - wantErr bool - }{ - { - name: "成功获取评估目标", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTarget(gomock.Any(), int64(123)).Return(expectedTarget, nil) - return mockRepo - }, - targetID: 123, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - }, - wantErr: false, - }, - { - name: "获取失败", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().GetEvalTarget(gomock.Any(), int64(999)).Return(nil, errors.New("not found")) - return mockRepo - }, - targetID: 999, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) + if tt.prepare != nil { + tt.prepare(deps, expectDo) + } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, nil) + typedOps := map[entity.EvalTargetType]ISourceEvalTargetOperateService{} + if tt.args.needSourceInfo { + typedOps[entity.EvalTargetTypeLoopPrompt] = deps.operator + } - result, err := service.GetEvalTarget(context.Background(), tt.targetID) + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: typedOps, + } + do, err := svc.GetEvalTargetVersion(ctx, tt.args.spaceID, tt.args.versionID, tt.args.needSourceInfo) if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) + require.Error(t, err) + return } + + require.NoError(t, err) + assert.Equal(t, expectDo, do) }) } } -func TestEvalTargetServiceImpl_GenerateMockOutputData(t *testing.T) { +func TestEvalTargetServiceImpl_asyncExecuteTarget(t *testing.T) { t.Parallel() + type prepareFunc func(ctx context.Context, deps *evalTargetServiceTestDeps, target *entity.EvalTarget, input *entity.EvalTargetInputData) + tests := []struct { - name string - outputSchemas []*entity.ArgsSchema - want map[string]string - wantErr bool + name string + prepare prepareFunc + wantErr bool + wantErrCode int32 + expectCallee string + expectID int64 }{ { - name: "空schema列表", - outputSchemas: []*entity.ArgsSchema{}, - want: map[string]string{}, - wantErr: false, + name: "validate input failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, target *entity.EvalTarget, input *entity.EvalTargetInputData) { + deps.operator.EXPECT().ValidateInput(ctx, target.SpaceID, target.EvalTargetVersion.InputSchema, input).Return(errorx.NewByCode(errno.CommonInvalidParamCode)) + deps.metric.EXPECT().EmitRun(target.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, }, { - name: "有效schema生成mock数据", - outputSchemas: []*entity.ArgsSchema{ - { - Key: gptr.Of("output1"), - JsonSchema: gptr.Of(`{"type": "string"}`), - }, - { - Key: gptr.Of("output2"), - JsonSchema: gptr.Of(`{"type": "number"}`), - }, + name: "async execute failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, target *entity.EvalTarget, input *entity.EvalTargetInputData) { + deps.operator.EXPECT().ValidateInput(ctx, target.SpaceID, target.EvalTargetVersion.InputSchema, input).Return(nil) + deps.operator.EXPECT().AsyncExecute(ctx, target.SpaceID, gomock.Any()).Return(int64(0), "callee", errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.metric.EXPECT().EmitRun(target.SpaceID, gomock.Any(), gomock.Any()).Times(1) }, - want: map[string]string{}, // 实际内容由jsonmock生成,这里只验证不为空 - wantErr: false, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + expectCallee: "callee", }, { - name: "无效schema使用默认值", - outputSchemas: []*entity.ArgsSchema{ - { - Key: gptr.Of("invalid_output"), - JsonSchema: gptr.Of(`invalid json`), - }, + name: "success", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, target *entity.EvalTarget, input *entity.EvalTargetInputData) { + deps.operator.EXPECT().ValidateInput(ctx, target.SpaceID, target.EvalTargetVersion.InputSchema, input).Return(nil) + deps.operator.EXPECT().AsyncExecute(ctx, target.SpaceID, gomock.Any()).Return(int64(999), "callee", nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(999), nil) + deps.metric.EXPECT().EmitRun(target.SpaceID, gomock.Any(), gomock.Any()).Times(1) }, - want: map[string]string{ - "invalid_output": "{}", - }, - wantErr: false, + expectCallee: "callee", + expectID: 999, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() + ctx := context.Background() ctrl := gomock.NewController(t) defer ctrl.Finish() - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, nil) - - result, err := service.GenerateMockOutputData(tt.outputSchemas) - - if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, len(tt.outputSchemas), len(result)) - - // 对于有效的schema,验证生成的数据不为空 - for _, schema := range tt.outputSchemas { - if schema.Key != nil { - value, exists := result[*schema.Key] - assert.True(t, exists) - assert.NotEmpty(t, value) - } - } + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), } - }) - } -} - -func TestEvalTargetServiceImpl_EdgeCases(t *testing.T) { - t.Parallel() - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) - spaceID int64 - versionID int64 - needSourceInfo bool - want *entity.EvalTarget - wantErr bool - }{ - { - name: "成功获取版本信息_无需源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - return mockRepo, nil - }, - spaceID: 1, - versionID: 456, - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, + target := &entity.EvalTarget{ + ID: 1, SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, + SourceTargetID: "source", + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, - }, - wantErr: false, - }, - { - name: "成功获取版本信息_需要源信息", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", + ID: 2, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("a")}, }, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - mockOperator.EXPECT().PackSourceVersionInfo(gomock.Any(), int64(1), []*entity.EvalTarget{expectedTarget}).Return(nil) - - typedOperators := map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, - } - return mockRepo, typedOperators - }, - spaceID: 1, - versionID: 456, - needSourceInfo: true, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", }, - }, - wantErr: false, - }, - { - name: "获取版本失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(999)).Return(nil, errors.New("version not found")) - return mockRepo, nil - }, - spaceID: 1, - versionID: 999, - needSourceInfo: false, - wantErr: true, - }, - { - name: "包装源信息失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - } - - mockRepo.EXPECT().GetEvalTargetVersion(gomock.Any(), int64(1), int64(456)).Return(expectedTarget, nil) - mockOperator.EXPECT().PackSourceVersionInfo(gomock.Any(), int64(1), []*entity.EvalTarget{expectedTarget}).Return(errors.New("pack source info failed")) - - typedOperators := map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, - } - return mockRepo, typedOperators - }, - spaceID: 1, - versionID: 456, - needSourceInfo: true, - wantErr: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() + } + input := &entity.EvalTargetInputData{InputFields: map[string]*entity.Content{"a": {ContentType: gptr.Of(entity.ContentTypeText)}}} - mockRepo, typedOperators := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) + typedOps := map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + entity.EvalTargetTypeCustomRPCServer: deps.operator, + } - if typedOperators == nil { - typedOperators = make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: typedOps, } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) + if tt.prepare != nil { + tt.prepare(ctx, deps, target, input) + } - result, err := service.GetEvalTargetVersion(context.Background(), tt.spaceID, tt.versionID, tt.needSourceInfo) + record, callee, err := svc.asyncExecuteTarget(ctx, target.SpaceID, target, &entity.ExecuteTargetCtx{ItemID: 1, TurnID: 2}, input) if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) + require.Error(t, err) + statusErr, ok := errorx.FromStatusError(err) + require.True(t, ok) + assert.Equal(t, tt.wantErrCode, statusErr.Code()) + assert.Equal(t, tt.expectCallee, callee) + return } + + require.NoError(t, err) + require.NotNil(t, record) + assert.Equal(t, tt.expectCallee, callee) + assert.Equal(t, tt.expectID, record.ID) + assert.Equal(t, entity.EvalTargetRunStatusAsyncInvoking, gptr.Indirect(record.Status)) }) } } -func TestEvalTargetServiceImpl_MoreEdgeCases(t *testing.T) { +func TestEvalTargetServiceImpl_ReportInvokeRecords(t *testing.T) { t.Parallel() + ctx := context.Background() + tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) - spaceID int64 - sourceTargetID string - sourceTargetVersion string - targetType entity.EvalTargetType - needSourceInfo bool - want *entity.EvalTarget - wantErr bool + name string + prepare func(deps *evalTargetServiceTestDeps, param *entity.ReportTargetRecordParam, record *entity.EvalTargetRecord) + wantErr bool + errCode int32 }{ { - name: "成功获取源目标版本", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, - } - - mockRepo.EXPECT().GetEvalTargetVersionBySourceTarget(gomock.Any(), int64(1), "target_123", "v1.0", entity.EvalTargetTypeCozeBot).Return(expectedTarget, nil) - return mockRepo, nil - }, - spaceID: 1, - sourceTargetID: "target_123", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, + name: "record query error", + prepare: func(deps *evalTargetServiceTestDeps, param *entity.ReportTargetRecordParam, record *entity.EvalTargetRecord) { + deps.repo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(ctx, param.SpaceID, param.RecordID).Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) }, - wantErr: false, + wantErr: true, + errCode: errno.CommonInternalErrorCode, }, { - name: "获取失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().GetEvalTargetVersionBySourceTarget(gomock.Any(), int64(1), "target_999", "v1.0", entity.EvalTargetTypeCozeBot).Return(nil, errors.New("not found")) - return mockRepo, nil + name: "record not found", + prepare: func(deps *evalTargetServiceTestDeps, param *entity.ReportTargetRecordParam, record *entity.EvalTargetRecord) { + deps.repo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(ctx, param.SpaceID, param.RecordID).Return(nil, nil) }, - spaceID: 1, - sourceTargetID: "target_999", - sourceTargetVersion: "v1.0", - targetType: entity.EvalTargetTypeCozeBot, - needSourceInfo: false, - wantErr: true, + wantErr: true, + errCode: errno.CommonBadRequestCode, }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo, typedOperators := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - if typedOperators == nil { - typedOperators = make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - } - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - result, err := service.GetEvalTargetVersionBySourceTarget(context.Background(), tt.spaceID, tt.sourceTargetID, tt.sourceTargetVersion, tt.targetType, tt.needSourceInfo) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } - }) - } -} - -func TestEvalTargetServiceImpl_GetEvalTargetVersionBySource(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) - spaceID int64 - targetID int64 - sourceVersion string - needSourceInfo bool - want *entity.EvalTarget - wantErr bool - }{ { - name: "成功找到匹配版本", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - versions := []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "456", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 789, - SourceTargetVersion: "v1.0", - }, - }, - } - - mockRepo.EXPECT().BatchGetEvalTargetBySource(gomock.Any(), gomock.Any()).Return(versions, nil) - return mockRepo, nil - }, - spaceID: 1, - targetID: 456, - sourceVersion: "v1.0", - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "456", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 789, - SourceTargetVersion: "v1.0", - }, + name: "status not async", + prepare: func(deps *evalTargetServiceTestDeps, param *entity.ReportTargetRecordParam, record *entity.EvalTargetRecord) { + status := entity.EvalTargetRunStatusSuccess + record.Status = &status + deps.repo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(ctx, param.SpaceID, param.RecordID).Return(record, nil) }, - wantErr: false, - }, - { - name: "未找到匹配版本", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - versions := []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "456", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 789, - SourceTargetVersion: "v2.0", // 不匹配 + wantErr: true, + errCode: errno.CommonBadRequestCode, + }, + { + name: "success", + prepare: func(deps *evalTargetServiceTestDeps, param *entity.ReportTargetRecordParam, record *entity.EvalTargetRecord) { + status := entity.EvalTargetRunStatusAsyncInvoking + record.Status = &status + record.EvalTargetOutputData = &entity.EvalTargetOutputData{} + deps.repo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(ctx, param.SpaceID, param.RecordID).Return(record, nil) + var saved *entity.EvalTargetRecord + deps.repo.EXPECT().SaveEvalTargetRecord(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, rec *entity.EvalTargetRecord) error { + saved = rec + return nil + }) + deps.repo.EXPECT().GetEvalTargetVersion(gomock.Any(), record.SpaceID, record.TargetVersionID).Return(&entity.EvalTarget{EvalTargetType: entity.EvalTargetTypeCustomRPCServer}, nil) + deps.repo.EXPECT().CreateEvalTargetRecord(gomock.Any(), gomock.Any()).AnyTimes() + deps.metric.EXPECT().EmitRun(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() + + param.Session = &entity.Session{UserID: "user"} + param.OutputData = &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{ + "key": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("value"), }, }, + EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 1, OutputTokens: 2}, + EvalTargetRunError: &entity.EvalTargetRunError{Code: 1, Message: "oops"}, + TimeConsumingMS: gptr.Of(int64(10)), } - mockRepo.EXPECT().BatchGetEvalTargetBySource(gomock.Any(), gomock.Any()).Return(versions, nil) - return mockRepo, nil - }, - spaceID: 1, - targetID: 456, - sourceVersion: "v1.0", - needSourceInfo: false, - wantErr: true, - }, - { - name: "批量查询失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().BatchGetEvalTargetBySource(gomock.Any(), gomock.Any()).Return(nil, errors.New("query failed")) - return mockRepo, nil + deps.metric.EXPECT().EmitRun(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() + + t.Cleanup(func() { + require.NotNil(t, saved) + assert.Equal(t, param.OutputData, saved.EvalTargetOutputData) + assert.Equal(t, param.Status, gptr.Indirect(saved.Status)) + }) }, - spaceID: 1, - targetID: 456, - sourceVersion: "v1.0", - needSourceInfo: false, - wantErr: true, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() ctrl := gomock.NewController(t) defer ctrl.Finish() - mockRepo, typedOperators := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), + } - if typedOperators == nil { - typedOperators = make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: map[entity.EvalTargetType]ISourceEvalTargetOperateService{}, } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) + record := &entity.EvalTargetRecord{ + ID: 1, + SpaceID: 1, + TargetID: 2, + TargetVersionID: 3, + Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), + } + param := &entity.ReportTargetRecordParam{ + SpaceID: 1, + RecordID: 1, + Status: entity.EvalTargetRunStatusSuccess, + OutputData: &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{}, + }, + } - result, err := service.GetEvalTargetVersionBySource(context.Background(), tt.spaceID, tt.targetID, tt.sourceVersion, tt.needSourceInfo) + if tt.prepare != nil { + tt.prepare(deps, param, record) + } + err := svc.ReportInvokeRecords(ctx, param) if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) + require.Error(t, err) + statusErr, ok := errorx.FromStatusError(err) + require.True(t, ok) + assert.Equal(t, tt.errCode, statusErr.Code()) + return } + + require.NoError(t, err) }) } } -func TestEvalTargetServiceImpl_GetEvalTargetVersionByTarget(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) - spaceID int64 - targetID int64 - sourceTargetVersion string - needSourceInfo bool - want *entity.EvalTarget - wantErr bool - }{ - { - name: "成功获取目标版本", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedTarget := &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_456", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 789, - SourceTargetVersion: "v1.0", - }, - } +type fakeRuntimeParam struct { + parseErr error +} - mockRepo.EXPECT().GetEvalTargetVersionByTarget(gomock.Any(), int64(1), int64(456), "v1.0").Return(expectedTarget, nil) - return mockRepo, nil - }, - spaceID: 1, - targetID: 456, - sourceTargetVersion: "v1.0", - needSourceInfo: false, - want: &entity.EvalTarget{ - ID: 123, - SpaceID: 1, - SourceTargetID: "target_456", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 789, - SourceTargetVersion: "v1.0", - }, - }, - wantErr: false, - }, - { - name: "获取失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().GetEvalTargetVersionByTarget(gomock.Any(), int64(1), int64(999), "v1.0").Return(nil, errors.New("not found")) - return mockRepo, nil - }, - spaceID: 1, - targetID: 999, - sourceTargetVersion: "v1.0", - needSourceInfo: false, - wantErr: true, - }, +func (f *fakeRuntimeParam) GetJSONDemo() string { return "{}" } +func (f *fakeRuntimeParam) GetJSONValue() string { return "{}" } +func (f *fakeRuntimeParam) ParseFromJSON(string) (entity.IRuntimeParam, error) { + if f.parseErr != nil { + return nil, f.parseErr } + return &fakeRuntimeParam{}, nil +} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() +func TestEvalTargetServiceImpl_ValidateRuntimeParam(t *testing.T) { + t.Parallel() - ctrl := gomock.NewController(t) - defer ctrl.Finish() + ctrl := gomock.NewController(t) + defer ctrl.Finish() - mockRepo, typedOperators := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) + operator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) + operator.EXPECT().RuntimeParam().Return(&fakeRuntimeParam{parseErr: nil}).Times(1) - if typedOperators == nil { - typedOperators = make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - } + svc := &EvalTargetServiceImpl{ + typedOperators: map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + entity.EvalTargetTypeLoopPrompt: operator, + }, + } - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) + require.NoError(t, svc.ValidateRuntimeParam(context.Background(), entity.EvalTargetTypeLoopPrompt, "{}")) - result, err := service.GetEvalTargetVersionByTarget(context.Background(), tt.spaceID, tt.targetID, tt.sourceTargetVersion, tt.needSourceInfo) + err := svc.ValidateRuntimeParam(context.Background(), entity.EvalTargetTypeLoopPrompt, "") + require.NoError(t, err) - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } - }) - } + err = svc.ValidateRuntimeParam(context.Background(), entity.EvalTargetTypeCustomRPCServer, "{}") + require.Error(t, err) } -func TestEvalTargetServiceImpl_BatchGetEvalTargetBySource(t *testing.T) { +func TestSetSpanInputOutput(t *testing.T) { t.Parallel() + textType := entity.ContentTypeText + imageType := entity.ContentTypeImage + tests := []struct { - name string - setupMocks func(*gomock.Controller) *repomocks.MockIEvalTargetRepo - param *entity.BatchGetEvalTargetBySourceParam - want []*entity.EvalTarget - wantErr bool + name string + input *entity.EvalTargetInputData + output *entity.EvalTargetOutputData + wantInputs int + wantOutputs int }{ { - name: "成功批量获取", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedTargets := []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - }, - } - - mockRepo.EXPECT().BatchGetEvalTargetBySource(gomock.Any(), gomock.Any()).Return(expectedTargets, nil) - return mockRepo - }, - param: &entity.BatchGetEvalTargetBySourceParam{ - SpaceID: 1, - SourceTargetID: []string{"target_123"}, - TargetType: entity.EvalTargetTypeCozeBot, - }, - want: []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - }, - }, - wantErr: false, + name: "text content", + input: &entity.EvalTargetInputData{InputFields: map[string]*entity.Content{ + "text": {ContentType: &textType, Text: gptr.Of("hello")}, + }}, + output: &entity.EvalTargetOutputData{OutputFields: map[string]*entity.Content{ + "text": {ContentType: &textType, Text: gptr.Of("world")}, + }, EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 1, OutputTokens: 2}}, + wantInputs: 1, + wantOutputs: 1, }, { - name: "查询失败", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().BatchGetEvalTargetBySource(gomock.Any(), gomock.Any()).Return(nil, errors.New("query failed")) - return mockRepo - }, - param: &entity.BatchGetEvalTargetBySourceParam{ - SpaceID: 1, - SourceTargetID: []string{"target_123"}, - TargetType: entity.EvalTargetTypeCozeBot, - }, - wantErr: true, + name: "image content", + input: &entity.EvalTargetInputData{InputFields: map[string]*entity.Content{ + "image": {ContentType: &imageType, Image: &entity.Image{Name: gptr.Of("img"), URL: gptr.Of("http://img")}}, + }}, + output: &entity.EvalTargetOutputData{OutputFields: map[string]*entity.Content{}}, + wantInputs: 1, + wantOutputs: 0, + }, + { + name: "nil", + input: nil, + output: nil, + wantInputs: 0, + wantOutputs: 0, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, nil) - - result, err := service.BatchGetEvalTargetBySource(context.Background(), tt.param) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } + spanParam := &targetSpanTagsParams{} + setSpanInputOutput(context.Background(), spanParam, tt.input, tt.output) + assert.Len(t, spanParam.Inputs, tt.wantInputs) + assert.Len(t, spanParam.Outputs, tt.wantOutputs) }) } } -func TestEvalTargetServiceImpl_BatchGetEvalTargetVersion(t *testing.T) { +func TestToTraceParts(t *testing.T) { t.Parallel() + textType := entity.ContentTypeText + imageType := entity.ContentTypeImage + multipartType := entity.ContentTypeMultipart + tests := []struct { - name string - setupMocks func(*gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) - spaceID int64 - versionIDs []int64 - needSourceInfo bool - want []*entity.EvalTarget - wantErr bool + name string + content *entity.Content + wantLen int }{ { - name: "成功批量获取版本", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedVersions := []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, - }, - } - - mockRepo.EXPECT().BatchGetEvalTargetVersion(gomock.Any(), int64(1), []int64{456}).Return(expectedVersions, nil) - return mockRepo, nil - }, - spaceID: 1, - versionIDs: []int64{456}, - needSourceInfo: false, - want: []*entity.EvalTarget{ - { - ID: 123, - SpaceID: 1, - SourceTargetID: "target_123", - EvalTargetType: entity.EvalTargetTypeCozeBot, - EvalTargetVersion: &entity.EvalTargetVersion{ - ID: 456, - SourceTargetVersion: "v1.0", - }, - }, + name: "text", + content: &entity.Content{ + ContentType: &textType, + Text: gptr.Of("hello"), }, - wantErr: false, + wantLen: 1, }, { - name: "查询失败", - setupMocks: func(ctrl *gomock.Controller) (*repomocks.MockIEvalTargetRepo, map[entity.EvalTargetType]ISourceEvalTargetOperateService) { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().BatchGetEvalTargetVersion(gomock.Any(), int64(1), []int64{999}).Return(nil, errors.New("query failed")) - return mockRepo, nil + name: "image", + content: &entity.Content{ + ContentType: &imageType, + Image: &entity.Image{ + Name: gptr.Of("img"), + URL: gptr.Of("http://img"), + }, }, - spaceID: 1, - versionIDs: []int64{999}, - needSourceInfo: false, - wantErr: true, + wantLen: 1, }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo, typedOperators := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - if typedOperators == nil { - typedOperators = make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - } - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - result, err := service.BatchGetEvalTargetVersion(context.Background(), tt.spaceID, tt.versionIDs, tt.needSourceInfo) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } - }) - } -} - -func TestEvalTargetServiceImpl_GetRecordByID(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - setupMocks func(*gomock.Controller) *repomocks.MockIEvalTargetRepo - spaceID int64 - recordID int64 - want *entity.EvalTargetRecord - wantErr bool - }{ { - name: "成功获取记录", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedRecord := &entity.EvalTargetRecord{ - ID: 123, - SpaceID: 1, - TargetID: 456, - TargetVersionID: 789, - } - - mockRepo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(gomock.Any(), int64(1), int64(123)).Return(expectedRecord, nil) - return mockRepo - }, - spaceID: 1, - recordID: 123, - want: &entity.EvalTargetRecord{ - ID: 123, - SpaceID: 1, - TargetID: 456, - TargetVersionID: 789, + name: "multipart", + content: &entity.Content{ + ContentType: &multipartType, + MultiPart: []*entity.Content{ + {ContentType: &textType, Text: gptr.Of("part1")}, + {ContentType: &textType, Text: gptr.Of("part2")}, + }, }, - wantErr: false, + wantLen: 2, }, { - name: "获取失败", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().GetEvalTargetRecordByIDAndSpaceID(gomock.Any(), int64(1), int64(999)).Return(nil, errors.New("not found")) - return mockRepo + name: "unknown", + content: &entity.Content{ + ContentType: nil, }, - spaceID: 1, - recordID: 999, - wantErr: true, + wantLen: 1, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, nil) - - result, err := service.GetRecordByID(context.Background(), tt.spaceID, tt.recordID) - - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } + parts := toTraceParts(context.Background(), tt.content) + assert.Len(t, parts, tt.wantLen) }) } } -func TestEvalTargetServiceImpl_BatchGetRecordByIDs(t *testing.T) { +func TestConvert2TraceString(t *testing.T) { t.Parallel() tests := []struct { - name string - setupMocks func(*gomock.Controller) *repomocks.MockIEvalTargetRepo - spaceID int64 - recordIDs []int64 - want []*entity.EvalTargetRecord - wantErr bool + name string + input interface{} + want string }{ { - name: "成功批量获取记录", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - - expectedRecords := []*entity.EvalTargetRecord{ - { - ID: 123, - SpaceID: 1, - TargetID: 456, - TargetVersionID: 789, - }, - { - ID: 124, - SpaceID: 1, - TargetID: 457, - TargetVersionID: 790, - }, - } - - mockRepo.EXPECT().ListEvalTargetRecordByIDsAndSpaceID(gomock.Any(), int64(1), []int64{123, 124}).Return(expectedRecords, nil) - return mockRepo - }, - spaceID: 1, - recordIDs: []int64{123, 124}, - want: []*entity.EvalTargetRecord{ - { - ID: 123, - SpaceID: 1, - TargetID: 456, - TargetVersionID: 789, - }, - { - ID: 124, - SpaceID: 1, - TargetID: 457, - TargetVersionID: 790, - }, - }, - wantErr: false, - }, - { - name: "spaceID为0", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - // 不应该调用仓储方法 - return mockRepo - }, - spaceID: 0, - recordIDs: []int64{123}, - wantErr: true, - }, - { - name: "recordIDs为空", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - // 不应该调用仓储方法 - return mockRepo - }, - spaceID: 1, - recordIDs: []int64{}, - wantErr: true, + name: "nil", + input: nil, + want: "", }, { - name: "查询失败", - setupMocks: func(ctrl *gomock.Controller) *repomocks.MockIEvalTargetRepo { - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockRepo.EXPECT().ListEvalTargetRecordByIDsAndSpaceID(gomock.Any(), int64(1), []int64{999}).Return(nil, errors.New("query failed")) - return mockRepo - }, - spaceID: 1, - recordIDs: []int64{999}, - wantErr: true, + name: "map", + input: map[string]string{"a": "b"}, + want: "{\"a\":\"b\"}", }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() + got := Convert2TraceString(tt.input) + if tt.input == nil { + assert.Equal(t, tt.want, got) + return + } - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo := tt.setupMocks(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, nil) - - result, err := service.BatchGetRecordByIDs(context.Background(), tt.spaceID, tt.recordIDs) + var expect interface{} + require.NoError(t, json.Unmarshal([]byte(tt.want), &expect)) - if tt.wantErr { - assert.Error(t, err) - assert.Nil(t, result) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, result) - } + var actual interface{} + require.NoError(t, json.Unmarshal([]byte(got), &actual)) + assert.Equal(t, expect, actual) }) } } -func TestEvalTargetServiceImpl_ValidateRuntimeParam(t *testing.T) { +func TestEvalTargetServiceImpl_GenerateMockOutputData(t *testing.T) { t.Parallel() + svc := &EvalTargetServiceImpl{} + + validSchema := `{"type":"object","properties":{"name":{"type":"string"}}}` + invalidSchema := "invalid" + tests := []struct { - name string - setupMocks func(*gomock.Controller) map[entity.EvalTargetType]ISourceEvalTargetOperateService - targetType entity.EvalTargetType - runtimeParam string - wantErr bool + name string + schemas []*entity.ArgsSchema + wantLen int }{ { - name: "空参数直接返回成功", - setupMocks: func(ctrl *gomock.Controller) map[entity.EvalTargetType]ISourceEvalTargetOperateService { - return make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - }, - targetType: entity.EvalTargetTypeCozeBot, - runtimeParam: "", - wantErr: false, + name: "empty schema", + schemas: nil, + wantLen: 0, }, { - name: "成功验证运行时参数", - setupMocks: func(ctrl *gomock.Controller) map[entity.EvalTargetType]ISourceEvalTargetOperateService { - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - mockRuntimeParam := &entity.DummyRuntimeParam{} - - mockOperator.EXPECT().RuntimeParam().Return(mockRuntimeParam) - - return map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, - } - }, - targetType: entity.EvalTargetTypeCozeBot, - runtimeParam: `{"timeout": 30}`, - wantErr: false, - }, - { - name: "不支持的目标类型", - setupMocks: func(ctrl *gomock.Controller) map[entity.EvalTargetType]ISourceEvalTargetOperateService { - return make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) + name: "valid schema", + schemas: []*entity.ArgsSchema{ + {Key: gptr.Of("name"), JsonSchema: &validSchema}, }, - targetType: 99, // 不存在的类型 - runtimeParam: `{"timeout": 30}`, - wantErr: true, + wantLen: 1, }, { - name: "JSON解析失败", - setupMocks: func(ctrl *gomock.Controller) map[entity.EvalTargetType]ISourceEvalTargetOperateService { - // 创建一个自定义的RuntimeParam实现来模拟解析失败 - mockOperator := servicemocks.NewMockISourceEvalTargetOperateService(ctrl) - - // 使用真实的PromptRuntimeParam来测试解析错误 - mockOperator.EXPECT().RuntimeParam().Return(entity.NewPromptRuntimeParam(nil)) - - return map[entity.EvalTargetType]ISourceEvalTargetOperateService{ - entity.EvalTargetTypeCozeBot: mockOperator, - } + name: "invalid schema", + schemas: []*entity.ArgsSchema{ + {Key: gptr.Of("invalid"), JsonSchema: &invalidSchema}, }, - targetType: entity.EvalTargetTypeCozeBot, - runtimeParam: `invalid json syntax`, - wantErr: true, + wantLen: 1, }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - typedOperators := tt.setupMocks(ctrl) - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - err := service.ValidateRuntimeParam(context.Background(), tt.targetType, tt.runtimeParam) - - if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - } + result, err := svc.GenerateMockOutputData(tt.schemas) + require.NoError(t, err) + assert.Len(t, result, tt.wantLen) }) } } @@ -1518,107 +752,35 @@ func TestBuildPageByCursor(t *testing.T) { wantErr bool }{ { - name: "cursor为nil_返回第1页", + name: "nil cursor", cursor: nil, wantPage: 1, - wantErr: false, }, { - name: "cursor为有效数字", + name: "valid cursor", cursor: gptr.Of("5"), wantPage: 5, - wantErr: false, }, { - name: "cursor为无效字符串", - cursor: gptr.Of("invalid"), + name: "invalid cursor", + cursor: gptr.Of("abc"), wantErr: true, }, - { - name: "cursor为0", - cursor: gptr.Of("0"), - wantPage: 0, - wantErr: false, - }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() page, err := buildPageByCursor(tt.cursor) - if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.wantPage, page) + require.Error(t, err) + return } - }) - } -} -func TestConvert2TraceString(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - input interface{} - want string - }{ - { - name: "nil输入", - input: nil, - want: "", - }, - { - name: "字符串输入", - input: "test string", - want: `"test string"`, - }, - { - name: "数字输入", - input: 123, - want: "123", - }, - { - name: "对象输入", - input: map[string]interface{}{ - "key": "value", - }, - want: `{"key":"value"}`, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - result := Convert2TraceString(tt.input) - assert.Equal(t, tt.want, result) + require.NoError(t, err) + assert.Equal(t, tt.wantPage, page) }) } } - -func TestNewEvalTargetServiceImpl(t *testing.T) { - t.Parallel() - - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockRepo := repomocks.NewMockIEvalTargetRepo(ctrl) - mockIDGen := idgenmocks.NewMockIIDGenerator(ctrl) - mockMetric := mocks.NewMockEvalTargetMetrics(ctrl) - typedOperators := make(map[entity.EvalTargetType]ISourceEvalTargetOperateService) - - service := NewEvalTargetServiceImpl(mockRepo, mockIDGen, mockMetric, typedOperators) - - assert.NotNil(t, service) - - impl, ok := service.(*EvalTargetServiceImpl) - assert.True(t, ok) - assert.Equal(t, mockRepo, impl.evalTargetRepo) - assert.Equal(t, mockIDGen, impl.idgen) - assert.Equal(t, mockMetric, impl.metric) - assert.Equal(t, typedOperators, impl.typedOperators) -} From 7b2a5ec73db6b031652a40d85bff786802dab3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 20 Oct 2025 11:17:45 +0800 Subject: [PATCH 090/100] fix Change-Id: I233cafb16116e8a67adfce78899b462f81217ed2 --- backend/modules/evaluation/domain/service/target_impl_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 6d2a06fa9..0e3337bc5 100755 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -1,3 +1,6 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + package service import ( From 99331f82ddecf686c3c5e0a7db77d6ed8e82c5e3 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 20 Oct 2025 12:31:24 +0800 Subject: [PATCH 091/100] test: [Coda] add eval openapi invoke result tests (LogID: 20251020121552010079145031634481D) Co-Authored-By: Coda --- .../application/eval_openapi_app_test.go | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100755 backend/modules/evaluation/application/eval_openapi_app_test.go diff --git a/backend/modules/evaluation/application/eval_openapi_app_test.go b/backend/modules/evaluation/application/eval_openapi_app_test.go new file mode 100755 index 000000000..a4756b5d4 --- /dev/null +++ b/backend/modules/evaluation/application/eval_openapi_app_test.go @@ -0,0 +1,207 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package application + +import ( + "context" + "errors" + "strconv" + "testing" + "time" + + "github.com/bytedance/gg/gptr" + "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + eventmocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/events/mocks" + repomocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/repo/mocks" + servicemocks "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/service/mocks" +) + +func TestEvalOpenAPIApplication_ReportEvalTargetInvokeResult(t *testing.T) { + t.Parallel() + + repoErrorReq := newSuccessInvokeResultReq(11, 101) + reportErrorReq := newSuccessInvokeResultReq(22, 202) + publisherErrorReq := newSuccessInvokeResultReq(33, 303) + successReq := newSuccessInvokeResultReq(44, 404) + failedReq := newFailedInvokeResultReq(55, 505, "invoke failed") + + tests := []struct { + name string + req *openapi.ReportEvalTargetInvokeResultRequest + setup func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, targetSvc *servicemocks.MockIEvalTargetService, publisher *eventmocks.MockExptEventPublisher) + wantErr bool + }{ + { + name: "repo returns error", + req: repoErrorReq, + setup: func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, _ *servicemocks.MockIEvalTargetService, _ *eventmocks.MockExptEventPublisher) { + asyncRepo.EXPECT().GetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(repoErrorReq.GetInvokeID(), 10)).Return(nil, errors.New("repo error")) + }, + wantErr: true, + }, + { + name: "report invoke records returns error", + req: reportErrorReq, + setup: func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, targetSvc *servicemocks.MockIEvalTargetService, publisher *eventmocks.MockExptEventPublisher) { + actx := &entity.EvalAsyncCtx{AsyncUnixMS: time.Now().Add(-200 * time.Millisecond).UnixMilli()} + asyncRepo.EXPECT().GetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(reportErrorReq.GetInvokeID(), 10)).Return(actx, nil) + targetSvc.EXPECT().ReportInvokeRecords(gomock.Any(), gomock.AssignableToTypeOf(&entity.ReportTargetRecordParam{})).DoAndReturn(func(_ context.Context, param *entity.ReportTargetRecordParam) error { + assert.Equal(t, reportErrorReq.GetWorkspaceID(), param.SpaceID) + assert.Equal(t, reportErrorReq.GetInvokeID(), param.RecordID) + assert.Equal(t, entity.EvalTargetRunStatusSuccess, param.Status) + if assert.NotNil(t, param.OutputData) { + assert.NotNil(t, param.OutputData.EvalTargetUsage) + assert.NotNil(t, param.OutputData.TimeConsumingMS) + if param.OutputData.TimeConsumingMS != nil { + assert.Greater(t, *param.OutputData.TimeConsumingMS, int64(0)) + } + } + assert.Nil(t, param.Session) + return errors.New("report error") + }) + publisher.EXPECT().PublishExptRecordEvalEvent(gomock.Any(), gomock.Any(), gomock.Any()).Times(0) + }, + wantErr: true, + }, + { + name: "publisher returns error", + req: publisherErrorReq, + setup: func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, targetSvc *servicemocks.MockIEvalTargetService, publisher *eventmocks.MockExptEventPublisher) { + session := &entity.Session{UserID: "user"} + event := &entity.ExptItemEvalEvent{} + actx := &entity.EvalAsyncCtx{AsyncUnixMS: time.Now().Add(-150 * time.Millisecond).UnixMilli(), Event: event, Session: session} + asyncRepo.EXPECT().GetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(publisherErrorReq.GetInvokeID(), 10)).Return(actx, nil) + targetSvc.EXPECT().ReportInvokeRecords(gomock.Any(), gomock.AssignableToTypeOf(&entity.ReportTargetRecordParam{})).DoAndReturn(func(_ context.Context, param *entity.ReportTargetRecordParam) error { + assert.Equal(t, session, param.Session) + return nil + }) + publisher.EXPECT().PublishExptRecordEvalEvent(gomock.Any(), event, gomock.Any()).DoAndReturn(func(_ context.Context, evt *entity.ExptItemEvalEvent, duration *time.Duration) error { + assert.Equal(t, event, evt) + if assert.NotNil(t, duration) { + assert.Equal(t, 3*time.Second, *duration) + } + return errors.New("publish error") + }) + }, + wantErr: true, + }, + { + name: "success without event", + req: successReq, + setup: func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, targetSvc *servicemocks.MockIEvalTargetService, publisher *eventmocks.MockExptEventPublisher) { + actx := &entity.EvalAsyncCtx{AsyncUnixMS: time.Now().Add(-100 * time.Millisecond).UnixMilli()} + asyncRepo.EXPECT().GetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(successReq.GetInvokeID(), 10)).Return(actx, nil) + targetSvc.EXPECT().ReportInvokeRecords(gomock.Any(), gomock.AssignableToTypeOf(&entity.ReportTargetRecordParam{})).DoAndReturn(func(_ context.Context, param *entity.ReportTargetRecordParam) error { + assert.Nil(t, param.Session) + return nil + }) + publisher.EXPECT().PublishExptRecordEvalEvent(gomock.Any(), gomock.Any(), gomock.Any()).Times(0) + }, + wantErr: false, + }, + { + name: "success with event on failure status", + req: failedReq, + setup: func(t *testing.T, asyncRepo *repomocks.MockIEvalAsyncRepo, targetSvc *servicemocks.MockIEvalTargetService, publisher *eventmocks.MockExptEventPublisher) { + session := &entity.Session{UserID: "owner"} + event := &entity.ExptItemEvalEvent{} + actx := &entity.EvalAsyncCtx{AsyncUnixMS: time.Now().Add(-120 * time.Millisecond).UnixMilli(), Event: event, Session: session} + asyncRepo.EXPECT().GetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(failedReq.GetInvokeID(), 10)).Return(actx, nil) + targetSvc.EXPECT().ReportInvokeRecords(gomock.Any(), gomock.AssignableToTypeOf(&entity.ReportTargetRecordParam{})).DoAndReturn(func(_ context.Context, param *entity.ReportTargetRecordParam) error { + assert.Equal(t, entity.EvalTargetRunStatusFail, param.Status) + if assert.NotNil(t, param.OutputData) { + if assert.NotNil(t, param.OutputData.EvalTargetRunError) { + assert.Equal(t, failedReq.GetErrorMessage(), param.OutputData.EvalTargetRunError.Message) + } + assert.NotNil(t, param.OutputData.TimeConsumingMS) + } + assert.Equal(t, session, param.Session) + return nil + }) + publisher.EXPECT().PublishExptRecordEvalEvent(gomock.Any(), event, gomock.Any()).DoAndReturn(func(_ context.Context, evt *entity.ExptItemEvalEvent, duration *time.Duration) error { + assert.Equal(t, event, evt) + if assert.NotNil(t, duration) { + assert.Equal(t, 3*time.Second, *duration) + } + return nil + }) + }, + wantErr: false, + }, + } + + for _, tc := range tests { + caseData := tc + t.Run(caseData.name, func(t *testing.T) { + t.Parallel() + + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + asyncRepo := repomocks.NewMockIEvalAsyncRepo(ctrl) + targetSvc := servicemocks.NewMockIEvalTargetService(ctrl) + publisher := eventmocks.NewMockExptEventPublisher(ctrl) + + app := &EvalOpenAPIApplication{ + targetSvc: targetSvc, + asyncRepo: asyncRepo, + publisher: publisher, + } + + caseData.setup(t, asyncRepo, targetSvc, publisher) + + resp, err := app.ReportEvalTargetInvokeResult_(context.Background(), caseData.req) + if caseData.wantErr { + assert.Error(t, err) + assert.Nil(t, resp) + return + } + + assert.NoError(t, err) + if assert.NotNil(t, resp) { + assert.NotNil(t, resp.BaseResp) + } + }) + } +} + +func newSuccessInvokeResultReq(workspaceID, invokeID int64) *openapi.ReportEvalTargetInvokeResultRequest { + status := spi.InvokeEvalTargetStatus_SUCCESS + contentType := spi.ContentTypeText + text := "result" + inputTokens := int64(10) + outputTokens := int64(20) + + return &openapi.ReportEvalTargetInvokeResultRequest{ + WorkspaceID: gptr.Of(workspaceID), + InvokeID: gptr.Of(invokeID), + Status: &status, + Output: &spi.InvokeEvalTargetOutput{ + ActualOutput: &spi.Content{ + ContentType: &contentType, + Text: gptr.Of(text), + }, + }, + Usage: &spi.InvokeEvalTargetUsage{ + InputTokens: &inputTokens, + OutputTokens: &outputTokens, + }, + } +} + +func newFailedInvokeResultReq(workspaceID, invokeID int64, errorMessage string) *openapi.ReportEvalTargetInvokeResultRequest { + status := spi.InvokeEvalTargetStatus_FAILED + + return &openapi.ReportEvalTargetInvokeResultRequest{ + WorkspaceID: gptr.Of(workspaceID), + InvokeID: gptr.Of(invokeID), + Status: &status, + ErrorMessage: gptr.Of(errorMessage), + } +} From dd4b30843dd82c7c407f2d4d8c06855f031c7dc4 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 20 Oct 2025 14:29:24 +0800 Subject: [PATCH 092/100] test: [Coda] add eval target app and convertor coverage (LogID: 202510201405230100791450314179984) Co-Authored-By: Coda --- .../target/eval_target_record_test.go | 160 ++++++ .../application/eval_openapi_app_test.go | 5 + .../application/eval_target_app_test.go | 544 ++++++++++++++---- 3 files changed, 608 insertions(+), 101 deletions(-) create mode 100755 backend/modules/evaluation/application/convertor/target/eval_target_record_test.go diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go new file mode 100755 index 000000000..d0d8a1cc2 --- /dev/null +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go @@ -0,0 +1,160 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package target + +import ( + "testing" + "time" + + "github.com/bytedance/gg/gptr" + "github.com/stretchr/testify/assert" + + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/openapi" + "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/domain/entity" + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" +) + +func TestEvalTargetRecordConversions(t *testing.T) { + now := time.Now().UnixMilli() + status := entity.EvalTargetRunStatusSuccess + record := &entity.EvalTargetRecord{ + ID: 1, + SpaceID: 2, + TargetID: 3, + TargetVersionID: 4, + ExperimentRunID: 5, + ItemID: 6, + TurnID: 7, + TraceID: "trace", + LogID: "log", + EvalTargetInputData: &entity.EvalTargetInputData{ + HistoryMessages: []*entity.Message{ + { + Role: entity.RoleUser, + Content: &entity.Content{ + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("hello"), + }, + }, + }, + InputFields: map[string]*entity.Content{ + "field": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("value"), + }, + }, + Ext: map[string]string{"extra": "ext"}, + }, + EvalTargetOutputData: &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{ + "output": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("out"), + }, + }, + EvalTargetUsage: &entity.EvalTargetUsage{ + InputTokens: 10, + OutputTokens: 20, + }, + EvalTargetRunError: &entity.EvalTargetRunError{Code: errno.CommonInternalErrorCode, Message: "err"}, + TimeConsumingMS: gptr.Of(int64(42)), + }, + Status: &status, + BaseInfo: &entity.BaseInfo{CreatedAt: gptr.Of(now), UpdatedAt: gptr.Of(now + 1)}, + } + + dto := EvalTargetRecordDO2DTO(record) + assert.NotNil(t, dto) + assert.Equal(t, record.ID, dto.GetID()) + assert.Equal(t, record.TraceID, dto.GetTraceID()) + assert.Equal(t, "value", dto.GetEvalTargetInputData().GetInputFields()["field"].GetText()) + assert.Equal(t, int64(10), dto.GetEvalTargetOutputData().GetEvalTargetUsage().GetInputTokens()) + + back := RecordDTO2DO(dto) + assert.Equal(t, record.TargetID, back.TargetID) + assert.Equal(t, record.EvalTargetOutputData.OutputFields["output"].GetText(), back.EvalTargetOutputData.OutputFields["output"].GetText()) + assert.Equal(t, record.Status, back.Status) + + var nilTime *int64 + assert.True(t, UnixMsPtr2Time(nilTime).IsZero()) + neg := gptr.Of(int64(-1)) + assert.True(t, UnixMsPtr2Time(neg).IsZero()) + assert.False(t, UnixMsPtr2Time(gptr.Of(int64(123))).IsZero()) +} + +func TestToInvokeOutputDataDO(t *testing.T) { + successStatus := spi.InvokeEvalTargetStatus_SUCCESS + contentType := spi.ContentTypeText + successReq := &openapi.ReportEvalTargetInvokeResultRequest{ + Status: &successStatus, + Output: &spi.InvokeEvalTargetOutput{ + ActualOutput: &spi.Content{ + ContentType: &contentType, + Text: gptr.Of("mock-output"), + MultiPart: []*spi.Content{{ + ContentType: &contentType, + Text: gptr.Of("part"), + }}, + }, + }, + Usage: &spi.InvokeEvalTargetUsage{ + InputTokens: gptr.Of(int64(100)), + OutputTokens: gptr.Of(int64(200)), + }, + } + + successOutput := ToInvokeOutputDataDO(successReq) + if assert.NotNil(t, successOutput) { + assert.Contains(t, successOutput.OutputFields, consts.OutputSchemaKey) + assert.NotNil(t, successOutput.EvalTargetUsage) + assert.Equal(t, int64(100), successOutput.EvalTargetUsage.InputTokens) + assert.Nil(t, successOutput.EvalTargetRunError) + } + + failStatus := spi.InvokeEvalTargetStatus_FAILED + failReq := &openapi.ReportEvalTargetInvokeResultRequest{ + Status: &failStatus, + ErrorMessage: gptr.Of("failed"), + } + + failOutput := ToInvokeOutputDataDO(failReq) + if assert.NotNil(t, failOutput) { + assert.NotNil(t, failOutput.EvalTargetRunError) + assert.Equal(t, int32(errno.CustomEvalTargetInvokeFailCode), failOutput.EvalTargetRunError.Code) + assert.Equal(t, "failed", failOutput.EvalTargetRunError.Message) + assert.Nil(t, failOutput.EvalTargetUsage) + } + + unknownStatus := spi.InvokeEvalTargetStatus(99) + unknownReq := &openapi.ReportEvalTargetInvokeResultRequest{Status: &unknownStatus} + assert.Nil(t, ToInvokeOutputDataDO(unknownReq)) +} + +func TestToSPIContentHelpers(t *testing.T) { + textType := spi.ContentTypeText + imageType := spi.ContentTypeImage + spiContent := &spi.Content{ + ContentType: &textType, + Text: gptr.Of("root"), + Image: &spi.Image{ + URL: gptr.Of("http://example.com/image.png"), + }, + MultiPart: []*spi.Content{{ + ContentType: &imageType, + }}, + } + + content := ToSPIContentDO(spiContent) + if assert.NotNil(t, content) { + assert.Equal(t, entity.ContentTypeText, *content.ContentType) + assert.Len(t, content.MultiPart, 1) + assert.Equal(t, entity.ContentTypeImage, *content.MultiPart[0].ContentType) + } + + assert.Equal(t, entity.EvalTargetRunStatusSuccess, ToTargetRunStatsDO(spi.InvokeEvalTargetStatus_SUCCESS)) + assert.Equal(t, entity.EvalTargetRunStatusFail, ToTargetRunStatsDO(spi.InvokeEvalTargetStatus_FAILED)) + assert.Equal(t, entity.EvalTargetRunStatusUnknown, ToTargetRunStatsDO(spi.InvokeEvalTargetStatus(42))) +} diff --git a/backend/modules/evaluation/application/eval_openapi_app_test.go b/backend/modules/evaluation/application/eval_openapi_app_test.go index a4756b5d4..19d3c63ae 100755 --- a/backend/modules/evaluation/application/eval_openapi_app_test.go +++ b/backend/modules/evaluation/application/eval_openapi_app_test.go @@ -205,3 +205,8 @@ func newFailedInvokeResultReq(workspaceID, invokeID int64, errorMessage string) ErrorMessage: gptr.Of(errorMessage), } } + +func TestNewEvalOpenAPIApplication(t *testing.T) { + app := NewEvalOpenAPIApplication(nil, nil, nil) + assert.NotNil(t, app) +} diff --git a/backend/modules/evaluation/application/eval_target_app_test.go b/backend/modules/evaluation/application/eval_target_app_test.go index 605d3e9c1..3af7302e7 100644 --- a/backend/modules/evaluation/application/eval_target_app_test.go +++ b/backend/modules/evaluation/application/eval_target_app_test.go @@ -15,7 +15,7 @@ import ( domaincommon "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/common" domain_eval_target "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/domain/eval_target" - "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" + evaltargetapi "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/eval_target" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/evaluation/spi" "github.com/coze-dev/coze-loop/backend/modules/evaluation/application/convertor/target" "github.com/coze-dev/coze-loop/backend/modules/evaluation/consts" @@ -52,17 +52,17 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { tests := []struct { name string - req *eval_target.CreateEvalTargetRequest + req *evaltargetapi.CreateEvalTargetRequest mockSetup func() - wantResp *eval_target.CreateEvalTargetResponse + wantResp *evaltargetapi.CreateEvalTargetResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetID: &validSourceTargetID, SourceTargetVersion: &validSourceTargetVersion, EvalTargetType: &validEvalTargetType, @@ -91,7 +91,7 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { gomock.Any(), // options ).Return(int64(1), int64(2), nil) }, - wantResp: &eval_target.CreateEvalTargetResponse{ + wantResp: &evaltargetapi.CreateEvalTargetResponse{ ID: gptr.Of(int64(1)), VersionID: gptr.Of(int64(2)), }, @@ -107,7 +107,7 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - nil param", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, Param: nil, }, @@ -118,9 +118,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - missing source target id", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetVersion: &validSourceTargetVersion, EvalTargetType: &validEvalTargetType, }, @@ -132,9 +132,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - missing source target version", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetID: &validSourceTargetID, EvalTargetType: &validEvalTargetType, }, @@ -157,7 +157,7 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { gomock.Any(), // options ).Return(int64(1), int64(2), nil) }, - wantResp: &eval_target.CreateEvalTargetResponse{ + wantResp: &evaltargetapi.CreateEvalTargetResponse{ ID: gptr.Of(int64(1)), VersionID: gptr.Of(int64(2)), }, @@ -165,9 +165,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - missing eval target type", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetID: &validSourceTargetID, SourceTargetVersion: &validSourceTargetVersion, }, @@ -179,9 +179,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetID: &validSourceTargetID, SourceTargetVersion: &validSourceTargetVersion, EvalTargetType: &validEvalTargetType, @@ -197,9 +197,9 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { }, { name: "error - service failure", - req: &eval_target.CreateEvalTargetRequest{ + req: &evaltargetapi.CreateEvalTargetRequest{ WorkspaceID: validSpaceID, - Param: &eval_target.CreateEvalTargetParam{ + Param: &evaltargetapi.CreateEvalTargetParam{ SourceTargetID: &validSourceTargetID, SourceTargetVersion: &validSourceTargetVersion, EvalTargetType: &validEvalTargetType, @@ -237,6 +237,16 @@ func TestEvalTargetApplicationImpl_CreateEvalTarget(t *testing.T) { } } +func TestNewEvalTargetHandlerImpl(t *testing.T) { + handler := NewEvalTargetHandlerImpl(nil, nil, nil, nil) + if handler == nil { + t.Fatalf("handler is nil") + } + if handler2 := NewEvalTargetHandlerImpl(nil, nil, nil, nil); handler2 != handler { + t.Fatalf("handler should be singleton") + } +} + func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -269,15 +279,15 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { tests := []struct { name string - req *eval_target.BatchGetEvalTargetsBySourceRequest + req *evaltargetapi.BatchGetEvalTargetsBySourceRequest mockSetup func() - wantResp *eval_target.BatchGetEvalTargetsBySourceResponse + wantResp *evaltargetapi.BatchGetEvalTargetsBySourceResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, EvalTargetType: &validEvalTargetType, @@ -298,7 +308,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { mockTypedOperator.EXPECT().PackSourceInfo(gomock.Any(), validSpaceID, validEvalTargets).Return(nil) }, - wantResp: &eval_target.BatchGetEvalTargetsBySourceResponse{ + wantResp: &evaltargetapi.BatchGetEvalTargetsBySourceResponse{ EvalTargets: []*domain_eval_target.EvalTarget{ { ID: gptr.Of(int64(1)), @@ -320,7 +330,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { }, { name: "error - empty source target ids", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: []string{}, EvalTargetType: &validEvalTargetType, @@ -332,7 +342,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { }, { name: "error - nil eval target type", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, EvalTargetType: nil, @@ -344,7 +354,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { }, { name: "error - auth failure", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, EvalTargetType: &validEvalTargetType, @@ -359,7 +369,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { }, { name: "error - service failure", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, EvalTargetType: &validEvalTargetType, @@ -375,7 +385,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetsBySource(t *testing.T) { }, { name: "error - pack source info failure", - req: &eval_target.BatchGetEvalTargetsBySourceRequest{ + req: &evaltargetapi.BatchGetEvalTargetsBySourceRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, EvalTargetType: &validEvalTargetType, @@ -446,15 +456,15 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { tests := []struct { name string - req *eval_target.GetEvalTargetVersionRequest + req *evaltargetapi.GetEvalTargetVersionRequest mockSetup func() - wantResp *eval_target.GetEvalTargetVersionResponse + wantResp *evaltargetapi.GetEvalTargetVersionResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.GetEvalTargetVersionRequest{ + req: &evaltargetapi.GetEvalTargetVersionRequest{ WorkspaceID: validSpaceID, EvalTargetVersionID: &validVersionID, }, @@ -471,7 +481,7 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { }). Return(nil) }, - wantResp: &eval_target.GetEvalTargetVersionResponse{ + wantResp: &evaltargetapi.GetEvalTargetVersionResponse{ EvalTarget: target.EvalTargetDO2DTO(validEvalTarget), }, wantErr: false, @@ -486,7 +496,7 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { }, { name: "error - nil version id", - req: &eval_target.GetEvalTargetVersionRequest{ + req: &evaltargetapi.GetEvalTargetVersionRequest{ WorkspaceID: validSpaceID, }, mockSetup: func() {}, @@ -496,7 +506,7 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { }, { name: "success - eval target not found", - req: &eval_target.GetEvalTargetVersionRequest{ + req: &evaltargetapi.GetEvalTargetVersionRequest{ WorkspaceID: validSpaceID, EvalTargetVersionID: &validVersionID, }, @@ -505,12 +515,12 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { GetEvalTargetVersion(gomock.Any(), validSpaceID, validVersionID, false). Return(nil, nil) }, - wantResp: &eval_target.GetEvalTargetVersionResponse{}, + wantResp: &evaltargetapi.GetEvalTargetVersionResponse{}, wantErr: false, }, { name: "error - service failure", - req: &eval_target.GetEvalTargetVersionRequest{ + req: &evaltargetapi.GetEvalTargetVersionRequest{ WorkspaceID: validSpaceID, EvalTargetVersionID: &validVersionID, }, @@ -525,7 +535,7 @@ func TestEvalTargetApplicationImpl_GetEvalTargetVersion(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.GetEvalTargetVersionRequest{ + req: &evaltargetapi.GetEvalTargetVersionRequest{ WorkspaceID: validSpaceID, EvalTargetVersionID: &validVersionID, }, @@ -610,15 +620,15 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetVersions(t *testing.T) { tests := []struct { name string - req *eval_target.BatchGetEvalTargetVersionsRequest + req *evaltargetapi.BatchGetEvalTargetVersionsRequest mockSetup func() - wantResp *eval_target.BatchGetEvalTargetVersionsResponse + wantResp *evaltargetapi.BatchGetEvalTargetVersionsResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.BatchGetEvalTargetVersionsRequest{ + req: &evaltargetapi.BatchGetEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, EvalTargetVersionIds: validVersionIDs, }, @@ -631,7 +641,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetVersions(t *testing.T) { Authorization(gomock.Any(), gomock.Any()). Return(nil) }, - wantResp: &eval_target.BatchGetEvalTargetVersionsResponse{ + wantResp: &evaltargetapi.BatchGetEvalTargetVersionsResponse{ EvalTargets: []*domain_eval_target.EvalTarget{ target.EvalTargetDO2DTO(validEvalTargets[0]), target.EvalTargetDO2DTO(validEvalTargets[1]), @@ -649,7 +659,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetVersions(t *testing.T) { }, { name: "error - empty version ids", - req: &eval_target.BatchGetEvalTargetVersionsRequest{ + req: &evaltargetapi.BatchGetEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, EvalTargetVersionIds: []int64{}, }, @@ -660,7 +670,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetVersions(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.BatchGetEvalTargetVersionsRequest{ + req: &evaltargetapi.BatchGetEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, EvalTargetVersionIds: validVersionIDs, }, @@ -675,7 +685,7 @@ func TestEvalTargetApplicationImpl_BatchGetEvalTargetVersions(t *testing.T) { }, { name: "error - service failure", - req: &eval_target.BatchGetEvalTargetVersionsRequest{ + req: &evaltargetapi.BatchGetEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, EvalTargetVersionIds: validVersionIDs, }, @@ -757,15 +767,15 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargets(t *testing.T) { tests := []struct { name string - req *eval_target.ListSourceEvalTargetsRequest + req *evaltargetapi.ListSourceEvalTargetsRequest mockSetup func() - wantResp *eval_target.ListSourceEvalTargetsResponse + wantResp *evaltargetapi.ListSourceEvalTargetsResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.ListSourceEvalTargetsRequest{ + req: &evaltargetapi.ListSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, TargetType: &validEvalTargetType, }, @@ -788,7 +798,7 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargets(t *testing.T) { EvalTargetType: 1, }}, "", false, nil) }, - wantResp: &eval_target.ListSourceEvalTargetsResponse{ + wantResp: &evaltargetapi.ListSourceEvalTargetsResponse{ EvalTargets: []*domain_eval_target.EvalTarget{ target.EvalTargetDO2DTO(validEvalTargets[0]), target.EvalTargetDO2DTO(validEvalTargets[1]), @@ -806,7 +816,7 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargets(t *testing.T) { }, { name: "error - nil eval target type", - req: &eval_target.ListSourceEvalTargetsRequest{ + req: &evaltargetapi.ListSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, }, mockSetup: func() {}, @@ -892,15 +902,15 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargetVersions(t *testing.T) { tests := []struct { name string - req *eval_target.ListSourceEvalTargetVersionsRequest + req *evaltargetapi.ListSourceEvalTargetVersionsRequest mockSetup func() - wantResp *eval_target.ListSourceEvalTargetVersionsResponse + wantResp *evaltargetapi.ListSourceEvalTargetVersionsResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.ListSourceEvalTargetVersionsRequest{ + req: &evaltargetapi.ListSourceEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, TargetType: &validEvalTargetType, }, @@ -936,7 +946,7 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargetVersions(t *testing.T) { }, }}, "", false, nil) }, - wantResp: &eval_target.ListSourceEvalTargetVersionsResponse{ + wantResp: &evaltargetapi.ListSourceEvalTargetVersionsResponse{ Versions: []*domain_eval_target.EvalTargetVersion{ target.EvalTargetVersionDO2DTO(validEvalTargets[0]), target.EvalTargetVersionDO2DTO(validEvalTargets[1]), @@ -955,7 +965,7 @@ func TestEvalTargetApplicationImpl_ListSourceEvalTargetVersions(t *testing.T) { }, { name: "error - nil target type", - req: &eval_target.ListSourceEvalTargetVersionsRequest{ + req: &evaltargetapi.ListSourceEvalTargetVersionsRequest{ WorkspaceID: validSpaceID, }, mockSetup: func() {}, @@ -1023,15 +1033,15 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { tests := []struct { name string - req *eval_target.BatchGetSourceEvalTargetsRequest + req *evaltargetapi.BatchGetSourceEvalTargetsRequest mockSetup func() - wantResp *eval_target.BatchGetSourceEvalTargetsResponse + wantResp *evaltargetapi.BatchGetSourceEvalTargetsResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.BatchGetSourceEvalTargetsRequest{ + req: &evaltargetapi.BatchGetSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, TargetType: &validEvalTargetType, SourceTargetIds: validSourceTargetIDs, @@ -1042,7 +1052,7 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { BatchGetSource(gomock.Any(), validSpaceID, validSourceTargetIDs). Return(validEvalTargets, nil) }, - wantResp: &eval_target.BatchGetSourceEvalTargetsResponse{ + wantResp: &evaltargetapi.BatchGetSourceEvalTargetsResponse{ EvalTargets: []*domain_eval_target.EvalTarget{ target.EvalTargetDO2DTO(validEvalTargets[0]), target.EvalTargetDO2DTO(validEvalTargets[1]), @@ -1052,7 +1062,7 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { }, { name: "error - nil target type", - req: &eval_target.BatchGetSourceEvalTargetsRequest{ + req: &evaltargetapi.BatchGetSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, SourceTargetIds: validSourceTargetIDs, }, @@ -1063,7 +1073,7 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.BatchGetSourceEvalTargetsRequest{ + req: &evaltargetapi.BatchGetSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, TargetType: &validEvalTargetType, SourceTargetIds: validSourceTargetIDs, @@ -1079,7 +1089,7 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { }, { name: "error - unsupported target type", - req: &eval_target.BatchGetSourceEvalTargetsRequest{ + req: &evaltargetapi.BatchGetSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, TargetType: &unsupportedEvalTargetType, SourceTargetIds: validSourceTargetIDs, @@ -1093,7 +1103,7 @@ func TestEvalTargetApplicationImpl_BatchGetSourceEvalTargets(t *testing.T) { }, { name: "error - service failure", - req: &eval_target.BatchGetSourceEvalTargetsRequest{ + req: &evaltargetapi.BatchGetSourceEvalTargetsRequest{ WorkspaceID: validSpaceID, TargetType: &validEvalTargetType, SourceTargetIds: validSourceTargetIDs, @@ -1184,15 +1194,15 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { tests := []struct { name string - req *eval_target.SearchCustomEvalTargetRequest + req *evaltargetapi.SearchCustomEvalTargetRequest mockSetup func() - wantResp *eval_target.SearchCustomEvalTargetResponse + wantResp *evaltargetapi.SearchCustomEvalTargetResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request with applicationID", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1219,7 +1229,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { PageToken: &validPageToken, }).Return(validCustomEvalTargets, "next-token", true, nil) }, - wantResp: &eval_target.SearchCustomEvalTargetResponse{ + wantResp: &evaltargetapi.SearchCustomEvalTargetResponse{ CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{ { ID: gptr.Of("target-1"), @@ -1241,7 +1251,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "success - normal request with customRPCServer", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, CustomRPCServer: validCustomRPCServer, @@ -1259,7 +1269,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { mockTypedOperator.EXPECT().SearchCustomEvalTarget(gomock.Any(), gomock.Any()).Return(validCustomEvalTargets, "next-token", true, nil) }, - wantResp: &eval_target.SearchCustomEvalTargetResponse{ + wantResp: &evaltargetapi.SearchCustomEvalTargetResponse{ CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{ { ID: gptr.Of("target-1"), @@ -1289,7 +1299,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - nil workspaceID", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ Keyword: &validKeyword, ApplicationID: &validApplicationID, Region: &validRegion, @@ -1301,7 +1311,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - both applicationID and customRPCServer are nil", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, Region: &validRegion, @@ -1313,7 +1323,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - nil region", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1325,7 +1335,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - target type not support", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1341,7 +1351,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1357,7 +1367,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "error - service failure", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1374,7 +1384,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { }, { name: "success - empty results", - req: &eval_target.SearchCustomEvalTargetRequest{ + req: &evaltargetapi.SearchCustomEvalTargetRequest{ WorkspaceID: &validSpaceID, Keyword: &validKeyword, ApplicationID: &validApplicationID, @@ -1398,7 +1408,7 @@ func TestEvalTargetApplicationImpl_SearchCustomEvalTarget(t *testing.T) { PageToken: nil, }).Return([]*entity.CustomEvalTarget{}, "", false, nil) }, - wantResp: &eval_target.SearchCustomEvalTargetResponse{ + wantResp: &evaltargetapi.SearchCustomEvalTargetResponse{ CustomEvalTargets: []*domain_eval_target.CustomEvalTarget{}, NextPageToken: gptr.Of(""), HasMore: gptr.Of(false), @@ -1478,15 +1488,15 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { tests := []struct { name string - req *eval_target.MockEvalTargetOutputRequest + req *evaltargetapi.MockEvalTargetOutputRequest mockSetup func() - wantResp *eval_target.MockEvalTargetOutputResponse + wantResp *evaltargetapi.MockEvalTargetOutputResponse wantErr bool wantErrCode int32 }{ { name: "success - normal request", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1507,7 +1517,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { GenerateMockOutputData(validEvalTarget.EvalTargetVersion.OutputSchema). Return(map[string]string{"output": "mock output"}, nil) }, - wantResp: &eval_target.MockEvalTargetOutputResponse{ + wantResp: &evaltargetapi.MockEvalTargetOutputResponse{ EvalTarget: target.EvalTargetDO2DTO(validEvalTarget), MockOutput: map[string]string{"output": "mock output"}, }, @@ -1523,7 +1533,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "error - unsupported target type", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1536,7 +1546,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "error - auth failed", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1557,7 +1567,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "error - build by source failed", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1574,7 +1584,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "error - build by source returns nil", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1591,7 +1601,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "error - generate mock data failed", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1614,7 +1624,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { }, { name: "success - no output schema", - req: &eval_target.MockEvalTargetOutputRequest{ + req: &evaltargetapi.MockEvalTargetOutputRequest{ WorkspaceID: validSpaceID, SourceTargetID: validSourceTargetID, EvalTargetVersion: validEvalTargetVersion, @@ -1641,7 +1651,7 @@ func TestEvalTargetApplicationImpl_MockEvalTargetOutput(t *testing.T) { mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(nil) }, - wantResp: &eval_target.MockEvalTargetOutputResponse{ + wantResp: &evaltargetapi.MockEvalTargetOutputResponse{ EvalTarget: target.EvalTargetDO2DTO(&entity.EvalTarget{ ID: 1, SpaceID: validSpaceID, @@ -1707,14 +1717,14 @@ func TestEvalTargetApplicationImpl_AsyncExecuteEvalTarget(t *testing.T) { tests := []struct { name string - req *eval_target.AsyncExecuteEvalTargetRequest + req *evaltargetapi.AsyncExecuteEvalTargetRequest mockSetup func() wantErr bool wantErrCode int32 }{ { name: "success", - req: &eval_target.AsyncExecuteEvalTargetRequest{ + req: &evaltargetapi.AsyncExecuteEvalTargetRequest{ WorkspaceID: workspaceID, EvalTargetID: targetID, EvalTargetVersionID: versionID, @@ -1738,7 +1748,7 @@ func TestEvalTargetApplicationImpl_AsyncExecuteEvalTarget(t *testing.T) { }, { name: "auth failure", - req: &eval_target.AsyncExecuteEvalTargetRequest{ + req: &evaltargetapi.AsyncExecuteEvalTargetRequest{ WorkspaceID: workspaceID, EvalTargetID: targetID, EvalTargetVersionID: versionID, @@ -1752,7 +1762,7 @@ func TestEvalTargetApplicationImpl_AsyncExecuteEvalTarget(t *testing.T) { }, { name: "service failure", - req: &eval_target.AsyncExecuteEvalTargetRequest{ + req: &evaltargetapi.AsyncExecuteEvalTargetRequest{ WorkspaceID: workspaceID, EvalTargetID: targetID, EvalTargetVersionID: versionID, @@ -1827,14 +1837,14 @@ func TestEvalTargetApplicationImpl_DebugEvalTarget(t *testing.T) { tests := []struct { name string - req *eval_target.DebugEvalTargetRequest + req *evaltargetapi.DebugEvalTargetRequest mockSetup func() wantErr bool wantErrCode int32 }{ { name: "success", - req: &eval_target.DebugEvalTargetRequest{ + req: &evaltargetapi.DebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of(string(paramBytes)), @@ -1849,7 +1859,7 @@ func TestEvalTargetApplicationImpl_DebugEvalTarget(t *testing.T) { }, { name: "invalid json", - req: &eval_target.DebugEvalTargetRequest{ + req: &evaltargetapi.DebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of("{"), @@ -1860,7 +1870,7 @@ func TestEvalTargetApplicationImpl_DebugEvalTarget(t *testing.T) { }, { name: "service failure", - req: &eval_target.DebugEvalTargetRequest{ + req: &evaltargetapi.DebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of(string(paramBytes)), @@ -1876,7 +1886,7 @@ func TestEvalTargetApplicationImpl_DebugEvalTarget(t *testing.T) { }, { name: "unsupported type", - req: &eval_target.DebugEvalTargetRequest{ + req: &evaltargetapi.DebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: gptr.Of(domain_eval_target.EvalTargetType(0)), Param: gptr.Of(string(paramBytes)), @@ -1945,14 +1955,14 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { tests := []struct { name string - req *eval_target.AsyncDebugEvalTargetRequest + req *evaltargetapi.AsyncDebugEvalTargetRequest mockSetup func() wantErr bool wantErrCode int32 }{ { name: "success", - req: &eval_target.AsyncDebugEvalTargetRequest{ + req: &evaltargetapi.AsyncDebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of(string(paramBytes)), @@ -1968,7 +1978,7 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { }, { name: "invalid json", - req: &eval_target.AsyncDebugEvalTargetRequest{ + req: &evaltargetapi.AsyncDebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of("{"), @@ -1979,7 +1989,7 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { }, { name: "service failure", - req: &eval_target.AsyncDebugEvalTargetRequest{ + req: &evaltargetapi.AsyncDebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of(string(paramBytes)), @@ -1995,7 +2005,7 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { }, { name: "set async ctx failure", - req: &eval_target.AsyncDebugEvalTargetRequest{ + req: &evaltargetapi.AsyncDebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: &targetType, Param: gptr.Of(string(paramBytes)), @@ -2012,7 +2022,7 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { }, { name: "unsupported type", - req: &eval_target.AsyncDebugEvalTargetRequest{ + req: &evaltargetapi.AsyncDebugEvalTargetRequest{ WorkspaceID: &workspaceID, EvalTargetType: gptr.Of(domain_eval_target.EvalTargetType(0)), Param: gptr.Of(string(paramBytes)), @@ -2048,3 +2058,335 @@ func TestEvalTargetApplicationImpl_AsyncDebugEvalTarget(t *testing.T) { }) } } + +func TestEvalTargetApplicationImpl_ExecuteEvalTarget(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockAuth := rpcmocks.NewMockIAuthProvider(ctrl) + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + + app := &EvalTargetApplicationImpl{ + auth: mockAuth, + evalTargetService: mockEvalTargetService, + } + + workspaceID := int64(100) + targetID := int64(200) + versionID := int64(300) + inputData := &domain_eval_target.EvalTargetInputData{} + record := &entity.EvalTargetRecord{ID: 1, SpaceID: workspaceID, TargetID: targetID, BaseInfo: &entity.BaseInfo{}} + + tests := []struct { + name string + req *evaltargetapi.ExecuteEvalTargetRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "success", + req: &evaltargetapi.ExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(targetID, 10), + SpaceID: workspaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.Run), EntityType: gptr.Of(rpc.AuthEntityType_EvaluationTarget)}}, + }).Return(nil) + mockEvalTargetService.EXPECT().ExecuteTarget( + gomock.Any(), + workspaceID, + targetID, + versionID, + gomock.AssignableToTypeOf(&entity.ExecuteTargetCtx{}), + gomock.AssignableToTypeOf(&entity.EvalTargetInputData{}), + ).Return(record, nil) + }, + }, + { + name: "nil request", + req: nil, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "nil input data", + req: &evaltargetapi.ExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + }, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "auth failure", + req: &evaltargetapi.ExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(errorx.NewByCode(errno.CommonNoPermissionCode)) + }, + wantErr: true, + wantErrCode: errno.CommonNoPermissionCode, + }, + { + name: "service failure", + req: &evaltargetapi.ExecuteEvalTargetRequest{ + WorkspaceID: workspaceID, + EvalTargetID: targetID, + EvalTargetVersionID: versionID, + InputData: inputData, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(nil) + mockEvalTargetService.EXPECT().ExecuteTarget(gomock.Any(), workspaceID, targetID, versionID, gomock.Any(), gomock.Any()). + Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.ExecuteEvalTarget(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + return + } + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.EvalTargetRecord) + }) + } +} + +func TestEvalTargetApplicationImpl_GetEvalTargetRecord(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockAuth := rpcmocks.NewMockIAuthProvider(ctrl) + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + + app := &EvalTargetApplicationImpl{ + auth: mockAuth, + evalTargetService: mockEvalTargetService, + } + + workspaceID := int64(111) + recordID := int64(222) + record := &entity.EvalTargetRecord{TargetID: 333, ID: recordID, BaseInfo: &entity.BaseInfo{}} + + tests := []struct { + name string + req *evaltargetapi.GetEvalTargetRecordRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "nil request", + req: nil, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "service failure", + req: &evaltargetapi.GetEvalTargetRecordRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordID: recordID, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().GetRecordByID(gomock.Any(), workspaceID, recordID). + Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "record not found", + req: &evaltargetapi.GetEvalTargetRecordRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordID: recordID, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().GetRecordByID(gomock.Any(), workspaceID, recordID).Return(nil, nil) + }, + }, + { + name: "auth failure", + req: &evaltargetapi.GetEvalTargetRecordRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordID: recordID, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().GetRecordByID(gomock.Any(), workspaceID, recordID).Return(record, nil) + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(errorx.NewByCode(errno.CommonNoPermissionCode)) + }, + wantErr: true, + wantErrCode: errno.CommonNoPermissionCode, + }, + { + name: "success", + req: &evaltargetapi.GetEvalTargetRecordRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordID: recordID, + }, + mockSetup: func() { + mockEvalTargetService.EXPECT().GetRecordByID(gomock.Any(), workspaceID, recordID).Return(record, nil) + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(record.TargetID, 10), + SpaceID: workspaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of(consts.Read), EntityType: gptr.Of(rpc.AuthEntityType_EvaluationTarget)}}, + }).Return(nil) + }, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.GetEvalTargetRecord(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + return + } + + assert.NoError(t, err) + assert.NotNil(t, resp) + }) + } +} + +func TestEvalTargetApplicationImpl_BatchGetEvalTargetRecords(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockAuth := rpcmocks.NewMockIAuthProvider(ctrl) + mockEvalTargetService := mocks.NewMockIEvalTargetService(ctrl) + + app := &EvalTargetApplicationImpl{ + auth: mockAuth, + evalTargetService: mockEvalTargetService, + } + + workspaceID := int64(777) + recordIDs := []int64{1, 2} + records := []*entity.EvalTargetRecord{{ID: 1, BaseInfo: &entity.BaseInfo{}}, {ID: 2, BaseInfo: &entity.BaseInfo{}}} + + tests := []struct { + name string + req *evaltargetapi.BatchGetEvalTargetRecordsRequest + mockSetup func() + wantErr bool + wantErrCode int32 + }{ + { + name: "nil request", + req: nil, + mockSetup: func() {}, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "auth failure", + req: &evaltargetapi.BatchGetEvalTargetRecordsRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordIds: recordIDs, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(errorx.NewByCode(errno.CommonNoPermissionCode)) + }, + wantErr: true, + wantErrCode: errno.CommonNoPermissionCode, + }, + { + name: "service failure", + req: &evaltargetapi.BatchGetEvalTargetRecordsRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordIds: recordIDs, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), gomock.Any()).Return(nil) + mockEvalTargetService.EXPECT().BatchGetRecordByIDs(gomock.Any(), workspaceID, recordIDs). + Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "success", + req: &evaltargetapi.BatchGetEvalTargetRecordsRequest{ + WorkspaceID: workspaceID, + EvalTargetRecordIds: recordIDs, + }, + mockSetup: func() { + mockAuth.EXPECT().Authorization(gomock.Any(), &rpc.AuthorizationParam{ + ObjectID: strconv.FormatInt(workspaceID, 10), + SpaceID: workspaceID, + ActionObjects: []*rpc.ActionObject{{Action: gptr.Of("listLoopEvaluationTarget"), EntityType: gptr.Of(rpc.AuthEntityType_Space)}}, + }).Return(nil) + mockEvalTargetService.EXPECT().BatchGetRecordByIDs(gomock.Any(), workspaceID, recordIDs).Return(records, nil) + }, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + if tc.mockSetup != nil { + tc.mockSetup() + } + + resp, err := app.BatchGetEvalTargetRecords(context.Background(), tc.req) + + if tc.wantErr { + assert.Error(t, err) + if tc.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + assert.True(t, ok) + assert.Equal(t, tc.wantErrCode, statusErr.Code()) + } + return + } + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Len(t, resp.EvalTargetRecords, len(recordIDs)) + }) + } +} From 67e9837f720d9551809ef967b37957a804546375 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 20 Oct 2025 15:08:31 +0800 Subject: [PATCH 093/100] test: [Coda] enhance evaluation module unit tests (LogID: 20251020145031010079145031340757A) Co-Authored-By: Coda --- .../target/eval_target_record_test.go | 15 ++ .../service/expt_run_item_turn_impl_test.go | 107 +++++++++++ .../domain/service/target_impl_test.go | 176 ++++++++++++++++++ 3 files changed, 298 insertions(+) diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go index d0d8a1cc2..6cf7e8140 100755 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record_test.go @@ -133,6 +133,21 @@ func TestToInvokeOutputDataDO(t *testing.T) { assert.Nil(t, ToInvokeOutputDataDO(unknownReq)) } +func TestToInvokeOutputDataDO_PartialData(t *testing.T) { + successStatus := spi.InvokeEvalTargetStatus_SUCCESS + req := &openapi.ReportEvalTargetInvokeResultRequest{ + Status: &successStatus, + Output: &spi.InvokeEvalTargetOutput{}, + Usage: &spi.InvokeEvalTargetUsage{}, + } + + output := ToInvokeOutputDataDO(req) + if assert.NotNil(t, output) { + assert.Empty(t, output.OutputFields) + assert.Nil(t, output.EvalTargetUsage) + } +} + func TestToSPIContentHelpers(t *testing.T) { textType := spi.ContentTypeText imageType := spi.ContentTypeImage diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go index c844aef19..10ee742bb 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl_test.go @@ -5,6 +5,7 @@ package service import ( "context" "errors" + "strconv" "testing" "github.com/bytedance/gg/gptr" @@ -1120,6 +1121,112 @@ func TestDefaultExptTurnEvaluationImpl_callTarget_RuntimeParam(t *testing.T) { } } +func TestDefaultExptTurnEvaluationImpl_callTarget_Async(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + mockMetric := metricsmocks.NewMockExptMetric(ctrl) + mockEvalTargetService := svcmocks.NewMockIEvalTargetService(ctrl) + mockEvalAsyncRepo := repomocks.NewMockIEvalAsyncRepo(ctrl) + + service := &DefaultExptTurnEvaluationImpl{ + metric: mockMetric, + evalTargetService: mockEvalTargetService, + evalAsyncRepo: mockEvalAsyncRepo, + } + + spaceID := int64(42) + targetID := int64(101) + targetVersionID := int64(202) + isAsync := true + record := &entity.EvalTargetRecord{ + ID: 9999, + EvalTargetOutputData: &entity.EvalTargetOutputData{OutputFields: map[string]*entity.Content{}}, + Status: gptr.Of(entity.EvalTargetRunStatusAsyncInvoking), + TargetID: targetID, + TargetVersionID: targetVersionID, + SpaceID: spaceID, + } + + turnContent := &entity.Content{ContentType: gptr.Of(entity.ContentTypeText), Text: gptr.Of("payload")} + etec := &entity.ExptTurnEvalCtx{ + ExptItemEvalCtx: &entity.ExptItemEvalCtx{ + Event: &entity.ExptItemEvalEvent{ + ExptID: 555, + ExptRunID: 777, + SpaceID: spaceID, + Session: &entity.Session{UserID: "user"}, + }, + Expt: &entity.Experiment{ + SpaceID: spaceID, + TargetVersionID: targetVersionID, + Target: &entity.EvalTarget{ + ID: targetID, + EvalTargetType: entity.EvalTargetTypeCustomRPCServer, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + CustomRPCServer: &entity.CustomRPCServer{ + IsAsync: gptr.Of(isAsync), + }, + }, + }, + EvalConf: &entity.EvaluationConfiguration{ + ConnectorConf: entity.Connector{ + TargetConf: &entity.TargetConf{ + TargetVersionID: targetVersionID, + IngressConf: &entity.TargetIngressConf{ + EvalSetAdapter: &entity.FieldAdapter{ + FieldConfs: []*entity.FieldConf{ + {FieldName: "fieldA", FromField: "fieldA"}, + }, + }, + }, + }, + }, + }, + }, + EvalSetItem: &entity.EvaluationSetItem{ItemID: 888}, + }, + Turn: &entity.Turn{ + ID: 999, + FieldDataList: []*entity.FieldData{ + {Name: "fieldA", Content: turnContent}, + }, + }, + Ext: map[string]string{"ext-key": "ext-val"}, + } + + mockMetric.EXPECT().EmitTurnExecTargetResult(spaceID, false) + + mockEvalTargetService.EXPECT().AsyncExecuteTarget(gomock.Any(), spaceID, targetID, targetVersionID, gomock.Any(), gomock.Any()).DoAndReturn( + func(_ context.Context, _ int64, _ int64, _ int64, param *entity.ExecuteTargetCtx, input *entity.EvalTargetInputData) (*entity.EvalTargetRecord, string, error) { + assert.Equal(t, int64(777), gptr.Indirect(param.ExperimentRunID)) + assert.Equal(t, int64(888), param.ItemID) + assert.Equal(t, int64(999), param.TurnID) + if assert.NotNil(t, input) { + assert.Equal(t, "payload", gptr.Indirect(input.InputFields["fieldA"].Text)) + assert.Equal(t, "ext-val", input.Ext["ext-key"]) + } + return record, "callee-service", nil + }, + ) + + mockEvalAsyncRepo.EXPECT().SetEvalAsyncCtx(gomock.Any(), strconv.FormatInt(record.ID, 10), gomock.Any()).DoAndReturn( + func(_ context.Context, invokeID string, actx *entity.EvalAsyncCtx) error { + assert.Equal(t, strconv.FormatInt(record.ID, 10), invokeID) + if assert.NotNil(t, actx) { + assert.Equal(t, "callee-service", actx.Callee) + assert.Equal(t, etec.Event, actx.Event) + } + return nil + }, + ) + + got, err := service.callTarget(context.Background(), etec, []*entity.Message{}, spaceID) + assert.NoError(t, err) + assert.Equal(t, record, got) +} + func TestDefaultExptTurnEvaluationImpl_buildEvaluatorInputData(t *testing.T) { t.Parallel() diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 0e3337bc5..f160451bb 100755 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -375,6 +375,182 @@ func TestEvalTargetServiceImpl_asyncExecuteTarget(t *testing.T) { } } +func TestEvalTargetServiceImpl_ExecuteTarget(t *testing.T) { + t.Parallel() + + type prepareResult struct { + typedOps map[entity.EvalTargetType]ISourceEvalTargetOperateService + expectedOutput *entity.EvalTargetOutputData + } + + tests := []struct { + name string + prepare func(ctx context.Context, deps *evalTargetServiceTestDeps, evalTarget *entity.EvalTarget, input *entity.EvalTargetInputData) prepareResult + wantStatus entity.EvalTargetRunStatus + wantErrCode int32 + }{ + { + name: "success", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, evalTarget *entity.EvalTarget, input *entity.EvalTargetInputData) prepareResult { + outputData := &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{ + "answer": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("ok"), + }, + }, + EvalTargetUsage: &entity.EvalTargetUsage{InputTokens: 1, OutputTokens: 2}, + } + deps.operator.EXPECT().ValidateInput(ctx, evalTarget.SpaceID, evalTarget.EvalTargetVersion.InputSchema, input).Return(nil) + deps.operator.EXPECT().Execute(ctx, evalTarget.SpaceID, gomock.Any()).DoAndReturn(func(_ context.Context, _ int64, param *entity.ExecuteEvalTargetParam) (*entity.EvalTargetOutputData, entity.EvalTargetRunStatus, error) { + assert.Equal(t, evalTarget.ID, param.TargetID) + assert.Equal(t, evalTarget.EvalTargetVersion.ID, param.VersionID) + assert.Equal(t, evalTarget.SourceTargetID, param.SourceTargetID) + assert.Equal(t, evalTarget.EvalTargetType, param.TargetType) + return outputData, entity.EvalTargetRunStatusSuccess, nil + }) + return prepareResult{ + typedOps: map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + evalTarget.EvalTargetType: deps.operator, + }, + expectedOutput: outputData, + } + }, + wantStatus: entity.EvalTargetRunStatusSuccess, + }, + { + name: "validate input failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, evalTarget *entity.EvalTarget, input *entity.EvalTargetInputData) prepareResult { + deps.operator.EXPECT().ValidateInput(ctx, evalTarget.SpaceID, evalTarget.EvalTargetVersion.InputSchema, input).Return(errorx.NewByCode(errno.CommonInvalidParamCode)) + return prepareResult{ + typedOps: map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + evalTarget.EvalTargetType: deps.operator, + }, + } + }, + wantStatus: entity.EvalTargetRunStatusFail, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "execute failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, evalTarget *entity.EvalTarget, input *entity.EvalTargetInputData) prepareResult { + deps.operator.EXPECT().ValidateInput(ctx, evalTarget.SpaceID, evalTarget.EvalTargetVersion.InputSchema, input).Return(nil) + deps.operator.EXPECT().Execute(ctx, evalTarget.SpaceID, gomock.Any()).Return(nil, entity.EvalTargetRunStatusFail, errorx.NewByCode(errno.CommonInternalErrorCode)) + return prepareResult{ + typedOps: map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + evalTarget.EvalTargetType: deps.operator, + }, + } + }, + wantStatus: entity.EvalTargetRunStatusFail, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "execute returns nil output", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, evalTarget *entity.EvalTarget, input *entity.EvalTargetInputData) prepareResult { + deps.operator.EXPECT().ValidateInput(ctx, evalTarget.SpaceID, evalTarget.EvalTargetVersion.InputSchema, input).Return(nil) + deps.operator.EXPECT().Execute(ctx, evalTarget.SpaceID, gomock.Any()).Return(nil, entity.EvalTargetRunStatusSuccess, nil) + return prepareResult{ + typedOps: map[entity.EvalTargetType]ISourceEvalTargetOperateService{ + evalTarget.EvalTargetType: deps.operator, + }, + } + }, + wantStatus: entity.EvalTargetRunStatusFail, + wantErrCode: errno.CommonInternalErrorCode, + }, + } + + for _, tc := range tests { + tcase := tc + t.Run(tcase.name, func(t *testing.T) { + t.Parallel() + + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), + } + + evalTarget := &entity.EvalTarget{ + ID: 200, + SpaceID: 100, + SourceTargetID: "src-id", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: 300, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("field")}, + }, + }, + } + + input := &entity.EvalTargetInputData{ + InputFields: map[string]*entity.Content{ + "field": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("hello"), + }, + }, + } + + param := &entity.ExecuteTargetCtx{ + ExperimentRunID: gptr.Of(int64(555)), + ItemID: 777, + TurnID: 888, + } + + deps.repo.EXPECT().GetEvalTargetVersion(ctx, evalTarget.SpaceID, evalTarget.EvalTargetVersion.ID).Return(evalTarget, nil) + deps.metric.EXPECT().EmitRun(evalTarget.SpaceID, gomock.Any(), gomock.Any()).Times(1) + deps.idgen.EXPECT().GenID(ctx).Return(int64(9999), nil) + + var savedRecord *entity.EvalTargetRecord + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).DoAndReturn(func(_ context.Context, rec *entity.EvalTargetRecord) (int64, error) { + savedRecord = rec + return rec.ID, nil + }) + + prepareRes := tcase.prepare(ctx, deps, evalTarget, input) + + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: prepareRes.typedOps, + } + + record, err := svc.ExecuteTarget(ctx, evalTarget.SpaceID, evalTarget.ID, evalTarget.EvalTargetVersion.ID, param, input) + require.NoError(t, err) + require.NotNil(t, record) + require.NotNil(t, savedRecord) + assert.Equal(t, savedRecord, record) + assert.Equal(t, int64(9999), record.ID) + assert.Equal(t, tcase.wantStatus, gptr.Indirect(record.Status)) + + if prepareRes.expectedOutput != nil { + assert.Equal(t, prepareRes.expectedOutput, record.EvalTargetOutputData) + assert.Nil(t, record.EvalTargetOutputData.EvalTargetRunError) + } else { + if assert.NotNil(t, record.EvalTargetOutputData) { + if tcase.wantErrCode == 0 { + assert.Nil(t, record.EvalTargetOutputData.EvalTargetRunError) + } else { + if assert.NotNil(t, record.EvalTargetOutputData.EvalTargetRunError) { + assert.Equal(t, tcase.wantErrCode, record.EvalTargetOutputData.EvalTargetRunError.Code) + } + } + } + } + }) + } +} + func TestEvalTargetServiceImpl_ReportInvokeRecords(t *testing.T) { t.Parallel() From e2929ec4a074ffb014aca5ecf1b12eb3bb0e4ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 20 Oct 2025 19:19:14 +0800 Subject: [PATCH 094/100] fix Change-Id: I0d679cd402159c271b53c497563e4b477e24632b --- backend/api/router/coze/loop/apis/middleware.go | 1 + .../application/convertor/target/eval_target_test.go | 4 ++-- backend/modules/evaluation/application/eval_target_app.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/api/router/coze/loop/apis/middleware.go b/backend/api/router/coze/loop/apis/middleware.go index ed8be7f62..2060ec0ef 100644 --- a/backend/api/router/coze/loop/apis/middleware.go +++ b/backend/api/router/coze/loop/apis/middleware.go @@ -1274,6 +1274,7 @@ func _listtracesoapiMw(handler *apis.APIHandler) []app.HandlerFunc { func _asyncdebugevaltargetMw(handler *apis.APIHandler) []app.HandlerFunc { return nil } + func _validateevaluatorMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_test.go b/backend/modules/evaluation/application/convertor/target/eval_target_test.go index be50802bf..584b3212a 100755 --- a/backend/modules/evaluation/application/convertor/target/eval_target_test.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_test.go @@ -440,7 +440,7 @@ func TestCustomRPCServerConversions(t *testing.T) { assert.Equal(t, doValue.Description, gptr.Indirect(dtoValue.Description)) assert.Equal(t, doValue.ServerName, gptr.Indirect(dtoValue.ServerName)) assert.Equal(t, doValue.AccessProtocol, gptr.Indirect(dtoValue.AccessProtocol)) - assert.Equal(t, []string(doValue.Regions), dtoValue.Regions) + assert.Equal(t, doValue.Regions, dtoValue.Regions) assert.Equal(t, doValue.Cluster, gptr.Indirect(dtoValue.Cluster)) assert.Equal(t, doValue.InvokeHTTPInfo.Path, gptr.Indirect(dtoValue.InvokeHTTPInfo.Path)) assert.Equal(t, doValue.AsyncInvokeHTTPInfo.Method, gptr.Indirect(dtoValue.AsyncInvokeHTTPInfo.Method)) @@ -448,7 +448,7 @@ func TestCustomRPCServerConversions(t *testing.T) { assert.Equal(t, doValue.SearchHTTPInfo.Path, gptr.Indirect(dtoValue.SearchHTTPInfo.Path)) assert.Equal(t, doValue.CustomEvalTarget.Name, dtoValue.CustomEvalTarget.Name) assert.Equal(t, doValue.IsAsync, dtoValue.IsAsync) - assert.Equal(t, do.Region(gptr.Indirect(dtoValue.ExecRegion)), doValue.ExecRegion) + assert.Equal(t, gptr.Indirect(dtoValue.ExecRegion), doValue.ExecRegion) assert.Equal(t, doValue.ExecEnv, dtoValue.ExecEnv) assert.Equal(t, doValue.Timeout, dtoValue.Timeout) assert.Equal(t, doValue.AsyncTimeout, dtoValue.AsyncTimeout) diff --git a/backend/modules/evaluation/application/eval_target_app.go b/backend/modules/evaluation/application/eval_target_app.go index e5c540df6..f37fa1d1c 100644 --- a/backend/modules/evaluation/application/eval_target_app.go +++ b/backend/modules/evaluation/application/eval_target_app.go @@ -487,6 +487,7 @@ func (e EvalTargetApplicationImpl) SearchCustomEvalTarget(ctx context.Context, r HasMore: &hasMore, }, nil } + func (e EvalTargetApplicationImpl) MockEvalTargetOutput(ctx context.Context, request *eval_target.MockEvalTargetOutputRequest) (r *eval_target.MockEvalTargetOutputResponse, err error) { // 参数验证 if request == nil { From 3f32d545ec0b18e4b92074be46fddc8952e4be33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Mon, 20 Oct 2025 19:30:04 +0800 Subject: [PATCH 095/100] fix Change-Id: I97789c10adfd899c0ffa41ea200cdaf029b2828f --- backend/api/router/coze/loop/apis/middleware.go | 4 ++++ .../application/convertor/target/eval_target_record.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/api/router/coze/loop/apis/middleware.go b/backend/api/router/coze/loop/apis/middleware.go index 2060ec0ef..280dc31d6 100644 --- a/backend/api/router/coze/loop/apis/middleware.go +++ b/backend/api/router/coze/loop/apis/middleware.go @@ -1342,6 +1342,7 @@ func _mockevaltargetoutputMw(handler *apis.APIHandler) []app.HandlerFunc { func _passbackevaltargetinvokeresultMw(handler *apis.APIHandler) []app.HandlerFunc { return nil } + func _batchdebugevaluatorMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil @@ -1369,6 +1370,7 @@ func _insightanalysisexperimentMw(handler *apis.APIHandler) []app.HandlerFunc { func _evaluation0Mw(handler *apis.APIHandler) []app.HandlerFunc { return nil } + func _insight_analysis_recordsMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil @@ -1377,6 +1379,7 @@ func _insight_analysis_recordsMw(handler *apis.APIHandler) []app.HandlerFunc { func _eval_targets0Mw(handler *apis.APIHandler) []app.HandlerFunc { return nil } + func _insight_analysis_record_idMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil @@ -1385,6 +1388,7 @@ func _insight_analysis_record_idMw(handler *apis.APIHandler) []app.HandlerFunc { func _reportevaltargetinvokeresultMw(handler *apis.APIHandler) []app.HandlerFunc { return nil } + func _deleteexptinsightanalysisrecordMw(handler *apis.APIHandler) []app.HandlerFunc { // your code... return nil diff --git a/backend/modules/evaluation/application/convertor/target/eval_target_record.go b/backend/modules/evaluation/application/convertor/target/eval_target_record.go index ffcd49feb..5ae564930 100644 --- a/backend/modules/evaluation/application/convertor/target/eval_target_record.go +++ b/backend/modules/evaluation/application/convertor/target/eval_target_record.go @@ -370,5 +370,4 @@ func ToInvokeOutputDataDO(req *openapi.ReportEvalTargetInvokeResultRequest) *ent default: return nil } - } From 1e2fc7ce2ad99a4a1b7f6fe45e5ecfb884af3adb Mon Sep 17 00:00:00 2001 From: liushengyang Date: Mon, 20 Oct 2025 20:16:36 +0800 Subject: [PATCH 096/100] fix(evaluation): golangci-lint err --- .../domain/service/expt_run_item_event_impl_test.go | 6 +++--- .../evaluation/domain/service/expt_run_item_turn_impl.go | 3 ++- backend/modules/evaluation/domain/service/target_impl.go | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go index 7483c88a6..1120088fb 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_event_impl_test.go @@ -705,9 +705,9 @@ func TestExptRecordEvalModeSubmit_PreEval(t *testing.T) { }, eiec: &entity.ExptItemEvalCtx{ Event: &entity.ExptItemEvalEvent{ - ExptID: 1, - ExptRunID: 2, - SpaceID: 3, + ExptID: 1, + ExptRunID: 2, + SpaceID: 3, EvalSetItemID: 1, }, EvalSetItem: mockEvalSetItem, diff --git a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go index 45bcb566b..423ad3e72 100644 --- a/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go +++ b/backend/modules/evaluation/domain/service/expt_run_item_turn_impl.go @@ -286,7 +286,8 @@ func (e *DefaultExptTurnEvaluationImpl) CallEvaluators(ctx context.Context, etec } func (e *DefaultExptTurnEvaluationImpl) callEvaluators(ctx context.Context, execEvaluatorVersionIDs []int64, etec *entity.ExptTurnEvalCtx, - targetResult *entity.EvalTargetRecord, history []*entity.Message) (map[int64]*entity.EvaluatorRecord, error) { + targetResult *entity.EvalTargetRecord, history []*entity.Message, +) (map[int64]*entity.EvaluatorRecord, error) { var ( recordMap sync.Map item = etec.EvalSetItem diff --git a/backend/modules/evaluation/domain/service/target_impl.go b/backend/modules/evaluation/domain/service/target_impl.go index 11f5e1ab6..0f3b7c884 100644 --- a/backend/modules/evaluation/domain/service/target_impl.go +++ b/backend/modules/evaluation/domain/service/target_impl.go @@ -346,7 +346,8 @@ func (e *EvalTargetServiceImpl) ExecuteTarget(ctx context.Context, spaceID, targ } func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID int64, targetID int64, targetVersionID int64, - param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) { + param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData, +) (record *entity.EvalTargetRecord, callee string, err error) { if inputData == nil || param == nil { return nil, "", errorx.NewByCode(errno.CommonInvalidParamCode, errorx.WithExtraMsg("AsyncExecuteTarget with invalid param")) } @@ -360,7 +361,8 @@ func (e *EvalTargetServiceImpl) AsyncExecuteTarget(ctx context.Context, spaceID } func (e *EvalTargetServiceImpl) asyncExecuteTarget(ctx context.Context, spaceID int64, target *entity.EvalTarget, param *entity.ExecuteTargetCtx, - inputData *entity.EvalTargetInputData) (record *entity.EvalTargetRecord, callee string, err error) { + inputData *entity.EvalTargetInputData, +) (record *entity.EvalTargetRecord, callee string, err error) { defer func(st time.Time) { e.metric.EmitRun(spaceID, err, st) }(time.Now()) // todo(@liushengyang): mtr defer goroutine.Recovery(ctx) From 8d8c21c226e9dc9e3f777468469def6ba7c7dfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdsf86=E2=80=9D?= Date: Tue, 21 Oct 2025 10:50:05 +0800 Subject: [PATCH 097/100] fix Change-Id: I6c85e9ce2fa3a9d2cf4394b34a4a126c5f272e63 --- .../observability/domain/task/service/task_service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/modules/observability/domain/task/service/task_service_test.go b/backend/modules/observability/domain/task/service/task_service_test.go index c3f21f65f..ae89ad4b3 100755 --- a/backend/modules/observability/domain/task/service/task_service_test.go +++ b/backend/modules/observability/domain/task/service/task_service_test.go @@ -370,7 +370,7 @@ func TestTaskServiceImpl_ListTasks(t *testing.T) { Sampler: &entity.Sampler{}, } repoMock.EXPECT().ListTasks(gomock.Any(), gomock.Any()).Return([]*entity.ObservabilityTask{taskDO}, int64(1), nil) - userMock.EXPECT().GetUserInfo(gomock.Any(), []string{"user1", "user2"}).Return(nil, map[string]*entitycommon.UserInfo{}, nil) + userMock.EXPECT().GetUserInfo(gomock.Any(), gomock.Any()).Return(nil, map[string]*entitycommon.UserInfo{}, nil) svc := &TaskServiceImpl{TaskRepo: repoMock, userProvider: userMock} resp, err := svc.ListTasks(context.Background(), &ListTasksReq{WorkspaceID: 2, TaskFilters: &filter.TaskFilterFields{}}) From 3ef35585c8613fb610a748a139032cae491d927e Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 21 Oct 2025 11:39:21 +0800 Subject: [PATCH 098/100] fix(evaluation): ut --- .../evaluation/domain/service/file_name | 1 + .../domain/service/target_impl_test.go | 462 ++++++++++++++++++ 2 files changed, 463 insertions(+) create mode 100644 backend/modules/evaluation/domain/service/file_name diff --git a/backend/modules/evaluation/domain/service/file_name b/backend/modules/evaluation/domain/service/file_name new file mode 100644 index 000000000..268baf2d8 --- /dev/null +++ b/backend/modules/evaluation/domain/service/file_name @@ -0,0 +1 @@ +ID,status,test_field,actual_output,test_evaluator,test_evaluator_reason,test_tag,logID,targetTraceID diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index f160451bb..65e9a77e6 100755 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -963,3 +963,465 @@ func TestBuildPageByCursor(t *testing.T) { }) } } + +func TestEvalTargetServiceImpl_DebugTarget(t *testing.T) { + t.Parallel() + + type prepareFunc func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) + + tests := []struct { + name string + prepare prepareFunc + wantErr bool + wantErrCode int32 + wantStatus entity.EvalTargetRunStatus + }{ + { + name: "unsupported target type", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + // 不设置任何 operator,模拟不支持的类型 + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "validate input failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(errorx.NewByCode(errno.CommonInvalidParamCode)) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "execute failed with status error", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(nil) + deps.operator.EXPECT().Execute(ctx, param.SpaceID, gomock.Any()).Return(nil, entity.EvalTargetRunStatusFail, errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.idgen.EXPECT().GenID(ctx).Return(int64(999), nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(999), nil) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantStatus: entity.EvalTargetRunStatusFail, + }, + { + name: "execute failed with common error", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(nil) + deps.operator.EXPECT().Execute(ctx, param.SpaceID, gomock.Any()).Return(nil, entity.EvalTargetRunStatusFail, errorx.New("common error")) + deps.idgen.EXPECT().GenID(ctx).Return(int64(999), nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(999), nil) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantStatus: entity.EvalTargetRunStatusFail, + }, + { + name: "execute success", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + outputData := &entity.EvalTargetOutputData{ + OutputFields: map[string]*entity.Content{ + "answer": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("test answer"), + }, + }, + EvalTargetUsage: &entity.EvalTargetUsage{ + InputTokens: 10, + OutputTokens: 20, + }, + } + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(nil) + deps.operator.EXPECT().Execute(ctx, param.SpaceID, gomock.Any()).DoAndReturn(func(_ context.Context, _ int64, execParam *entity.ExecuteEvalTargetParam) (*entity.EvalTargetOutputData, entity.EvalTargetRunStatus, error) { + assert.Equal(t, param.InputData, execParam.Input) + assert.Equal(t, param.PatchyTarget.EvalTargetType, execParam.TargetType) + assert.Equal(t, param.PatchyTarget, execParam.EvalTarget) + return outputData, entity.EvalTargetRunStatusSuccess, nil + }) + deps.idgen.EXPECT().GenID(ctx).Return(int64(999), nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(999), nil) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantStatus: entity.EvalTargetRunStatusSuccess, + }, + { + name: "idgen error", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(nil) + deps.operator.EXPECT().Execute(ctx, param.SpaceID, gomock.Any()).Return(&entity.EvalTargetOutputData{}, entity.EvalTargetRunStatusSuccess, nil) + deps.idgen.EXPECT().GenID(ctx).Return(int64(0), errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "create record error", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, param *entity.DebugTargetParam) { + deps.operator.EXPECT().ValidateInput(ctx, param.SpaceID, param.PatchyTarget.EvalTargetVersion.InputSchema, param.InputData).Return(nil) + deps.operator.EXPECT().Execute(ctx, param.SpaceID, gomock.Any()).Return(&entity.EvalTargetOutputData{}, entity.EvalTargetRunStatusSuccess, nil) + deps.idgen.EXPECT().GenID(ctx).Return(int64(999), nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(0), errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.metric.EXPECT().EmitRun(param.SpaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), + } + + param := &entity.DebugTargetParam{ + SpaceID: 100, + PatchyTarget: &entity.EvalTarget{ + ID: 200, + SpaceID: 100, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: 300, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + { + Key: gptr.Of("input_field"), + SupportContentTypes: []entity.ContentType{entity.ContentTypeText}, + JsonSchema: gptr.Of(`{"type":"string"}`), + }, + }, + }, + }, + InputData: &entity.EvalTargetInputData{ + InputFields: map[string]*entity.Content{ + "input_field": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("test input"), + }, + }, + }, + } + + typedOps := map[entity.EvalTargetType]ISourceEvalTargetOperateService{} + if tt.prepare != nil { + tt.prepare(ctx, deps, param) + // 只有在 prepare 函数中设置了 operator 时才添加到 typedOps + if tt.name != "unsupported target type" { + typedOps[entity.EvalTargetTypeLoopPrompt] = deps.operator + } + } + + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: typedOps, + } + + record, err := svc.DebugTarget(ctx, param) + + if tt.wantErr { + require.Error(t, err) + if tt.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + require.True(t, ok) + assert.Equal(t, tt.wantErrCode, statusErr.Code()) + } + return + } + + require.NoError(t, err) + require.NotNil(t, record) + assert.Equal(t, int64(999), record.ID) + assert.Equal(t, param.SpaceID, record.SpaceID) + assert.Equal(t, param.InputData, record.EvalTargetInputData) + assert.Equal(t, tt.wantStatus, gptr.Indirect(record.Status)) + + // 验证 BaseInfo 字段 + require.NotNil(t, record.BaseInfo) + require.NotNil(t, record.BaseInfo.CreatedBy) + require.NotNil(t, record.BaseInfo.UpdatedBy) + require.NotNil(t, record.BaseInfo.CreatedAt) + require.NotNil(t, record.BaseInfo.UpdatedAt) + }) + } +} + +func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { + t.Parallel() + + type prepareFunc func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) + + tests := []struct { + name string + prepare prepareFunc + wantErr bool + wantErrCode int32 + expectCallee string + expectID int64 + }{ + { + name: "nil input data", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + // 不设置任何 mock,因为会在参数验证阶段失败 + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "nil param", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + // 不设置任何 mock,因为会在参数验证阶段失败 + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "get eval target version failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(nil, errorx.NewByCode(errno.CommonInternalErrorCode)) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + }, + { + name: "unsupported target type", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + evalTarget := &entity.EvalTarget{ + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("input_field")}, + }, + }, + } + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(evalTarget, nil) + deps.metric.EXPECT().EmitRun(spaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "validate input failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + evalTarget := &entity.EvalTarget{ + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("input_field")}, + }, + }, + } + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(evalTarget, nil) + deps.operator.EXPECT().ValidateInput(ctx, spaceID, evalTarget.EvalTargetVersion.InputSchema, inputData).Return(errorx.NewByCode(errno.CommonInvalidParamCode)) + deps.metric.EXPECT().EmitRun(spaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInvalidParamCode, + }, + { + name: "async execute failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + evalTarget := &entity.EvalTarget{ + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("input_field")}, + }, + }, + } + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(evalTarget, nil) + deps.operator.EXPECT().ValidateInput(ctx, spaceID, evalTarget.EvalTargetVersion.InputSchema, inputData).Return(nil) + deps.operator.EXPECT().AsyncExecute(ctx, spaceID, gomock.Any()).Return(int64(0), "callee", errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.metric.EXPECT().EmitRun(spaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + expectCallee: "callee", + }, + { + name: "create record failed", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + evalTarget := &entity.EvalTarget{ + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("input_field")}, + }, + }, + } + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(evalTarget, nil) + deps.operator.EXPECT().ValidateInput(ctx, spaceID, evalTarget.EvalTargetVersion.InputSchema, inputData).Return(nil) + deps.operator.EXPECT().AsyncExecute(ctx, spaceID, gomock.Any()).Return(int64(999), "callee", nil) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(0), errorx.NewByCode(errno.CommonInternalErrorCode)) + deps.metric.EXPECT().EmitRun(spaceID, gomock.Any(), gomock.Any()).Times(1) + }, + wantErr: true, + wantErrCode: errno.CommonInternalErrorCode, + expectCallee: "callee", + }, + { + name: "success", + prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { + evalTarget := &entity.EvalTarget{ + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetVersion: &entity.EvalTargetVersion{ + ID: targetVersionID, + SourceTargetVersion: "v1", + InputSchema: []*entity.ArgsSchema{ + {Key: gptr.Of("input_field")}, + }, + }, + } + deps.repo.EXPECT().GetEvalTargetVersion(ctx, spaceID, targetVersionID).Return(evalTarget, nil) + deps.operator.EXPECT().ValidateInput(ctx, spaceID, evalTarget.EvalTargetVersion.InputSchema, inputData).Return(nil) + deps.operator.EXPECT().AsyncExecute(ctx, spaceID, gomock.Any()).DoAndReturn(func(_ context.Context, _ int64, execParam *entity.ExecuteEvalTargetParam) (int64, string, error) { + assert.Equal(t, targetID, execParam.TargetID) + assert.Equal(t, targetVersionID, execParam.VersionID) + assert.Equal(t, "test-source", execParam.SourceTargetID) + assert.Equal(t, "v1", execParam.SourceTargetVersion) + assert.Equal(t, inputData, execParam.Input) + assert.Equal(t, entity.EvalTargetTypeLoopPrompt, execParam.TargetType) + assert.Equal(t, evalTarget, execParam.EvalTarget) + return int64(999), "callee", nil + }) + deps.repo.EXPECT().CreateEvalTargetRecord(ctx, gomock.Any()).Return(int64(999), nil) + deps.metric.EXPECT().EmitRun(spaceID, gomock.Any(), gomock.Any()).Times(1) + }, + expectCallee: "callee", + expectID: 999, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + ctx := context.Background() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + deps := &evalTargetServiceTestDeps{ + repo: repomocks.NewMockIEvalTargetRepo(ctrl), + idgen: idgenmocks.NewMockIIDGenerator(ctrl), + metric: metricsmocks.NewMockEvalTargetMetrics(ctrl), + operator: servicemocks.NewMockISourceEvalTargetOperateService(ctrl), + } + + spaceID := int64(100) + targetID := int64(200) + targetVersionID := int64(300) + param := &entity.ExecuteTargetCtx{ + ExperimentRunID: gptr.Of(int64(555)), + ItemID: 777, + TurnID: 888, + } + inputData := &entity.EvalTargetInputData{ + InputFields: map[string]*entity.Content{ + "input_field": { + ContentType: gptr.Of(entity.ContentTypeText), + Text: gptr.Of("test input"), + }, + }, + } + + // 根据测试用例设置不同的参数 + var testParam *entity.ExecuteTargetCtx + var testInputData *entity.EvalTargetInputData + if tt.name == "nil input data" { + testParam = param + testInputData = nil + } else if tt.name == "nil param" { + testParam = nil + testInputData = inputData + } else { + testParam = param + testInputData = inputData + } + + typedOps := map[entity.EvalTargetType]ISourceEvalTargetOperateService{} + if tt.prepare != nil { + tt.prepare(ctx, deps, spaceID, targetID, targetVersionID, testParam, testInputData) + // 只有在 prepare 函数中设置了 operator 时才添加到 typedOps + if tt.name != "unsupported target type" { + typedOps[entity.EvalTargetTypeLoopPrompt] = deps.operator + } + } + + svc := &EvalTargetServiceImpl{ + evalTargetRepo: deps.repo, + idgen: deps.idgen, + metric: deps.metric, + typedOperators: typedOps, + } + + record, callee, err := svc.AsyncExecuteTarget(ctx, spaceID, targetID, targetVersionID, testParam, testInputData) + + if tt.wantErr { + require.Error(t, err) + if tt.wantErrCode != 0 { + statusErr, ok := errorx.FromStatusError(err) + require.True(t, ok) + assert.Equal(t, tt.wantErrCode, statusErr.Code()) + } + assert.Equal(t, tt.expectCallee, callee) + return + } + + require.NoError(t, err) + require.NotNil(t, record) + assert.Equal(t, tt.expectCallee, callee) + assert.Equal(t, tt.expectID, record.ID) + assert.Equal(t, spaceID, record.SpaceID) + assert.Equal(t, targetID, record.TargetID) + assert.Equal(t, targetVersionID, record.TargetVersionID) + assert.Equal(t, param.ItemID, record.ItemID) + assert.Equal(t, param.TurnID, record.TurnID) + assert.Equal(t, inputData, record.EvalTargetInputData) + assert.Equal(t, entity.EvalTargetRunStatusAsyncInvoking, gptr.Indirect(record.Status)) + + // 验证 BaseInfo 字段 + require.NotNil(t, record.BaseInfo) + require.NotNil(t, record.BaseInfo.CreatedBy) + require.NotNil(t, record.BaseInfo.UpdatedBy) + require.NotNil(t, record.BaseInfo.CreatedAt) + require.NotNil(t, record.BaseInfo.UpdatedAt) + }) + } +} From 90621d42073cd00130864ce84789daa8a5c29321 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 21 Oct 2025 11:48:00 +0800 Subject: [PATCH 099/100] fix(evaluation): ut --- .../domain/service/target_impl_test.go | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/backend/modules/evaluation/domain/service/target_impl_test.go b/backend/modules/evaluation/domain/service/target_impl_test.go index 65e9a77e6..a9b152274 100755 --- a/backend/modules/evaluation/domain/service/target_impl_test.go +++ b/backend/modules/evaluation/domain/service/target_impl_test.go @@ -1091,13 +1091,13 @@ func TestEvalTargetServiceImpl_DebugTarget(t *testing.T) { ID: 200, SpaceID: 100, SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ ID: 300, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ { - Key: gptr.Of("input_field"), + Key: gptr.Of("input_field"), SupportContentTypes: []entity.ContentType{entity.ContentTypeText}, JsonSchema: gptr.Of(`{"type":"string"}`), }, @@ -1200,12 +1200,12 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { name: "unsupported target type", prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { evalTarget := &entity.EvalTarget{ - ID: targetID, - SpaceID: spaceID, - SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: targetVersionID, + ID: targetVersionID, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ {Key: gptr.Of("input_field")}, @@ -1222,12 +1222,12 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { name: "validate input failed", prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { evalTarget := &entity.EvalTarget{ - ID: targetID, - SpaceID: spaceID, - SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: targetVersionID, + ID: targetVersionID, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ {Key: gptr.Of("input_field")}, @@ -1245,12 +1245,12 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { name: "async execute failed", prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { evalTarget := &entity.EvalTarget{ - ID: targetID, - SpaceID: spaceID, - SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: targetVersionID, + ID: targetVersionID, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ {Key: gptr.Of("input_field")}, @@ -1270,12 +1270,12 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { name: "create record failed", prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { evalTarget := &entity.EvalTarget{ - ID: targetID, - SpaceID: spaceID, - SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: targetVersionID, + ID: targetVersionID, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ {Key: gptr.Of("input_field")}, @@ -1296,12 +1296,12 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { name: "success", prepare: func(ctx context.Context, deps *evalTargetServiceTestDeps, spaceID int64, targetID int64, targetVersionID int64, param *entity.ExecuteTargetCtx, inputData *entity.EvalTargetInputData) { evalTarget := &entity.EvalTarget{ - ID: targetID, - SpaceID: spaceID, - SourceTargetID: "test-source", - EvalTargetType: entity.EvalTargetTypeLoopPrompt, + ID: targetID, + SpaceID: spaceID, + SourceTargetID: "test-source", + EvalTargetType: entity.EvalTargetTypeLoopPrompt, EvalTargetVersion: &entity.EvalTargetVersion{ - ID: targetVersionID, + ID: targetVersionID, SourceTargetVersion: "v1", InputSchema: []*entity.ArgsSchema{ {Key: gptr.Of("input_field")}, @@ -1364,13 +1364,14 @@ func TestEvalTargetServiceImpl_AsyncExecuteTarget(t *testing.T) { // 根据测试用例设置不同的参数 var testParam *entity.ExecuteTargetCtx var testInputData *entity.EvalTargetInputData - if tt.name == "nil input data" { + switch tt.name { + case "nil input data": testParam = param testInputData = nil - } else if tt.name == "nil param" { + case "nil param": testParam = nil testInputData = inputData - } else { + default: testParam = param testInputData = inputData } From 83b2efedf48ae3f15da36c5f1dff69574df696b2 Mon Sep 17 00:00:00 2001 From: liushengyang Date: Tue, 21 Oct 2025 12:28:12 +0800 Subject: [PATCH 100/100] fix(evaluation): ut --- .github/.codecov.yaml | 1 + .../evaluation/domain/entity/expt_run_test.go | 697 ++++++++++++++++++ 2 files changed, 698 insertions(+) create mode 100644 backend/modules/evaluation/domain/entity/expt_run_test.go diff --git a/.github/.codecov.yaml b/.github/.codecov.yaml index 1ca402194..410accc0d 100644 --- a/.github/.codecov.yaml +++ b/.github/.codecov.yaml @@ -56,6 +56,7 @@ ignore: - "**/repo/mysql/**" - "**/repo/**/mysql/**" - "**/repo/redis/**" + - "**/repo/**/redis/**" - "backend/api/router/coze/loop/apis/*.go" parsers: diff --git a/backend/modules/evaluation/domain/entity/expt_run_test.go b/backend/modules/evaluation/domain/entity/expt_run_test.go new file mode 100644 index 000000000..35b110419 --- /dev/null +++ b/backend/modules/evaluation/domain/entity/expt_run_test.go @@ -0,0 +1,697 @@ +// Copyright (c) 2025 coze-dev Authors +// SPDX-License-Identifier: Apache-2.0 + +package entity + +import ( + "testing" + "time" + + "github.com/bytedance/gg/gptr" + "github.com/stretchr/testify/assert" + + "github.com/coze-dev/coze-loop/backend/modules/evaluation/pkg/errno" + "github.com/coze-dev/coze-loop/backend/pkg/errorx" +) + +func TestExptTurnRunResult_AbortWithTargetResult(t *testing.T) { + tests := []struct { + name string + turnRunResult *ExptTurnRunResult + experiment *Experiment + expectedAbort bool + expectedErr bool + expectedErrMsg string + checkAsyncAbort bool + }{ + { + name: "TargetResult为nil,应该中止并设置错误", + turnRunResult: &ExptTurnRunResult{ + TargetResult: nil, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(false), + }, + }, + }, + }, + expectedAbort: true, + expectedErr: true, + expectedErrMsg: "target result is nil", + }, + { + name: "TargetResult有执行错误,应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: &EvalTargetRunError{ + Code: 500, + Message: "execution failed", + }, + }, + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(false), + }, + }, + }, + }, + expectedAbort: true, + expectedErr: false, + }, + { + name: "TargetResult无执行错误,非异步调用,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusSuccess), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(false), + }, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "异步调用且状态为AsyncInvoking,应该中止并设置AsyncAbort", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(true), + }, + }, + }, + }, + expectedAbort: true, + expectedErr: false, + checkAsyncAbort: true, + }, + { + name: "异步调用但状态不是AsyncInvoking,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusSuccess), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(true), + }, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "非异步调用但状态为AsyncInvoking,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(false), + }, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "Experiment为nil,AsyncCallTarget返回false,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: nil, + expectedAbort: false, + expectedErr: false, + }, + { + name: "Experiment.Target为nil,AsyncCallTarget返回false,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: &Experiment{ + Target: nil, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "Experiment.Target.EvalTargetVersion为nil,AsyncCallTarget返回false,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: nil, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "Experiment.Target.EvalTargetVersion.CustomRPCServer为nil,AsyncCallTarget返回false,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: gptr.Of(EvalTargetRunStatusAsyncInvoking), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: nil, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "EvalTargetOutputData为nil,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: nil, + Status: gptr.Of(EvalTargetRunStatusSuccess), + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(false), + }, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + { + name: "Status为nil,不应该中止", + turnRunResult: &ExptTurnRunResult{ + TargetResult: &EvalTargetRecord{ + EvalTargetOutputData: &EvalTargetOutputData{ + EvalTargetRunError: nil, + }, + Status: nil, + }, + }, + experiment: &Experiment{ + Target: &EvalTarget{ + EvalTargetVersion: &EvalTargetVersion{ + CustomRPCServer: &CustomRPCServer{ + IsAsync: gptr.Of(true), + }, + }, + }, + }, + expectedAbort: false, + expectedErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // 执行测试 + result := tt.turnRunResult.AbortWithTargetResult(tt.experiment) + + // 验证返回值 + assert.Equal(t, tt.expectedAbort, result) + + // 验证错误设置 + if tt.expectedErr { + assert.Error(t, tt.turnRunResult.GetEvalErr()) + if tt.expectedErrMsg != "" { + assert.Contains(t, tt.turnRunResult.GetEvalErr().Error(), tt.expectedErrMsg) + } + // 验证错误码 + statusErr, ok := errorx.FromStatusError(tt.turnRunResult.GetEvalErr()) + assert.True(t, ok) + assert.Equal(t, int32(errno.CommonInternalErrorCode), statusErr.Code()) + } else { + assert.NoError(t, tt.turnRunResult.GetEvalErr()) + } + + // 验证AsyncAbort设置 + if tt.checkAsyncAbort { + assert.True(t, tt.turnRunResult.AsyncAbort) + } else { + assert.False(t, tt.turnRunResult.AsyncAbort) + } + }) + } +} + +func TestExptTurnRunResult_SetEvalErr(t *testing.T) { + tests := []struct { + name string + err error + expected error + }{ + { + name: "设置nil错误", + err: nil, + expected: nil, + }, + { + name: "设置非nil错误", + err: errorx.New("test error"), + expected: errorx.New("test error"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := &ExptTurnRunResult{} + result.SetEvalErr(tt.err) + + if tt.expected == nil { + assert.Nil(t, result.GetEvalErr()) + } else { + assert.NotNil(t, result.GetEvalErr()) + assert.Contains(t, result.GetEvalErr().Error(), "test error") + } + }) + } +} + +func TestExptTurnRunResult_SetTargetResult(t *testing.T) { + tests := []struct { + name string + targetResult *EvalTargetRecord + expected *EvalTargetRecord + }{ + { + name: "设置nil TargetResult", + targetResult: nil, + expected: nil, + }, + { + name: "设置非nil TargetResult", + targetResult: &EvalTargetRecord{ + ID: 123, + SpaceID: 456, + }, + expected: &EvalTargetRecord{ + ID: 123, + SpaceID: 456, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := &ExptTurnRunResult{} + returned := result.SetTargetResult(tt.targetResult) + + // 验证返回值是同一个实例 + assert.Equal(t, result, returned) + + // 验证TargetResult被正确设置 + assert.Equal(t, tt.expected, result.TargetResult) + }) + } +} + +func TestExptTurnRunResult_SetEvaluatorResults(t *testing.T) { + tests := []struct { + name string + evaluatorResults map[int64]*EvaluatorRecord + expected map[int64]*EvaluatorRecord + }{ + { + name: "设置nil EvaluatorResults", + evaluatorResults: nil, + expected: nil, + }, + { + name: "设置非nil EvaluatorResults", + evaluatorResults: map[int64]*EvaluatorRecord{ + 1: {ID: 100, EvaluatorVersionID: 1}, + 2: {ID: 200, EvaluatorVersionID: 2}, + }, + expected: map[int64]*EvaluatorRecord{ + 1: {ID: 100, EvaluatorVersionID: 1}, + 2: {ID: 200, EvaluatorVersionID: 2}, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := &ExptTurnRunResult{} + returned := result.SetEvaluatorResults(tt.evaluatorResults) + + // 验证返回值是同一个实例 + assert.Equal(t, result, returned) + + // 验证EvaluatorResults被正确设置 + assert.Equal(t, tt.expected, result.EvaluatorResults) + }) + } +} + +func TestExptTurnRunResult_GetEvaluatorRecord(t *testing.T) { + tests := []struct { + name string + turnRunResult *ExptTurnRunResult + evaluatorVersionID int64 + expected *EvaluatorRecord + }{ + { + name: "ExptTurnRunResult为nil", + turnRunResult: nil, + evaluatorVersionID: 1, + expected: nil, + }, + { + name: "EvaluatorResults为nil", + turnRunResult: &ExptTurnRunResult{ + EvaluatorResults: nil, + }, + evaluatorVersionID: 1, + expected: nil, + }, + { + name: "EvaluatorResults为空map", + turnRunResult: &ExptTurnRunResult{ + EvaluatorResults: map[int64]*EvaluatorRecord{}, + }, + evaluatorVersionID: 1, + expected: nil, + }, + { + name: "找到对应的EvaluatorRecord", + turnRunResult: &ExptTurnRunResult{ + EvaluatorResults: map[int64]*EvaluatorRecord{ + 1: {ID: 100, EvaluatorVersionID: 1}, + 2: {ID: 200, EvaluatorVersionID: 2}, + }, + }, + evaluatorVersionID: 1, + expected: &EvaluatorRecord{ID: 100, EvaluatorVersionID: 1}, + }, + { + name: "找不到对应的EvaluatorRecord", + turnRunResult: &ExptTurnRunResult{ + EvaluatorResults: map[int64]*EvaluatorRecord{ + 1: {ID: 100, EvaluatorVersionID: 1}, + 2: {ID: 200, EvaluatorVersionID: 2}, + }, + }, + evaluatorVersionID: 3, + expected: nil, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result *EvaluatorRecord + if tt.turnRunResult != nil { + result = tt.turnRunResult.GetEvaluatorRecord(tt.evaluatorVersionID) + } else { + result = (*ExptTurnRunResult)(nil).GetEvaluatorRecord(tt.evaluatorVersionID) + } + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestExptItemEvalConf_GetConcurNum(t *testing.T) { + tests := []struct { + name string + conf *ExptItemEvalConf + expected int + }{ + { + name: "conf为nil,返回默认值", + conf: nil, + expected: defaultItemEvalConcurNum, + }, + { + name: "ConcurNum为0,返回默认值", + conf: &ExptItemEvalConf{ConcurNum: 0}, + expected: defaultItemEvalConcurNum, + }, + { + name: "ConcurNum为负数,返回默认值", + conf: &ExptItemEvalConf{ConcurNum: -1}, + expected: defaultItemEvalConcurNum, + }, + { + name: "ConcurNum为正数,返回设置值", + conf: &ExptItemEvalConf{ConcurNum: 5}, + expected: 5, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result int + if tt.conf != nil { + result = tt.conf.GetConcurNum() + } else { + result = (*ExptItemEvalConf)(nil).GetConcurNum() + } + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestExptItemEvalConf_GetInterval(t *testing.T) { + tests := []struct { + name string + conf *ExptItemEvalConf + expected time.Duration + }{ + { + name: "conf为nil,返回默认值", + conf: nil, + expected: defaultItemEvalInterval, + }, + { + name: "IntervalSecond为0,返回默认值", + conf: &ExptItemEvalConf{IntervalSecond: 0}, + expected: defaultItemEvalInterval, + }, + { + name: "IntervalSecond为负数,返回默认值", + conf: &ExptItemEvalConf{IntervalSecond: -1}, + expected: defaultItemEvalInterval, + }, + { + name: "IntervalSecond为正数,返回设置值", + conf: &ExptItemEvalConf{IntervalSecond: 30}, + expected: 30 * time.Second, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result time.Duration + if tt.conf != nil { + result = tt.conf.GetInterval() + } else { + result = (*ExptItemEvalConf)(nil).GetInterval() + } + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestExptItemEvalConf_getZombieSecond(t *testing.T) { + tests := []struct { + name string + conf *ExptItemEvalConf + expected int + }{ + { + name: "conf为nil,返回默认值", + conf: nil, + expected: defaultItemZombieSecond, + }, + { + name: "ZombieSecond为0,返回默认值", + conf: &ExptItemEvalConf{ZombieSecond: 0}, + expected: defaultItemZombieSecond, + }, + { + name: "ZombieSecond为负数,返回默认值", + conf: &ExptItemEvalConf{ZombieSecond: -1}, + expected: defaultItemZombieSecond, + }, + { + name: "ZombieSecond为正数,返回设置值", + conf: &ExptItemEvalConf{ZombieSecond: 1800}, + expected: 1800, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result int + if tt.conf != nil { + result = tt.conf.getZombieSecond() + } else { + result = (*ExptItemEvalConf)(nil).getZombieSecond() + } + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestExptItemEvalConf_getAsyncZombieSecond(t *testing.T) { + tests := []struct { + name string + conf *ExptItemEvalConf + expected int + }{ + { + name: "conf为nil,返回默认值", + conf: nil, + expected: defaultItemAsyncZombieSecond, + }, + { + name: "AsyncZombieSecond为0,返回默认值", + conf: &ExptItemEvalConf{AsyncZombieSecond: 0}, + expected: defaultItemAsyncZombieSecond, + }, + { + name: "AsyncZombieSecond为负数,返回默认值", + conf: &ExptItemEvalConf{AsyncZombieSecond: -1}, + expected: defaultItemAsyncZombieSecond, + }, + { + name: "AsyncZombieSecond为正数,返回设置值", + conf: &ExptItemEvalConf{AsyncZombieSecond: 7200}, + expected: 7200, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result int + if tt.conf != nil { + result = tt.conf.getAsyncZombieSecond() + } else { + result = (*ExptItemEvalConf)(nil).getAsyncZombieSecond() + } + assert.Equal(t, tt.expected, result) + }) + } +} + +func TestExptItemEvalConf_GetItemZombieSecond(t *testing.T) { + tests := []struct { + name string + conf *ExptItemEvalConf + isAsync bool + expected int + }{ + { + name: "conf为nil,isAsync为false,返回同步默认值", + conf: nil, + isAsync: false, + expected: defaultItemZombieSecond, + }, + { + name: "conf为nil,isAsync为true,返回异步默认值", + conf: nil, + isAsync: true, + expected: defaultItemAsyncZombieSecond, + }, + { + name: "conf有值,isAsync为false,返回同步设置值", + conf: &ExptItemEvalConf{ZombieSecond: 1800, AsyncZombieSecond: 7200}, + isAsync: false, + expected: 1800, + }, + { + name: "conf有值,isAsync为true,返回异步设置值", + conf: &ExptItemEvalConf{ZombieSecond: 1800, AsyncZombieSecond: 7200}, + isAsync: true, + expected: 7200, + }, + { + name: "conf有值但ZombieSecond为0,isAsync为false,返回同步默认值", + conf: &ExptItemEvalConf{ZombieSecond: 0, AsyncZombieSecond: 7200}, + isAsync: false, + expected: defaultItemZombieSecond, + }, + { + name: "conf有值但AsyncZombieSecond为0,isAsync为true,返回异步默认值", + conf: &ExptItemEvalConf{ZombieSecond: 1800, AsyncZombieSecond: 0}, + isAsync: true, + expected: defaultItemAsyncZombieSecond, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var result int + if tt.conf != nil { + result = tt.conf.GetItemZombieSecond(tt.isAsync) + } else { + result = (*ExptItemEvalConf)(nil).GetItemZombieSecond(tt.isAsync) + } + assert.Equal(t, tt.expected, result) + }) + } +}