From da1fcf870844ef37a11d342e9bdaef928caee376 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 19 Jan 2026 22:14:56 +0800 Subject: [PATCH 01/19] [feat][backend] add model param --- .../coze/loop/llm/coze.loop.llm.manage.thrift | 12 ++ idl/thrift/coze/loop/llm/domain/manage.thrift | 118 ++++++++++++++++++ .../coze/loop/llm/domain/runtime.thrift | 2 + 3 files changed, 132 insertions(+) diff --git a/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift b/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift index 447a6c79c..11abbae4e 100644 --- a/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift +++ b/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift @@ -4,11 +4,22 @@ include "../../../base.thrift" include "./domain/manage.thrift" include "./domain/common.thrift" +struct Filter { + 1: optional string name_like + 2: optional list families + 3: optional list statuses + 4: optional list abilities +} + struct ListModelsRequest { 1: optional i64 workspace_id (api.js_conv='true', vt.not_nil='true', vt.gt='0', go.tag='json:"workspace_id"') 2: optional common.Scenario scenario + 3: optional Filter filter + + 100: optional string cookie (api.header='cookie') 127: optional i32 page_size 128: optional string page_token + 129: optional i32 page 255: optional base.Base Base } @@ -25,6 +36,7 @@ struct ListModelsResponse { struct GetModelRequest { 1: optional i64 workspace_id (api.js_conv='true', vt.not_nil='true', vt.gt='0', go.tag='json:"workspace_id"') 2: optional i64 model_id (api.js_conv='true', api.path='model_id', go.tag='json:"model_id"') + 3: optional string identification 255: optional base.Base Base } diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index a3462c26e..31b1933ef 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -12,8 +12,43 @@ struct Model { 7: optional ProtocolConfig protocol_config 8: optional map scenario_configs 9: optional ParamConfig param_config + 10: optional string identification // 模型表示 (name, endpoint) + 11: optional Family family // 模型家族 + 14: optional bool is_public + 15: optional Visibility visibility + 16: optional string icon // 模型图标 + 17: optional list tags //模型标签 + 18: optional ModelStatus status // 模型状态 + + 100: optional string created_by + 101: optional i64 created_at + 102: optional string updated_by + 103: optional i64 updated_at +} + +struct Series { + 1: optional string name // series name + 2: optional string icon // series icon url + 3: optional Family family // family name +} + +struct Visibility { + 1: optional VisibleMode mode + 2: optional list spaceIDs // Mode为Specified有效,配置为除模型所属空间外的其他空间 +} + +struct ProviderInfo { + 1: optional MaaSInfo maas_info } +struct MaaSInfo { + 1: optional string host + 2: optional string region + 3: optional string baseURL // v3 sdk + 4: optional string customizationJobsID // 精调模型任务的 ID +} + + struct Ability { 1: optional i64 max_context_tokens (api.js_conv='true', go.tag='json:"max_context_tokens"') 2: optional i64 max_input_tokens (api.js_conv='true', go.tag='json:"max_input_tokens"') @@ -22,11 +57,14 @@ struct Ability { 5: optional bool json_mode 6: optional bool multi_modal 7: optional AbilityMultiModal ability_multi_modal + 8: optional InterfaceCategory interface_category } struct AbilityMultiModal { + // 图片 1: optional bool image 2: optional AbilityImage ability_image + // 视频 3: optional bool video 4: optional AbilityVideo ability_video } @@ -44,6 +82,11 @@ struct AbilityVideo { 2: optional list supported_video_formats } +struct AbilityVideo { + 1: optional i64 max_video_size (api.js_conv='true', go.tag='json:"max_video_size"') // MB + 2: optional list supported_formats (api.js_conv='true', go.tag='json:"supported_formats"') +} + struct ProtocolConfig { 1: optional string base_url 2: optional string api_key @@ -143,6 +186,7 @@ struct ParamSchema { 6: optional string max 7: optional string default_value 8: optional list options + 9: optional list properties } struct ParamOption { @@ -171,6 +215,80 @@ const ParamType param_type_float = "float" const ParamType param_type_int = "int" const ParamType param_type_boolean = "boolean" const ParamType param_type_string = "string" +const ParamType param_type_void = "void" +const ParamType param_type_object = "object" + +typedef string Family (ts.enum="true") +const Family family_undefined = "undefined" +const Family family_gpt = "gpt" +const Family family_seed = "seed" +const Family family_gemini = "gemini" +const Family family_claude = "claude" +const Family family_ernie = "ernie" +const Family family_baichuan = "baichuan" +const Family family_qwen = "qwen" +const Family family_glm = "glm" +const Family family_skylark = "skylark" +const Family family_moonshot = "moonshot" +const Family family_minimax = "minimax" +const Family family_doubao = "doubao" +const Family family_baichuan2 = "baichuan2" +const Family family_deepseekv2 = "deepseekv2" +const Family family_deepseek_coder_v2 = "deepseek_coder_v2" +const Family family_deepseek_coder = "deepseek_coder" +const Family family_internalm2_5 = "internalm2_5" +const Family family_qwen2 = "qwen2" +const Family family_qwen2_5 = "qwen2.5" +const Family family_qwen2_5_coder = "qwen2.5_coder" +const Family family_mini_cpm = "mini_cpm" +const Family family_mini_cpm_3 = "mini_cpm_3" +const Family family_chat_glm_3 = "chat_glm_3" +const Family family_mistra = "mistral" +const Family family_gemma = "gemma" +const Family family_gemma_2 = "gemma_2" +const Family family_intern_vl2 = "intern_vl2" +const Family family_intern_vl2_5 = "intern_vl2.5" +const Family family_deepseek_v3 = "deepseek_v3" +const Family family_deepseek_r1 = "deepseek_r1" +const Family family_kimi = "kimi" +const Family family_seedream = "seedream" +const Family family_intern_vl3 = "intern_vl3" + + +typedef string Provider (ts.enum="true") +const Provider provider_undefined = "undefined" +const Provider provider_maas = "maas" + +typedef string VisibleMode (ts.enum="true") +const VisibleMode visible_mode_default = "default" +const VisibleMode visible_mode_specified = "specified" +const VisibleMode visible_mode_undefined = "undefined" +const VisibleMode visible_mode_all = "all" + +typedef string ModelStatus (ts.enum="true") +const ModelStatus model_status_undefined = "undefined" +const ModelStatus model_status_available = "available" //可用 +const ModelStatus model_status_unavailable = "unavailable" //不可用 + +typedef string VideoFormat (ts.enum="true") +const VideoFormat video_format_undefined = "undefined" +const VideoFormat video_format_mp4 = "mp4" +const VideoFormat video_format_avi = "avi" +const VideoFormat video_format_mov = "mov" +const VideoFormat video_format_mpg = "mpg" + +typedef string InterfaceCategory (ts.enum="true") +const InterfaceCategory interface_category_undefined = "undefined" +const InterfaceCategory interface_category_chat_completion_api = "chat_completion_api" +const InterfaceCategory interface_category_response_api = "response_api" + +typedef string AbilityEnum (ts.enum="true") +const AbilityEnum ability_undefined = "undefined" +const AbilityEnum ability_json_mode = "json_mode" +const AbilityEnum ability_function_call = "function_call" +const AbilityEnum ability_multi_modal = "multi_modal" + + typedef string VideoFormat (ts.enum="true") const VideoFormat video_format_undefined = "undefined" diff --git a/idl/thrift/coze/loop/llm/domain/runtime.thrift b/idl/thrift/coze/loop/llm/domain/runtime.thrift index e645f3f65..a410e4bee 100644 --- a/idl/thrift/coze/loop/llm/domain/runtime.thrift +++ b/idl/thrift/coze/loop/llm/domain/runtime.thrift @@ -14,9 +14,11 @@ struct ModelConfig { 8: optional i32 top_k 9: optional double presence_penalty 10: optional double frequency_penalty + 11: optional string identification // 与ParamSchema对应 100: optional list param_config_values + 101: optional string extra } struct ParamConfigValue { From 60bb3d45e37fb052e776446e51183fd3d4d71ab8 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 19 Jan 2026 22:20:26 +0800 Subject: [PATCH 02/19] [feat][backend] add model param --- idl/thrift/coze/loop/llm/domain/manage.thrift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index 31b1933ef..902e15f9e 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -187,6 +187,13 @@ struct ParamSchema { 7: optional string default_value 8: optional list options 9: optional list properties + 10: optional Dependency dependency // 依赖参数 + 11: optional string jsonpath // 赋值路径 +} + +struct Dependency { + 1: optional string key + 2: optional string condition } struct ParamOption { From fe4a629b0ae0d15aeabdcd1284b1a1188751ce4c Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 19 Jan 2026 22:30:54 +0800 Subject: [PATCH 03/19] [feat][backend] add model param --- idl/thrift/coze/loop/llm/domain/manage.thrift | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index 902e15f9e..36b58b942 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -82,11 +82,6 @@ struct AbilityVideo { 2: optional list supported_video_formats } -struct AbilityVideo { - 1: optional i64 max_video_size (api.js_conv='true', go.tag='json:"max_video_size"') // MB - 2: optional list supported_formats (api.js_conv='true', go.tag='json:"supported_formats"') -} - struct ProtocolConfig { 1: optional string base_url 2: optional string api_key @@ -277,13 +272,6 @@ const ModelStatus model_status_undefined = "undefined" const ModelStatus model_status_available = "available" //可用 const ModelStatus model_status_unavailable = "unavailable" //不可用 -typedef string VideoFormat (ts.enum="true") -const VideoFormat video_format_undefined = "undefined" -const VideoFormat video_format_mp4 = "mp4" -const VideoFormat video_format_avi = "avi" -const VideoFormat video_format_mov = "mov" -const VideoFormat video_format_mpg = "mpg" - typedef string InterfaceCategory (ts.enum="true") const InterfaceCategory interface_category_undefined = "undefined" const InterfaceCategory interface_category_chat_completion_api = "chat_completion_api" From 3944afa49472e616b22becab98370c35f808030d Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 19 Jan 2026 22:40:17 +0800 Subject: [PATCH 04/19] [feat][backend] fix --- idl/thrift/coze/loop/llm/domain/manage.thrift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index 36b58b942..8b5ffed16 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -182,13 +182,13 @@ struct ParamSchema { 7: optional string default_value 8: optional list options 9: optional list properties - 10: optional Dependency dependency // 依赖参数 + 10: optional Reaction reaction // 依赖参数 11: optional string jsonpath // 赋值路径 } -struct Dependency { - 1: optional string key - 2: optional string condition +struct Reaction { + 1: optional string dependency // 依赖的字段 + 2: optional string visible // 可见性表达式 } struct ParamOption { From 7ba393ec2b7a27b2cb5c267f87843d27064ed85d Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Wed, 21 Jan 2026 14:50:17 +0800 Subject: [PATCH 05/19] [feat][backend] add protocol --- idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift | 1 + idl/thrift/coze/loop/llm/domain/runtime.thrift | 1 + 2 files changed, 2 insertions(+) diff --git a/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift b/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift index 11abbae4e..000ab00cc 100644 --- a/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift +++ b/idl/thrift/coze/loop/llm/coze.loop.llm.manage.thrift @@ -37,6 +37,7 @@ struct GetModelRequest { 1: optional i64 workspace_id (api.js_conv='true', vt.not_nil='true', vt.gt='0', go.tag='json:"workspace_id"') 2: optional i64 model_id (api.js_conv='true', api.path='model_id', go.tag='json:"model_id"') 3: optional string identification + 4: optional manage.Protocol protocol 255: optional base.Base Base } diff --git a/idl/thrift/coze/loop/llm/domain/runtime.thrift b/idl/thrift/coze/loop/llm/domain/runtime.thrift index a410e4bee..59a7068b4 100644 --- a/idl/thrift/coze/loop/llm/domain/runtime.thrift +++ b/idl/thrift/coze/loop/llm/domain/runtime.thrift @@ -15,6 +15,7 @@ struct ModelConfig { 9: optional double presence_penalty 10: optional double frequency_penalty 11: optional string identification + 12: optional manage.Protocol protocol // 模型提供方 // 与ParamSchema对应 100: optional list param_config_values From 7e23ad4f21610099733b1ca2852c066b9374b32a Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Wed, 21 Jan 2026 14:52:33 +0800 Subject: [PATCH 06/19] [feat][backend] fix idl --- idl/thrift/coze/loop/llm/domain/manage.thrift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index 8b5ffed16..2d95282c2 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -13,12 +13,11 @@ struct Model { 8: optional map scenario_configs 9: optional ParamConfig param_config 10: optional string identification // 模型表示 (name, endpoint) - 11: optional Family family // 模型家族 - 14: optional bool is_public - 15: optional Visibility visibility - 16: optional string icon // 模型图标 - 17: optional list tags //模型标签 - 18: optional ModelStatus status // 模型状态 + 11: optional Series series // 模型 + 12: optional Visibility visibility + 13: optional string icon // 模型图标 + 14: optional list tags //模型标签 + 15: optional ModelStatus status // 模型状态 100: optional string created_by 101: optional i64 created_at From 57efe4f30dc15dd6cc7f9a911565de5ac7313bc5 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Wed, 21 Jan 2026 15:13:17 +0800 Subject: [PATCH 07/19] [feat][backend] support agentkit: code gen --- .../coze/loop/llm/domain/manage/k-manage.go | 2069 +++++++++++- .../coze/loop/llm/domain/manage/manage.go | 2996 ++++++++++++++++- .../llm/domain/manage/manage_validator.go | 35 + .../coze/loop/llm/domain/runtime/k-runtime.go | 165 + .../coze/loop/llm/domain/runtime/runtime.go | 232 ++ .../loop/llm/manage/coze.loop.llm.manage.go | 858 ++++- .../manage/coze.loop.llm.manage_validator.go | 8 + .../loop/llm/manage/k-coze.loop.llm.manage.go | 627 ++++ 8 files changed, 6711 insertions(+), 279 deletions(-) diff --git a/backend/kitex_gen/coze/loop/llm/domain/manage/k-manage.go b/backend/kitex_gen/coze/loop/llm/domain/manage/k-manage.go index d501fc201..4e13b688b 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/manage/k-manage.go +++ b/backend/kitex_gen/coze/loop/llm/domain/manage/k-manage.go @@ -170,6 +170,146 @@ func (p *Model) FastRead(buf []byte) (int, error) { 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.STRUCT { + 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.LIST { + 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.STRING { + 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 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.I64 { + 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 102: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField102(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 103: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField103(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 @@ -327,6 +467,152 @@ func (p *Model) FastReadField9(buf []byte) (int, error) { return offset, nil } +func (p *Model) 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.Identification = _field + return offset, nil +} + +func (p *Model) FastReadField11(buf []byte) (int, error) { + offset := 0 + _field := NewSeries() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Series = _field + return offset, nil +} + +func (p *Model) FastReadField12(buf []byte) (int, error) { + offset := 0 + _field := NewVisibility() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Visibility = _field + return offset, nil +} + +func (p *Model) 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.Icon = _field + return offset, nil +} + +func (p *Model) FastReadField14(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Tags = _field + return offset, nil +} + +func (p *Model) FastReadField15(buf []byte) (int, error) { + offset := 0 + + var _field *ModelStatus + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Status = _field + return offset, nil +} + +func (p *Model) 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.CreatedBy = _field + return offset, nil +} + +func (p *Model) FastReadField101(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.CreatedAt = _field + return offset, nil +} + +func (p *Model) FastReadField102(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.UpdatedBy = _field + return offset, nil +} + +func (p *Model) FastReadField103(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.UpdatedAt = _field + return offset, nil +} + func (p *Model) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -336,6 +622,8 @@ func (p *Model) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField101(buf[offset:], w) + offset += p.fastWriteField103(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField5(buf[offset:], w) @@ -343,6 +631,14 @@ func (p *Model) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset += p.fastWriteField7(buf[offset:], w) offset += p.fastWriteField8(buf[offset:], w) offset += p.fastWriteField9(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.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField102(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -360,6 +656,16 @@ func (p *Model) BLength() int { l += p.field7Length() l += p.field8Length() l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + l += p.field14Length() + l += p.field15Length() + l += p.field100Length() + l += p.field101Length() + l += p.field102Length() + l += p.field103Length() } l += thrift.Binary.FieldStopLength() return l @@ -454,174 +760,1270 @@ func (p *Model) fastWriteField9(buf []byte, w thrift.NocopyWriter) int { return offset } -func (p *Model) field1Length() int { +func (p *Model) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIdentification() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 10) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Identification) + } + return offset +} + +func (p *Model) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSeries() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 11) + offset += p.Series.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *Model) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVisibility() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 12) + offset += p.Visibility.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *Model) fastWriteField13(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIcon() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 13) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Icon) + } + return offset +} + +func (p *Model) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTags() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 14) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Tags { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } + return offset +} + +func (p *Model) fastWriteField15(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStatus() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 15) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Status) + } + return offset +} + +func (p *Model) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCreatedBy() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.CreatedBy) + } + return offset +} + +func (p *Model) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCreatedAt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 101) + offset += thrift.Binary.WriteI64(buf[offset:], *p.CreatedAt) + } + return offset +} + +func (p *Model) fastWriteField102(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUpdatedBy() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 102) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.UpdatedBy) + } + return offset +} + +func (p *Model) fastWriteField103(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUpdatedAt() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I64, 103) + offset += thrift.Binary.WriteI64(buf[offset:], *p.UpdatedAt) + } + return offset +} + +func (p *Model) field1Length() int { + l := 0 + if p.IsSetModelID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *Model) field2Length() int { + l := 0 + if p.IsSetWorkspaceID() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *Model) field3Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *Model) field4Length() int { + l := 0 + if p.IsSetDesc() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Desc) + } + return l +} + +func (p *Model) field5Length() int { + l := 0 + if p.IsSetAbility() { + l += thrift.Binary.FieldBeginLength() + l += p.Ability.BLength() + } + return l +} + +func (p *Model) field6Length() int { + l := 0 + if p.IsSetProtocol() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Protocol) + } + return l +} + +func (p *Model) field7Length() int { + l := 0 + if p.IsSetProtocolConfig() { + l += thrift.Binary.FieldBeginLength() + l += p.ProtocolConfig.BLength() + } + return l +} + +func (p *Model) field8Length() int { + l := 0 + if p.IsSetScenarioConfigs() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.MapBeginLength() + for k, v := range p.ScenarioConfigs { + _, _ = k, v + + l += thrift.Binary.StringLengthNocopy(k) + l += v.BLength() + } + } + return l +} + +func (p *Model) field9Length() int { + l := 0 + if p.IsSetParamConfig() { + l += thrift.Binary.FieldBeginLength() + l += p.ParamConfig.BLength() + } + return l +} + +func (p *Model) field10Length() int { + l := 0 + if p.IsSetIdentification() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Identification) + } + return l +} + +func (p *Model) field11Length() int { + l := 0 + if p.IsSetSeries() { + l += thrift.Binary.FieldBeginLength() + l += p.Series.BLength() + } + return l +} + +func (p *Model) field12Length() int { + l := 0 + if p.IsSetVisibility() { + l += thrift.Binary.FieldBeginLength() + l += p.Visibility.BLength() + } + return l +} + +func (p *Model) field13Length() int { + l := 0 + if p.IsSetIcon() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Icon) + } + return l +} + +func (p *Model) field14Length() int { + l := 0 + if p.IsSetTags() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Tags { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *Model) field15Length() int { + l := 0 + if p.IsSetStatus() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Status) + } + return l +} + +func (p *Model) field100Length() int { + l := 0 + if p.IsSetCreatedBy() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.CreatedBy) + } + return l +} + +func (p *Model) field101Length() int { + l := 0 + if p.IsSetCreatedAt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *Model) field102Length() int { + l := 0 + if p.IsSetUpdatedBy() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.UpdatedBy) + } + return l +} + +func (p *Model) field103Length() int { + l := 0 + if p.IsSetUpdatedAt() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I64Length() + } + return l +} + +func (p *Model) DeepCopy(s interface{}) error { + src, ok := s.(*Model) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.ModelID != nil { + tmp := *src.ModelID + p.ModelID = &tmp + } + + if src.WorkspaceID != nil { + tmp := *src.WorkspaceID + p.WorkspaceID = &tmp + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.Desc != nil { + var tmp string + if *src.Desc != "" { + tmp = kutils.StringDeepCopy(*src.Desc) + } + p.Desc = &tmp + } + + var _ability *Ability + if src.Ability != nil { + _ability = &Ability{} + if err := _ability.DeepCopy(src.Ability); err != nil { + return err + } + } + p.Ability = _ability + + if src.Protocol != nil { + tmp := *src.Protocol + p.Protocol = &tmp + } + + var _protocolConfig *ProtocolConfig + if src.ProtocolConfig != nil { + _protocolConfig = &ProtocolConfig{} + if err := _protocolConfig.DeepCopy(src.ProtocolConfig); err != nil { + return err + } + } + p.ProtocolConfig = _protocolConfig + + if src.ScenarioConfigs != nil { + p.ScenarioConfigs = make(map[common.Scenario]*ScenarioConfig, len(src.ScenarioConfigs)) + for key, val := range src.ScenarioConfigs { + var _key common.Scenario + _key = key + + var _val *ScenarioConfig + if val != nil { + _val = &ScenarioConfig{} + if err := _val.DeepCopy(val); err != nil { + return err + } + } + + p.ScenarioConfigs[_key] = _val + } + } + + var _paramConfig *ParamConfig + if src.ParamConfig != nil { + _paramConfig = &ParamConfig{} + if err := _paramConfig.DeepCopy(src.ParamConfig); err != nil { + return err + } + } + p.ParamConfig = _paramConfig + + if src.Identification != nil { + var tmp string + if *src.Identification != "" { + tmp = kutils.StringDeepCopy(*src.Identification) + } + p.Identification = &tmp + } + + var _series *Series + if src.Series != nil { + _series = &Series{} + if err := _series.DeepCopy(src.Series); err != nil { + return err + } + } + p.Series = _series + + var _visibility *Visibility + if src.Visibility != nil { + _visibility = &Visibility{} + if err := _visibility.DeepCopy(src.Visibility); err != nil { + return err + } + } + p.Visibility = _visibility + + if src.Icon != nil { + var tmp string + if *src.Icon != "" { + tmp = kutils.StringDeepCopy(*src.Icon) + } + p.Icon = &tmp + } + + if src.Tags != nil { + p.Tags = make([]string, 0, len(src.Tags)) + for _, elem := range src.Tags { + var _elem string + if elem != "" { + _elem = kutils.StringDeepCopy(elem) + } + p.Tags = append(p.Tags, _elem) + } + } + + if src.Status != nil { + tmp := *src.Status + p.Status = &tmp + } + + if src.CreatedBy != nil { + var tmp string + if *src.CreatedBy != "" { + tmp = kutils.StringDeepCopy(*src.CreatedBy) + } + p.CreatedBy = &tmp + } + + if src.CreatedAt != nil { + tmp := *src.CreatedAt + p.CreatedAt = &tmp + } + + if src.UpdatedBy != nil { + var tmp string + if *src.UpdatedBy != "" { + tmp = kutils.StringDeepCopy(*src.UpdatedBy) + } + p.UpdatedBy = &tmp + } + + if src.UpdatedAt != nil { + tmp := *src.UpdatedAt + p.UpdatedAt = &tmp + } + + return nil +} + +func (p *Series) 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_Series[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Series) 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.Name = _field + return offset, nil +} + +func (p *Series) 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.Icon = _field + return offset, nil +} + +func (p *Series) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *Family + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Family = _field + return offset, nil +} + +func (p *Series) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Series) 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 *Series) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Series) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *Series) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIcon() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Icon) + } + return offset +} + +func (p *Series) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetFamily() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Family) + } + return offset +} + +func (p *Series) field1Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *Series) field2Length() int { + l := 0 + if p.IsSetIcon() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Icon) + } + return l +} + +func (p *Series) field3Length() int { + l := 0 + if p.IsSetFamily() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Family) + } + return l +} + +func (p *Series) DeepCopy(s interface{}) error { + src, ok := s.(*Series) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.Name != nil { + var tmp string + if *src.Name != "" { + tmp = kutils.StringDeepCopy(*src.Name) + } + p.Name = &tmp + } + + if src.Icon != nil { + var tmp string + if *src.Icon != "" { + tmp = kutils.StringDeepCopy(*src.Icon) + } + p.Icon = &tmp + } + + if src.Family != nil { + tmp := *src.Family + p.Family = &tmp + } + + return nil +} + +func (p *Visibility) 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.LIST { + 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_Visibility[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Visibility) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *VisibleMode + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Mode = _field + return offset, nil +} + +func (p *Visibility) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]int64, 0, size) + for i := 0; i < size; i++ { + var _elem int64 + if v, l, err := thrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.SpaceIDs = _field + return offset, nil +} + +func (p *Visibility) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Visibility) 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 *Visibility) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Visibility) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetMode() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Mode) + } + return offset +} + +func (p *Visibility) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSpaceIDs() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.SpaceIDs { + length++ + offset += thrift.Binary.WriteI64(buf[offset:], v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) + } + return offset +} + +func (p *Visibility) field1Length() int { + l := 0 + if p.IsSetMode() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Mode) + } + return l +} + +func (p *Visibility) field2Length() int { + l := 0 + if p.IsSetSpaceIDs() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + l += + thrift.Binary.I64Length() * len(p.SpaceIDs) + } + return l +} + +func (p *Visibility) DeepCopy(s interface{}) error { + src, ok := s.(*Visibility) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.Mode != nil { + tmp := *src.Mode + p.Mode = &tmp + } + + if src.SpaceIDs != nil { + p.SpaceIDs = make([]int64, 0, len(src.SpaceIDs)) + for _, elem := range src.SpaceIDs { + var _elem int64 + _elem = elem + p.SpaceIDs = append(p.SpaceIDs, _elem) + } + } + + return nil +} + +func (p *ProviderInfo) 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_ProviderInfo[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *ProviderInfo) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewMaaSInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.MaasInfo = _field + return offset, nil +} + +func (p *ProviderInfo) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *ProviderInfo) 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 *ProviderInfo) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *ProviderInfo) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetMaasInfo() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.MaasInfo.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ProviderInfo) field1Length() int { + l := 0 + if p.IsSetMaasInfo() { + l += thrift.Binary.FieldBeginLength() + l += p.MaasInfo.BLength() + } + return l +} + +func (p *ProviderInfo) DeepCopy(s interface{}) error { + src, ok := s.(*ProviderInfo) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + var _maasInfo *MaaSInfo + if src.MaasInfo != nil { + _maasInfo = &MaaSInfo{} + if err := _maasInfo.DeepCopy(src.MaasInfo); err != nil { + return err + } + } + p.MaasInfo = _maasInfo + + return nil +} + +func (p *MaaSInfo) 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 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 + } + } + 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_MaaSInfo[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *MaaSInfo) 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.Host = _field + return offset, nil +} + +func (p *MaaSInfo) 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.Region = _field + return offset, nil +} + +func (p *MaaSInfo) 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.BaseURL = _field + return offset, nil +} + +func (p *MaaSInfo) 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.CustomizationJobsID = _field + return offset, nil +} + +func (p *MaaSInfo) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *MaaSInfo) 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 += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *MaaSInfo) BLength() int { l := 0 - if p.IsSetModelID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() } + l += thrift.Binary.FieldStopLength() return l } -func (p *Model) field2Length() int { - l := 0 - if p.IsSetWorkspaceID() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.I64Length() +func (p *MaaSInfo) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetHost() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Host) } - return l + return offset } -func (p *Model) field3Length() int { - l := 0 - if p.IsSetName() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Name) +func (p *MaaSInfo) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetRegion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Region) } - return l + return offset } -func (p *Model) field4Length() int { - l := 0 - if p.IsSetDesc() { - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Desc) +func (p *MaaSInfo) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBaseURL() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.BaseURL) } - return l + return offset } -func (p *Model) field5Length() int { - l := 0 - if p.IsSetAbility() { - l += thrift.Binary.FieldBeginLength() - l += p.Ability.BLength() +func (p *MaaSInfo) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCustomizationJobsID() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.CustomizationJobsID) } - return l + return offset } -func (p *Model) field6Length() int { +func (p *MaaSInfo) field1Length() int { l := 0 - if p.IsSetProtocol() { + if p.IsSetHost() { l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(*p.Protocol) + l += thrift.Binary.StringLengthNocopy(*p.Host) } return l } -func (p *Model) field7Length() int { +func (p *MaaSInfo) field2Length() int { l := 0 - if p.IsSetProtocolConfig() { + if p.IsSetRegion() { l += thrift.Binary.FieldBeginLength() - l += p.ProtocolConfig.BLength() + l += thrift.Binary.StringLengthNocopy(*p.Region) } return l } -func (p *Model) field8Length() int { +func (p *MaaSInfo) field3Length() int { l := 0 - if p.IsSetScenarioConfigs() { + if p.IsSetBaseURL() { l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.MapBeginLength() - for k, v := range p.ScenarioConfigs { - _, _ = k, v - - l += thrift.Binary.StringLengthNocopy(k) - l += v.BLength() - } + l += thrift.Binary.StringLengthNocopy(*p.BaseURL) } return l } -func (p *Model) field9Length() int { +func (p *MaaSInfo) field4Length() int { l := 0 - if p.IsSetParamConfig() { + if p.IsSetCustomizationJobsID() { l += thrift.Binary.FieldBeginLength() - l += p.ParamConfig.BLength() + l += thrift.Binary.StringLengthNocopy(*p.CustomizationJobsID) } return l } -func (p *Model) DeepCopy(s interface{}) error { - src, ok := s.(*Model) +func (p *MaaSInfo) DeepCopy(s interface{}) error { + src, ok := s.(*MaaSInfo) if !ok { return fmt.Errorf("%T's type not matched %T", s, p) } - if src.ModelID != nil { - tmp := *src.ModelID - p.ModelID = &tmp - } - - if src.WorkspaceID != nil { - tmp := *src.WorkspaceID - p.WorkspaceID = &tmp - } - - if src.Name != nil { + if src.Host != nil { var tmp string - if *src.Name != "" { - tmp = kutils.StringDeepCopy(*src.Name) + if *src.Host != "" { + tmp = kutils.StringDeepCopy(*src.Host) } - p.Name = &tmp + p.Host = &tmp } - if src.Desc != nil { + if src.Region != nil { var tmp string - if *src.Desc != "" { - tmp = kutils.StringDeepCopy(*src.Desc) - } - p.Desc = &tmp - } - - var _ability *Ability - if src.Ability != nil { - _ability = &Ability{} - if err := _ability.DeepCopy(src.Ability); err != nil { - return err - } - } - p.Ability = _ability - - if src.Protocol != nil { - tmp := *src.Protocol - p.Protocol = &tmp - } - - var _protocolConfig *ProtocolConfig - if src.ProtocolConfig != nil { - _protocolConfig = &ProtocolConfig{} - if err := _protocolConfig.DeepCopy(src.ProtocolConfig); err != nil { - return err + if *src.Region != "" { + tmp = kutils.StringDeepCopy(*src.Region) } + p.Region = &tmp } - p.ProtocolConfig = _protocolConfig - - if src.ScenarioConfigs != nil { - p.ScenarioConfigs = make(map[common.Scenario]*ScenarioConfig, len(src.ScenarioConfigs)) - for key, val := range src.ScenarioConfigs { - var _key common.Scenario - _key = key - var _val *ScenarioConfig - if val != nil { - _val = &ScenarioConfig{} - if err := _val.DeepCopy(val); err != nil { - return err - } - } - - p.ScenarioConfigs[_key] = _val + if src.BaseURL != nil { + var tmp string + if *src.BaseURL != "" { + tmp = kutils.StringDeepCopy(*src.BaseURL) } + p.BaseURL = &tmp } - var _paramConfig *ParamConfig - if src.ParamConfig != nil { - _paramConfig = &ParamConfig{} - if err := _paramConfig.DeepCopy(src.ParamConfig); err != nil { - return err + if src.CustomizationJobsID != nil { + var tmp string + if *src.CustomizationJobsID != "" { + tmp = kutils.StringDeepCopy(*src.CustomizationJobsID) } + p.CustomizationJobsID = &tmp } - p.ParamConfig = _paramConfig return nil } @@ -741,6 +2143,20 @@ func (p *Ability) FastRead(buf []byte) (int, error) { 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 @@ -855,6 +2271,20 @@ func (p *Ability) FastReadField7(buf []byte) (int, error) { return offset, nil } +func (p *Ability) FastReadField8(buf []byte) (int, error) { + offset := 0 + + var _field *InterfaceCategory + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.InterfaceCategory = _field + return offset, nil +} + func (p *Ability) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -869,6 +2299,7 @@ func (p *Ability) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { 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 @@ -884,6 +2315,7 @@ func (p *Ability) BLength() int { l += p.field5Length() l += p.field6Length() l += p.field7Length() + l += p.field8Length() } l += thrift.Binary.FieldStopLength() return l @@ -952,6 +2384,15 @@ func (p *Ability) fastWriteField7(buf []byte, w thrift.NocopyWriter) int { return offset } +func (p *Ability) fastWriteField8(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetInterfaceCategory() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 8) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.InterfaceCategory) + } + return offset +} + func (p *Ability) field1Length() int { l := 0 if p.IsSetMaxContextTokens() { @@ -1015,6 +2456,15 @@ func (p *Ability) field7Length() int { return l } +func (p *Ability) field8Length() int { + l := 0 + if p.IsSetInterfaceCategory() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.InterfaceCategory) + } + return l +} + func (p *Ability) DeepCopy(s interface{}) error { src, ok := s.(*Ability) if !ok { @@ -1060,6 +2510,11 @@ func (p *Ability) DeepCopy(s interface{}) error { } p.AbilityMultiModal = _abilityMultiModal + if src.InterfaceCategory != nil { + tmp := *src.InterfaceCategory + p.InterfaceCategory = &tmp + } + return nil } @@ -5772,6 +7227,48 @@ func (p *ParamSchema) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 9: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField9(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.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 + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -5877,18 +7374,43 @@ func (p *ParamSchema) FastReadField6(buf []byte) (int, error) { func (p *ParamSchema) FastReadField7(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 + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.DefaultValue = _field + return offset, nil +} + +func (p *ParamSchema) FastReadField8(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*ParamOption, 0, size) + values := make([]ParamOption, 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.DefaultValue = _field + p.Options = _field return offset, nil } -func (p *ParamSchema) FastReadField8(buf []byte) (int, error) { +func (p *ParamSchema) FastReadField9(buf []byte) (int, error) { offset := 0 _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) @@ -5896,8 +7418,8 @@ func (p *ParamSchema) FastReadField8(buf []byte) (int, error) { if err != nil { return offset, err } - _field := make([]*ParamOption, 0, size) - values := make([]ParamOption, size) + _field := make([]*ParamSchema, 0, size) + values := make([]ParamSchema, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -5909,7 +7431,33 @@ func (p *ParamSchema) FastReadField8(buf []byte) (int, error) { _field = append(_field, _elem) } - p.Options = _field + p.Properties = _field + return offset, nil +} + +func (p *ParamSchema) FastReadField10(buf []byte) (int, error) { + offset := 0 + _field := NewReaction() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Reaction = _field + return offset, nil +} + +func (p *ParamSchema) FastReadField11(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.Jsonpath = _field return offset, nil } @@ -5928,6 +7476,9 @@ func (p *ParamSchema) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset += p.fastWriteField6(buf[offset:], w) offset += p.fastWriteField7(buf[offset:], w) offset += p.fastWriteField8(buf[offset:], w) + offset += p.fastWriteField9(buf[offset:], w) + offset += p.fastWriteField10(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -5944,6 +7495,9 @@ func (p *ParamSchema) BLength() int { l += p.field6Length() l += p.field7Length() l += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() } l += thrift.Binary.FieldStopLength() return l @@ -6028,6 +7582,40 @@ func (p *ParamSchema) fastWriteField8(buf []byte, w thrift.NocopyWriter) int { return offset } +func (p *ParamSchema) fastWriteField9(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetProperties() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 9) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Properties { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset +} + +func (p *ParamSchema) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetReaction() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 10) + offset += p.Reaction.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ParamSchema) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetJsonpath() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 11) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Jsonpath) + } + return offset +} + func (p *ParamSchema) field1Length() int { l := 0 if p.IsSetName() { @@ -6104,6 +7692,37 @@ func (p *ParamSchema) field8Length() int { return l } +func (p *ParamSchema) field9Length() int { + l := 0 + if p.IsSetProperties() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Properties { + _ = v + l += v.BLength() + } + } + return l +} + +func (p *ParamSchema) field10Length() int { + l := 0 + if p.IsSetReaction() { + l += thrift.Binary.FieldBeginLength() + l += p.Reaction.BLength() + } + return l +} + +func (p *ParamSchema) field11Length() int { + l := 0 + if p.IsSetJsonpath() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Jsonpath) + } + return l +} + func (p *ParamSchema) DeepCopy(s interface{}) error { src, ok := s.(*ParamSchema) if !ok { @@ -6178,6 +7797,214 @@ func (p *ParamSchema) DeepCopy(s interface{}) error { } } + if src.Properties != nil { + p.Properties = make([]*ParamSchema, 0, len(src.Properties)) + for _, elem := range src.Properties { + var _elem *ParamSchema + if elem != nil { + _elem = &ParamSchema{} + if err := _elem.DeepCopy(elem); err != nil { + return err + } + } + + p.Properties = append(p.Properties, _elem) + } + } + + var _reaction *Reaction + if src.Reaction != nil { + _reaction = &Reaction{} + if err := _reaction.DeepCopy(src.Reaction); err != nil { + return err + } + } + p.Reaction = _reaction + + if src.Jsonpath != nil { + var tmp string + if *src.Jsonpath != "" { + tmp = kutils.StringDeepCopy(*src.Jsonpath) + } + p.Jsonpath = &tmp + } + + return nil +} + +func (p *Reaction) 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 + } + } + 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_Reaction[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Reaction) 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.Dependency = _field + return offset, nil +} + +func (p *Reaction) 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.Visible = _field + return offset, nil +} + +func (p *Reaction) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Reaction) 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 *Reaction) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Reaction) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetDependency() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Dependency) + } + return offset +} + +func (p *Reaction) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVisible() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Visible) + } + return offset +} + +func (p *Reaction) field1Length() int { + l := 0 + if p.IsSetDependency() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Dependency) + } + return l +} + +func (p *Reaction) field2Length() int { + l := 0 + if p.IsSetVisible() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Visible) + } + return l +} + +func (p *Reaction) DeepCopy(s interface{}) error { + src, ok := s.(*Reaction) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.Dependency != nil { + var tmp string + if *src.Dependency != "" { + tmp = kutils.StringDeepCopy(*src.Dependency) + } + p.Dependency = &tmp + } + + if src.Visible != nil { + var tmp string + if *src.Visible != "" { + tmp = kutils.StringDeepCopy(*src.Visible) + } + p.Visible = &tmp + } + return nil } diff --git a/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go b/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go index 6f0e4dbaf..e22cf1fb9 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go +++ b/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go @@ -36,6 +36,110 @@ const ( ParamTypeString = "string" + ParamTypeVoid = "void" + + ParamTypeObject = "object" + + FamilyUndefined = "undefined" + + FamilyGpt = "gpt" + + FamilySeed = "seed" + + FamilyGemini = "gemini" + + FamilyClaude = "claude" + + FamilyErnie = "ernie" + + FamilyBaichuan = "baichuan" + + FamilyQwen = "qwen" + + FamilyGlm = "glm" + + FamilySkylark = "skylark" + + FamilyMoonshot = "moonshot" + + FamilyMinimax = "minimax" + + FamilyDoubao = "doubao" + + FamilyBaichuan2 = "baichuan2" + + FamilyDeepseekv2 = "deepseekv2" + + FamilyDeepseekCoderV2 = "deepseek_coder_v2" + + FamilyDeepseekCoder = "deepseek_coder" + + FamilyInternalm25 = "internalm2_5" + + FamilyQwen2 = "qwen2" + + FamilyQwen25 = "qwen2.5" + + FamilyQwen25Coder = "qwen2.5_coder" + + FamilyMiniCpm = "mini_cpm" + + FamilyMiniCpm3 = "mini_cpm_3" + + FamilyChatGlm3 = "chat_glm_3" + + FamilyMistra = "mistral" + + FamilyGemma = "gemma" + + FamilyGemma2 = "gemma_2" + + FamilyInternVl2 = "intern_vl2" + + FamilyInternVl25 = "intern_vl2.5" + + FamilyDeepseekV3 = "deepseek_v3" + + FamilyDeepseekR1 = "deepseek_r1" + + FamilyKimi = "kimi" + + FamilySeedream = "seedream" + + FamilyInternVl3 = "intern_vl3" + + ProviderUndefined = "undefined" + + ProviderMaas = "maas" + + VisibleModeDefault = "default" + + VisibleModeSpecified = "specified" + + VisibleModeUndefined = "undefined" + + VisibleModeAll = "all" + + ModelStatusUndefined = "undefined" + + ModelStatusAvailable = "available" + + ModelStatusUnavailable = "unavailable" + + InterfaceCategoryUndefined = "undefined" + + InterfaceCategoryChatCompletionAPI = "chat_completion_api" + + InterfaceCategoryResponseAPI = "response_api" + + AbilityUndefined = "undefined" + + AbilityJSONMode = "json_mode" + + AbilityFunctionCall = "function_call" + + AbilityMultiModal_ = "multi_modal" + VideoFormatUndefined = "undefined" VideoFormatMp4 = "mp4" @@ -71,6 +175,18 @@ type Protocol = string type ParamType = string +type Family = string + +type Provider = string + +type VisibleMode = string + +type ModelStatus = string + +type InterfaceCategory = string + +type AbilityEnum = string + type VideoFormat = string type Model struct { @@ -83,6 +199,21 @@ type Model struct { ProtocolConfig *ProtocolConfig `thrift:"protocol_config,7,optional" frugal:"7,optional,ProtocolConfig" form:"protocol_config" json:"protocol_config,omitempty" query:"protocol_config"` ScenarioConfigs map[common.Scenario]*ScenarioConfig `thrift:"scenario_configs,8,optional" frugal:"8,optional,map" form:"scenario_configs" json:"scenario_configs,omitempty" query:"scenario_configs"` ParamConfig *ParamConfig `thrift:"param_config,9,optional" frugal:"9,optional,ParamConfig" form:"param_config" json:"param_config,omitempty" query:"param_config"` + // 模型表示 (name, endpoint) + Identification *string `thrift:"identification,10,optional" frugal:"10,optional,string" form:"identification" json:"identification,omitempty" query:"identification"` + // 模型 + Series *Series `thrift:"series,11,optional" frugal:"11,optional,Series" form:"series" json:"series,omitempty" query:"series"` + Visibility *Visibility `thrift:"visibility,12,optional" frugal:"12,optional,Visibility" form:"visibility" json:"visibility,omitempty" query:"visibility"` + // 模型图标 + Icon *string `thrift:"icon,13,optional" frugal:"13,optional,string" form:"icon" json:"icon,omitempty" query:"icon"` + //模型标签 + Tags []string `thrift:"tags,14,optional" frugal:"14,optional,list" form:"tags" json:"tags,omitempty" query:"tags"` + // 模型状态 + Status *ModelStatus `thrift:"status,15,optional" frugal:"15,optional,string" form:"status" json:"status,omitempty" query:"status"` + CreatedBy *string `thrift:"created_by,100,optional" frugal:"100,optional,string" form:"created_by" json:"created_by,omitempty" query:"created_by"` + CreatedAt *int64 `thrift:"created_at,101,optional" frugal:"101,optional,i64" form:"created_at" json:"created_at,omitempty" query:"created_at"` + UpdatedBy *string `thrift:"updated_by,102,optional" frugal:"102,optional,string" form:"updated_by" json:"updated_by,omitempty" query:"updated_by"` + UpdatedAt *int64 `thrift:"updated_at,103,optional" frugal:"103,optional,i64" form:"updated_at" json:"updated_at,omitempty" query:"updated_at"` } func NewModel() *Model { @@ -199,6 +330,126 @@ func (p *Model) GetParamConfig() (v *ParamConfig) { } return p.ParamConfig } + +var Model_Identification_DEFAULT string + +func (p *Model) GetIdentification() (v string) { + if p == nil { + return + } + if !p.IsSetIdentification() { + return Model_Identification_DEFAULT + } + return *p.Identification +} + +var Model_Series_DEFAULT *Series + +func (p *Model) GetSeries() (v *Series) { + if p == nil { + return + } + if !p.IsSetSeries() { + return Model_Series_DEFAULT + } + return p.Series +} + +var Model_Visibility_DEFAULT *Visibility + +func (p *Model) GetVisibility() (v *Visibility) { + if p == nil { + return + } + if !p.IsSetVisibility() { + return Model_Visibility_DEFAULT + } + return p.Visibility +} + +var Model_Icon_DEFAULT string + +func (p *Model) GetIcon() (v string) { + if p == nil { + return + } + if !p.IsSetIcon() { + return Model_Icon_DEFAULT + } + return *p.Icon +} + +var Model_Tags_DEFAULT []string + +func (p *Model) GetTags() (v []string) { + if p == nil { + return + } + if !p.IsSetTags() { + return Model_Tags_DEFAULT + } + return p.Tags +} + +var Model_Status_DEFAULT ModelStatus + +func (p *Model) GetStatus() (v ModelStatus) { + if p == nil { + return + } + if !p.IsSetStatus() { + return Model_Status_DEFAULT + } + return *p.Status +} + +var Model_CreatedBy_DEFAULT string + +func (p *Model) GetCreatedBy() (v string) { + if p == nil { + return + } + if !p.IsSetCreatedBy() { + return Model_CreatedBy_DEFAULT + } + return *p.CreatedBy +} + +var Model_CreatedAt_DEFAULT int64 + +func (p *Model) GetCreatedAt() (v int64) { + if p == nil { + return + } + if !p.IsSetCreatedAt() { + return Model_CreatedAt_DEFAULT + } + return *p.CreatedAt +} + +var Model_UpdatedBy_DEFAULT string + +func (p *Model) GetUpdatedBy() (v string) { + if p == nil { + return + } + if !p.IsSetUpdatedBy() { + return Model_UpdatedBy_DEFAULT + } + return *p.UpdatedBy +} + +var Model_UpdatedAt_DEFAULT int64 + +func (p *Model) GetUpdatedAt() (v int64) { + if p == nil { + return + } + if !p.IsSetUpdatedAt() { + return Model_UpdatedAt_DEFAULT + } + return *p.UpdatedAt +} func (p *Model) SetModelID(val *int64) { p.ModelID = val } @@ -226,17 +477,57 @@ func (p *Model) SetScenarioConfigs(val map[common.Scenario]*ScenarioConfig) { func (p *Model) SetParamConfig(val *ParamConfig) { p.ParamConfig = val } +func (p *Model) SetIdentification(val *string) { + p.Identification = val +} +func (p *Model) SetSeries(val *Series) { + p.Series = val +} +func (p *Model) SetVisibility(val *Visibility) { + p.Visibility = val +} +func (p *Model) SetIcon(val *string) { + p.Icon = val +} +func (p *Model) SetTags(val []string) { + p.Tags = val +} +func (p *Model) SetStatus(val *ModelStatus) { + p.Status = val +} +func (p *Model) SetCreatedBy(val *string) { + p.CreatedBy = val +} +func (p *Model) SetCreatedAt(val *int64) { + p.CreatedAt = val +} +func (p *Model) SetUpdatedBy(val *string) { + p.UpdatedBy = val +} +func (p *Model) SetUpdatedAt(val *int64) { + p.UpdatedAt = val +} var fieldIDToName_Model = map[int16]string{ - 1: "model_id", - 2: "workspace_id", - 3: "name", - 4: "desc", - 5: "ability", - 6: "protocol", - 7: "protocol_config", - 8: "scenario_configs", - 9: "param_config", + 1: "model_id", + 2: "workspace_id", + 3: "name", + 4: "desc", + 5: "ability", + 6: "protocol", + 7: "protocol_config", + 8: "scenario_configs", + 9: "param_config", + 10: "identification", + 11: "series", + 12: "visibility", + 13: "icon", + 14: "tags", + 15: "status", + 100: "created_by", + 101: "created_at", + 102: "updated_by", + 103: "updated_at", } func (p *Model) IsSetModelID() bool { @@ -275,6 +566,46 @@ func (p *Model) IsSetParamConfig() bool { return p.ParamConfig != nil } +func (p *Model) IsSetIdentification() bool { + return p.Identification != nil +} + +func (p *Model) IsSetSeries() bool { + return p.Series != nil +} + +func (p *Model) IsSetVisibility() bool { + return p.Visibility != nil +} + +func (p *Model) IsSetIcon() bool { + return p.Icon != nil +} + +func (p *Model) IsSetTags() bool { + return p.Tags != nil +} + +func (p *Model) IsSetStatus() bool { + return p.Status != nil +} + +func (p *Model) IsSetCreatedBy() bool { + return p.CreatedBy != nil +} + +func (p *Model) IsSetCreatedAt() bool { + return p.CreatedAt != nil +} + +func (p *Model) IsSetUpdatedBy() bool { + return p.UpdatedBy != nil +} + +func (p *Model) IsSetUpdatedAt() bool { + return p.UpdatedAt != nil +} + func (p *Model) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -365,6 +696,86 @@ func (p *Model) Read(iprot thrift.TProtocol) (err error) { } 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.STRUCT { + 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.LIST { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 15: + if fieldTypeId == thrift.STRING { + if err = p.ReadField15(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.I64 { + if err = p.ReadField101(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 102: + if fieldTypeId == thrift.STRING { + if err = p.ReadField102(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 103: + if fieldTypeId == thrift.I64 { + if err = p.ReadField103(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 @@ -502,35 +913,151 @@ func (p *Model) ReadField9(iprot thrift.TProtocol) error { p.ParamConfig = _field return nil } +func (p *Model) ReadField10(iprot thrift.TProtocol) error { -func (p *Model) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("Model"); err != nil { - goto WriteStructBeginError + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } - 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.writeField6(oprot); err != nil { - fieldId = 6 + p.Identification = _field + return nil +} +func (p *Model) ReadField11(iprot thrift.TProtocol) error { + _field := NewSeries() + if err := _field.Read(iprot); err != nil { + return err + } + p.Series = _field + return nil +} +func (p *Model) ReadField12(iprot thrift.TProtocol) error { + _field := NewVisibility() + if err := _field.Read(iprot); err != nil { + return err + } + p.Visibility = _field + return nil +} +func (p *Model) ReadField13(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Icon = _field + return nil +} +func (p *Model) ReadField14(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + 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.Tags = _field + return nil +} +func (p *Model) ReadField15(iprot thrift.TProtocol) error { + + var _field *ModelStatus + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Status = _field + return nil +} +func (p *Model) ReadField100(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.CreatedBy = _field + return nil +} +func (p *Model) ReadField101(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.CreatedAt = _field + return nil +} +func (p *Model) ReadField102(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.UpdatedBy = _field + return nil +} +func (p *Model) ReadField103(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.UpdatedAt = _field + return nil +} + +func (p *Model) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Model"); 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.writeField6(oprot); err != nil { + fieldId = 6 goto WriteFieldError } if err = p.writeField7(oprot); err != nil { @@ -545,6 +1072,46 @@ func (p *Model) Write(oprot thrift.TProtocol) (err error) { fieldId = 9 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.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } + if err = p.writeField102(oprot); err != nil { + fieldId = 102 + goto WriteFieldError + } + if err = p.writeField103(oprot); err != nil { + fieldId = 103 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -736,85 +1303,303 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) } - -func (p *Model) String() string { - if p == nil { - return "" +func (p *Model) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetIdentification() { + if err = oprot.WriteFieldBegin("identification", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Identification); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("Model(%+v)", *p) - + 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 *Model) DeepEqual(ano *Model) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ModelID) { - return false - } - if !p.Field2DeepEqual(ano.WorkspaceID) { - return false - } - if !p.Field3DeepEqual(ano.Name) { - return false - } - if !p.Field4DeepEqual(ano.Desc) { - return false - } - if !p.Field5DeepEqual(ano.Ability) { - return false - } - if !p.Field6DeepEqual(ano.Protocol) { - return false - } - if !p.Field7DeepEqual(ano.ProtocolConfig) { - return false - } - if !p.Field8DeepEqual(ano.ScenarioConfigs) { - return false - } - if !p.Field9DeepEqual(ano.ParamConfig) { - return false +func (p *Model) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetSeries() { + if err = oprot.WriteFieldBegin("series", thrift.STRUCT, 11); err != nil { + goto WriteFieldBeginError + } + if err := p.Series.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return true + 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 *Model) Field1DeepEqual(src *int64) bool { - - if p.ModelID == src { - return true - } else if p.ModelID == nil || src == nil { - return false - } - if *p.ModelID != *src { - return false +func (p *Model) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetVisibility() { + if err = oprot.WriteFieldBegin("visibility", thrift.STRUCT, 12); err != nil { + goto WriteFieldBeginError + } + if err := p.Visibility.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return true + 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 *Model) Field2DeepEqual(src *int64) bool { - - if p.WorkspaceID == src { - return true - } else if p.WorkspaceID == nil || src == nil { - return false - } - if *p.WorkspaceID != *src { - return false +func (p *Model) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetIcon() { + if err = oprot.WriteFieldBegin("icon", thrift.STRING, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Icon); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return true + 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 *Model) Field3DeepEqual(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 - } +func (p *Model) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetTags() { + if err = oprot.WriteFieldBegin("tags", thrift.LIST, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Tags)); err != nil { + return err + } + for _, v := range p.Tags { + 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 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} +func (p *Model) writeField15(oprot thrift.TProtocol) (err error) { + if p.IsSetStatus() { + if err = oprot.WriteFieldBegin("status", thrift.STRING, 15); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*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 15 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) +} +func (p *Model) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetCreatedBy() { + if err = oprot.WriteFieldBegin("created_by", thrift.STRING, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.CreatedBy); 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 *Model) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetCreatedAt() { + if err = oprot.WriteFieldBegin("created_at", thrift.I64, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.CreatedAt); 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 *Model) writeField102(oprot thrift.TProtocol) (err error) { + if p.IsSetUpdatedBy() { + if err = oprot.WriteFieldBegin("updated_by", thrift.STRING, 102); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.UpdatedBy); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 102 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 102 end error: ", p), err) +} +func (p *Model) writeField103(oprot thrift.TProtocol) (err error) { + if p.IsSetUpdatedAt() { + if err = oprot.WriteFieldBegin("updated_at", thrift.I64, 103); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.UpdatedAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 103 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 103 end error: ", p), err) +} + +func (p *Model) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Model(%+v)", *p) + +} + +func (p *Model) DeepEqual(ano *Model) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ModelID) { + return false + } + if !p.Field2DeepEqual(ano.WorkspaceID) { + return false + } + if !p.Field3DeepEqual(ano.Name) { + return false + } + if !p.Field4DeepEqual(ano.Desc) { + return false + } + if !p.Field5DeepEqual(ano.Ability) { + return false + } + if !p.Field6DeepEqual(ano.Protocol) { + return false + } + if !p.Field7DeepEqual(ano.ProtocolConfig) { + return false + } + if !p.Field8DeepEqual(ano.ScenarioConfigs) { + return false + } + if !p.Field9DeepEqual(ano.ParamConfig) { + return false + } + if !p.Field10DeepEqual(ano.Identification) { + return false + } + if !p.Field11DeepEqual(ano.Series) { + return false + } + if !p.Field12DeepEqual(ano.Visibility) { + return false + } + if !p.Field13DeepEqual(ano.Icon) { + return false + } + if !p.Field14DeepEqual(ano.Tags) { + return false + } + if !p.Field15DeepEqual(ano.Status) { + return false + } + if !p.Field100DeepEqual(ano.CreatedBy) { + return false + } + if !p.Field101DeepEqual(ano.CreatedAt) { + return false + } + if !p.Field102DeepEqual(ano.UpdatedBy) { + return false + } + if !p.Field103DeepEqual(ano.UpdatedAt) { + return false + } + return true +} + +func (p *Model) Field1DeepEqual(src *int64) bool { + + if p.ModelID == src { + return true + } else if p.ModelID == nil || src == nil { + return false + } + if *p.ModelID != *src { + return false + } + return true +} +func (p *Model) Field2DeepEqual(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 *Model) Field3DeepEqual(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 *Model) Field4DeepEqual(src *string) bool { @@ -827,50 +1612,1366 @@ func (p *Model) Field4DeepEqual(src *string) bool { if strings.Compare(*p.Desc, *src) != 0 { return false } - return true -} -func (p *Model) Field5DeepEqual(src *Ability) bool { - - if !p.Ability.DeepEqual(src) { + return true +} +func (p *Model) Field5DeepEqual(src *Ability) bool { + + if !p.Ability.DeepEqual(src) { + return false + } + return true +} +func (p *Model) Field6DeepEqual(src *Protocol) bool { + + if p.Protocol == src { + return true + } else if p.Protocol == nil || src == nil { + return false + } + if strings.Compare(*p.Protocol, *src) != 0 { + return false + } + return true +} +func (p *Model) Field7DeepEqual(src *ProtocolConfig) bool { + + if !p.ProtocolConfig.DeepEqual(src) { + return false + } + return true +} +func (p *Model) Field8DeepEqual(src map[common.Scenario]*ScenarioConfig) bool { + + if len(p.ScenarioConfigs) != len(src) { + return false + } + for k, v := range p.ScenarioConfigs { + _src := src[k] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *Model) Field9DeepEqual(src *ParamConfig) bool { + + if !p.ParamConfig.DeepEqual(src) { + return false + } + return true +} +func (p *Model) Field10DeepEqual(src *string) bool { + + if p.Identification == src { + return true + } else if p.Identification == nil || src == nil { + return false + } + if strings.Compare(*p.Identification, *src) != 0 { + return false + } + return true +} +func (p *Model) Field11DeepEqual(src *Series) bool { + + if !p.Series.DeepEqual(src) { + return false + } + return true +} +func (p *Model) Field12DeepEqual(src *Visibility) bool { + + if !p.Visibility.DeepEqual(src) { + return false + } + return true +} +func (p *Model) Field13DeepEqual(src *string) bool { + + if p.Icon == src { + return true + } else if p.Icon == nil || src == nil { + return false + } + if strings.Compare(*p.Icon, *src) != 0 { + return false + } + return true +} +func (p *Model) Field14DeepEqual(src []string) bool { + + if len(p.Tags) != len(src) { + return false + } + for i, v := range p.Tags { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *Model) Field15DeepEqual(src *ModelStatus) bool { + + if p.Status == src { + return true + } else if p.Status == nil || src == nil { + return false + } + if strings.Compare(*p.Status, *src) != 0 { + return false + } + return true +} +func (p *Model) Field100DeepEqual(src *string) bool { + + if p.CreatedBy == src { + return true + } else if p.CreatedBy == nil || src == nil { + return false + } + if strings.Compare(*p.CreatedBy, *src) != 0 { + return false + } + return true +} +func (p *Model) Field101DeepEqual(src *int64) bool { + + if p.CreatedAt == src { + return true + } else if p.CreatedAt == nil || src == nil { + return false + } + if *p.CreatedAt != *src { + return false + } + return true +} +func (p *Model) Field102DeepEqual(src *string) bool { + + if p.UpdatedBy == src { + return true + } else if p.UpdatedBy == nil || src == nil { + return false + } + if strings.Compare(*p.UpdatedBy, *src) != 0 { + return false + } + return true +} +func (p *Model) Field103DeepEqual(src *int64) bool { + + if p.UpdatedAt == src { + return true + } else if p.UpdatedAt == nil || src == nil { + return false + } + if *p.UpdatedAt != *src { + return false + } + return true +} + +type Series struct { + // series name + Name *string `thrift:"name,1,optional" frugal:"1,optional,string" form:"name" json:"name,omitempty" query:"name"` + // series icon url + Icon *string `thrift:"icon,2,optional" frugal:"2,optional,string" form:"icon" json:"icon,omitempty" query:"icon"` + // family name + Family *Family `thrift:"family,3,optional" frugal:"3,optional,string" form:"family" json:"family,omitempty" query:"family"` +} + +func NewSeries() *Series { + return &Series{} +} + +func (p *Series) InitDefault() { +} + +var Series_Name_DEFAULT string + +func (p *Series) GetName() (v string) { + if p == nil { + return + } + if !p.IsSetName() { + return Series_Name_DEFAULT + } + return *p.Name +} + +var Series_Icon_DEFAULT string + +func (p *Series) GetIcon() (v string) { + if p == nil { + return + } + if !p.IsSetIcon() { + return Series_Icon_DEFAULT + } + return *p.Icon +} + +var Series_Family_DEFAULT Family + +func (p *Series) GetFamily() (v Family) { + if p == nil { + return + } + if !p.IsSetFamily() { + return Series_Family_DEFAULT + } + return *p.Family +} +func (p *Series) SetName(val *string) { + p.Name = val +} +func (p *Series) SetIcon(val *string) { + p.Icon = val +} +func (p *Series) SetFamily(val *Family) { + p.Family = val +} + +var fieldIDToName_Series = map[int16]string{ + 1: "name", + 2: "icon", + 3: "family", +} + +func (p *Series) IsSetName() bool { + return p.Name != nil +} + +func (p *Series) IsSetIcon() bool { + return p.Icon != nil +} + +func (p *Series) IsSetFamily() bool { + return p.Family != nil +} + +func (p *Series) 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_Series[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 *Series) ReadField1(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 *Series) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Icon = _field + return nil +} +func (p *Series) ReadField3(iprot thrift.TProtocol) error { + + var _field *Family + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Family = _field + return nil +} + +func (p *Series) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Series"); 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 *Series) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} +func (p *Series) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetIcon() { + if err = oprot.WriteFieldBegin("icon", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Icon); 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 *Series) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFamily() { + if err = oprot.WriteFieldBegin("family", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Family); 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 *Series) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Series(%+v)", *p) + +} + +func (p *Series) DeepEqual(ano *Series) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Name) { + return false + } + if !p.Field2DeepEqual(ano.Icon) { + return false + } + if !p.Field3DeepEqual(ano.Family) { + return false + } + return true +} + +func (p *Series) Field1DeepEqual(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 *Series) Field2DeepEqual(src *string) bool { + + if p.Icon == src { + return true + } else if p.Icon == nil || src == nil { + return false + } + if strings.Compare(*p.Icon, *src) != 0 { + return false + } + return true +} +func (p *Series) Field3DeepEqual(src *Family) bool { + + if p.Family == src { + return true + } else if p.Family == nil || src == nil { + return false + } + if strings.Compare(*p.Family, *src) != 0 { + return false + } + return true +} + +type Visibility struct { + Mode *VisibleMode `thrift:"mode,1,optional" frugal:"1,optional,string" form:"mode" json:"mode,omitempty" query:"mode"` + // Mode为Specified有效,配置为除模型所属空间外的其他空间 + SpaceIDs []int64 `thrift:"spaceIDs,2,optional" frugal:"2,optional,list" form:"spaceIDs" json:"spaceIDs,omitempty" query:"spaceIDs"` +} + +func NewVisibility() *Visibility { + return &Visibility{} +} + +func (p *Visibility) InitDefault() { +} + +var Visibility_Mode_DEFAULT VisibleMode + +func (p *Visibility) GetMode() (v VisibleMode) { + if p == nil { + return + } + if !p.IsSetMode() { + return Visibility_Mode_DEFAULT + } + return *p.Mode +} + +var Visibility_SpaceIDs_DEFAULT []int64 + +func (p *Visibility) GetSpaceIDs() (v []int64) { + if p == nil { + return + } + if !p.IsSetSpaceIDs() { + return Visibility_SpaceIDs_DEFAULT + } + return p.SpaceIDs +} +func (p *Visibility) SetMode(val *VisibleMode) { + p.Mode = val +} +func (p *Visibility) SetSpaceIDs(val []int64) { + p.SpaceIDs = val +} + +var fieldIDToName_Visibility = map[int16]string{ + 1: "mode", + 2: "spaceIDs", +} + +func (p *Visibility) IsSetMode() bool { + return p.Mode != nil +} + +func (p *Visibility) IsSetSpaceIDs() bool { + return p.SpaceIDs != nil +} + +func (p *Visibility) 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.LIST { + 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_Visibility[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 *Visibility) ReadField1(iprot thrift.TProtocol) error { + + var _field *VisibleMode + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Mode = _field + return nil +} +func (p *Visibility) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]int64, 0, size) + for i := 0; i < size; i++ { + + var _elem int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.SpaceIDs = _field + return nil +} + +func (p *Visibility) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Visibility"); 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 *Visibility) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetMode() { + if err = oprot.WriteFieldBegin("mode", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Mode); 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 *Visibility) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetSpaceIDs() { + if err = oprot.WriteFieldBegin("spaceIDs", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.I64, len(p.SpaceIDs)); err != nil { + return err + } + for _, v := range p.SpaceIDs { + if err := oprot.WriteI64(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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Visibility) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Visibility(%+v)", *p) + +} + +func (p *Visibility) DeepEqual(ano *Visibility) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Mode) { + return false + } + if !p.Field2DeepEqual(ano.SpaceIDs) { + return false + } + return true +} + +func (p *Visibility) Field1DeepEqual(src *VisibleMode) bool { + + if p.Mode == src { + return true + } else if p.Mode == nil || src == nil { + return false + } + if strings.Compare(*p.Mode, *src) != 0 { + return false + } + return true +} +func (p *Visibility) Field2DeepEqual(src []int64) bool { + + if len(p.SpaceIDs) != len(src) { + return false + } + for i, v := range p.SpaceIDs { + _src := src[i] + if v != _src { + return false + } + } + return true +} + +type ProviderInfo struct { + MaasInfo *MaaSInfo `thrift:"maas_info,1,optional" frugal:"1,optional,MaaSInfo" form:"maas_info" json:"maas_info,omitempty" query:"maas_info"` +} + +func NewProviderInfo() *ProviderInfo { + return &ProviderInfo{} +} + +func (p *ProviderInfo) InitDefault() { +} + +var ProviderInfo_MaasInfo_DEFAULT *MaaSInfo + +func (p *ProviderInfo) GetMaasInfo() (v *MaaSInfo) { + if p == nil { + return + } + if !p.IsSetMaasInfo() { + return ProviderInfo_MaasInfo_DEFAULT + } + return p.MaasInfo +} +func (p *ProviderInfo) SetMaasInfo(val *MaaSInfo) { + p.MaasInfo = val +} + +var fieldIDToName_ProviderInfo = map[int16]string{ + 1: "maas_info", +} + +func (p *ProviderInfo) IsSetMaasInfo() bool { + return p.MaasInfo != nil +} + +func (p *ProviderInfo) 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_ProviderInfo[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 *ProviderInfo) ReadField1(iprot thrift.TProtocol) error { + _field := NewMaaSInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.MaasInfo = _field + return nil +} + +func (p *ProviderInfo) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ProviderInfo"); 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 *ProviderInfo) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetMaasInfo() { + if err = oprot.WriteFieldBegin("maas_info", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.MaasInfo.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 *ProviderInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ProviderInfo(%+v)", *p) + +} + +func (p *ProviderInfo) DeepEqual(ano *ProviderInfo) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.MaasInfo) { + return false + } + return true +} + +func (p *ProviderInfo) Field1DeepEqual(src *MaaSInfo) bool { + + if !p.MaasInfo.DeepEqual(src) { + return false + } + return true +} + +type MaaSInfo struct { + Host *string `thrift:"host,1,optional" frugal:"1,optional,string" form:"host" json:"host,omitempty" query:"host"` + Region *string `thrift:"region,2,optional" frugal:"2,optional,string" form:"region" json:"region,omitempty" query:"region"` + // v3 sdk + BaseURL *string `thrift:"baseURL,3,optional" frugal:"3,optional,string" form:"baseURL" json:"baseURL,omitempty" query:"baseURL"` + // 精调模型任务的 ID + CustomizationJobsID *string `thrift:"customizationJobsID,4,optional" frugal:"4,optional,string" form:"customizationJobsID" json:"customizationJobsID,omitempty" query:"customizationJobsID"` +} + +func NewMaaSInfo() *MaaSInfo { + return &MaaSInfo{} +} + +func (p *MaaSInfo) InitDefault() { +} + +var MaaSInfo_Host_DEFAULT string + +func (p *MaaSInfo) GetHost() (v string) { + if p == nil { + return + } + if !p.IsSetHost() { + return MaaSInfo_Host_DEFAULT + } + return *p.Host +} + +var MaaSInfo_Region_DEFAULT string + +func (p *MaaSInfo) GetRegion() (v string) { + if p == nil { + return + } + if !p.IsSetRegion() { + return MaaSInfo_Region_DEFAULT + } + return *p.Region +} + +var MaaSInfo_BaseURL_DEFAULT string + +func (p *MaaSInfo) GetBaseURL() (v string) { + if p == nil { + return + } + if !p.IsSetBaseURL() { + return MaaSInfo_BaseURL_DEFAULT + } + return *p.BaseURL +} + +var MaaSInfo_CustomizationJobsID_DEFAULT string + +func (p *MaaSInfo) GetCustomizationJobsID() (v string) { + if p == nil { + return + } + if !p.IsSetCustomizationJobsID() { + return MaaSInfo_CustomizationJobsID_DEFAULT + } + return *p.CustomizationJobsID +} +func (p *MaaSInfo) SetHost(val *string) { + p.Host = val +} +func (p *MaaSInfo) SetRegion(val *string) { + p.Region = val +} +func (p *MaaSInfo) SetBaseURL(val *string) { + p.BaseURL = val +} +func (p *MaaSInfo) SetCustomizationJobsID(val *string) { + p.CustomizationJobsID = val +} + +var fieldIDToName_MaaSInfo = map[int16]string{ + 1: "host", + 2: "region", + 3: "baseURL", + 4: "customizationJobsID", +} + +func (p *MaaSInfo) IsSetHost() bool { + return p.Host != nil +} + +func (p *MaaSInfo) IsSetRegion() bool { + return p.Region != nil +} + +func (p *MaaSInfo) IsSetBaseURL() bool { + return p.BaseURL != nil +} + +func (p *MaaSInfo) IsSetCustomizationJobsID() bool { + return p.CustomizationJobsID != nil +} + +func (p *MaaSInfo) 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 4: + if fieldTypeId == thrift.STRING { + 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_MaaSInfo[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 *MaaSInfo) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Host = _field + return nil +} +func (p *MaaSInfo) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Region = _field + return nil +} +func (p *MaaSInfo) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.BaseURL = _field + return nil +} +func (p *MaaSInfo) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.CustomizationJobsID = _field + return nil +} + +func (p *MaaSInfo) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MaaSInfo"); 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 = 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 *MaaSInfo) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetHost() { + if err = oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Host); 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 *MaaSInfo) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetRegion() { + if err = oprot.WriteFieldBegin("region", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *MaaSInfo) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBaseURL() { + if err = oprot.WriteFieldBegin("baseURL", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.BaseURL); 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 *MaaSInfo) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetCustomizationJobsID() { + if err = oprot.WriteFieldBegin("customizationJobsID", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.CustomizationJobsID); 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 *MaaSInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MaaSInfo(%+v)", *p) + +} + +func (p *MaaSInfo) DeepEqual(ano *MaaSInfo) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Host) { + return false + } + if !p.Field2DeepEqual(ano.Region) { + return false + } + if !p.Field3DeepEqual(ano.BaseURL) { + return false + } + if !p.Field4DeepEqual(ano.CustomizationJobsID) { return false } return true } -func (p *Model) Field6DeepEqual(src *Protocol) bool { - if p.Protocol == src { +func (p *MaaSInfo) Field1DeepEqual(src *string) bool { + + if p.Host == src { return true - } else if p.Protocol == nil || src == nil { + } else if p.Host == nil || src == nil { return false } - if strings.Compare(*p.Protocol, *src) != 0 { + if strings.Compare(*p.Host, *src) != 0 { return false } return true } -func (p *Model) Field7DeepEqual(src *ProtocolConfig) bool { +func (p *MaaSInfo) Field2DeepEqual(src *string) bool { - if !p.ProtocolConfig.DeepEqual(src) { + 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 *Model) Field8DeepEqual(src map[common.Scenario]*ScenarioConfig) bool { +func (p *MaaSInfo) Field3DeepEqual(src *string) bool { - if len(p.ScenarioConfigs) != len(src) { + if p.BaseURL == src { + return true + } else if p.BaseURL == nil || src == nil { return false } - for k, v := range p.ScenarioConfigs { - _src := src[k] - if !v.DeepEqual(_src) { - return false - } + if strings.Compare(*p.BaseURL, *src) != 0 { + return false } return true } -func (p *Model) Field9DeepEqual(src *ParamConfig) bool { +func (p *MaaSInfo) Field4DeepEqual(src *string) bool { - if !p.ParamConfig.DeepEqual(src) { + if p.CustomizationJobsID == src { + return true + } else if p.CustomizationJobsID == nil || src == nil { + return false + } + if strings.Compare(*p.CustomizationJobsID, *src) != 0 { return false } return true @@ -884,6 +2985,7 @@ type Ability struct { JSONMode *bool `thrift:"json_mode,5,optional" frugal:"5,optional,bool" form:"json_mode" json:"json_mode,omitempty" query:"json_mode"` MultiModal *bool `thrift:"multi_modal,6,optional" frugal:"6,optional,bool" form:"multi_modal" json:"multi_modal,omitempty" query:"multi_modal"` AbilityMultiModal *AbilityMultiModal `thrift:"ability_multi_modal,7,optional" frugal:"7,optional,AbilityMultiModal" form:"ability_multi_modal" json:"ability_multi_modal,omitempty" query:"ability_multi_modal"` + InterfaceCategory *InterfaceCategory `thrift:"interface_category,8,optional" frugal:"8,optional,string" form:"interface_category" json:"interface_category,omitempty" query:"interface_category"` } func NewAbility() *Ability { @@ -976,6 +3078,18 @@ func (p *Ability) GetAbilityMultiModal() (v *AbilityMultiModal) { } return p.AbilityMultiModal } + +var Ability_InterfaceCategory_DEFAULT InterfaceCategory + +func (p *Ability) GetInterfaceCategory() (v InterfaceCategory) { + if p == nil { + return + } + if !p.IsSetInterfaceCategory() { + return Ability_InterfaceCategory_DEFAULT + } + return *p.InterfaceCategory +} func (p *Ability) SetMaxContextTokens(val *int64) { p.MaxContextTokens = val } @@ -997,6 +3111,9 @@ func (p *Ability) SetMultiModal(val *bool) { func (p *Ability) SetAbilityMultiModal(val *AbilityMultiModal) { p.AbilityMultiModal = val } +func (p *Ability) SetInterfaceCategory(val *InterfaceCategory) { + p.InterfaceCategory = val +} var fieldIDToName_Ability = map[int16]string{ 1: "max_context_tokens", @@ -1006,6 +3123,7 @@ var fieldIDToName_Ability = map[int16]string{ 5: "json_mode", 6: "multi_modal", 7: "ability_multi_modal", + 8: "interface_category", } func (p *Ability) IsSetMaxContextTokens() bool { @@ -1036,6 +3154,10 @@ func (p *Ability) IsSetAbilityMultiModal() bool { return p.AbilityMultiModal != nil } +func (p *Ability) IsSetInterfaceCategory() bool { + return p.InterfaceCategory != nil +} + func (p *Ability) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1110,6 +3232,14 @@ func (p *Ability) Read(iprot thrift.TProtocol) (err error) { } 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 @@ -1213,6 +3343,17 @@ func (p *Ability) ReadField7(iprot thrift.TProtocol) error { p.AbilityMultiModal = _field return nil } +func (p *Ability) ReadField8(iprot thrift.TProtocol) error { + + var _field *InterfaceCategory + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.InterfaceCategory = _field + return nil +} func (p *Ability) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -1248,6 +3389,10 @@ func (p *Ability) Write(oprot thrift.TProtocol) (err error) { fieldId = 7 goto WriteFieldError } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -1392,6 +3537,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } +func (p *Ability) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetInterfaceCategory() { + if err = oprot.WriteFieldBegin("interface_category", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.InterfaceCategory); 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 *Ability) String() string { if p == nil { @@ -1428,6 +3591,9 @@ func (p *Ability) DeepEqual(ano *Ability) bool { if !p.Field7DeepEqual(ano.AbilityMultiModal) { return false } + if !p.Field8DeepEqual(ano.InterfaceCategory) { + return false + } return true } @@ -1510,10 +3676,24 @@ func (p *Ability) Field7DeepEqual(src *AbilityMultiModal) bool { } return true } +func (p *Ability) Field8DeepEqual(src *InterfaceCategory) bool { + + if p.InterfaceCategory == src { + return true + } else if p.InterfaceCategory == nil || src == nil { + return false + } + if strings.Compare(*p.InterfaceCategory, *src) != 0 { + return false + } + return true +} type AbilityMultiModal struct { + // 图片 Image *bool `thrift:"image,1,optional" frugal:"1,optional,bool" form:"image" json:"image,omitempty" query:"image"` AbilityImage *AbilityImage `thrift:"ability_image,2,optional" frugal:"2,optional,AbilityImage" form:"ability_image" json:"ability_image,omitempty" query:"ability_image"` + // 视频 Video *bool `thrift:"video,3,optional" frugal:"3,optional,bool" form:"video" json:"video,omitempty" query:"video"` AbilityVideo *AbilityVideo `thrift:"ability_video,4,optional" frugal:"4,optional,AbilityVideo" form:"ability_video" json:"ability_video,omitempty" query:"ability_video"` } @@ -7991,6 +10171,11 @@ type ParamSchema struct { Max *string `thrift:"max,6,optional" frugal:"6,optional,string" form:"max" json:"max,omitempty" query:"max"` DefaultValue *string `thrift:"default_value,7,optional" frugal:"7,optional,string" form:"default_value" json:"default_value,omitempty" query:"default_value"` Options []*ParamOption `thrift:"options,8,optional" frugal:"8,optional,list" form:"options" json:"options,omitempty" query:"options"` + Properties []*ParamSchema `thrift:"properties,9,optional" frugal:"9,optional,list" form:"properties" json:"properties,omitempty" query:"properties"` + // 依赖参数 + Reaction *Reaction `thrift:"reaction,10,optional" frugal:"10,optional,Reaction" form:"reaction" json:"reaction,omitempty" query:"reaction"` + // 赋值路径 + Jsonpath *string `thrift:"jsonpath,11,optional" frugal:"11,optional,string" form:"jsonpath" json:"jsonpath,omitempty" query:"jsonpath"` } func NewParamSchema() *ParamSchema { @@ -8095,6 +10280,42 @@ func (p *ParamSchema) GetOptions() (v []*ParamOption) { } return p.Options } + +var ParamSchema_Properties_DEFAULT []*ParamSchema + +func (p *ParamSchema) GetProperties() (v []*ParamSchema) { + if p == nil { + return + } + if !p.IsSetProperties() { + return ParamSchema_Properties_DEFAULT + } + return p.Properties +} + +var ParamSchema_Reaction_DEFAULT *Reaction + +func (p *ParamSchema) GetReaction() (v *Reaction) { + if p == nil { + return + } + if !p.IsSetReaction() { + return ParamSchema_Reaction_DEFAULT + } + return p.Reaction +} + +var ParamSchema_Jsonpath_DEFAULT string + +func (p *ParamSchema) GetJsonpath() (v string) { + if p == nil { + return + } + if !p.IsSetJsonpath() { + return ParamSchema_Jsonpath_DEFAULT + } + return *p.Jsonpath +} func (p *ParamSchema) SetName(val *string) { p.Name = val } @@ -8119,16 +10340,28 @@ func (p *ParamSchema) SetDefaultValue(val *string) { func (p *ParamSchema) SetOptions(val []*ParamOption) { p.Options = val } +func (p *ParamSchema) SetProperties(val []*ParamSchema) { + p.Properties = val +} +func (p *ParamSchema) SetReaction(val *Reaction) { + p.Reaction = val +} +func (p *ParamSchema) SetJsonpath(val *string) { + p.Jsonpath = val +} var fieldIDToName_ParamSchema = map[int16]string{ - 1: "name", - 2: "label", - 3: "desc", - 4: "type", - 5: "min", - 6: "max", - 7: "default_value", - 8: "options", + 1: "name", + 2: "label", + 3: "desc", + 4: "type", + 5: "min", + 6: "max", + 7: "default_value", + 8: "options", + 9: "properties", + 10: "reaction", + 11: "jsonpath", } func (p *ParamSchema) IsSetName() bool { @@ -8163,6 +10396,18 @@ func (p *ParamSchema) IsSetOptions() bool { return p.Options != nil } +func (p *ParamSchema) IsSetProperties() bool { + return p.Properties != nil +} + +func (p *ParamSchema) IsSetReaction() bool { + return p.Reaction != nil +} + +func (p *ParamSchema) IsSetJsonpath() bool { + return p.Jsonpath != nil +} + func (p *ParamSchema) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8245,6 +10490,30 @@ func (p *ParamSchema) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 9: + if fieldTypeId == thrift.LIST { + if err = p.ReadField9(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.STRING { + if err = p.ReadField11(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 @@ -8374,6 +10643,48 @@ func (p *ParamSchema) ReadField8(iprot thrift.TProtocol) error { p.Options = _field return nil } +func (p *ParamSchema) ReadField9(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*ParamSchema, 0, size) + values := make([]ParamSchema, 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.Properties = _field + return nil +} +func (p *ParamSchema) ReadField10(iprot thrift.TProtocol) error { + _field := NewReaction() + if err := _field.Read(iprot); err != nil { + return err + } + p.Reaction = _field + return nil +} +func (p *ParamSchema) ReadField11(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Jsonpath = _field + return nil +} func (p *ParamSchema) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -8413,6 +10724,18 @@ func (p *ParamSchema) Write(oprot thrift.TProtocol) (err error) { fieldId = 8 goto WriteFieldError } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + 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 = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -8539,12 +10862,82 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *ParamSchema) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetDefaultValue() { - if err = oprot.WriteFieldBegin("default_value", thrift.STRING, 7); err != nil { +func (p *ParamSchema) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetDefaultValue() { + if err = oprot.WriteFieldBegin("default_value", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.DefaultValue); 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 *ParamSchema) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err = oprot.WriteFieldBegin("options", thrift.LIST, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Options)); err != nil { + return err + } + for _, v := range p.Options { + 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 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} +func (p *ParamSchema) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetProperties() { + if err = oprot.WriteFieldBegin("properties", thrift.LIST, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Properties)); err != nil { + return err + } + for _, v := range p.Properties { + 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 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} +func (p *ParamSchema) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetReaction() { + if err = oprot.WriteFieldBegin("reaction", thrift.STRUCT, 10); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.DefaultValue); err != nil { + if err := p.Reaction.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8553,24 +10946,16 @@ func (p *ParamSchema) writeField7(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } -func (p *ParamSchema) writeField8(oprot thrift.TProtocol) (err error) { - if p.IsSetOptions() { - if err = oprot.WriteFieldBegin("options", thrift.LIST, 8); err != nil { +func (p *ParamSchema) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetJsonpath() { + if err = oprot.WriteFieldBegin("jsonpath", thrift.STRING, 11); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Options)); err != nil { - return err - } - for _, v := range p.Options { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteString(*p.Jsonpath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8579,9 +10964,9 @@ func (p *ParamSchema) writeField8(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 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 8 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } func (p *ParamSchema) String() string { @@ -8622,6 +11007,15 @@ func (p *ParamSchema) DeepEqual(ano *ParamSchema) bool { if !p.Field8DeepEqual(ano.Options) { return false } + if !p.Field9DeepEqual(ano.Properties) { + return false + } + if !p.Field10DeepEqual(ano.Reaction) { + return false + } + if !p.Field11DeepEqual(ano.Jsonpath) { + return false + } return true } @@ -8722,6 +11116,298 @@ func (p *ParamSchema) Field8DeepEqual(src []*ParamOption) bool { } return true } +func (p *ParamSchema) Field9DeepEqual(src []*ParamSchema) bool { + + if len(p.Properties) != len(src) { + return false + } + for i, v := range p.Properties { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *ParamSchema) Field10DeepEqual(src *Reaction) bool { + + if !p.Reaction.DeepEqual(src) { + return false + } + return true +} +func (p *ParamSchema) Field11DeepEqual(src *string) bool { + + if p.Jsonpath == src { + return true + } else if p.Jsonpath == nil || src == nil { + return false + } + if strings.Compare(*p.Jsonpath, *src) != 0 { + return false + } + return true +} + +type Reaction struct { + // 依赖的字段 + Dependency *string `thrift:"dependency,1,optional" frugal:"1,optional,string" form:"dependency" json:"dependency,omitempty" query:"dependency"` + // 可见性表达式 + Visible *string `thrift:"visible,2,optional" frugal:"2,optional,string" form:"visible" json:"visible,omitempty" query:"visible"` +} + +func NewReaction() *Reaction { + return &Reaction{} +} + +func (p *Reaction) InitDefault() { +} + +var Reaction_Dependency_DEFAULT string + +func (p *Reaction) GetDependency() (v string) { + if p == nil { + return + } + if !p.IsSetDependency() { + return Reaction_Dependency_DEFAULT + } + return *p.Dependency +} + +var Reaction_Visible_DEFAULT string + +func (p *Reaction) GetVisible() (v string) { + if p == nil { + return + } + if !p.IsSetVisible() { + return Reaction_Visible_DEFAULT + } + return *p.Visible +} +func (p *Reaction) SetDependency(val *string) { + p.Dependency = val +} +func (p *Reaction) SetVisible(val *string) { + p.Visible = val +} + +var fieldIDToName_Reaction = map[int16]string{ + 1: "dependency", + 2: "visible", +} + +func (p *Reaction) IsSetDependency() bool { + return p.Dependency != nil +} + +func (p *Reaction) IsSetVisible() bool { + return p.Visible != nil +} + +func (p *Reaction) 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 + } + 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_Reaction[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 *Reaction) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Dependency = _field + return nil +} +func (p *Reaction) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Visible = _field + return nil +} + +func (p *Reaction) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Reaction"); 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 *Reaction) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetDependency() { + if err = oprot.WriteFieldBegin("dependency", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Dependency); 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 *Reaction) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVisible() { + if err = oprot.WriteFieldBegin("visible", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Visible); 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 *Reaction) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Reaction(%+v)", *p) + +} + +func (p *Reaction) DeepEqual(ano *Reaction) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Dependency) { + return false + } + if !p.Field2DeepEqual(ano.Visible) { + return false + } + return true +} + +func (p *Reaction) Field1DeepEqual(src *string) bool { + + if p.Dependency == src { + return true + } else if p.Dependency == nil || src == nil { + return false + } + if strings.Compare(*p.Dependency, *src) != 0 { + return false + } + return true +} +func (p *Reaction) Field2DeepEqual(src *string) bool { + + if p.Visible == src { + return true + } else if p.Visible == nil || src == nil { + return false + } + if strings.Compare(*p.Visible, *src) != 0 { + return false + } + return true +} type ParamOption struct { // 实际值 diff --git a/backend/kitex_gen/coze/loop/llm/domain/manage/manage_validator.go b/backend/kitex_gen/coze/loop/llm/domain/manage/manage_validator.go index b10464682..e5cabe55e 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/manage/manage_validator.go +++ b/backend/kitex_gen/coze/loop/llm/domain/manage/manage_validator.go @@ -37,6 +37,33 @@ func (p *Model) IsValid() error { return fmt.Errorf("field ParamConfig not valid, %w", err) } } + if p.Series != nil { + if err := p.Series.IsValid(); err != nil { + return fmt.Errorf("field Series not valid, %w", err) + } + } + if p.Visibility != nil { + if err := p.Visibility.IsValid(); err != nil { + return fmt.Errorf("field Visibility not valid, %w", err) + } + } + return nil +} +func (p *Series) IsValid() error { + return nil +} +func (p *Visibility) IsValid() error { + return nil +} +func (p *ProviderInfo) IsValid() error { + if p.MaasInfo != nil { + if err := p.MaasInfo.IsValid(); err != nil { + return fmt.Errorf("field MaasInfo not valid, %w", err) + } + } + return nil +} +func (p *MaaSInfo) IsValid() error { return nil } func (p *Ability) IsValid() error { @@ -156,6 +183,14 @@ func (p *ParamConfig) IsValid() error { return nil } func (p *ParamSchema) IsValid() error { + if p.Reaction != nil { + if err := p.Reaction.IsValid(); err != nil { + return fmt.Errorf("field Reaction not valid, %w", err) + } + } + return nil +} +func (p *Reaction) IsValid() error { return nil } func (p *ParamOption) IsValid() error { diff --git a/backend/kitex_gen/coze/loop/llm/domain/runtime/k-runtime.go b/backend/kitex_gen/coze/loop/llm/domain/runtime/k-runtime.go index d6baa6312..0127ca427 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/runtime/k-runtime.go +++ b/backend/kitex_gen/coze/loop/llm/domain/runtime/k-runtime.go @@ -188,6 +188,34 @@ func (p *ModelConfig) FastRead(buf []byte) (int, error) { 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.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 100: if fieldTypeId == thrift.LIST { l, err = p.FastReadField100(buf[offset:]) @@ -202,6 +230,20 @@ func (p *ModelConfig) FastRead(buf []byte) (int, error) { 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 + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -374,6 +416,34 @@ func (p *ModelConfig) FastReadField10(buf []byte) (int, error) { return offset, nil } +func (p *ModelConfig) FastReadField11(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.Identification = _field + return offset, nil +} + +func (p *ModelConfig) FastReadField12(buf []byte) (int, error) { + offset := 0 + + var _field *manage.Protocol + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Protocol = _field + return offset, nil +} + func (p *ModelConfig) FastReadField100(buf []byte) (int, error) { offset := 0 @@ -399,6 +469,20 @@ func (p *ModelConfig) FastReadField100(buf []byte) (int, error) { return offset, nil } +func (p *ModelConfig) 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.Extra = _field + return offset, nil +} + func (p *ModelConfig) FastWrite(buf []byte) int { return p.FastWriteNocopy(buf, nil) } @@ -416,7 +500,10 @@ func (p *ModelConfig) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset += p.fastWriteField5(buf[offset:], w) offset += p.fastWriteField6(buf[offset:], w) offset += p.fastWriteField7(buf[offset:], w) + offset += p.fastWriteField11(buf[offset:], w) + offset += p.fastWriteField12(buf[offset:], w) offset += p.fastWriteField100(buf[offset:], w) + offset += p.fastWriteField101(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -435,7 +522,10 @@ func (p *ModelConfig) BLength() int { l += p.field8Length() l += p.field9Length() l += p.field10Length() + l += p.field11Length() + l += p.field12Length() l += p.field100Length() + l += p.field101Length() } l += thrift.Binary.FieldStopLength() return l @@ -536,6 +626,24 @@ func (p *ModelConfig) fastWriteField10(buf []byte, w thrift.NocopyWriter) int { return offset } +func (p *ModelConfig) fastWriteField11(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIdentification() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 11) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Identification) + } + return offset +} + +func (p *ModelConfig) fastWriteField12(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetProtocol() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 12) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Protocol) + } + return offset +} + func (p *ModelConfig) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetParamConfigValues() { @@ -552,6 +660,15 @@ func (p *ModelConfig) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { return offset } +func (p *ModelConfig) fastWriteField101(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetExtra() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 101) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Extra) + } + return offset +} + func (p *ModelConfig) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -644,6 +761,24 @@ func (p *ModelConfig) field10Length() int { return l } +func (p *ModelConfig) field11Length() int { + l := 0 + if p.IsSetIdentification() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Identification) + } + return l +} + +func (p *ModelConfig) field12Length() int { + l := 0 + if p.IsSetProtocol() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Protocol) + } + return l +} + func (p *ModelConfig) field100Length() int { l := 0 if p.IsSetParamConfigValues() { @@ -657,6 +792,15 @@ func (p *ModelConfig) field100Length() int { return l } +func (p *ModelConfig) field101Length() int { + l := 0 + if p.IsSetExtra() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Extra) + } + return l +} + func (p *ModelConfig) DeepCopy(s interface{}) error { src, ok := s.(*ModelConfig) if !ok { @@ -720,6 +864,19 @@ func (p *ModelConfig) DeepCopy(s interface{}) error { p.FrequencyPenalty = &tmp } + if src.Identification != nil { + var tmp string + if *src.Identification != "" { + tmp = kutils.StringDeepCopy(*src.Identification) + } + p.Identification = &tmp + } + + if src.Protocol != nil { + tmp := *src.Protocol + p.Protocol = &tmp + } + if src.ParamConfigValues != nil { p.ParamConfigValues = make([]*ParamConfigValue, 0, len(src.ParamConfigValues)) for _, elem := range src.ParamConfigValues { @@ -735,6 +892,14 @@ func (p *ModelConfig) DeepCopy(s interface{}) error { } } + if src.Extra != nil { + var tmp string + if *src.Extra != "" { + tmp = kutils.StringDeepCopy(*src.Extra) + } + p.Extra = &tmp + } + return nil } diff --git a/backend/kitex_gen/coze/loop/llm/domain/runtime/runtime.go b/backend/kitex_gen/coze/loop/llm/domain/runtime/runtime.go index 3bc6f8e85..a6511ba9c 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/runtime/runtime.go +++ b/backend/kitex_gen/coze/loop/llm/domain/runtime/runtime.go @@ -80,8 +80,12 @@ type ModelConfig struct { TopK *int32 `thrift:"top_k,8,optional" frugal:"8,optional,i32" form:"top_k" json:"top_k,omitempty" query:"top_k"` PresencePenalty *float64 `thrift:"presence_penalty,9,optional" frugal:"9,optional,double" form:"presence_penalty" json:"presence_penalty,omitempty" query:"presence_penalty"` FrequencyPenalty *float64 `thrift:"frequency_penalty,10,optional" frugal:"10,optional,double" form:"frequency_penalty" json:"frequency_penalty,omitempty" query:"frequency_penalty"` + Identification *string `thrift:"identification,11,optional" frugal:"11,optional,string" form:"identification" json:"identification,omitempty" query:"identification"` + // 模型提供方 + Protocol *manage.Protocol `thrift:"protocol,12,optional" frugal:"12,optional,string" form:"protocol" json:"protocol,omitempty" query:"protocol"` // 与ParamSchema对应 ParamConfigValues []*ParamConfigValue `thrift:"param_config_values,100,optional" frugal:"100,optional,list" form:"param_config_values" json:"param_config_values,omitempty" query:"param_config_values"` + Extra *string `thrift:"extra,101,optional" frugal:"101,optional,string" form:"extra" json:"extra,omitempty" query:"extra"` } func NewModelConfig() *ModelConfig { @@ -206,6 +210,30 @@ func (p *ModelConfig) GetFrequencyPenalty() (v float64) { return *p.FrequencyPenalty } +var ModelConfig_Identification_DEFAULT string + +func (p *ModelConfig) GetIdentification() (v string) { + if p == nil { + return + } + if !p.IsSetIdentification() { + return ModelConfig_Identification_DEFAULT + } + return *p.Identification +} + +var ModelConfig_Protocol_DEFAULT manage.Protocol + +func (p *ModelConfig) GetProtocol() (v manage.Protocol) { + if p == nil { + return + } + if !p.IsSetProtocol() { + return ModelConfig_Protocol_DEFAULT + } + return *p.Protocol +} + var ModelConfig_ParamConfigValues_DEFAULT []*ParamConfigValue func (p *ModelConfig) GetParamConfigValues() (v []*ParamConfigValue) { @@ -217,6 +245,18 @@ func (p *ModelConfig) GetParamConfigValues() (v []*ParamConfigValue) { } return p.ParamConfigValues } + +var ModelConfig_Extra_DEFAULT string + +func (p *ModelConfig) GetExtra() (v string) { + if p == nil { + return + } + if !p.IsSetExtra() { + return ModelConfig_Extra_DEFAULT + } + return *p.Extra +} func (p *ModelConfig) SetModelID(val int64) { p.ModelID = val } @@ -247,9 +287,18 @@ func (p *ModelConfig) SetPresencePenalty(val *float64) { func (p *ModelConfig) SetFrequencyPenalty(val *float64) { p.FrequencyPenalty = val } +func (p *ModelConfig) SetIdentification(val *string) { + p.Identification = val +} +func (p *ModelConfig) SetProtocol(val *manage.Protocol) { + p.Protocol = val +} func (p *ModelConfig) SetParamConfigValues(val []*ParamConfigValue) { p.ParamConfigValues = val } +func (p *ModelConfig) SetExtra(val *string) { + p.Extra = val +} var fieldIDToName_ModelConfig = map[int16]string{ 1: "model_id", @@ -262,7 +311,10 @@ var fieldIDToName_ModelConfig = map[int16]string{ 8: "top_k", 9: "presence_penalty", 10: "frequency_penalty", + 11: "identification", + 12: "protocol", 100: "param_config_values", + 101: "extra", } func (p *ModelConfig) IsSetTemperature() bool { @@ -301,10 +353,22 @@ func (p *ModelConfig) IsSetFrequencyPenalty() bool { return p.FrequencyPenalty != nil } +func (p *ModelConfig) IsSetIdentification() bool { + return p.Identification != nil +} + +func (p *ModelConfig) IsSetProtocol() bool { + return p.Protocol != nil +} + func (p *ModelConfig) IsSetParamConfigValues() bool { return p.ParamConfigValues != nil } +func (p *ModelConfig) IsSetExtra() bool { + return p.Extra != nil +} + func (p *ModelConfig) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -405,6 +469,22 @@ func (p *ModelConfig) Read(iprot thrift.TProtocol) (err error) { } 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.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 100: if fieldTypeId == thrift.LIST { if err = p.ReadField100(iprot); err != nil { @@ -413,6 +493,14 @@ func (p *ModelConfig) Read(iprot thrift.TProtocol) (err error) { } 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 + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -567,6 +655,28 @@ func (p *ModelConfig) ReadField10(iprot thrift.TProtocol) error { p.FrequencyPenalty = _field return nil } +func (p *ModelConfig) ReadField11(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Identification = _field + return nil +} +func (p *ModelConfig) ReadField12(iprot thrift.TProtocol) error { + + var _field *manage.Protocol + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Protocol = _field + return nil +} func (p *ModelConfig) ReadField100(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { @@ -590,6 +700,17 @@ func (p *ModelConfig) ReadField100(iprot thrift.TProtocol) error { p.ParamConfigValues = _field return nil } +func (p *ModelConfig) ReadField101(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Extra = _field + return nil +} func (p *ModelConfig) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -637,10 +758,22 @@ func (p *ModelConfig) Write(oprot thrift.TProtocol) (err error) { 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.writeField100(oprot); err != nil { fieldId = 100 goto WriteFieldError } + if err = p.writeField101(oprot); err != nil { + fieldId = 101 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -845,6 +978,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } +func (p *ModelConfig) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetIdentification() { + if err = oprot.WriteFieldBegin("identification", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Identification); 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 *ModelConfig) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetProtocol() { + if err = oprot.WriteFieldBegin("protocol", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Protocol); 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 *ModelConfig) writeField100(oprot thrift.TProtocol) (err error) { if p.IsSetParamConfigValues() { if err = oprot.WriteFieldBegin("param_config_values", thrift.LIST, 100); err != nil { @@ -871,6 +1040,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 100 end error: ", p), err) } +func (p *ModelConfig) writeField101(oprot thrift.TProtocol) (err error) { + if p.IsSetExtra() { + if err = oprot.WriteFieldBegin("extra", thrift.STRING, 101); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Extra); 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 *ModelConfig) String() string { if p == nil { @@ -916,9 +1103,18 @@ func (p *ModelConfig) DeepEqual(ano *ModelConfig) bool { if !p.Field10DeepEqual(ano.FrequencyPenalty) { return false } + if !p.Field11DeepEqual(ano.Identification) { + return false + } + if !p.Field12DeepEqual(ano.Protocol) { + return false + } if !p.Field100DeepEqual(ano.ParamConfigValues) { return false } + if !p.Field101DeepEqual(ano.Extra) { + return false + } return true } @@ -1033,6 +1229,30 @@ func (p *ModelConfig) Field10DeepEqual(src *float64) bool { } return true } +func (p *ModelConfig) Field11DeepEqual(src *string) bool { + + if p.Identification == src { + return true + } else if p.Identification == nil || src == nil { + return false + } + if strings.Compare(*p.Identification, *src) != 0 { + return false + } + return true +} +func (p *ModelConfig) Field12DeepEqual(src *manage.Protocol) bool { + + if p.Protocol == src { + return true + } else if p.Protocol == nil || src == nil { + return false + } + if strings.Compare(*p.Protocol, *src) != 0 { + return false + } + return true +} func (p *ModelConfig) Field100DeepEqual(src []*ParamConfigValue) bool { if len(p.ParamConfigValues) != len(src) { @@ -1046,6 +1266,18 @@ func (p *ModelConfig) Field100DeepEqual(src []*ParamConfigValue) bool { } return true } +func (p *ModelConfig) Field101DeepEqual(src *string) bool { + + if p.Extra == src { + return true + } else if p.Extra == nil || src == nil { + return false + } + if strings.Compare(*p.Extra, *src) != 0 { + return false + } + return true +} type ParamConfigValue struct { // 传给下游模型的key,与ParamSchema.name对齐 diff --git a/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage.go b/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage.go index a2676d2f8..5e55086f8 100644 --- a/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage.go +++ b/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage.go @@ -12,11 +12,489 @@ import ( "strings" ) +type Filter struct { + NameLike *string `thrift:"name_like,1,optional" frugal:"1,optional,string" form:"name_like" json:"name_like,omitempty" query:"name_like"` + Families []manage.Family `thrift:"families,2,optional" frugal:"2,optional,list" form:"families" json:"families,omitempty" query:"families"` + Statuses []manage.ModelStatus `thrift:"statuses,3,optional" frugal:"3,optional,list" form:"statuses" json:"statuses,omitempty" query:"statuses"` + Abilities []manage.AbilityEnum `thrift:"abilities,4,optional" frugal:"4,optional,list" form:"abilities" json:"abilities,omitempty" query:"abilities"` +} + +func NewFilter() *Filter { + return &Filter{} +} + +func (p *Filter) InitDefault() { +} + +var Filter_NameLike_DEFAULT string + +func (p *Filter) GetNameLike() (v string) { + if p == nil { + return + } + if !p.IsSetNameLike() { + return Filter_NameLike_DEFAULT + } + return *p.NameLike +} + +var Filter_Families_DEFAULT []manage.Family + +func (p *Filter) GetFamilies() (v []manage.Family) { + if p == nil { + return + } + if !p.IsSetFamilies() { + return Filter_Families_DEFAULT + } + return p.Families +} + +var Filter_Statuses_DEFAULT []manage.ModelStatus + +func (p *Filter) GetStatuses() (v []manage.ModelStatus) { + if p == nil { + return + } + if !p.IsSetStatuses() { + return Filter_Statuses_DEFAULT + } + return p.Statuses +} + +var Filter_Abilities_DEFAULT []manage.AbilityEnum + +func (p *Filter) GetAbilities() (v []manage.AbilityEnum) { + if p == nil { + return + } + if !p.IsSetAbilities() { + return Filter_Abilities_DEFAULT + } + return p.Abilities +} +func (p *Filter) SetNameLike(val *string) { + p.NameLike = val +} +func (p *Filter) SetFamilies(val []manage.Family) { + p.Families = val +} +func (p *Filter) SetStatuses(val []manage.ModelStatus) { + p.Statuses = val +} +func (p *Filter) SetAbilities(val []manage.AbilityEnum) { + p.Abilities = val +} + +var fieldIDToName_Filter = map[int16]string{ + 1: "name_like", + 2: "families", + 3: "statuses", + 4: "abilities", +} + +func (p *Filter) IsSetNameLike() bool { + return p.NameLike != nil +} + +func (p *Filter) IsSetFamilies() bool { + return p.Families != nil +} + +func (p *Filter) IsSetStatuses() bool { + return p.Statuses != nil +} + +func (p *Filter) IsSetAbilities() bool { + return p.Abilities != nil +} + +func (p *Filter) 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + 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_Filter[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 *Filter) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.NameLike = _field + return nil +} +func (p *Filter) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]manage.Family, 0, size) + for i := 0; i < size; i++ { + + var _elem manage.Family + 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.Families = _field + return nil +} +func (p *Filter) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]manage.ModelStatus, 0, size) + for i := 0; i < size; i++ { + + var _elem manage.ModelStatus + 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.Statuses = _field + return nil +} +func (p *Filter) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]manage.AbilityEnum, 0, size) + for i := 0; i < size; i++ { + + var _elem manage.AbilityEnum + 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.Abilities = _field + return nil +} + +func (p *Filter) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Filter"); 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 = 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 *Filter) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetNameLike() { + if err = oprot.WriteFieldBegin("name_like", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.NameLike); 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 *Filter) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetFamilies() { + if err = oprot.WriteFieldBegin("families", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Families)); err != nil { + return err + } + for _, v := range p.Families { + 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} +func (p *Filter) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetStatuses() { + if err = oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Statuses)); err != nil { + return err + } + for _, v := range p.Statuses { + 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} +func (p *Filter) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetAbilities() { + if err = oprot.WriteFieldBegin("abilities", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Abilities)); err != nil { + return err + } + for _, v := range p.Abilities { + 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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Filter) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Filter(%+v)", *p) + +} + +func (p *Filter) DeepEqual(ano *Filter) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.NameLike) { + return false + } + if !p.Field2DeepEqual(ano.Families) { + return false + } + if !p.Field3DeepEqual(ano.Statuses) { + return false + } + if !p.Field4DeepEqual(ano.Abilities) { + return false + } + return true +} + +func (p *Filter) Field1DeepEqual(src *string) bool { + + if p.NameLike == src { + return true + } else if p.NameLike == nil || src == nil { + return false + } + if strings.Compare(*p.NameLike, *src) != 0 { + return false + } + return true +} +func (p *Filter) Field2DeepEqual(src []manage.Family) bool { + + if len(p.Families) != len(src) { + return false + } + for i, v := range p.Families { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *Filter) Field3DeepEqual(src []manage.ModelStatus) bool { + + if len(p.Statuses) != len(src) { + return false + } + for i, v := range p.Statuses { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *Filter) Field4DeepEqual(src []manage.AbilityEnum) bool { + + if len(p.Abilities) != len(src) { + return false + } + for i, v := range p.Abilities { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + type ListModelsRequest struct { WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` Scenario *common.Scenario `thrift:"scenario,2,optional" frugal:"2,optional,string" form:"scenario" json:"scenario,omitempty" query:"scenario"` + Filter *Filter `thrift:"filter,3,optional" frugal:"3,optional,Filter" form:"filter" json:"filter,omitempty" query:"filter"` + Cookie *string `thrift:"cookie,100,optional" frugal:"100,optional,string" header:"cookie" json:"cookie,omitempty"` PageSize *int32 `thrift:"page_size,127,optional" frugal:"127,optional,i32" form:"page_size" json:"page_size,omitempty" query:"page_size"` PageToken *string `thrift:"page_token,128,optional" frugal:"128,optional,string" form:"page_token" json:"page_token,omitempty" query:"page_token"` + Page *int32 `thrift:"page,129,optional" frugal:"129,optional,i32" form:"page" json:"page,omitempty" query:"page"` Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } @@ -51,6 +529,30 @@ func (p *ListModelsRequest) GetScenario() (v common.Scenario) { return *p.Scenario } +var ListModelsRequest_Filter_DEFAULT *Filter + +func (p *ListModelsRequest) GetFilter() (v *Filter) { + if p == nil { + return + } + if !p.IsSetFilter() { + return ListModelsRequest_Filter_DEFAULT + } + return p.Filter +} + +var ListModelsRequest_Cookie_DEFAULT string + +func (p *ListModelsRequest) GetCookie() (v string) { + if p == nil { + return + } + if !p.IsSetCookie() { + return ListModelsRequest_Cookie_DEFAULT + } + return *p.Cookie +} + var ListModelsRequest_PageSize_DEFAULT int32 func (p *ListModelsRequest) GetPageSize() (v int32) { @@ -75,6 +577,18 @@ func (p *ListModelsRequest) GetPageToken() (v string) { return *p.PageToken } +var ListModelsRequest_Page_DEFAULT int32 + +func (p *ListModelsRequest) GetPage() (v int32) { + if p == nil { + return + } + if !p.IsSetPage() { + return ListModelsRequest_Page_DEFAULT + } + return *p.Page +} + var ListModelsRequest_Base_DEFAULT *base.Base func (p *ListModelsRequest) GetBase() (v *base.Base) { @@ -92,12 +606,21 @@ func (p *ListModelsRequest) SetWorkspaceID(val *int64) { func (p *ListModelsRequest) SetScenario(val *common.Scenario) { p.Scenario = val } +func (p *ListModelsRequest) SetFilter(val *Filter) { + p.Filter = val +} +func (p *ListModelsRequest) SetCookie(val *string) { + p.Cookie = val +} func (p *ListModelsRequest) SetPageSize(val *int32) { p.PageSize = val } func (p *ListModelsRequest) SetPageToken(val *string) { p.PageToken = val } +func (p *ListModelsRequest) SetPage(val *int32) { + p.Page = val +} func (p *ListModelsRequest) SetBase(val *base.Base) { p.Base = val } @@ -105,8 +628,11 @@ func (p *ListModelsRequest) SetBase(val *base.Base) { var fieldIDToName_ListModelsRequest = map[int16]string{ 1: "workspace_id", 2: "scenario", + 3: "filter", + 100: "cookie", 127: "page_size", 128: "page_token", + 129: "page", 255: "Base", } @@ -118,6 +644,14 @@ func (p *ListModelsRequest) IsSetScenario() bool { return p.Scenario != nil } +func (p *ListModelsRequest) IsSetFilter() bool { + return p.Filter != nil +} + +func (p *ListModelsRequest) IsSetCookie() bool { + return p.Cookie != nil +} + func (p *ListModelsRequest) IsSetPageSize() bool { return p.PageSize != nil } @@ -126,6 +660,10 @@ func (p *ListModelsRequest) IsSetPageToken() bool { return p.PageToken != nil } +func (p *ListModelsRequest) IsSetPage() bool { + return p.Page != nil +} + func (p *ListModelsRequest) IsSetBase() bool { return p.Base != nil } @@ -164,6 +702,22 @@ func (p *ListModelsRequest) 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 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 127: if fieldTypeId == thrift.I32 { if err = p.ReadField127(iprot); err != nil { @@ -180,6 +734,14 @@ func (p *ListModelsRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 129: + if fieldTypeId == thrift.I32 { + if err = p.ReadField129(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 { @@ -239,6 +801,25 @@ func (p *ListModelsRequest) ReadField2(iprot thrift.TProtocol) error { p.Scenario = _field return nil } +func (p *ListModelsRequest) ReadField3(iprot thrift.TProtocol) error { + _field := NewFilter() + if err := _field.Read(iprot); err != nil { + return err + } + p.Filter = _field + return nil +} +func (p *ListModelsRequest) ReadField100(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Cookie = _field + return nil +} func (p *ListModelsRequest) ReadField127(iprot thrift.TProtocol) error { var _field *int32 @@ -261,6 +842,17 @@ func (p *ListModelsRequest) ReadField128(iprot thrift.TProtocol) error { p.PageToken = _field return nil } +func (p *ListModelsRequest) ReadField129(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.Page = _field + return nil +} func (p *ListModelsRequest) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBase() if err := _field.Read(iprot); err != nil { @@ -284,6 +876,14 @@ func (p *ListModelsRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField100(oprot); err != nil { + fieldId = 100 + goto WriteFieldError + } if err = p.writeField127(oprot); err != nil { fieldId = 127 goto WriteFieldError @@ -292,6 +892,10 @@ func (p *ListModelsRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 128 goto WriteFieldError } + if err = p.writeField129(oprot); err != nil { + fieldId = 129 + goto WriteFieldError + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -350,6 +954,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } +func (p *ListModelsRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFilter() { + if err = oprot.WriteFieldBegin("filter", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.Filter.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 *ListModelsRequest) writeField100(oprot thrift.TProtocol) (err error) { + if p.IsSetCookie() { + if err = oprot.WriteFieldBegin("cookie", thrift.STRING, 100); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Cookie); 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 *ListModelsRequest) writeField127(oprot thrift.TProtocol) (err error) { if p.IsSetPageSize() { if err = oprot.WriteFieldBegin("page_size", thrift.I32, 127); err != nil { @@ -386,6 +1026,24 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 128 end error: ", p), err) } +func (p *ListModelsRequest) writeField129(oprot thrift.TProtocol) (err error) { + if p.IsSetPage() { + if err = oprot.WriteFieldBegin("page", thrift.I32, 129); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.Page); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 129 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 129 end error: ", p), err) +} func (p *ListModelsRequest) writeField255(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { @@ -425,12 +1083,21 @@ func (p *ListModelsRequest) DeepEqual(ano *ListModelsRequest) bool { if !p.Field2DeepEqual(ano.Scenario) { return false } + if !p.Field3DeepEqual(ano.Filter) { + return false + } + if !p.Field100DeepEqual(ano.Cookie) { + return false + } if !p.Field127DeepEqual(ano.PageSize) { return false } if !p.Field128DeepEqual(ano.PageToken) { return false } + if !p.Field129DeepEqual(ano.Page) { + return false + } if !p.Field255DeepEqual(ano.Base) { return false } @@ -461,6 +1128,25 @@ func (p *ListModelsRequest) Field2DeepEqual(src *common.Scenario) bool { } return true } +func (p *ListModelsRequest) Field3DeepEqual(src *Filter) bool { + + if !p.Filter.DeepEqual(src) { + return false + } + return true +} +func (p *ListModelsRequest) Field100DeepEqual(src *string) bool { + + if p.Cookie == src { + return true + } else if p.Cookie == nil || src == nil { + return false + } + if strings.Compare(*p.Cookie, *src) != 0 { + return false + } + return true +} func (p *ListModelsRequest) Field127DeepEqual(src *int32) bool { if p.PageSize == src { @@ -485,6 +1171,18 @@ func (p *ListModelsRequest) Field128DeepEqual(src *string) bool { } return true } +func (p *ListModelsRequest) Field129DeepEqual(src *int32) bool { + + if p.Page == src { + return true + } else if p.Page == nil || src == nil { + return false + } + if *p.Page != *src { + return false + } + return true +} func (p *ListModelsRequest) Field255DeepEqual(src *base.Base) bool { if !p.Base.DeepEqual(src) { @@ -994,9 +1692,11 @@ func (p *ListModelsResponse) Field255DeepEqual(src *base.BaseResp) bool { } type GetModelRequest struct { - WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` - ModelID *int64 `thrift:"model_id,2,optional" frugal:"2,optional,i64" json:"model_id" path:"model_id" ` - Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` + WorkspaceID *int64 `thrift:"workspace_id,1,optional" frugal:"1,optional,i64" json:"workspace_id" form:"workspace_id" query:"workspace_id"` + ModelID *int64 `thrift:"model_id,2,optional" frugal:"2,optional,i64" json:"model_id" path:"model_id" ` + Identification *string `thrift:"identification,3,optional" frugal:"3,optional,string" form:"identification" json:"identification,omitempty" query:"identification"` + Protocol *manage.Protocol `thrift:"protocol,4,optional" frugal:"4,optional,string" form:"protocol" json:"protocol,omitempty" query:"protocol"` + Base *base.Base `thrift:"Base,255,optional" frugal:"255,optional,base.Base" form:"Base" json:"Base,omitempty" query:"Base"` } func NewGetModelRequest() *GetModelRequest { @@ -1030,6 +1730,30 @@ func (p *GetModelRequest) GetModelID() (v int64) { return *p.ModelID } +var GetModelRequest_Identification_DEFAULT string + +func (p *GetModelRequest) GetIdentification() (v string) { + if p == nil { + return + } + if !p.IsSetIdentification() { + return GetModelRequest_Identification_DEFAULT + } + return *p.Identification +} + +var GetModelRequest_Protocol_DEFAULT manage.Protocol + +func (p *GetModelRequest) GetProtocol() (v manage.Protocol) { + if p == nil { + return + } + if !p.IsSetProtocol() { + return GetModelRequest_Protocol_DEFAULT + } + return *p.Protocol +} + var GetModelRequest_Base_DEFAULT *base.Base func (p *GetModelRequest) GetBase() (v *base.Base) { @@ -1047,6 +1771,12 @@ func (p *GetModelRequest) SetWorkspaceID(val *int64) { func (p *GetModelRequest) SetModelID(val *int64) { p.ModelID = val } +func (p *GetModelRequest) SetIdentification(val *string) { + p.Identification = val +} +func (p *GetModelRequest) SetProtocol(val *manage.Protocol) { + p.Protocol = val +} func (p *GetModelRequest) SetBase(val *base.Base) { p.Base = val } @@ -1054,6 +1784,8 @@ func (p *GetModelRequest) SetBase(val *base.Base) { var fieldIDToName_GetModelRequest = map[int16]string{ 1: "workspace_id", 2: "model_id", + 3: "identification", + 4: "protocol", 255: "Base", } @@ -1065,6 +1797,14 @@ func (p *GetModelRequest) IsSetModelID() bool { return p.ModelID != nil } +func (p *GetModelRequest) IsSetIdentification() bool { + return p.Identification != nil +} + +func (p *GetModelRequest) IsSetProtocol() bool { + return p.Protocol != nil +} + func (p *GetModelRequest) IsSetBase() bool { return p.Base != nil } @@ -1103,6 +1843,22 @@ func (p *GetModelRequest) 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.STRING { + if err = p.ReadField4(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 { @@ -1162,6 +1918,28 @@ func (p *GetModelRequest) ReadField2(iprot thrift.TProtocol) error { p.ModelID = _field return nil } +func (p *GetModelRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Identification = _field + return nil +} +func (p *GetModelRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *manage.Protocol + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Protocol = _field + return nil +} func (p *GetModelRequest) ReadField255(iprot thrift.TProtocol) error { _field := base.NewBase() if err := _field.Read(iprot); err != nil { @@ -1185,6 +1963,14 @@ func (p *GetModelRequest) 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 + } if err = p.writeField255(oprot); err != nil { fieldId = 255 goto WriteFieldError @@ -1243,6 +2029,42 @@ WriteFieldBeginError: WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } +func (p *GetModelRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetIdentification() { + if err = oprot.WriteFieldBegin("identification", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Identification); 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 *GetModelRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetProtocol() { + if err = oprot.WriteFieldBegin("protocol", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Protocol); 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 *GetModelRequest) writeField255(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { @@ -1282,6 +2104,12 @@ func (p *GetModelRequest) DeepEqual(ano *GetModelRequest) bool { if !p.Field2DeepEqual(ano.ModelID) { return false } + if !p.Field3DeepEqual(ano.Identification) { + return false + } + if !p.Field4DeepEqual(ano.Protocol) { + return false + } if !p.Field255DeepEqual(ano.Base) { return false } @@ -1312,6 +2140,30 @@ func (p *GetModelRequest) Field2DeepEqual(src *int64) bool { } return true } +func (p *GetModelRequest) Field3DeepEqual(src *string) bool { + + if p.Identification == src { + return true + } else if p.Identification == nil || src == nil { + return false + } + if strings.Compare(*p.Identification, *src) != 0 { + return false + } + return true +} +func (p *GetModelRequest) Field4DeepEqual(src *manage.Protocol) bool { + + if p.Protocol == src { + return true + } else if p.Protocol == nil || src == nil { + return false + } + if strings.Compare(*p.Protocol, *src) != 0 { + return false + } + return true +} func (p *GetModelRequest) Field255DeepEqual(src *base.Base) bool { if !p.Base.DeepEqual(src) { diff --git a/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage_validator.go b/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage_validator.go index 7fdd1dbf0..f2a625cda 100644 --- a/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage_validator.go +++ b/backend/kitex_gen/coze/loop/llm/manage/coze.loop.llm.manage_validator.go @@ -21,6 +21,9 @@ var ( _ = time.Nanosecond ) +func (p *Filter) IsValid() error { + return nil +} func (p *ListModelsRequest) IsValid() error { if p.WorkspaceID == nil { return fmt.Errorf("field WorkspaceID not_nil rule failed") @@ -28,6 +31,11 @@ func (p *ListModelsRequest) IsValid() error { if *p.WorkspaceID <= int64(0) { return fmt.Errorf("field WorkspaceID gt rule failed, current value: %v", *p.WorkspaceID) } + if p.Filter != nil { + if err := p.Filter.IsValid(); err != nil { + return fmt.Errorf("field Filter 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/llm/manage/k-coze.loop.llm.manage.go b/backend/kitex_gen/coze/loop/llm/manage/k-coze.loop.llm.manage.go index fa64d1cdc..a41e1cec5 100644 --- a/backend/kitex_gen/coze/loop/llm/manage/k-coze.loop.llm.manage.go +++ b/backend/kitex_gen/coze/loop/llm/manage/k-coze.loop.llm.manage.go @@ -31,6 +31,360 @@ var ( _ = thrift.STOP ) +func (p *Filter) 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.LIST { + 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.LIST { + 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.LIST { + 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_Filter[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Filter) 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.NameLike = _field + return offset, nil +} + +func (p *Filter) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]manage.Family, 0, size) + for i := 0; i < size; i++ { + var _elem manage.Family + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Families = _field + return offset, nil +} + +func (p *Filter) FastReadField3(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]manage.ModelStatus, 0, size) + for i := 0; i < size; i++ { + var _elem manage.ModelStatus + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Statuses = _field + return offset, nil +} + +func (p *Filter) FastReadField4(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]manage.AbilityEnum, 0, size) + for i := 0; i < size; i++ { + var _elem manage.AbilityEnum + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Abilities = _field + return offset, nil +} + +func (p *Filter) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *Filter) 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 += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Filter) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Filter) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetNameLike() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.NameLike) + } + return offset +} + +func (p *Filter) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetFamilies() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Families { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } + return offset +} + +func (p *Filter) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStatuses() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Statuses { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } + return offset +} + +func (p *Filter) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAbilities() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 4) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Abilities { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } + return offset +} + +func (p *Filter) field1Length() int { + l := 0 + if p.IsSetNameLike() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.NameLike) + } + return l +} + +func (p *Filter) field2Length() int { + l := 0 + if p.IsSetFamilies() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Families { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *Filter) field3Length() int { + l := 0 + if p.IsSetStatuses() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Statuses { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *Filter) field4Length() int { + l := 0 + if p.IsSetAbilities() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Abilities { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } + return l +} + +func (p *Filter) DeepCopy(s interface{}) error { + src, ok := s.(*Filter) + if !ok { + return fmt.Errorf("%T's type not matched %T", s, p) + } + + if src.NameLike != nil { + var tmp string + if *src.NameLike != "" { + tmp = kutils.StringDeepCopy(*src.NameLike) + } + p.NameLike = &tmp + } + + if src.Families != nil { + p.Families = make([]manage.Family, 0, len(src.Families)) + for _, elem := range src.Families { + var _elem manage.Family + _elem = elem + p.Families = append(p.Families, _elem) + } + } + + if src.Statuses != nil { + p.Statuses = make([]manage.ModelStatus, 0, len(src.Statuses)) + for _, elem := range src.Statuses { + var _elem manage.ModelStatus + _elem = elem + p.Statuses = append(p.Statuses, _elem) + } + } + + if src.Abilities != nil { + p.Abilities = make([]manage.AbilityEnum, 0, len(src.Abilities)) + for _, elem := range src.Abilities { + var _elem manage.AbilityEnum + _elem = elem + p.Abilities = append(p.Abilities, _elem) + } + } + + return nil +} + func (p *ListModelsRequest) FastRead(buf []byte) (int, error) { var err error @@ -76,6 +430,34 @@ func (p *ListModelsRequest) 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 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 127: if fieldTypeId == thrift.I32 { l, err = p.FastReadField127(buf[offset:]) @@ -104,6 +486,20 @@ func (p *ListModelsRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 129: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField129(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:]) @@ -164,6 +560,32 @@ func (p *ListModelsRequest) FastReadField2(buf []byte) (int, error) { return offset, nil } +func (p *ListModelsRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + _field := NewFilter() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Filter = _field + return offset, nil +} + +func (p *ListModelsRequest) 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.Cookie = _field + return offset, nil +} + func (p *ListModelsRequest) FastReadField127(buf []byte) (int, error) { offset := 0 @@ -192,6 +614,20 @@ func (p *ListModelsRequest) FastReadField128(buf []byte) (int, error) { return offset, nil } +func (p *ListModelsRequest) FastReadField129(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.Page = _field + return offset, nil +} + func (p *ListModelsRequest) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBase() @@ -213,7 +649,10 @@ func (p *ListModelsRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) i if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField127(buf[offset:], w) + offset += p.fastWriteField129(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField100(buf[offset:], w) offset += p.fastWriteField128(buf[offset:], w) offset += p.fastWriteField255(buf[offset:], w) } @@ -226,8 +665,11 @@ func (p *ListModelsRequest) BLength() int { if p != nil { l += p.field1Length() l += p.field2Length() + l += p.field3Length() + l += p.field100Length() l += p.field127Length() l += p.field128Length() + l += p.field129Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -252,6 +694,24 @@ func (p *ListModelsRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) i return offset } +func (p *ListModelsRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetFilter() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 3) + offset += p.Filter.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *ListModelsRequest) fastWriteField100(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCookie() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 100) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Cookie) + } + return offset +} + func (p *ListModelsRequest) fastWriteField127(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetPageSize() { @@ -270,6 +730,15 @@ func (p *ListModelsRequest) fastWriteField128(buf []byte, w thrift.NocopyWriter) return offset } +func (p *ListModelsRequest) fastWriteField129(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPage() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.I32, 129) + offset += thrift.Binary.WriteI32(buf[offset:], *p.Page) + } + return offset +} + func (p *ListModelsRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetBase() { @@ -297,6 +766,24 @@ func (p *ListModelsRequest) field2Length() int { return l } +func (p *ListModelsRequest) field3Length() int { + l := 0 + if p.IsSetFilter() { + l += thrift.Binary.FieldBeginLength() + l += p.Filter.BLength() + } + return l +} + +func (p *ListModelsRequest) field100Length() int { + l := 0 + if p.IsSetCookie() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Cookie) + } + return l +} + func (p *ListModelsRequest) field127Length() int { l := 0 if p.IsSetPageSize() { @@ -315,6 +802,15 @@ func (p *ListModelsRequest) field128Length() int { return l } +func (p *ListModelsRequest) field129Length() int { + l := 0 + if p.IsSetPage() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.I32Length() + } + return l +} + func (p *ListModelsRequest) field255Length() int { l := 0 if p.IsSetBase() { @@ -340,6 +836,23 @@ func (p *ListModelsRequest) DeepCopy(s interface{}) error { p.Scenario = &tmp } + var _filter *Filter + if src.Filter != nil { + _filter = &Filter{} + if err := _filter.DeepCopy(src.Filter); err != nil { + return err + } + } + p.Filter = _filter + + if src.Cookie != nil { + var tmp string + if *src.Cookie != "" { + tmp = kutils.StringDeepCopy(*src.Cookie) + } + p.Cookie = &tmp + } + if src.PageSize != nil { tmp := *src.PageSize p.PageSize = &tmp @@ -353,6 +866,11 @@ func (p *ListModelsRequest) DeepCopy(s interface{}) error { p.PageToken = &tmp } + if src.Page != nil { + tmp := *src.Page + p.Page = &tmp + } + var _base *base.Base if src.Base != nil { _base = &base.Base{} @@ -772,6 +1290,34 @@ func (p *GetModelRequest) 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.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 255: if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField255(buf[offset:]) @@ -832,6 +1378,34 @@ func (p *GetModelRequest) FastReadField2(buf []byte) (int, error) { return offset, nil } +func (p *GetModelRequest) 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.Identification = _field + return offset, nil +} + +func (p *GetModelRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *manage.Protocol + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Protocol = _field + return offset, nil +} + func (p *GetModelRequest) FastReadField255(buf []byte) (int, error) { offset := 0 _field := base.NewBase() @@ -853,6 +1427,8 @@ func (p *GetModelRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int 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.fastWriteField255(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) @@ -864,6 +1440,8 @@ func (p *GetModelRequest) BLength() int { if p != nil { l += p.field1Length() l += p.field2Length() + l += p.field3Length() + l += p.field4Length() l += p.field255Length() } l += thrift.Binary.FieldStopLength() @@ -888,6 +1466,24 @@ func (p *GetModelRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int return offset } +func (p *GetModelRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIdentification() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Identification) + } + return offset +} + +func (p *GetModelRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetProtocol() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Protocol) + } + return offset +} + func (p *GetModelRequest) fastWriteField255(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetBase() { @@ -915,6 +1511,24 @@ func (p *GetModelRequest) field2Length() int { return l } +func (p *GetModelRequest) field3Length() int { + l := 0 + if p.IsSetIdentification() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Identification) + } + return l +} + +func (p *GetModelRequest) field4Length() int { + l := 0 + if p.IsSetProtocol() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Protocol) + } + return l +} + func (p *GetModelRequest) field255Length() int { l := 0 if p.IsSetBase() { @@ -940,6 +1554,19 @@ func (p *GetModelRequest) DeepCopy(s interface{}) error { p.ModelID = &tmp } + if src.Identification != nil { + var tmp string + if *src.Identification != "" { + tmp = kutils.StringDeepCopy(*src.Identification) + } + p.Identification = &tmp + } + + if src.Protocol != nil { + tmp := *src.Protocol + p.Protocol = &tmp + } + var _base *base.Base if src.Base != nil { _base = &base.Base{} From e2a05d98b5bc7e12e9eef63a0772747a19e85981 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Wed, 21 Jan 2026 16:20:01 +0800 Subject: [PATCH 08/19] [feat][backend] support agentkit: code gen --- idl/thrift/coze/loop/llm/domain/manage.thrift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index 2d95282c2..c7827b0b1 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -237,18 +237,18 @@ const Family family_baichuan2 = "baichuan2" const Family family_deepseekv2 = "deepseekv2" const Family family_deepseek_coder_v2 = "deepseek_coder_v2" const Family family_deepseek_coder = "deepseek_coder" -const Family family_internalm2_5 = "internalm2_5" +const Family family_internalm25 = "internalm2_5" const Family family_qwen2 = "qwen2" -const Family family_qwen2_5 = "qwen2.5" -const Family family_qwen2_5_coder = "qwen2.5_coder" +const Family family_qwen25 = "qwen2.5" +const Family family_qwen25_coder = "qwen2.5_coder" const Family family_mini_cpm = "mini_cpm" -const Family family_mini_cpm_3 = "mini_cpm_3" -const Family family_chat_glm_3 = "chat_glm_3" +const Family family_mini_cpm3 = "mini_cpm_3" +const Family family_chat_glm3 = "chat_glm_3" const Family family_mistra = "mistral" const Family family_gemma = "gemma" const Family family_gemma_2 = "gemma_2" const Family family_intern_vl2 = "intern_vl2" -const Family family_intern_vl2_5 = "intern_vl2.5" +const Family family_intern_vl25 = "intern_vl2.5" const Family family_deepseek_v3 = "deepseek_v3" const Family family_deepseek_r1 = "deepseek_r1" const Family family_kimi = "kimi" From 0bab4e73e61649907ebef25329978b23b00a3a00 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Wed, 21 Jan 2026 17:35:48 +0800 Subject: [PATCH 09/19] [feat][backend] add do field --- backend/modules/llm/domain/entity/manage.go | 49 ++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index 3b08d96bc..0b3589256 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -7,9 +7,8 @@ import ( "strconv" "github.com/bytedance/sonic" - "github.com/pkg/errors" - "github.com/coze-dev/coze-loop/backend/pkg/lang/ptr" + "github.com/pkg/errors" ) type Model struct { @@ -25,6 +24,17 @@ type Model struct { ProtocolConfig *ProtocolConfig `json:"protocol_config" yaml:"protocol_config" mapstructure:"protocol_config"` // 该模型的协议配置 ScenarioConfigs map[Scenario]*ScenarioConfig `json:"scenario_configs" yaml:"scenario_configs" mapstructure:"scenario_configs"` // 该模型的场景配置 ParamConfig *ParamConfig `json:"param_config" yaml:"param_config" mapstructure:"param_config"` // 该模型的参数配置 + Identification string `json:"identification" yaml:"identification"` + Series *Series `json:"series" yaml:"series"` + Visibility *Visibility `json:"visibility" yaml:"visibility"` + Icon string `json:"icon" yaml:"icon" mapstructure:"icon"` // 模型图标 + Tags []string `json:"tags" yaml:"tags" mapstructure:"tags"` //模型标签 + Status ModelStatus `json:"status" yaml:"status" mapstructure:"status"` // 模型状态 + + CreatedBy string `json:"created_by" yaml:"created_by" mapstructure:"created_by"` // 创建人 + CreatedAt int64 `json:"created_at" yaml:"created_at" mapstructure:"created_at"` // 创建时间 + UpdatedBy string `json:"updated_by" yaml:"updated_by" mapstructure:"updated_by"` // 更新人 + UpdatedAt int64 `json:"updated_at" yaml:"updated_at" mapstructure:"updated_at"` // 更新时间 } func (m *Model) Valid() error { @@ -364,6 +374,19 @@ const ( ProtocolArkBot Protocol = "arkbot" ) +type Family string + +const ( + FamilyUndefined Family = "undefined" + FamilySeed Family = "seed" +) + +type Series struct { + Name string `json:"name"` + Icon string `json:"icon"` + Family Family `json:"family"` +} + type ListModelReq struct { WorkspaceID *int64 Scenario *Scenario @@ -375,3 +398,25 @@ type GetModelReq struct { WorkspaceID *int64 ModelID int64 } + +type VisibleMode string + +const ( + VisibleModeUndefined VisibleMode = "undefined" + VisibleModelAll VisibleMode = "all" + VisibleModelSpecified VisibleMode = "specified" + VisibleModelDefault VisibleMode = "default" +) + +type Visibility struct { + Mode VisibleMode `json:"mode"` + SpaceIDs []int64 `json:"space_ids"` // model为specified时有效 +} + +type ModelStatus string + +const ( + ModelStatusUndefined ModelStatus = "undefined" + ModelStatusEnabled ModelStatus = "enabled" + ModelStatusDisabled ModelStatus = "disabled" +) From 34a503368438ab8c7430a67c0be1b40d4200664d Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Sun, 25 Jan 2026 22:30:17 +0800 Subject: [PATCH 10/19] [feat][backend] add thinking --- backend/modules/llm/domain/entity/manage.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index 0b3589256..f01b685cb 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -153,6 +153,7 @@ type Ability struct { JsonMode bool `json:"json_mode" yaml:"json_mode" mapstructure:"json_mode"` MultiModal bool `json:"multi_modal" yaml:"multi_modal" mapstructure:"multi_modal"` AbilityMultiModal *AbilityMultiModal `json:"ability_multi_modal" yaml:"ability_multi_modal" mapstructure:"ability_multi_modal"` + Thinking bool `json:"thinking" mapstructure:"thinking"` } type AbilityMultiModal struct { From 9ef244d86d699046858f0ad3196bddb855d027a2 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Sun, 25 Jan 2026 22:53:42 +0800 Subject: [PATCH 11/19] [feat][backend] add param option --- backend/modules/llm/domain/entity/manage.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index f01b685cb..c854e3c82 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -338,6 +338,14 @@ type ParamSchema struct { Max string `json:"max" yaml:"max" mapstructure:"max"` DefaultValue string `json:"default_value" yaml:"default_value" mapstructure:"default_value"` Options []*ParamOption `json:"options" yaml:"options" mapstructure:"options"` + Properties []*ParamSchema `json:"properties" mapstructrue:"properties"` + JsonPath string `json:"json_path" mapstructrue:"json_path"` + Reaction Reaction `json:"reaction" mapstructrue:"reaction"` +} + +type Reaction struct { + Dependency string `json:"dependency"` + Visible string `json:"visible"` } type ParamOption struct { @@ -352,6 +360,8 @@ const ( ParamTypeInt ParamType = "int" ParamTypeBoolean ParamType = "boolean" ParamTypeString ParamType = "string" + ParamTypeVoid ParamType = "void" + ParamTypeObject ParamType = "object" ) type Frame string From 5154a1dd66b11cd826fe43304ae6bd41432879cf Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Sun, 25 Jan 2026 23:32:04 +0800 Subject: [PATCH 12/19] [feat][backend] add undefined protocol --- backend/modules/llm/domain/entity/manage.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index c854e3c82..591470205 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -374,15 +374,16 @@ const ( type Protocol string const ( - ProtocolArk Protocol = "ark" - ProtocolOpenAI Protocol = "openai" - ProtocolDeepseek Protocol = "deepseek" - ProtocolClaude Protocol = "claude" - ProtocolOllama Protocol = "ollama" - ProtocolGemini Protocol = "gemini" - ProtocolQwen Protocol = "qwen" - ProtocolQianfan Protocol = "qianfan" - ProtocolArkBot Protocol = "arkbot" + ProtocolUndefined Protocol = "undefined" + ProtocolArk Protocol = "ark" + ProtocolOpenAI Protocol = "openai" + ProtocolDeepseek Protocol = "deepseek" + ProtocolClaude Protocol = "claude" + ProtocolOllama Protocol = "ollama" + ProtocolGemini Protocol = "gemini" + ProtocolQwen Protocol = "qwen" + ProtocolQianfan Protocol = "qianfan" + ProtocolArkBot Protocol = "arkbot" ) type Family string From bd9d9bd304d8531d868ece029808858e94d8bbbe Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 26 Jan 2026 00:03:31 +0800 Subject: [PATCH 13/19] [feat][backend] add convert --- .../modules/llm/domain/entity/convertor.go | 26 +++++++++++++++++-- backend/modules/llm/domain/entity/runtime.go | 11 +++++++- .../llm/domain/entity/runtime_option.go | 10 +++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/backend/modules/llm/domain/entity/convertor.go b/backend/modules/llm/domain/entity/convertor.go index e52b82834..93730a9e8 100644 --- a/backend/modules/llm/domain/entity/convertor.go +++ b/backend/modules/llm/domain/entity/convertor.go @@ -4,9 +4,9 @@ package entity import ( - "github.com/coze-dev/cozeloop-go/spec/tracespec" - + druntime "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/domain/runtime" "github.com/coze-dev/coze-loop/backend/pkg/lang/slices" + "github.com/coze-dev/cozeloop-go/spec/tracespec" ) func MergeStreamMsgs(msgs []*Message) *Message { @@ -221,3 +221,25 @@ func OptionsToTrace(os []Option) *tracespec.ModelCallOption { } return res } + +func ConvertToParamValues(model *Model, paramValues []*druntime.ParamConfigValue) map[string]*ParamValue { + if model == nil || model.ParamConfig == nil { + return nil + } + schemaMap := make(map[string]*ParamSchema) + for _, item := range model.ParamConfig.ParamSchemas { + schemaMap[item.Name] = item + } + resp := make(map[string]*ParamValue) + for _, item := range paramValues { + if v, ok := schemaMap[item.GetName()]; ok { + resp[item.GetName()] = &ParamValue{ + Name: item.GetName(), + ParamType: v.Type, + Value: item.GetValue().GetValue(), + JsonPath: v.JsonPath, + } + } + } + return resp +} diff --git a/backend/modules/llm/domain/entity/runtime.go b/backend/modules/llm/domain/entity/runtime.go index a2d3afc42..df38d1aac 100644 --- a/backend/modules/llm/domain/entity/runtime.go +++ b/backend/modules/llm/domain/entity/runtime.go @@ -3,7 +3,9 @@ package entity -import "time" +import ( + "time" +) type Message struct { Role Role `json:"role"` @@ -239,3 +241,10 @@ const ( type ResponseFormat struct { Type ResponseFormatType `json:"type,omitempty"` } + +type ParamValue struct { + Name string `json:"name"` + ParamType ParamType `json:"param_type"` + Value string `json:"value"` + JsonPath string `json:"json_path"` +} diff --git a/backend/modules/llm/domain/entity/runtime_option.go b/backend/modules/llm/domain/entity/runtime_option.go index b18ee5702..a3ed97f57 100644 --- a/backend/modules/llm/domain/entity/runtime_option.go +++ b/backend/modules/llm/domain/entity/runtime_option.go @@ -28,6 +28,8 @@ type Options struct { FrequencyPenalty *float32 // Parameters is the extra parameters for the model. Parameters map[string]string + // ParamValues + ParamValues map[string]*ParamValue } type Option struct { @@ -177,3 +179,11 @@ func WithParameters(p map[string]string) Option { }, } } + +func WithParamValues(p map[string]*ParamValue) Option { + return Option{ + apply: func(opts *Options) { + opts.ParamValues = p + }, + } +} From bfe92dd84de76c851b5f52f2096fcf168a2be4db Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 26 Jan 2026 00:06:20 +0800 Subject: [PATCH 14/19] [feat][backend] add convert --- backend/modules/llm/application/convertor/runtime_option.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/modules/llm/application/convertor/runtime_option.go b/backend/modules/llm/application/convertor/runtime_option.go index 731b112ac..18cf71c63 100644 --- a/backend/modules/llm/application/convertor/runtime_option.go +++ b/backend/modules/llm/application/convertor/runtime_option.go @@ -10,7 +10,7 @@ import ( "github.com/coze-dev/coze-loop/backend/pkg/lang/slices" ) -func ModelAndTools2OptionDOs(modelCfg *druntime.ModelConfig, tools []*druntime.Tool, parameters map[string]string) []entity.Option { +func ModelAndTools2OptionDOs(modelCfg *druntime.ModelConfig, tools []*druntime.Tool, parameters map[string]string, paramValues map[string]*entity.ParamValue) []entity.Option { var opts []entity.Option if modelCfg != nil { if modelCfg.Temperature != nil { @@ -50,6 +50,9 @@ func ModelAndTools2OptionDOs(modelCfg *druntime.ModelConfig, tools []*druntime.T if parameters != nil { opts = append(opts, entity.WithParameters(parameters)) } + if paramValues != nil { + opts = append(opts, entity.WithParamValues(paramValues)) + } return opts } From b3931aa724b0766450a2afd3696b94dd73db3405 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 26 Jan 2026 02:24:45 +0800 Subject: [PATCH 15/19] [feat][backend] add param value --- backend/modules/llm/domain/entity/runtime.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backend/modules/llm/domain/entity/runtime.go b/backend/modules/llm/domain/entity/runtime.go index df38d1aac..d2940e50e 100644 --- a/backend/modules/llm/domain/entity/runtime.go +++ b/backend/modules/llm/domain/entity/runtime.go @@ -4,6 +4,8 @@ package entity import ( + "fmt" + "strconv" "time" ) @@ -248,3 +250,18 @@ type ParamValue struct { Value string `json:"value"` JsonPath string `json:"json_path"` } + +func (p *ParamValue) GetValue() (any, error) { + switch p.ParamType { + case ParamTypeBoolean: + return strconv.ParseBool(p.Value) + case ParamTypeFloat: + return strconv.ParseFloat(p.Value, 64) + case ParamTypeInt: + return strconv.ParseInt(p.Value, 10, 64) + case ParamTypeString: + return p.Value, nil + default: + return nil, fmt.Errorf("unsupported param type: %s", p.ParamType) + } +} From 4a29d52fd9a236a4393e43989f02f1d7460c0ef6 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Mon, 26 Jan 2026 21:46:11 +0800 Subject: [PATCH 16/19] [feat][backend] fix convert model resp --- .../llm/application/convertor/manage.go | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/backend/modules/llm/application/convertor/manage.go b/backend/modules/llm/application/convertor/manage.go index 979410d27..efede34d9 100644 --- a/backend/modules/llm/application/convertor/manage.go +++ b/backend/modules/llm/application/convertor/manage.go @@ -4,6 +4,8 @@ package convertor import ( + "github.com/bytedance/gg/gptr" + "github.com/bytedance/gg/gvalue" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/domain/manage" "github.com/coze-dev/coze-loop/backend/modules/llm/domain/entity" @@ -25,7 +27,7 @@ func ModelDO2DTO(model *entity.Model, mask bool) *manage.Model { if !mask { pc = ProtocolConfigDO2DTO(model.ProtocolConfig) } - return &manage.Model{ + resp := &manage.Model{ ModelID: ptr.Of(model.ID), WorkspaceID: ptr.Of(model.WorkspaceID), Name: ptr.Of(model.Name), @@ -33,9 +35,80 @@ func ModelDO2DTO(model *entity.Model, mask bool) *manage.Model { Ability: AbilityDO2DTO(model.Ability), Protocol: ptr.Of(manage.Protocol(model.Protocol)), ProtocolConfig: pc, + Identification: ptr.Of(model.Identification), + Icon: ptr.Of(model.Icon), + Status: ptr.Of(ModelStatusDO2DTO(model.Status)), + Tags: model.Tags, + Series: SeriesDO2DTO(model.Series), + Visibility: VisibilityDO2DTO(model.Visibility), ScenarioConfigs: ScenarioConfigMapDO2DTO(model.ScenarioConfigs), ParamConfig: ParamConfigDO2DTO(model.ParamConfig), } + if gvalue.IsNotZero(model.CreatedAt) { + resp.CreatedAt = gptr.Of(model.CreatedAt) + } + if gvalue.IsNotZero(model.UpdatedAt) { + resp.UpdatedAt = gptr.Of(model.UpdatedAt) + } + if gvalue.IsNotZero(model.CreatedBy) { + resp.CreatedBy = gptr.Of(model.CreatedBy) + } + if gvalue.IsNotZero(model.UpdatedBy) { + resp.UpdatedBy = gptr.Of(model.UpdatedBy) + } + return resp +} + +func SeriesDO2DTO(v *entity.Series) *manage.Series { + if v == nil { + return nil + } + return &manage.Series{ + Name: ptr.Of(v.Name), + Icon: ptr.Of(v.Icon), + Family: ptr.Of(SeriesFamilyDO2DTO(v.Family)), + } +} + +func SeriesFamilyDO2DTO(v entity.Family) manage.Family { + switch v { + default: + return manage.FamilyUndefined + } +} + +func VisibilityDO2DTO(v *entity.Visibility) *manage.Visibility { + if v == nil { + return nil + } + return &manage.Visibility{ + Mode: ptr.Of(VisibleModelDO2DTO(v.Mode)), + SpaceIDs: v.SpaceIDs, + } +} + +func VisibleModelDO2DTO(v entity.VisibleMode) manage.VisibleMode { + switch v { + case entity.VisibleModelAll: + return manage.VisibleModeAll + case entity.VisibleModelSpecified: + return manage.VisibleModeSpecified + case entity.VisibleModelDefault: + return manage.VisibleModeDefault + default: + return manage.VisibleModeUndefined + } +} + +func ModelStatusDO2DTO(status entity.ModelStatus) manage.ModelStatus { + switch status { + case entity.ModelStatusDisabled: + return manage.ModelStatusUnavailable + case entity.ModelStatusEnabled: + return manage.ModelStatusAvailable + default: + return manage.ModelStatusUndefined + } } func AbilityDO2DTO(a *entity.Ability) *manage.Ability { From 52d1e68a8d2356a07e2642423a914cda34a624f4 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Tue, 27 Jan 2026 17:14:27 +0800 Subject: [PATCH 17/19] [feat][backend] add convert --- .../llm/application/convertor/manage.go | 53 ++++++++++++++++++- backend/modules/llm/application/runtime.go | 4 +- backend/modules/llm/domain/entity/manage.go | 16 ++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/backend/modules/llm/application/convertor/manage.go b/backend/modules/llm/application/convertor/manage.go index efede34d9..b928e6093 100644 --- a/backend/modules/llm/application/convertor/manage.go +++ b/backend/modules/llm/application/convertor/manage.go @@ -5,9 +5,11 @@ package convertor import ( "github.com/bytedance/gg/gptr" + "github.com/bytedance/gg/gslice" "github.com/bytedance/gg/gvalue" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/domain/common" "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/domain/manage" + manage2 "github.com/coze-dev/coze-loop/backend/kitex_gen/coze/loop/llm/manage" "github.com/coze-dev/coze-loop/backend/modules/llm/domain/entity" "github.com/coze-dev/coze-loop/backend/pkg/lang/ptr" "github.com/coze-dev/coze-loop/backend/pkg/lang/slices" @@ -66,17 +68,28 @@ func SeriesDO2DTO(v *entity.Series) *manage.Series { return &manage.Series{ Name: ptr.Of(v.Name), Icon: ptr.Of(v.Icon), - Family: ptr.Of(SeriesFamilyDO2DTO(v.Family)), + Family: ptr.Of(FamilyDO2DTO(v.Family)), } } -func SeriesFamilyDO2DTO(v entity.Family) manage.Family { +func FamilyDO2DTO(v entity.Family) manage.Family { switch v { + case entity.FamilySeed: + return manage.FamilySeed default: return manage.FamilyUndefined } } +func FamilyDTO2DO(val manage.Family) entity.Family { + switch val { + case manage.FamilySeed: + return entity.FamilySeed + default: + return entity.FamilyUndefined + } +} + func VisibilityDO2DTO(v *entity.Visibility) *manage.Visibility { if v == nil { return nil @@ -111,6 +124,17 @@ func ModelStatusDO2DTO(status entity.ModelStatus) manage.ModelStatus { } } +func ModelStatusDTO2DO(val manage.ModelStatus) entity.ModelStatus { + switch val { + case manage.ModelStatusUnavailable: + return entity.ModelStatusDisabled + case manage.ModelStatusAvailable: + return entity.ModelStatusEnabled + default: + return entity.ModelStatusUndefined + } +} + func AbilityDO2DTO(a *entity.Ability) *manage.Ability { if a == nil { return nil @@ -360,3 +384,28 @@ func ParamOptionDO2DTO(o *entity.ParamOption) *manage.ParamOption { Label: ptr.Of(o.Label), } } + +func AbilityEnumDTO2DO(val manage.AbilityEnum) entity.AbilityEnum { + switch val { + case manage.AbilityJSONMode: + return entity.AbilityEnumJsonMode + case manage.AbilityFunctionCall: + return entity.AbilityEnumFunctionCall + case manage.AbilityMultiModal_: + return entity.AbilityEnumMultiModal + default: + return entity.AbilityEnumUndefined + } +} + +func ListModelsFilterDTO2DO(val *manage2.Filter) *entity.ListModelsFilter { + if val == nil { + return nil + } + return &entity.ListModelsFilter{ + NameLike: val.NameLike, + Families: gslice.Map(val.Families, FamilyDTO2DO), + ModelStatuses: gslice.Map(val.Statuses, ModelStatusDTO2DO), + Abilities: gslice.Map(val.Abilities, AbilityEnumDTO2DO), + } +} diff --git a/backend/modules/llm/application/runtime.go b/backend/modules/llm/application/runtime.go index 3605c3589..cd25cc792 100644 --- a/backend/modules/llm/application/runtime.go +++ b/backend/modules/llm/application/runtime.go @@ -76,7 +76,7 @@ func (r *runtimeApp) Chat(ctx context.Context, req *runtime.ChatRequest) (resp * if err != nil { return resp, errorx.NewByCode(llm_errorx.RequestNotValidCode, errorx.WithExtraMsg(err.Error())) } - options := convertor.ModelAndTools2OptionDOs(req.GetModelConfig(), req.GetTools(), nil) + options := convertor.ModelAndTools2OptionDOs(req.GetModelConfig(), req.GetTools(), nil, nil) var respMsg *entity.Message // 5. start span var span looptracer.Span @@ -136,7 +136,7 @@ func (r *runtimeApp) ChatStream(ctx context.Context, req *runtime.ChatRequest, s if err != nil { return errorx.NewByCode(llm_errorx.RequestNotValidCode, errorx.WithExtraMsg(err.Error())) } - options := convertor.ModelAndTools2OptionDOs(req.GetModelConfig(), req.GetTools(), nil) + options := convertor.ModelAndTools2OptionDOs(req.GetModelConfig(), req.GetTools(), nil, nil) // 4. start trace var span looptracer.Span ctx, span = looptracer.GetTracer().StartSpan(ctx, model.Name, tracespec.VModelSpanType, looptracer.WithSpanWorkspaceID(strconv.FormatInt(req.GetBizParam().GetWorkspaceID(), 10))) diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index 591470205..e3334980f 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -432,3 +432,19 @@ const ( ModelStatusEnabled ModelStatus = "enabled" ModelStatusDisabled ModelStatus = "disabled" ) + +type ListModelsFilter struct { + NameLike *string `json:"name_like,omitempty"` + Families []Family `json:"families,omitempty"` + ModelStatuses []ModelStatus `json:"model_statuses,omitempty"` + Abilities []AbilityEnum `json:"abilities,omitempty"` +} + +type AbilityEnum string + +const ( + AbilityEnumUndefined AbilityEnum = "undefined" + AbilityEnumFunctionCall AbilityEnum = "function_call" + AbilityEnumMultiModal AbilityEnum = "multi_modal" + AbilityEnumJsonMode AbilityEnum = "json_mode" +) From f1ee948b52987bb0febdced6831ca1db9df5f32b Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Thu, 29 Jan 2026 19:10:02 +0800 Subject: [PATCH 18/19] [feat][backend] fix reaction --- backend/modules/llm/application/convertor/manage.go | 13 +++++++++++++ backend/modules/llm/domain/entity/manage.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/modules/llm/application/convertor/manage.go b/backend/modules/llm/application/convertor/manage.go index b928e6093..71483dc54 100644 --- a/backend/modules/llm/application/convertor/manage.go +++ b/backend/modules/llm/application/convertor/manage.go @@ -366,6 +366,19 @@ func ParamSchemaDO2DTO(ps *entity.ParamSchema) *manage.ParamSchema { Max: ptr.Of(ps.Max), DefaultValue: ptr.Of(ps.DefaultValue), Options: ParamOptionsDO2DTO(ps.Options), + Properties: gslice.Map(ps.Properties, ParamSchemaDO2DTO), + Jsonpath: ptr.Of(ps.JsonPath), + Reaction: ReactionDO2DTO(ps.Reaction), + } +} + +func ReactionDO2DTO(r *entity.Reaction) *manage.Reaction { + if r == nil { + return nil + } + return &manage.Reaction{ + Dependency: ptr.Of(r.Dependency), + Visible: ptr.Of(r.Visible), } } diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index e3334980f..77a444059 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -340,7 +340,7 @@ type ParamSchema struct { Options []*ParamOption `json:"options" yaml:"options" mapstructure:"options"` Properties []*ParamSchema `json:"properties" mapstructrue:"properties"` JsonPath string `json:"json_path" mapstructrue:"json_path"` - Reaction Reaction `json:"reaction" mapstructrue:"reaction"` + Reaction *Reaction `json:"reaction" mapstructrue:"reaction"` } type Reaction struct { From 3c7a879a0d6a0b5dd189bd0ee095b9e7632b8081 Mon Sep 17 00:00:00 2001 From: "chenzhe.29" Date: Thu, 29 Jan 2026 20:32:07 +0800 Subject: [PATCH 19/19] [feat][backend] add family enum --- .../kitex_gen/coze/loop/llm/domain/manage/manage.go | 2 ++ backend/modules/llm/application/convertor/manage.go | 12 ++++++++++++ backend/modules/llm/domain/entity/manage.go | 4 ++++ idl/thrift/coze/loop/llm/domain/manage.thrift | 1 + 4 files changed, 19 insertions(+) diff --git a/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go b/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go index e22cf1fb9..b2a9635de 100644 --- a/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go +++ b/backend/kitex_gen/coze/loop/llm/domain/manage/manage.go @@ -108,6 +108,8 @@ const ( FamilyInternVl3 = "intern_vl3" + FamilyDeepseek = "deepseek" + ProviderUndefined = "undefined" ProviderMaas = "maas" diff --git a/backend/modules/llm/application/convertor/manage.go b/backend/modules/llm/application/convertor/manage.go index 71483dc54..7d368ff2e 100644 --- a/backend/modules/llm/application/convertor/manage.go +++ b/backend/modules/llm/application/convertor/manage.go @@ -76,6 +76,12 @@ func FamilyDO2DTO(v entity.Family) manage.Family { switch v { case entity.FamilySeed: return manage.FamilySeed + case entity.FamilyGLM: + return manage.FamilyGlm + case entity.FamilyKimi: + return manage.FamilyKimi + case entity.FamilyDeepSeek: + return manage.FamilyDeepseek default: return manage.FamilyUndefined } @@ -85,6 +91,12 @@ func FamilyDTO2DO(val manage.Family) entity.Family { switch val { case manage.FamilySeed: return entity.FamilySeed + case manage.FamilyDeepseek: + return entity.FamilyDeepSeek + case manage.FamilyGlm: + return entity.FamilyGLM + case manage.FamilyKimi: + return entity.FamilyKimi default: return entity.FamilyUndefined } diff --git a/backend/modules/llm/domain/entity/manage.go b/backend/modules/llm/domain/entity/manage.go index 77a444059..eadb6a160 100644 --- a/backend/modules/llm/domain/entity/manage.go +++ b/backend/modules/llm/domain/entity/manage.go @@ -391,6 +391,10 @@ type Family string const ( FamilyUndefined Family = "undefined" FamilySeed Family = "seed" + FamilyGLM Family = "glm" + FamilyKimi Family = "kimi" + FamilyDeepSeek Family = "deepseek" + FamilyDoubao Family = "doubao" ) type Series struct { diff --git a/idl/thrift/coze/loop/llm/domain/manage.thrift b/idl/thrift/coze/loop/llm/domain/manage.thrift index c7827b0b1..b005a851b 100644 --- a/idl/thrift/coze/loop/llm/domain/manage.thrift +++ b/idl/thrift/coze/loop/llm/domain/manage.thrift @@ -254,6 +254,7 @@ const Family family_deepseek_r1 = "deepseek_r1" const Family family_kimi = "kimi" const Family family_seedream = "seedream" const Family family_intern_vl3 = "intern_vl3" +const Family family_deepseek = "deepseek" typedef string Provider (ts.enum="true")