fix(singleagent): v3/chat support customer variables (#2262)

This commit is contained in:
junwen-lee
2025-09-25 16:11:24 +08:00
committed by GitHub
parent d3b1e8cfd3
commit 0995536884
13 changed files with 155 additions and 5 deletions

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
// Code generated by thriftgo (0.4.1). DO NOT EDIT.
// Code generated by thriftgo (0.4.2). DO NOT EDIT.
package run
@ -22,7 +22,6 @@ 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"
@ -5153,6 +5152,7 @@ type ChatV3Request struct {
ConnectorID *int64 `thrift:"ConnectorID,12,optional" form:"connector_id" json:"connector_id,string,omitempty"`
// Specify shortcut instructions
ShortcutCommand *ShortcutCommandDetail `thrift:"ShortcutCommand,13,optional" form:"shortcut_command" json:"shortcut_command,omitempty"`
Parameters *string `thrift:"Parameters,14,optional" form:"parameters" json:"parameters,omitempty"`
}
func NewChatV3Request() *ChatV3Request {
@ -5251,6 +5251,15 @@ func (p *ChatV3Request) GetShortcutCommand() (v *ShortcutCommandDetail) {
return p.ShortcutCommand
}
var ChatV3Request_Parameters_DEFAULT string
func (p *ChatV3Request) GetParameters() (v string) {
if !p.IsSetParameters() {
return ChatV3Request_Parameters_DEFAULT
}
return *p.Parameters
}
var fieldIDToName_ChatV3Request = map[int16]string{
1: "BotID",
2: "ConversationID",
@ -5263,6 +5272,7 @@ var fieldIDToName_ChatV3Request = map[int16]string{
11: "ExtraParams",
12: "ConnectorID",
13: "ShortcutCommand",
14: "Parameters",
}
func (p *ChatV3Request) IsSetConversationID() bool {
@ -5301,6 +5311,10 @@ func (p *ChatV3Request) IsSetShortcutCommand() bool {
return p.ShortcutCommand != nil
}
func (p *ChatV3Request) IsSetParameters() bool {
return p.Parameters != nil
}
func (p *ChatV3Request) Read(iprot thrift.TProtocol) (err error) {
var fieldTypeId thrift.TType
var fieldId int16
@ -5411,6 +5425,14 @@ func (p *ChatV3Request) Read(iprot thrift.TProtocol) (err error) {
} else if err = iprot.Skip(fieldTypeId); err != nil {
goto SkipFieldError
}
case 14:
if fieldTypeId == thrift.STRING {
if err = p.ReadField14(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
@ -5632,6 +5654,17 @@ func (p *ChatV3Request) ReadField13(iprot thrift.TProtocol) error {
p.ShortcutCommand = _field
return nil
}
func (p *ChatV3Request) ReadField14(iprot thrift.TProtocol) error {
var _field *string
if v, err := iprot.ReadString(); err != nil {
return err
} else {
_field = &v
}
p.Parameters = _field
return nil
}
func (p *ChatV3Request) Write(oprot thrift.TProtocol) (err error) {
var fieldId int16
@ -5683,6 +5716,10 @@ func (p *ChatV3Request) Write(oprot thrift.TProtocol) (err error) {
fieldId = 13
goto WriteFieldError
}
if err = p.writeField14(oprot); err != nil {
fieldId = 14
goto WriteFieldError
}
}
if err = oprot.WriteFieldStop(); err != nil {
goto WriteFieldStopError
@ -5936,6 +5973,24 @@ WriteFieldBeginError:
WriteFieldEndError:
return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err)
}
func (p *ChatV3Request) writeField14(oprot thrift.TProtocol) (err error) {
if p.IsSetParameters() {
if err = oprot.WriteFieldBegin("Parameters", thrift.STRING, 14); err != nil {
goto WriteFieldBeginError
}
if err := oprot.WriteString(*p.Parameters); 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 *ChatV3Request) String() string {
if p == nil {

View File

@ -113,6 +113,8 @@ type ExecuteRequest struct {
ResumeInfo *InterruptInfo
PreCallTools []*agentrun.ToolsRetriever
CustomVariables map[string]string
ConversationID int64
}