feat: refactor model manager

* chore: mv model icon
* fix: model icon
* fix: model icon
* feat: refactor model manager
* fix: model icon
* fix: model icon
* feat: refactor model manager

See merge request: !905
This commit is contained in:
徐兆楠
2025-07-24 13:12:44 +00:00
parent 12f7762797
commit 9b3814e2c5
114 changed files with 2888 additions and 4982 deletions

View File

@@ -20,8 +20,7 @@ import (
"context"
"github.com/cloudwego/eino/components/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossmodelmgr"
"github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
)
type LLMParams struct {
@@ -59,5 +58,5 @@ func SetManager(m Manager) {
//go:generate mockgen -destination modelmock/model_mock.go --package mockmodel -source model.go
type Manager interface {
GetModel(ctx context.Context, params *LLMParams) (model.BaseChatModel, *crossmodelmgr.Model, error)
GetModel(ctx context.Context, params *LLMParams) (model.BaseChatModel, *modelmgr.Model, error)
}

View File

@@ -1,19 +1,3 @@
/*
* 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: model.go
//
@@ -29,9 +13,9 @@ import (
context "context"
reflect "reflect"
crossmodelmgr "github.com/coze-dev/coze-studio/backend/crossdomain/contract/crossmodelmgr"
model "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model"
model0 "github.com/cloudwego/eino/components/model"
model "github.com/cloudwego/eino/components/model"
model0 "github.com/coze-dev/coze-studio/backend/domain/workflow/crossdomain/model"
modelmgr "github.com/coze-dev/coze-studio/backend/infra/contract/modelmgr"
gomock "go.uber.org/mock/gomock"
)
@@ -39,7 +23,6 @@ import (
type MockManager struct {
ctrl *gomock.Controller
recorder *MockManagerMockRecorder
isgomock struct{}
}
// MockManagerMockRecorder is the mock recorder for MockManager.
@@ -60,11 +43,11 @@ func (m *MockManager) EXPECT() *MockManagerMockRecorder {
}
// GetModel mocks base method.
func (m *MockManager) GetModel(ctx context.Context, params *model.LLMParams) (model0.BaseChatModel, *crossmodelmgr.Model, error) {
func (m *MockManager) GetModel(ctx context.Context, params *model0.LLMParams) (model.BaseChatModel, *modelmgr.Model, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetModel", ctx, params)
ret0, _ := ret[0].(model0.BaseChatModel)
ret1, _ := ret[1].(*crossmodelmgr.Model)
ret0, _ := ret[0].(model.BaseChatModel)
ret1, _ := ret[1].(*modelmgr.Model)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}