feat: Support for Chat Flow & Agent Support for binding a single chat flow (#765)

Co-authored-by: Yu Yang <72337138+tomasyu985@users.noreply.github.com>
Co-authored-by: zengxiaohui <csu.zengxiaohui@gmail.com>
Co-authored-by: lijunwen.gigoo <lijunwen.gigoo@bytedance.com>
Co-authored-by: lvxinyu.1117 <lvxinyu.1117@bytedance.com>
Co-authored-by: liuyunchao.0510 <liuyunchao.0510@bytedance.com>
Co-authored-by: haozhenfei <37089575+haozhenfei@users.noreply.github.com>
Co-authored-by: July <jiangxujin@bytedance.com>
Co-authored-by: tecvan-fe <fanwenjie.fe@bytedance.com>
This commit is contained in:
Zhj
2025-08-28 21:53:32 +08:00
committed by GitHub
parent bbc615a18e
commit d70101c979
503 changed files with 48036 additions and 3427 deletions

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
package agentrun
@@ -5,6 +21,7 @@ package agentrun
import (
"context"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
)
@@ -13,6 +30,8 @@ type AgentRunService interface {
AgentRun(ctx context.Context, request *run.AgentRunRequest) (r *run.AgentRunResponse, err error)
ChatV3(ctx context.Context, request *run.ChatV3Request) (r *run.ChatV3Response, err error)
CancelChatApi(ctx context.Context, request *run.CancelChatApiRequest) (r *run.CancelChatApiResponse, err error)
}
type AgentRunServiceClient struct {
@@ -59,6 +78,15 @@ func (p *AgentRunServiceClient) ChatV3(ctx context.Context, request *run.ChatV3R
}
return _result.GetSuccess(), nil
}
func (p *AgentRunServiceClient) CancelChatApi(ctx context.Context, request *run.CancelChatApiRequest) (r *run.CancelChatApiResponse, err error) {
var _args AgentRunServiceCancelChatApiArgs
_args.Request = request
var _result AgentRunServiceCancelChatApiResult
if err = p.Client_().Call(ctx, "CancelChatApi", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
type AgentRunServiceProcessor struct {
processorMap map[string]thrift.TProcessorFunction
@@ -82,6 +110,7 @@ func NewAgentRunServiceProcessor(handler AgentRunService) *AgentRunServiceProces
self := &AgentRunServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
self.AddToProcessorMap("AgentRun", &agentRunServiceProcessorAgentRun{handler: handler})
self.AddToProcessorMap("ChatV3", &agentRunServiceProcessorChatV3{handler: handler})
self.AddToProcessorMap("CancelChatApi", &agentRunServiceProcessorCancelChatApi{handler: handler})
return self
}
func (p *AgentRunServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
@@ -198,6 +227,54 @@ func (p *agentRunServiceProcessorChatV3) Process(ctx context.Context, seqId int3
return true, err
}
type agentRunServiceProcessorCancelChatApi struct {
handler AgentRunService
}
func (p *agentRunServiceProcessorCancelChatApi) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := AgentRunServiceCancelChatApiArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("CancelChatApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return false, err
}
iprot.ReadMessageEnd()
var err2 error
result := AgentRunServiceCancelChatApiResult{}
var retval *run.CancelChatApiResponse
if retval, err2 = p.handler.CancelChatApi(ctx, args.Request); err2 != nil {
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelChatApi: "+err2.Error())
oprot.WriteMessageBegin("CancelChatApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return true, err2
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("CancelChatApi", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
type AgentRunServiceAgentRunArgs struct {
Request *run.AgentRunRequest `thrift:"request,1"`
}
@@ -781,3 +858,295 @@ func (p *AgentRunServiceChatV3Result) String() string {
return fmt.Sprintf("AgentRunServiceChatV3Result(%+v)", *p)
}
type AgentRunServiceCancelChatApiArgs struct {
Request *run.CancelChatApiRequest `thrift:"request,1"`
}
func NewAgentRunServiceCancelChatApiArgs() *AgentRunServiceCancelChatApiArgs {
return &AgentRunServiceCancelChatApiArgs{}
}
func (p *AgentRunServiceCancelChatApiArgs) InitDefault() {
}
var AgentRunServiceCancelChatApiArgs_Request_DEFAULT *run.CancelChatApiRequest
func (p *AgentRunServiceCancelChatApiArgs) GetRequest() (v *run.CancelChatApiRequest) {
if !p.IsSetRequest() {
return AgentRunServiceCancelChatApiArgs_Request_DEFAULT
}
return p.Request
}
var fieldIDToName_AgentRunServiceCancelChatApiArgs = map[int16]string{
1: "request",
}
func (p *AgentRunServiceCancelChatApiArgs) IsSetRequest() bool {
return p.Request != nil
}
func (p *AgentRunServiceCancelChatApiArgs) 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_AgentRunServiceCancelChatApiArgs[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 *AgentRunServiceCancelChatApiArgs) ReadField1(iprot thrift.TProtocol) error {
_field := run.NewCancelChatApiRequest()
if err := _field.Read(iprot); err != nil {
return err
}
p.Request = _field
return nil
}
func (p *AgentRunServiceCancelChatApiArgs) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("CancelChatApi_args"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField1(oprot); err != nil {
fieldId = 1
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *AgentRunServiceCancelChatApiArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
goto WriteFieldBeginError
}
if err := p.Request.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}
func (p *AgentRunServiceCancelChatApiArgs) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("AgentRunServiceCancelChatApiArgs(%+v)", *p)
}
type AgentRunServiceCancelChatApiResult struct {
Success *run.CancelChatApiResponse `thrift:"success,0,optional"`
}
func NewAgentRunServiceCancelChatApiResult() *AgentRunServiceCancelChatApiResult {
return &AgentRunServiceCancelChatApiResult{}
}
func (p *AgentRunServiceCancelChatApiResult) InitDefault() {
}
var AgentRunServiceCancelChatApiResult_Success_DEFAULT *run.CancelChatApiResponse
func (p *AgentRunServiceCancelChatApiResult) GetSuccess() (v *run.CancelChatApiResponse) {
if !p.IsSetSuccess() {
return AgentRunServiceCancelChatApiResult_Success_DEFAULT
}
return p.Success
}
var fieldIDToName_AgentRunServiceCancelChatApiResult = map[int16]string{
0: "success",
}
func (p *AgentRunServiceCancelChatApiResult) IsSetSuccess() bool {
return p.Success != nil
}
func (p *AgentRunServiceCancelChatApiResult) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
if _, err = iprot.ReadStructBegin(); err != nil {
goto ReadStructBeginError
}
for {
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
if err != nil {
goto ReadFieldBeginError
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 0:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField0(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
}
if err = iprot.ReadFieldEnd(); err != nil {
goto ReadFieldEndError
}
}
if err = iprot.ReadStructEnd(); err != nil {
goto ReadStructEndError
}
return nil
ReadStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AgentRunServiceCancelChatApiResult[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 *AgentRunServiceCancelChatApiResult) ReadField0(iprot thrift.TProtocol) error {
_field := run.NewCancelChatApiResponse()
if err := _field.Read(iprot); err != nil {
return err
}
p.Success = _field
return nil
}
func (p *AgentRunServiceCancelChatApiResult) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("CancelChatApi_result"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField0(oprot); err != nil {
fieldId = 0
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *AgentRunServiceCancelChatApiResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
goto WriteFieldBeginError
}
if err := p.Success.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}
func (p *AgentRunServiceCancelChatApiResult) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("AgentRunServiceCancelChatApiResult(%+v)", *p)
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
package common
@@ -26,6 +42,8 @@ const (
Scene_GenerateAgentInfo Scene = 8
//openapi
Scene_SceneOpenApi Scene = 9
// workflow
Scene_SceneWorkflow Scene = 50
)
func (p Scene) String() string {
@@ -50,6 +68,8 @@ func (p Scene) String() string {
return "GenerateAgentInfo"
case Scene_SceneOpenApi:
return "SceneOpenApi"
case Scene_SceneWorkflow:
return "SceneWorkflow"
}
return "<UNSET>"
}
@@ -76,6 +96,8 @@ func SceneFromString(s string) (Scene, error) {
return Scene_GenerateAgentInfo, nil
case "SceneOpenApi":
return Scene_SceneOpenApi, nil
case "SceneWorkflow":
return Scene_SceneWorkflow, nil
}
return Scene(0), fmt.Errorf("not a valid Scene string")
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
package conversation
@@ -5,6 +21,7 @@ package conversation
import (
"context"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
)
@@ -18,6 +35,10 @@ type ConversationService interface {
ClearConversationApi(ctx context.Context, req *ClearConversationApiRequest) (r *ClearConversationApiResponse, err error)
ListConversationsApi(ctx context.Context, request *ListConversationsApiRequest) (r *ListConversationsApiResponse, err error)
UpdateConversationApi(ctx context.Context, request *UpdateConversationApiRequest) (r *UpdateConversationApiResponse, err error)
DeleteConversationApi(ctx context.Context, req *DeleteConversationApiRequest) (r *DeleteConversationApiResponse, err error)
}
type ConversationServiceClient struct {
@@ -91,6 +112,24 @@ func (p *ConversationServiceClient) ListConversationsApi(ctx context.Context, re
}
return _result.GetSuccess(), nil
}
func (p *ConversationServiceClient) UpdateConversationApi(ctx context.Context, request *UpdateConversationApiRequest) (r *UpdateConversationApiResponse, err error) {
var _args ConversationServiceUpdateConversationApiArgs
_args.Request = request
var _result ConversationServiceUpdateConversationApiResult
if err = p.Client_().Call(ctx, "UpdateConversationApi", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
func (p *ConversationServiceClient) DeleteConversationApi(ctx context.Context, req *DeleteConversationApiRequest) (r *DeleteConversationApiResponse, err error) {
var _args ConversationServiceDeleteConversationApiArgs
_args.Req = req
var _result ConversationServiceDeleteConversationApiResult
if err = p.Client_().Call(ctx, "DeleteConversationApi", &_args, &_result); err != nil {
return
}
return _result.GetSuccess(), nil
}
type ConversationServiceProcessor struct {
processorMap map[string]thrift.TProcessorFunction
@@ -117,6 +156,8 @@ func NewConversationServiceProcessor(handler ConversationService) *ConversationS
self.AddToProcessorMap("CreateConversation", &conversationServiceProcessorCreateConversation{handler: handler})
self.AddToProcessorMap("ClearConversationApi", &conversationServiceProcessorClearConversationApi{handler: handler})
self.AddToProcessorMap("ListConversationsApi", &conversationServiceProcessorListConversationsApi{handler: handler})
self.AddToProcessorMap("UpdateConversationApi", &conversationServiceProcessorUpdateConversationApi{handler: handler})
self.AddToProcessorMap("DeleteConversationApi", &conversationServiceProcessorDeleteConversationApi{handler: handler})
return self
}
func (p *ConversationServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
@@ -377,6 +418,102 @@ func (p *conversationServiceProcessorListConversationsApi) Process(ctx context.C
return true, err
}
type conversationServiceProcessorUpdateConversationApi struct {
handler ConversationService
}
func (p *conversationServiceProcessorUpdateConversationApi) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := ConversationServiceUpdateConversationApiArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("UpdateConversationApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return false, err
}
iprot.ReadMessageEnd()
var err2 error
result := ConversationServiceUpdateConversationApiResult{}
var retval *UpdateConversationApiResponse
if retval, err2 = p.handler.UpdateConversationApi(ctx, args.Request); err2 != nil {
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UpdateConversationApi: "+err2.Error())
oprot.WriteMessageBegin("UpdateConversationApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return true, err2
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("UpdateConversationApi", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
type conversationServiceProcessorDeleteConversationApi struct {
handler ConversationService
}
func (p *conversationServiceProcessorDeleteConversationApi) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
args := ConversationServiceDeleteConversationApiArgs{}
if err = args.Read(iprot); err != nil {
iprot.ReadMessageEnd()
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
oprot.WriteMessageBegin("DeleteConversationApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return false, err
}
iprot.ReadMessageEnd()
var err2 error
result := ConversationServiceDeleteConversationApiResult{}
var retval *DeleteConversationApiResponse
if retval, err2 = p.handler.DeleteConversationApi(ctx, args.Req); err2 != nil {
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteConversationApi: "+err2.Error())
oprot.WriteMessageBegin("DeleteConversationApi", thrift.EXCEPTION, seqId)
x.Write(oprot)
oprot.WriteMessageEnd()
oprot.Flush(ctx)
return true, err2
} else {
result.Success = retval
}
if err2 = oprot.WriteMessageBegin("DeleteConversationApi", thrift.REPLY, seqId); err2 != nil {
err = err2
}
if err2 = result.Write(oprot); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
err = err2
}
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
err = err2
}
if err != nil {
return
}
return true, err
}
type ConversationServiceClearConversationCtxArgs struct {
Request *ClearConversationCtxRequest `thrift:"request,1"`
}
@@ -1836,3 +1973,587 @@ func (p *ConversationServiceListConversationsApiResult) String() string {
return fmt.Sprintf("ConversationServiceListConversationsApiResult(%+v)", *p)
}
type ConversationServiceUpdateConversationApiArgs struct {
Request *UpdateConversationApiRequest `thrift:"request,1"`
}
func NewConversationServiceUpdateConversationApiArgs() *ConversationServiceUpdateConversationApiArgs {
return &ConversationServiceUpdateConversationApiArgs{}
}
func (p *ConversationServiceUpdateConversationApiArgs) InitDefault() {
}
var ConversationServiceUpdateConversationApiArgs_Request_DEFAULT *UpdateConversationApiRequest
func (p *ConversationServiceUpdateConversationApiArgs) GetRequest() (v *UpdateConversationApiRequest) {
if !p.IsSetRequest() {
return ConversationServiceUpdateConversationApiArgs_Request_DEFAULT
}
return p.Request
}
var fieldIDToName_ConversationServiceUpdateConversationApiArgs = map[int16]string{
1: "request",
}
func (p *ConversationServiceUpdateConversationApiArgs) IsSetRequest() bool {
return p.Request != nil
}
func (p *ConversationServiceUpdateConversationApiArgs) 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_ConversationServiceUpdateConversationApiArgs[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 *ConversationServiceUpdateConversationApiArgs) ReadField1(iprot thrift.TProtocol) error {
_field := NewUpdateConversationApiRequest()
if err := _field.Read(iprot); err != nil {
return err
}
p.Request = _field
return nil
}
func (p *ConversationServiceUpdateConversationApiArgs) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("UpdateConversationApi_args"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField1(oprot); err != nil {
fieldId = 1
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *ConversationServiceUpdateConversationApiArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
goto WriteFieldBeginError
}
if err := p.Request.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}
func (p *ConversationServiceUpdateConversationApiArgs) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("ConversationServiceUpdateConversationApiArgs(%+v)", *p)
}
type ConversationServiceUpdateConversationApiResult struct {
Success *UpdateConversationApiResponse `thrift:"success,0,optional"`
}
func NewConversationServiceUpdateConversationApiResult() *ConversationServiceUpdateConversationApiResult {
return &ConversationServiceUpdateConversationApiResult{}
}
func (p *ConversationServiceUpdateConversationApiResult) InitDefault() {
}
var ConversationServiceUpdateConversationApiResult_Success_DEFAULT *UpdateConversationApiResponse
func (p *ConversationServiceUpdateConversationApiResult) GetSuccess() (v *UpdateConversationApiResponse) {
if !p.IsSetSuccess() {
return ConversationServiceUpdateConversationApiResult_Success_DEFAULT
}
return p.Success
}
var fieldIDToName_ConversationServiceUpdateConversationApiResult = map[int16]string{
0: "success",
}
func (p *ConversationServiceUpdateConversationApiResult) IsSetSuccess() bool {
return p.Success != nil
}
func (p *ConversationServiceUpdateConversationApiResult) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
if _, err = iprot.ReadStructBegin(); err != nil {
goto ReadStructBeginError
}
for {
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
if err != nil {
goto ReadFieldBeginError
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 0:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField0(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
}
if err = iprot.ReadFieldEnd(); err != nil {
goto ReadFieldEndError
}
}
if err = iprot.ReadStructEnd(); err != nil {
goto ReadStructEndError
}
return nil
ReadStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ConversationServiceUpdateConversationApiResult[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 *ConversationServiceUpdateConversationApiResult) ReadField0(iprot thrift.TProtocol) error {
_field := NewUpdateConversationApiResponse()
if err := _field.Read(iprot); err != nil {
return err
}
p.Success = _field
return nil
}
func (p *ConversationServiceUpdateConversationApiResult) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("UpdateConversationApi_result"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField0(oprot); err != nil {
fieldId = 0
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *ConversationServiceUpdateConversationApiResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
goto WriteFieldBeginError
}
if err := p.Success.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}
func (p *ConversationServiceUpdateConversationApiResult) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("ConversationServiceUpdateConversationApiResult(%+v)", *p)
}
type ConversationServiceDeleteConversationApiArgs struct {
Req *DeleteConversationApiRequest `thrift:"req,1"`
}
func NewConversationServiceDeleteConversationApiArgs() *ConversationServiceDeleteConversationApiArgs {
return &ConversationServiceDeleteConversationApiArgs{}
}
func (p *ConversationServiceDeleteConversationApiArgs) InitDefault() {
}
var ConversationServiceDeleteConversationApiArgs_Req_DEFAULT *DeleteConversationApiRequest
func (p *ConversationServiceDeleteConversationApiArgs) GetReq() (v *DeleteConversationApiRequest) {
if !p.IsSetReq() {
return ConversationServiceDeleteConversationApiArgs_Req_DEFAULT
}
return p.Req
}
var fieldIDToName_ConversationServiceDeleteConversationApiArgs = map[int16]string{
1: "req",
}
func (p *ConversationServiceDeleteConversationApiArgs) IsSetReq() bool {
return p.Req != nil
}
func (p *ConversationServiceDeleteConversationApiArgs) 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_ConversationServiceDeleteConversationApiArgs[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 *ConversationServiceDeleteConversationApiArgs) ReadField1(iprot thrift.TProtocol) error {
_field := NewDeleteConversationApiRequest()
if err := _field.Read(iprot); err != nil {
return err
}
p.Req = _field
return nil
}
func (p *ConversationServiceDeleteConversationApiArgs) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("DeleteConversationApi_args"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField1(oprot); err != nil {
fieldId = 1
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *ConversationServiceDeleteConversationApiArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
goto WriteFieldBeginError
}
if err := p.Req.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}
func (p *ConversationServiceDeleteConversationApiArgs) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("ConversationServiceDeleteConversationApiArgs(%+v)", *p)
}
type ConversationServiceDeleteConversationApiResult struct {
Success *DeleteConversationApiResponse `thrift:"success,0,optional"`
}
func NewConversationServiceDeleteConversationApiResult() *ConversationServiceDeleteConversationApiResult {
return &ConversationServiceDeleteConversationApiResult{}
}
func (p *ConversationServiceDeleteConversationApiResult) InitDefault() {
}
var ConversationServiceDeleteConversationApiResult_Success_DEFAULT *DeleteConversationApiResponse
func (p *ConversationServiceDeleteConversationApiResult) GetSuccess() (v *DeleteConversationApiResponse) {
if !p.IsSetSuccess() {
return ConversationServiceDeleteConversationApiResult_Success_DEFAULT
}
return p.Success
}
var fieldIDToName_ConversationServiceDeleteConversationApiResult = map[int16]string{
0: "success",
}
func (p *ConversationServiceDeleteConversationApiResult) IsSetSuccess() bool {
return p.Success != nil
}
func (p *ConversationServiceDeleteConversationApiResult) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
if _, err = iprot.ReadStructBegin(); err != nil {
goto ReadStructBeginError
}
for {
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
if err != nil {
goto ReadFieldBeginError
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 0:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField0(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
}
if err = iprot.ReadFieldEnd(); err != nil {
goto ReadFieldEndError
}
}
if err = iprot.ReadStructEnd(); err != nil {
goto ReadStructEndError
}
return nil
ReadStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ConversationServiceDeleteConversationApiResult[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 *ConversationServiceDeleteConversationApiResult) ReadField0(iprot thrift.TProtocol) error {
_field := NewDeleteConversationApiResponse()
if err := _field.Read(iprot); err != nil {
return err
}
p.Success = _field
return nil
}
func (p *ConversationServiceDeleteConversationApiResult) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("DeleteConversationApi_result"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField0(oprot); err != nil {
fieldId = 0
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *ConversationServiceDeleteConversationApiResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
goto WriteFieldBeginError
}
if err := p.Success.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}
func (p *ConversationServiceDeleteConversationApiResult) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("ConversationServiceDeleteConversationApiResult(%+v)", *p)
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
package message
@@ -6,6 +22,7 @@ import (
"database/sql"
"database/sql/driver"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/common"
@@ -7567,6 +7584,8 @@ type ListMessageApiResponse struct {
FirstID *int64 `thrift:"first_id,3,optional" form:"first_id" json:"first_id,string,omitempty"`
// The id of the last piece of data.
LastID *int64 `thrift:"last_id,4,optional" form:"last_id" json:"last_id,string,omitempty"`
Code int64 `thrift:"code,253" form:"code" json:"code" query:"code"`
Msg string `thrift:"msg,254" form:"msg" json:"msg" query:"msg"`
}
func NewListMessageApiResponse() *ListMessageApiResponse {
@@ -7612,11 +7631,21 @@ func (p *ListMessageApiResponse) GetLastID() (v int64) {
return *p.LastID
}
func (p *ListMessageApiResponse) GetCode() (v int64) {
return p.Code
}
func (p *ListMessageApiResponse) GetMsg() (v string) {
return p.Msg
}
var fieldIDToName_ListMessageApiResponse = map[int16]string{
1: "messages",
2: "has_more",
3: "first_id",
4: "last_id",
1: "messages",
2: "has_more",
3: "first_id",
4: "last_id",
253: "code",
254: "msg",
}
func (p *ListMessageApiResponse) IsSetMessages() bool {
@@ -7685,6 +7714,22 @@ func (p *ListMessageApiResponse) Read(iprot thrift.TProtocol) (err error) {
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 253:
if fieldTypeId == thrift.I64 {
if err = p.ReadField253(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 254:
if fieldTypeId == thrift.STRING {
if err = p.ReadField254(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
@@ -7770,6 +7815,28 @@ func (p *ListMessageApiResponse) ReadField4(iprot thrift.TProtocol) error {
p.LastID = _field
return nil
}
func (p *ListMessageApiResponse) ReadField253(iprot thrift.TProtocol) error {
var _field int64
if v, err := iprot.ReadI64(); err != nil {
return err
} else {
_field = v
}
p.Code = _field
return nil
}
func (p *ListMessageApiResponse) ReadField254(iprot thrift.TProtocol) error {
var _field string
if v, err := iprot.ReadString(); err != nil {
return err
} else {
_field = v
}
p.Msg = _field
return nil
}
func (p *ListMessageApiResponse) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
@@ -7793,6 +7860,14 @@ func (p *ListMessageApiResponse) Write(oprot thrift.TProtocol) (err error) {
fieldId = 4
goto WriteFieldError
}
if err = p.writeField253(oprot); err != nil {
fieldId = 253
goto WriteFieldError
}
if err = p.writeField254(oprot); err != nil {
fieldId = 254
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
@@ -7891,6 +7966,38 @@ WriteFieldBeginError:
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}
func (p *ListMessageApiResponse) writeField253(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("code", thrift.I64, 253); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteI64(p.Code); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 253 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 253 end error: ", p), err)
}
func (p *ListMessageApiResponse) writeField254(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("msg", thrift.STRING, 254); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteString(p.Msg); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 254 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 254 end error: ", p), err)
}
func (p *ListMessageApiResponse) String() string {
if p == nil {

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
package run
@@ -6,7 +22,9 @@ import (
"database/sql"
"database/sql/driver"
"fmt"
"github.com/apache/thrift/lib/go/thrift"
"github.com/coze-dev/coze-studio/backend/api/model/base"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
)
@@ -1875,6 +1893,7 @@ type AdditionalContent struct {
Type string `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"`
Text *string `thrift:"text,2,optional" form:"text" json:"text,omitempty" query:"text"`
FileURL *string `thrift:"file_url,3,optional" form:"file_url" json:"file_url,omitempty" query:"file_url"`
FileID *int64 `thrift:"file_id,4,optional" form:"file_id" json:"file_id,string,omitempty" query:"file_id"`
}
func NewAdditionalContent() *AdditionalContent {
@@ -1906,10 +1925,20 @@ func (p *AdditionalContent) GetFileURL() (v string) {
return *p.FileURL
}
var AdditionalContent_FileID_DEFAULT int64
func (p *AdditionalContent) GetFileID() (v int64) {
if !p.IsSetFileID() {
return AdditionalContent_FileID_DEFAULT
}
return *p.FileID
}
var fieldIDToName_AdditionalContent = map[int16]string{
1: "type",
2: "text",
3: "file_url",
4: "file_id",
}
func (p *AdditionalContent) IsSetText() bool {
@@ -1920,6 +1949,10 @@ func (p *AdditionalContent) IsSetFileURL() bool {
return p.FileURL != nil
}
func (p *AdditionalContent) IsSetFileID() bool {
return p.FileID != nil
}
func (p *AdditionalContent) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
@@ -1964,6 +1997,14 @@ func (p *AdditionalContent) Read(iprot thrift.TProtocol) (err error) {
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 4:
if fieldTypeId == thrift.I64 {
if err = p.ReadField4(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
@@ -2032,6 +2073,17 @@ func (p *AdditionalContent) ReadField3(iprot thrift.TProtocol) error {
p.FileURL = _field
return nil
}
func (p *AdditionalContent) ReadField4(iprot thrift.TProtocol) error {
var _field *int64
if v, err := iprot.ReadI64(); err != nil {
return err
} else {
_field = &v
}
p.FileID = _field
return nil
}
func (p *AdditionalContent) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
@@ -2051,6 +2103,10 @@ func (p *AdditionalContent) Write(oprot thrift.TProtocol) (err error) {
fieldId = 3
goto WriteFieldError
}
if err = p.writeField4(oprot); err != nil {
fieldId = 4
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
@@ -2121,6 +2177,24 @@ WriteFieldBeginError:
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}
func (p *AdditionalContent) writeField4(oprot thrift.TProtocol) (err error) {
if p.IsSetFileID() {
if err = oprot.WriteFieldBegin("file_id", thrift.I64, 4); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteI64(*p.FileID); 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 *AdditionalContent) String() string {
if p == nil {
@@ -9459,3 +9533,449 @@ func (p *ChatV3Response) String() string {
return fmt.Sprintf("ChatV3Response(%+v)", *p)
}
type CancelChatApiRequest struct {
ChatID int64 `thrift:"ChatID,1,required" form:"chat_id,required" json:"chat_id,string,required"`
ConversationID int64 `thrift:"ConversationID,2,required" form:"conversation_id,required" json:"conversation_id,string,required"`
Base *base.Base `thrift:"Base,255" form:"Base" json:"Base" query:"Base"`
}
func NewCancelChatApiRequest() *CancelChatApiRequest {
return &CancelChatApiRequest{}
}
func (p *CancelChatApiRequest) InitDefault() {
}
func (p *CancelChatApiRequest) GetChatID() (v int64) {
return p.ChatID
}
func (p *CancelChatApiRequest) GetConversationID() (v int64) {
return p.ConversationID
}
var CancelChatApiRequest_Base_DEFAULT *base.Base
func (p *CancelChatApiRequest) GetBase() (v *base.Base) {
if !p.IsSetBase() {
return CancelChatApiRequest_Base_DEFAULT
}
return p.Base
}
var fieldIDToName_CancelChatApiRequest = map[int16]string{
1: "ChatID",
2: "ConversationID",
255: "Base",
}
func (p *CancelChatApiRequest) IsSetBase() bool {
return p.Base != nil
}
func (p *CancelChatApiRequest) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
var issetChatID bool = false
var issetConversationID bool = false
if _, err = iprot.ReadStructBegin(); err != nil {
goto ReadStructBeginError
}
for {
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
if err != nil {
goto ReadFieldBeginError
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if fieldTypeId == thrift.I64 {
if err = p.ReadField1(iprot); err != nil {
goto ReadFieldError
}
issetChatID = true
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 2:
if fieldTypeId == thrift.I64 {
if err = p.ReadField2(iprot); err != nil {
goto ReadFieldError
}
issetConversationID = true
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 255:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField255(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
}
if err = iprot.ReadFieldEnd(); err != nil {
goto ReadFieldEndError
}
}
if err = iprot.ReadStructEnd(); err != nil {
goto ReadStructEndError
}
if !issetChatID {
fieldId = 1
goto RequiredFieldNotSetError
}
if !issetConversationID {
fieldId = 2
goto RequiredFieldNotSetError
}
return nil
ReadStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CancelChatApiRequest[fieldId]), err)
SkipFieldError:
return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)
ReadFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
RequiredFieldNotSetError:
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_CancelChatApiRequest[fieldId]))
}
func (p *CancelChatApiRequest) ReadField1(iprot thrift.TProtocol) error {
var _field int64
if v, err := iprot.ReadI64(); err != nil {
return err
} else {
_field = v
}
p.ChatID = _field
return nil
}
func (p *CancelChatApiRequest) ReadField2(iprot thrift.TProtocol) error {
var _field int64
if v, err := iprot.ReadI64(); err != nil {
return err
} else {
_field = v
}
p.ConversationID = _field
return nil
}
func (p *CancelChatApiRequest) ReadField255(iprot thrift.TProtocol) error {
_field := base.NewBase()
if err := _field.Read(iprot); err != nil {
return err
}
p.Base = _field
return nil
}
func (p *CancelChatApiRequest) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("CancelChatApiRequest"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField1(oprot); err != nil {
fieldId = 1
goto WriteFieldError
}
if err = p.writeField2(oprot); err != nil {
fieldId = 2
goto WriteFieldError
}
if err = p.writeField255(oprot); err != nil {
fieldId = 255
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *CancelChatApiRequest) writeField1(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("ChatID", thrift.I64, 1); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteI64(p.ChatID); 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 *CancelChatApiRequest) writeField2(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("ConversationID", thrift.I64, 2); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteI64(p.ConversationID); 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 *CancelChatApiRequest) writeField255(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil {
goto WriteFieldBeginError
}
if err := p.Base.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}
func (p *CancelChatApiRequest) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("CancelChatApiRequest(%+v)", *p)
}
type CancelChatApiResponse struct {
ChatV3ChatDetail *ChatV3ChatDetail `thrift:"ChatV3ChatDetail,1" form:"ChatV3ChatDetail" json:"ChatV3ChatDetail" query:"ChatV3ChatDetail"`
BaseResp *base.BaseResp `thrift:"BaseResp,255" form:"BaseResp" json:"BaseResp" query:"BaseResp"`
}
func NewCancelChatApiResponse() *CancelChatApiResponse {
return &CancelChatApiResponse{}
}
func (p *CancelChatApiResponse) InitDefault() {
}
var CancelChatApiResponse_ChatV3ChatDetail_DEFAULT *ChatV3ChatDetail
func (p *CancelChatApiResponse) GetChatV3ChatDetail() (v *ChatV3ChatDetail) {
if !p.IsSetChatV3ChatDetail() {
return CancelChatApiResponse_ChatV3ChatDetail_DEFAULT
}
return p.ChatV3ChatDetail
}
var CancelChatApiResponse_BaseResp_DEFAULT *base.BaseResp
func (p *CancelChatApiResponse) GetBaseResp() (v *base.BaseResp) {
if !p.IsSetBaseResp() {
return CancelChatApiResponse_BaseResp_DEFAULT
}
return p.BaseResp
}
var fieldIDToName_CancelChatApiResponse = map[int16]string{
1: "ChatV3ChatDetail",
255: "BaseResp",
}
func (p *CancelChatApiResponse) IsSetChatV3ChatDetail() bool {
return p.ChatV3ChatDetail != nil
}
func (p *CancelChatApiResponse) IsSetBaseResp() bool {
return p.BaseResp != nil
}
func (p *CancelChatApiResponse) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
if _, err = iprot.ReadStructBegin(); err != nil {
goto ReadStructBeginError
}
for {
_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
if err != nil {
goto ReadFieldBeginError
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField1(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 255:
if fieldTypeId == thrift.STRUCT {
if err = p.ReadField255(iprot); err != nil {
goto ReadFieldError
}
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
default:
if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
}
if err = iprot.ReadFieldEnd(); err != nil {
goto ReadFieldEndError
}
}
if err = iprot.ReadStructEnd(); err != nil {
goto ReadStructEndError
}
return nil
ReadStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CancelChatApiResponse[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 *CancelChatApiResponse) ReadField1(iprot thrift.TProtocol) error {
_field := NewChatV3ChatDetail()
if err := _field.Read(iprot); err != nil {
return err
}
p.ChatV3ChatDetail = _field
return nil
}
func (p *CancelChatApiResponse) ReadField255(iprot thrift.TProtocol) error {
_field := base.NewBaseResp()
if err := _field.Read(iprot); err != nil {
return err
}
p.BaseResp = _field
return nil
}
func (p *CancelChatApiResponse) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
if err = oprot.WriteStructBegin("CancelChatApiResponse"); err != nil {
goto WriteStructBeginError
}
if p != nil {
if err = p.writeField1(oprot); err != nil {
fieldId = 1
goto WriteFieldError
}
if err = p.writeField255(oprot); err != nil {
fieldId = 255
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
}
if err = oprot.WriteStructEnd(); err != nil {
goto WriteStructEndError
}
return nil
WriteStructBeginError:
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}
func (p *CancelChatApiResponse) writeField1(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("ChatV3ChatDetail", thrift.STRUCT, 1); err != nil {
goto WriteFieldBeginError
}
if err := p.ChatV3ChatDetail.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 *CancelChatApiResponse) writeField255(oprot thrift.TProtocol) (err error) {
if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil {
goto WriteFieldBeginError
}
if err := p.BaseResp.Write(oprot); err != nil {
return err
}
if err = oprot.WriteFieldEnd(); err != nil {
goto WriteFieldEndError
}
return nil
WriteFieldBeginError:
return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err)
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err)
}
func (p *CancelChatApiResponse) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("CancelChatApiResponse(%+v)", *p)
}