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:
@@ -20,10 +20,15 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/conversation"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
|
||||
)
|
||||
|
||||
//go:generate mockgen -destination conversationmock/conversation_mock.go --package conversationmock -source conversation.go
|
||||
type Conversation interface {
|
||||
GetCurrentConversation(ctx context.Context, req *conversation.GetCurrent) (*conversation.Conversation, error)
|
||||
CreateConversation(ctx context.Context, req *entity.CreateMeta) (*entity.Conversation, error)
|
||||
ClearConversationHistory(ctx context.Context, req *ClearConversationHistoryReq) (*entity.NewConversationCtxResponse, error)
|
||||
GetByID(ctx context.Context, id int64) (*entity.Conversation, error)
|
||||
}
|
||||
|
||||
var defaultSVC Conversation
|
||||
@@ -35,3 +40,7 @@ func DefaultSVC() Conversation {
|
||||
func SetDefaultSVC(c Conversation) {
|
||||
defaultSVC = c
|
||||
}
|
||||
|
||||
type ClearConversationHistoryReq struct {
|
||||
ConversationID int64
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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 MockGen. DO NOT EDIT.
|
||||
// Source: conversation.go
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -destination conversationmock/conversation_mock.go --package conversationmock -source conversation.go
|
||||
//
|
||||
|
||||
// Package conversationmock is a generated GoMock package.
|
||||
package conversationmock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
conversation "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/conversation"
|
||||
conversation0 "github.com/coze-dev/coze-studio/backend/crossdomain/contract/conversation"
|
||||
entity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockConversation is a mock of Conversation interface.
|
||||
type MockConversation struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockConversationMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockConversationMockRecorder is the mock recorder for MockConversation.
|
||||
type MockConversationMockRecorder struct {
|
||||
mock *MockConversation
|
||||
}
|
||||
|
||||
// NewMockConversation creates a new mock instance.
|
||||
func NewMockConversation(ctrl *gomock.Controller) *MockConversation {
|
||||
mock := &MockConversation{ctrl: ctrl}
|
||||
mock.recorder = &MockConversationMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockConversation) EXPECT() *MockConversationMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// ClearConversationHistory mocks base method.
|
||||
func (m *MockConversation) ClearConversationHistory(ctx context.Context, req *conversation0.ClearConversationHistoryReq) (*entity.NewConversationCtxResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClearConversationHistory", ctx, req)
|
||||
ret0, _ := ret[0].(*entity.NewConversationCtxResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ClearConversationHistory indicates an expected call of ClearConversationHistory.
|
||||
func (mr *MockConversationMockRecorder) ClearConversationHistory(ctx, req any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearConversationHistory", reflect.TypeOf((*MockConversation)(nil).ClearConversationHistory), ctx, req)
|
||||
}
|
||||
|
||||
// CreateConversation mocks base method.
|
||||
func (m *MockConversation) CreateConversation(ctx context.Context, req *entity.CreateMeta) (*entity.Conversation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreateConversation", ctx, req)
|
||||
ret0, _ := ret[0].(*entity.Conversation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// CreateConversation indicates an expected call of CreateConversation.
|
||||
func (mr *MockConversationMockRecorder) CreateConversation(ctx, req any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateConversation", reflect.TypeOf((*MockConversation)(nil).CreateConversation), ctx, req)
|
||||
}
|
||||
|
||||
// GetByID mocks base method.
|
||||
func (m *MockConversation) GetByID(ctx context.Context, id int64) (*entity.Conversation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetByID", ctx, id)
|
||||
ret0, _ := ret[0].(*entity.Conversation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetByID indicates an expected call of GetByID.
|
||||
func (mr *MockConversationMockRecorder) GetByID(ctx, id any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByID", reflect.TypeOf((*MockConversation)(nil).GetByID), ctx, id)
|
||||
}
|
||||
|
||||
// GetCurrentConversation mocks base method.
|
||||
func (m *MockConversation) GetCurrentConversation(ctx context.Context, req *conversation.GetCurrent) (*conversation.Conversation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetCurrentConversation", ctx, req)
|
||||
ret0, _ := ret[0].(*conversation.Conversation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetCurrentConversation indicates an expected call of GetCurrentConversation.
|
||||
func (mr *MockConversationMockRecorder) GetCurrentConversation(ctx, req any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentConversation", reflect.TypeOf((*MockConversation)(nil).GetCurrentConversation), ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user