Compare commits

..

2 Commits

Author SHA1 Message Date
92fc7ea401 chore: update @swc/core dep 2025-10-23 12:08:11 +08:00
be2c1f38c8 chore: upgrade eslint version
chore: update lock
2025-10-23 12:08:08 +08:00
301 changed files with 2687 additions and 1652 deletions

View File

@ -71,6 +71,4 @@ RUN chmod +x /app/parse_pdf.py /app/parse_docx.py && \
EXPOSE 8888
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
CMD ["/app/opencoze"]

File diff suppressed because it is too large Load Diff

View File

@ -14,16 +14,16 @@
* limitations under the License.
*/
package model
package agentrun
import "github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
type Tool struct {
PluginID int64 `json:"plugin_id"`
ToolID int64 `json:"tool_id"`
Arguments string `json:"arguments"`
ToolName string `json:"tool_name"`
Type ToolType `json:"type"`
PluginID int64 `json:"plugin_id"`
ToolID int64 `json:"tool_id"`
Arguments string `json:"arguments"`
ToolName string `json:"tool_name"`
Type ToolType `json:"type"`
PluginFrom *bot_common.PluginFrom `json:"plugin_from"`
}
@ -35,11 +35,11 @@ const (
)
type ToolsRetriever struct {
PluginID int64
ToolName string
ToolID int64
Arguments string
Type ToolType
PluginID int64
ToolName string
ToolID int64
Arguments string
Type ToolType
PluginFrom *bot_common.PluginFrom `json:"plugin_from"`
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package connector
import "github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package conversation
import "github.com/coze-dev/coze-studio/backend/api/model/conversation/common"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package database
type OperateType int64

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package database
import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package knowledge
import (
"github.com/bytedance/sonic"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package message
import (
"github.com/cloudwego/eino/schema"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package search
import (
resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package search
import (
resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common"

View File

@ -14,16 +14,16 @@
* limitations under the License.
*/
package model
package singleagent
import (
"github.com/cloudwego/eino/schema"
"gorm.io/gorm"
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
agentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/contract/workflow"
)
type EventType string
@ -113,7 +113,7 @@ type ExecuteRequest struct {
ResumeInfo *InterruptInfo
PreCallTools []*agentrun.ToolsRetriever
CustomVariables map[string]string
CustomVariables map[string]string
ConversationID int64
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package model
package variables
import (
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package model
package workflow
import (
"github.com/cloudwego/eino/schema"
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/message"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
)
type Locator uint8
@ -84,6 +84,8 @@ const (
SyncPatternStream SyncPattern = "stream"
)
var DebugURLTpl = "http://127.0.0.1:3000/work_flow?execute_id=%d&space_id=%d&workflow_id=%d&execute_mode=2"
type BizType string
const (

View File

@ -32,6 +32,8 @@ import (
projectAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/project"
publishAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/publish"
taskAPI "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/task"
connectorModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector"
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
@ -44,9 +46,7 @@ import (
"github.com/coze-dev/coze-studio/backend/application/plugin"
"github.com/coze-dev/coze-studio/backend/application/workflow"
"github.com/coze-dev/coze-studio/backend/bizpkg/config"
connectorModel "github.com/coze-dev/coze-studio/backend/crossdomain/connector/model"
knowledgeModel "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/domain/app/entity"
"github.com/coze-dev/coze-studio/backend/domain/app/repository"
"github.com/coze-dev/coze-studio/backend/domain/app/service"

View File

@ -37,34 +37,34 @@ import (
"github.com/coze-dev/coze-studio/backend/application/upload"
"github.com/coze-dev/coze-studio/backend/application/user"
"github.com/coze-dev/coze-studio/backend/application/workflow"
crossagent "github.com/coze-dev/coze-studio/backend/crossdomain/agent"
singleagentImpl "github.com/coze-dev/coze-studio/backend/crossdomain/agent/impl"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun"
agentrunImpl "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/impl"
crossconnector "github.com/coze-dev/coze-studio/backend/crossdomain/connector"
connectorImpl "github.com/coze-dev/coze-studio/backend/crossdomain/connector/impl"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/conversation"
conversationImpl "github.com/coze-dev/coze-studio/backend/crossdomain/conversation/impl"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/database"
databaseImpl "github.com/coze-dev/coze-studio/backend/crossdomain/database/impl"
crossdatacopy "github.com/coze-dev/coze-studio/backend/crossdomain/datacopy"
dataCopyImpl "github.com/coze-dev/coze-studio/backend/crossdomain/datacopy/impl"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge"
knowledgeImpl "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/impl"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/message"
messageImpl "github.com/coze-dev/coze-studio/backend/crossdomain/message/impl"
crossplugin "github.com/coze-dev/coze-studio/backend/crossdomain/plugin"
pluginImpl "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/impl"
crosssearch "github.com/coze-dev/coze-studio/backend/crossdomain/search"
searchImpl "github.com/coze-dev/coze-studio/backend/crossdomain/search/impl"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/upload"
uploadImpl "github.com/coze-dev/coze-studio/backend/crossdomain/upload/impl"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/user"
crossuserImpl "github.com/coze-dev/coze-studio/backend/crossdomain/user/impl"
crossvariables "github.com/coze-dev/coze-studio/backend/crossdomain/variables"
variablesImpl "github.com/coze-dev/coze-studio/backend/crossdomain/variables/impl"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow"
workflowImpl "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/impl"
crossagent "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agent"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun"
crossconnector "github.com/coze-dev/coze-studio/backend/crossdomain/contract/connector"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/contract/conversation"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/contract/database"
crossdatacopy "github.com/coze-dev/coze-studio/backend/crossdomain/contract/datacopy"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/contract/knowledge"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
crossplugin "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin"
crosssearch "github.com/coze-dev/coze-studio/backend/crossdomain/contract/search"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/contract/upload"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
crossvariables "github.com/coze-dev/coze-studio/backend/crossdomain/contract/variables"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/contract/workflow"
agentrunImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/agentrun"
connectorImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/connector"
conversationImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/conversation"
crossuserImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/crossuser"
databaseImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/database"
dataCopyImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/datacopy"
knowledgeImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/knowledge"
messageImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/message"
pluginImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/plugin"
searchImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/search"
singleagentImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/singleagent"
uploadImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/upload"
variablesImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/variables"
workflowImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/workflow"
"github.com/coze-dev/coze-studio/backend/infra/checkpoint"
"github.com/coze-dev/coze-studio/backend/infra/document/progressbar"
progressBarImpl "github.com/coze-dev/coze-studio/backend/infra/document/progressbar/impl/progressbar"

View File

@ -28,9 +28,9 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
crossDomainMessage "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
agentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/model"
crossDomainMessage "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
saEntity "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
"github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
convEntity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"

View File

@ -24,8 +24,8 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/conversation/common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
model "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
singleAgentEntity "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
convEntity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
"github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"

View File

@ -29,10 +29,10 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
singleagent "github.com/coze-dev/coze-studio/backend/crossdomain/agent/model"
agentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/model"
message "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
saEntity "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
"github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
convEntity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"

View File

@ -26,7 +26,7 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/conversation/common"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
singleagent "github.com/coze-dev/coze-studio/backend/crossdomain/agent/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
saEntity "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
convEntity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
openapiEntity "github.com/coze-dev/coze-studio/backend/domain/openauth/openapiauth/entity"

View File

@ -23,8 +23,8 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/conversation/message"
"github.com/coze-dev/coze-studio/backend/api/model/conversation/run"
"github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
apiMessage "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
message3 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
convEntity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
"github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"
@ -67,9 +67,9 @@ func (m *OpenapiMessageApplication) GetApiMessageList(ctx context.Context, mr *m
AgentID: currentConversation.AgentID,
Limit: int(ptr.From(mr.Limit)),
MessageType: []*model.MessageType{
ptr.Of(model.MessageTypeQuestion),
ptr.Of(model.MessageTypeAnswer),
MessageType: []*message3.MessageType{
ptr.Of(message3.MessageTypeQuestion),
ptr.Of(message3.MessageTypeAnswer),
},
}
if mr.ChatID != nil {
@ -127,7 +127,7 @@ func (m *OpenapiMessageApplication) buildMessageListResponse(ctx context.Context
MetaData: dm.Ext,
ReasoningContent: ptr.Of(dm.ReasoningContent),
}
if dm.ContentType == model.ContentTypeMix {
if dm.ContentType == message3.ContentTypeMix {
msg.ContentType = run.ContentTypeMixApi
if dm.DisplayContent != "" {
msg.Content = m.parseDisplayContent(ctx, dm)
@ -158,10 +158,10 @@ func (m *OpenapiMessageApplication) parseDisplayContent(ctx context.Context, dm
if one == nil {
continue
}
switch model.InputType(one.Type) {
case model.InputTypeText:
switch apiMessage.InputType(one.Type) {
case apiMessage.InputTypeText:
continue
case model.InputTypeImage, model.InputTypeFile:
case apiMessage.InputTypeImage, apiMessage.InputTypeFile:
if one.GetFileID() != 0 {
fileInfo, err := m.UploaodDomainSVC.GetFile(ctx, &uploadService.GetFileRequest{
ID: one.GetFileID(),

View File

@ -25,9 +25,11 @@ import (
"strings"
"time"
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
"github.com/coze-dev/coze-studio/backend/application/upload"
"github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/entity"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
"github.com/coze-dev/coze-studio/backend/infra/document"
@ -143,17 +145,17 @@ func convertDocTableSheet2Model(sheet entity.TableSheet) *dataset.DocTableSheet
}
}
func convertTableMeta(t []*entity.TableColumn) []*dataset.DocTableColumn {
func convertTableMeta(t []*entity.TableColumn) []*modelCommon.DocTableColumn {
if len(t) == 0 {
return nil
}
resp := make([]*dataset.DocTableColumn, 0)
resp := make([]*modelCommon.DocTableColumn, 0)
for i := range t {
if t[i] == nil {
continue
}
resp = append(resp, &dataset.DocTableColumn{
resp = append(resp, &modelCommon.DocTableColumn{
ID: t[i].ID,
ColumnName: t[i].Name,
IsSemantic: t[i].Indexing,
@ -165,30 +167,30 @@ func convertTableMeta(t []*entity.TableColumn) []*dataset.DocTableColumn {
return resp
}
func convertColumnType(t document.TableColumnType) *dataset.ColumnType {
func convertColumnType(t document.TableColumnType) *modelCommon.ColumnType {
switch t {
case document.TableColumnTypeString:
return dataset.ColumnTypePtr(dataset.ColumnType_Text)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Text)
case document.TableColumnTypeBoolean:
return dataset.ColumnTypePtr(dataset.ColumnType_Boolean)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Boolean)
case document.TableColumnTypeNumber:
return dataset.ColumnTypePtr(dataset.ColumnType_Float)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Float)
case document.TableColumnTypeTime:
return dataset.ColumnTypePtr(dataset.ColumnType_Date)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Date)
case document.TableColumnTypeInteger:
return dataset.ColumnTypePtr(dataset.ColumnType_Number)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Number)
case document.TableColumnTypeImage:
return dataset.ColumnTypePtr(dataset.ColumnType_Image)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Image)
default:
return dataset.ColumnTypePtr(dataset.ColumnType_Text)
return modelCommon.ColumnTypePtr(modelCommon.ColumnType_Text)
}
}
func convertDocTableSheet(t *entity.TableSheet) *dataset.DocTableSheet {
func convertDocTableSheet(t *entity.TableSheet) *modelCommon.DocTableSheet {
if t == nil {
return nil
}
return &dataset.DocTableSheet{
return &modelCommon.DocTableSheet{
ID: t.SheetId,
SheetName: t.SheetName,
TotalRow: t.TotalRows,
@ -215,7 +217,7 @@ func convertSliceContent(s *entity.Slice) string {
if len(s.RawContent) == 0 {
return ""
}
if s.RawContent[0].Type == model.SliceContentTypeTable {
if s.RawContent[0].Type == knowledgeModel.SliceContentTypeTable {
tableData := make([]sliceContentData, 0, len(s.RawContent[0].Table.Columns))
for _, col := range s.RawContent[0].Table.Columns {
tableData = append(tableData, sliceContentData{
@ -238,13 +240,13 @@ type sliceContentData struct {
Desc string `json:"desc"`
}
func convertSliceStatus2Model(status model.SliceStatus) dataset.SliceStatus {
func convertSliceStatus2Model(status knowledgeModel.SliceStatus) dataset.SliceStatus {
switch status {
case model.SliceStatusInit:
case knowledgeModel.SliceStatusInit:
return dataset.SliceStatus_PendingVectoring
case model.SliceStatusFinishStore:
case knowledgeModel.SliceStatusFinishStore:
return dataset.SliceStatus_FinishVectoring
case model.SliceStatusFailed:
case knowledgeModel.SliceStatusFailed:
return dataset.SliceStatus_Deactive
default:
return dataset.SliceStatus_PendingVectoring

View File

@ -26,13 +26,13 @@ import (
"github.com/bytedance/sonic"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
dataset "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
modelCommon "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
resource "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/application/search"
model "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/entity"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
resourceEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"

View File

@ -22,8 +22,8 @@ import (
"strings"
"github.com/coze-dev/coze-studio/backend/api/model/base"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
model "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
"github.com/coze-dev/coze-studio/backend/domain/memory/database/entity"
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"

View File

@ -21,14 +21,14 @@ import (
"fmt"
"github.com/coze-dev/coze-studio/backend/api/model/base"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
document "github.com/coze-dev/coze-studio/backend/api/model/data/knowledge"
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/application/search"
model "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/user"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
"github.com/coze-dev/coze-studio/backend/domain/memory/database/entity"
databaseEntity "github.com/coze-dev/coze-studio/backend/domain/memory/database/entity"
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"

View File

@ -23,10 +23,10 @@ import (
"strconv"
"github.com/coze-dev/coze-studio/backend/api/model/base"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
model "github.com/coze-dev/coze-studio/backend/crossdomain/variables/model"
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -32,10 +32,10 @@ import (
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert/api"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert/api"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
"github.com/coze-dev/coze-studio/backend/domain/plugin/repository"

View File

@ -30,9 +30,9 @@ import (
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
"github.com/coze-dev/coze-studio/backend/domain/plugin/repository"

View File

@ -23,7 +23,7 @@ import (
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"

View File

@ -26,7 +26,7 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -30,8 +30,8 @@ import (
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert/api"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert/api"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
"github.com/coze-dev/coze-studio/backend/domain/plugin/repository"

View File

@ -26,8 +26,8 @@ import (
productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
pluginCommon "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
mockPlugin "github.com/coze-dev/coze-studio/backend/internal/mock/domain/plugin"

View File

@ -30,9 +30,9 @@ import (
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
resCommon "github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -24,11 +24,11 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence"
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
search2 "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/marketplace_common"
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_common"
"github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
search2 "github.com/coze-dev/coze-studio/backend/crossdomain/search/model"
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"

View File

@ -20,10 +20,10 @@ import (
"context"
"fmt"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
database "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
dbservice "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"

View File

@ -23,10 +23,10 @@ import (
"strconv"
"sync"
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
"github.com/coze-dev/coze-studio/backend/api/model/resource"
"github.com/coze-dev/coze-studio/backend/api/model/resource/common"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
knowledgeModel "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
"github.com/coze-dev/coze-studio/backend/domain/search/entity"
search "github.com/coze-dev/coze-studio/backend/domain/search/service"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -23,9 +23,9 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/bizpkg/config"
singleagent "github.com/coze-dev/coze-studio/backend/crossdomain/agent/model"
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
searchEntity "github.com/coze-dev/coze-studio/backend/domain/search/entity"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -23,15 +23,15 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
knowledgeModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
"github.com/coze-dev/coze-studio/backend/bizpkg/config"
"github.com/coze-dev/coze-studio/backend/bizpkg/config/modelmgr"
knowledgeModel "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
workflowModel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
knowledge "github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
pluginEntity "github.com/coze-dev/coze-studio/backend/domain/plugin/entity"

View File

@ -25,9 +25,9 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
"github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
database "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
search "github.com/coze-dev/coze-studio/backend/domain/search/entity"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"

View File

@ -29,13 +29,13 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_open_api"
"github.com/coze-dev/coze-studio/backend/api/model/app/developer_api"
intelligence "github.com/coze-dev/coze-studio/backend/api/model/app/intelligence/common"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/crossdomain/agent"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/database"
database "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/agent"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/contract/database"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/entity"
singleagent "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/service"
variableEntity "github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"

View File

@ -29,15 +29,14 @@ import (
"github.com/cloudwego/eino/schema"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
"github.com/coze-dev/coze-studio/backend/bizpkg/debugutil"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/conversation"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/message"
message "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/upload"
workflowModel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/contract/conversation"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/contract/upload"
agententity "github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
"github.com/coze-dev/coze-studio/backend/domain/upload/service"
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
@ -832,7 +831,7 @@ func (w *ApplicationService) convertToChatFlowRunResponseList(ctx context.Contex
}
doneData, err := sonic.MarshalString(map[string]interface{}{
"debug_url": debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID),
"debug_url": fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID),
})
if err != nil {
return nil, err
@ -977,7 +976,7 @@ func (w *ApplicationService) convertToChatFlowRunResponseList(ctx context.Contex
})
doneData, _ := sonic.MarshalString(map[string]interface{}{
"debug_url": debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID),
"debug_url": fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID),
})
responses = append(responses, &workflow.ChatFlowRunResponse{

View File

@ -26,12 +26,12 @@ import (
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
messageentity "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/api/model/workflow"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun"
"github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/agentrunmock"
messageentity "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/upload"
"github.com/coze-dev/coze-studio/backend/crossdomain/upload/uploadmock"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun/agentrunmock"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/contract/upload"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/upload/uploadmock"
agententity "github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
uploadentity "github.com/coze-dev/coze-studio/backend/domain/upload/entity"
"github.com/coze-dev/coze-studio/backend/domain/upload/service"

View File

@ -31,6 +31,8 @@ import (
"golang.org/x/sync/errgroup"
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
pluginAPI "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop"
@ -42,12 +44,9 @@ import (
appmemory "github.com/coze-dev/coze-studio/backend/application/memory"
appplugin "github.com/coze-dev/coze-studio/backend/application/plugin"
"github.com/coze-dev/coze-studio/backend/application/user"
"github.com/coze-dev/coze-studio/backend/bizpkg/debugutil"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge"
model "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/user"
workflowModel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/contract/knowledge"
pluginConsts "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
search "github.com/coze-dev/coze-studio/backend/domain/search/entity"
domainWorkflow "github.com/coze-dev/coze-studio/backend/domain/workflow"
@ -1395,7 +1394,6 @@ func convertStreamRunEvent(workflowID int64) func(msg *entity.Message) (res *wor
}
}()
ctx := context.Background()
if msg.StateMessage != nil {
// stream run will skip all messages from workflow tools
if executeID > 0 && executeID != msg.StateMessage.ExecuteID {
@ -1407,7 +1405,7 @@ func convertStreamRunEvent(workflowID int64) func(msg *entity.Message) (res *wor
return &workflow.OpenAPIStreamRunFlowResponse{
ID: strconv.Itoa(messageID),
Event: string(DoneEvent),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID)),
}, nil
case entity.WorkflowFailed, entity.WorkflowCancel:
var wfe vo.WorkflowError
@ -1417,7 +1415,7 @@ func convertStreamRunEvent(workflowID int64) func(msg *entity.Message) (res *wor
return &workflow.OpenAPIStreamRunFlowResponse{
ID: strconv.Itoa(messageID),
Event: string(ErrEvent),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID)),
ErrorCode: ptr.Of(int64(wfe.Code())),
ErrorMessage: ptr.Of(wfe.Msg()),
}, nil
@ -1426,7 +1424,7 @@ func convertStreamRunEvent(workflowID int64) func(msg *entity.Message) (res *wor
return &workflow.OpenAPIStreamRunFlowResponse{
ID: strconv.Itoa(messageID),
Event: string(InterruptEvent),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID)),
InterruptData: &workflow.Interrupt{
EventID: fmt.Sprintf("%d/%d", executeID, msg.InterruptEvent.ID),
Type: workflow.InterruptType(msg.InterruptEvent.EventType),
@ -1438,7 +1436,7 @@ func convertStreamRunEvent(workflowID int64) func(msg *entity.Message) (res *wor
return &workflow.OpenAPIStreamRunFlowResponse{
ID: strconv.Itoa(messageID),
Event: string(InterruptEvent),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, workflowID, spaceID, executeID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, executeID, spaceID, workflowID)),
InterruptData: &workflow.Interrupt{
EventID: fmt.Sprintf("%d/%d", executeID, msg.InterruptEvent.ID),
Type: workflow.InterruptType(msg.InterruptEvent.ToolInterruptEvent.EventType),
@ -1731,7 +1729,7 @@ func (w *ApplicationService) OpenAPIRun(ctx context.Context, req *workflow.OpenA
return &workflow.OpenAPIRunFlowResponse{
ExecuteID: ptr.Of(strconv.FormatInt(exeID, 10)),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, meta.ID, meta.SpaceID, exeID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, exeID, meta.SpaceID, meta.ID)),
}, nil
}
@ -1767,7 +1765,7 @@ func (w *ApplicationService) OpenAPIRun(ctx context.Context, req *workflow.OpenA
return &workflow.OpenAPIRunFlowResponse{
Data: data,
ExecuteID: ptr.Of(strconv.FormatInt(wfExe.ID, 10)),
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, meta.ID, wfExe.SpaceID, wfExe.ID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, wfExe.ID, wfExe.SpaceID, meta.ID)),
Token: ptr.Of(wfExe.TokenInfo.InputTokens + wfExe.TokenInfo.OutputTokens),
Cost: ptr.Of("0.00000"),
}, nil
@ -1828,7 +1826,7 @@ func (w *ApplicationService) OpenAPIGetWorkflowRunHistory(ctx context.Context, r
LogID: ptr.Of(exe.LogID),
CreateTime: ptr.Of(exe.CreatedAt.Unix()),
UpdateTime: updateTime,
DebugUrl: ptr.Of(debugutil.GetWorkflowDebugURL(ctx, exe.WorkflowID, exe.SpaceID, exe.ID)),
DebugUrl: ptr.Of(fmt.Sprintf(workflowModel.DebugURLTpl, exe.ID, exe.SpaceID, exe.WorkflowID)),
Input: exe.Input,
Output: exe.Output,
Token: ptr.Of(exe.TokenInfo.InputTokens + exe.TokenInfo.OutputTokens),

View File

@ -106,7 +106,7 @@ func (c *BaseConfig) GetServerHost(ctx context.Context) (string, error) {
host := cfg.ServerHost
if host == "" {
return "http://127.0.0.1:8888", nil
return "", errors.New("server host is empty")
}
if strings.HasPrefix(host, "http://") || strings.HasPrefix(host, "https://") {

View File

@ -47,11 +47,6 @@ func getOldKnowledgeBuiltinChatModelConfig() *Model {
}
typeStr := strings.ToUpper(os.Getenv("BUILTIN_CM_TYPE"))
if typeStr == "" {
return nil
}
baseURLKey := fmt.Sprintf("BUILTIN_CM_%s_BASE_URL", typeStr)
apiKeyKey := fmt.Sprintf("BUILTIN_CM_%s_API_KEY", typeStr)
modelKey := fmt.Sprintf("BUILTIN_CM_%s_MODEL", typeStr)

View File

@ -63,9 +63,7 @@ func initOldModelConf(ctx context.Context, oss storage.Storage, c *ModelConfig)
return err
}
if envModel != nil {
oldModels = append(oldModels, envModel)
}
oldModels = append(oldModels, envModel)
for _, q := range oldModels {
if q.Provider.IconURI != "" {
@ -108,9 +106,6 @@ func initOldModelConf(ctx context.Context, oss storage.Storage, c *ModelConfig)
}
func initModelByEnv() (*Model, error) {
if os.Getenv("MODEL_PROTOCOL_0") == "" || os.Getenv("MODEL_OPENCOZE_ID_0") == "" {
return nil, nil
}
protocol := os.Getenv("MODEL_PROTOCOL_0")
openCozeID, err := envkey.GetI64("MODEL_OPENCOZE_ID_0")
if err != nil {

View File

@ -1,58 +0,0 @@
/*
* 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.
*/
package debugutil
import (
"context"
"fmt"
"net/url"
"strconv"
"github.com/coze-dev/coze-studio/backend/bizpkg/config"
"github.com/coze-dev/coze-studio/backend/pkg/logs"
)
func GetWorkflowDebugURL(ctx context.Context, workflowID, spaceID, executeID int64) string {
defaultURL := fmt.Sprintf("http://127.0.0.1:8888/work_flow?execute_id=%d&space_id=%d&workflow_id=%d&execute_mode=2", executeID, spaceID, workflowID)
serverHost, err := config.Base().GetServerHost(ctx)
if err != nil {
logs.CtxErrorf(ctx, "[GetWorkflowDebugURL] get base config failed, use default debug url instead, err: %v", err)
return defaultURL
}
workFlowURL, err := url.JoinPath(serverHost, "work_flow")
if err != nil {
logs.CtxErrorf(ctx, "[GetWorkflowDebugURL] join path failed, use default debug url instead, err: %v", err)
return defaultURL
}
u, err := url.Parse(workFlowURL)
if err != nil {
logs.CtxErrorf(ctx, "[GetWorkflowDebugURL] parse workflow url failed, use default debug url instead, err: %v", err)
return defaultURL
}
q := u.Query()
q.Set("execute_id", strconv.FormatInt(executeID, 10))
q.Set("space_id", strconv.FormatInt(spaceID, 10))
q.Set("workflow_id", strconv.FormatInt(workflowID, 10))
q.Set("execute_mode", "2")
u.RawQuery = q.Encode()
return u.String()
}

View File

@ -73,7 +73,7 @@ func GetBuiltinChatModel(ctx context.Context, envPrefix string) (bcm BaseChatMod
}
return nil, false, nil
return nil, true, nil
}
func checkModelConfig(ctx context.Context, bcm BaseChatModel) (err error) {

View File

@ -21,18 +21,16 @@ import (
"github.com/cloudwego/eino/schema"
model "github.com/coze-dev/coze-studio/backend/crossdomain/agent/model"
agentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
"github.com/coze-dev/coze-studio/backend/api/model/playground"
)
// Requests and responses must not reference domain entities and can only use models under api/model/crossdomain.
type SingleAgent interface {
StreamExecute(ctx context.Context,
agentRuntime *AgentRuntime) (*schema.StreamReader[*model.AgentEvent], error)
ObtainAgentByIdentity(ctx context.Context, identity *model.AgentIdentity) (*model.SingleAgent, error)
agentRuntime *AgentRuntime) (*schema.StreamReader[*singleagent.AgentEvent], error)
ObtainAgentByIdentity(ctx context.Context, identity *singleagent.AgentIdentity) (*singleagent.SingleAgent, error)
}
type AgentRuntime struct {
@ -51,9 +49,9 @@ type AgentRuntime struct {
ResumeInfo *ResumeInfo
}
type ResumeInfo = model.InterruptInfo
type ResumeInfo = singleagent.InterruptInfo
type AgentEvent = model.AgentEvent
type AgentEvent = singleagent.AgentEvent
var defaultSVC SingleAgent

View File

@ -19,13 +19,13 @@ package connector
import (
"context"
model "github.com/coze-dev/coze-studio/backend/crossdomain/connector/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector"
)
type Connector interface {
List(ctx context.Context) ([]*model.Connector, error)
GetByIDs(ctx context.Context, ids []int64) (map[int64]*model.Connector, error)
GetByID(ctx context.Context, id int64) (*model.Connector, error)
List(ctx context.Context) ([]*connector.Connector, error)
GetByIDs(ctx context.Context, ids []int64) (map[int64]*connector.Connector, error)
GetByID(ctx context.Context, id int64) (*connector.Connector, error)
}
var defaultSVC Connector

View File

@ -19,13 +19,13 @@ package conversation
import (
"context"
model "github.com/coze-dev/coze-studio/backend/crossdomain/conversation/model"
"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 *model.GetCurrent) (*model.Conversation, error)
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)

View File

@ -29,8 +29,8 @@ import (
context "context"
reflect "reflect"
conversation "github.com/coze-dev/coze-studio/backend/crossdomain/conversation/model"
conversation0 "github.com/coze-dev/coze-studio/backend/crossdomain/conversation"
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"
)

View File

@ -19,10 +19,10 @@ package database
import (
"context"
database "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
)
//go:generate mockgen -destination databasemock/database_mock.go --package databasemock -source model.go
//go:generate mockgen -destination databasemock/database_mock.go --package databasemock -source database.go
type Database interface {
ExecuteSQL(ctx context.Context, req *database.ExecuteSQLRequest) (*database.ExecuteSQLResponse, error)
PublishDatabase(ctx context.Context, req *database.PublishDatabaseRequest) (resp *database.PublishDatabaseResponse, err error)

View File

@ -13,7 +13,7 @@ import (
context "context"
reflect "reflect"
database "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
database "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
gomock "go.uber.org/mock/gomock"
)

View File

@ -0,0 +1,45 @@
/*
* 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.
*/
package knowledge
import (
"context"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
)
//go:generate mockgen -destination knowledgemock/knowledge_mock.go --package knowledgemock -source knowledge.go
type Knowledge interface {
ListKnowledge(ctx context.Context, request *knowledge.ListKnowledgeRequest) (response *knowledge.ListKnowledgeResponse, err error)
GetKnowledgeByID(ctx context.Context, request *knowledge.GetKnowledgeByIDRequest) (response *knowledge.GetKnowledgeByIDResponse, err error)
Retrieve(ctx context.Context, req *knowledge.RetrieveRequest) (*knowledge.RetrieveResponse, error)
DeleteKnowledge(ctx context.Context, request *knowledge.DeleteKnowledgeRequest) error
MGetKnowledgeByID(ctx context.Context, request *knowledge.MGetKnowledgeByIDRequest) (response *knowledge.MGetKnowledgeByIDResponse, err error)
Store(ctx context.Context, document *knowledge.CreateDocumentRequest) (*knowledge.CreateDocumentResponse, error)
Delete(ctx context.Context, r *knowledge.DeleteDocumentRequest) (*knowledge.DeleteDocumentResponse, error)
ListKnowledgeDetail(ctx context.Context, req *knowledge.ListKnowledgeDetailRequest) (*knowledge.ListKnowledgeDetailResponse, error)
}
var defaultSVC Knowledge
func DefaultSVC() Knowledge {
return defaultSVC
}
func SetDefaultSVC(c Knowledge) {
defaultSVC = c
}

View File

@ -13,7 +13,7 @@ import (
context "context"
reflect "reflect"
knowledge "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
knowledge "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
gomock "go.uber.org/mock/gomock"
)

View File

@ -21,19 +21,19 @@ import (
"github.com/cloudwego/eino/schema"
"github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
"github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"
)
//go:generate mockgen -destination messagemock/message_mock.go --package messagemock -source message.go
type Message interface {
GetByRunIDs(ctx context.Context, conversationID int64, runIDs []int64) ([]*model.Message, error)
PreCreate(ctx context.Context, msg *model.Message) (*model.Message, error)
Create(ctx context.Context, msg *model.Message) (*model.Message, error)
BatchCreate(ctx context.Context, msg []*model.Message) ([]*model.Message, error)
GetByRunIDs(ctx context.Context, conversationID int64, runIDs []int64) ([]*message.Message, error)
PreCreate(ctx context.Context, msg *message.Message) (*message.Message, error)
Create(ctx context.Context, msg *message.Message) (*message.Message, error)
BatchCreate(ctx context.Context, msg []*message.Message) ([]*message.Message, error)
List(ctx context.Context, meta *entity.ListMeta) (*entity.ListResult, error)
ListWithoutPair(ctx context.Context, req *entity.ListMeta) (*entity.ListResult, error)
Edit(ctx context.Context, msg *model.Message) (*model.Message, error)
Edit(ctx context.Context, msg *message.Message) (*message.Message, error)
Delete(ctx context.Context, req *entity.DeleteMeta) error
GetMessageByID(ctx context.Context, id int64) (*entity.Message, error)
MessageList(ctx context.Context, req *MessageListRequest) (*MessageListResponse, error)
@ -43,7 +43,7 @@ type Message interface {
var defaultSVC Message
type MessageMeta = model.Message
type MessageMeta = message.Message
func DefaultSVC() Message {
return defaultSVC
@ -71,10 +71,10 @@ type MessageListResponse struct {
}
type Content struct {
Type model.InputType `json:"type"`
Text *string `json:"text,omitempty"`
Uri *string `json:"uri,omitempty"`
Url *string `json:"url,omitempty"`
Type message.InputType `json:"type"`
Text *string `json:"text,omitempty"`
Uri *string `json:"uri,omitempty"`
Url *string `json:"url,omitempty"`
}
type WfMessage struct {

View File

@ -29,8 +29,8 @@ import (
context "context"
reflect "reflect"
message "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
message0 "github.com/coze-dev/coze-studio/backend/crossdomain/message"
message "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
message0 "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
entity "github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"
gomock "go.uber.org/mock/gomock"
)

View File

@ -23,9 +23,9 @@ import (
"github.com/getkin/kin-openapi/openapi3"
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
"github.com/coze-dev/coze-studio/backend/types/errno"
)
@ -213,7 +213,7 @@ func toOpenapiParameter(apiParam *common.APIParameter) (*openapi3.Parameter, err
}
if apiParam.LocalDefault != nil && *apiParam.LocalDefault != "" {
paramSchema.Default = *apiParam.LocalDefault
paramSchema.Default = apiParam.LocalDefault
}
if apiParam.LocalDisable {
paramSchema.Extensions[consts.APISchemaExtendLocalDisable] = true
@ -271,11 +271,11 @@ func toOpenapi3Schema(apiParam *common.APIParameter) (*openapi3.Schema, error) {
},
}
if apiParam.GlobalDefault != nil && *apiParam.GlobalDefault != "" {
sc.Default = *apiParam.GlobalDefault
sc.Default = apiParam.GlobalDefault
}
if apiParam.LocalDefault != nil && *apiParam.LocalDefault != "" {
sc.Default = *apiParam.LocalDefault
sc.Default = apiParam.LocalDefault
}
if apiParam.LocalDisable {
sc.Extensions[consts.APISchemaExtendLocalDisable] = true

View File

@ -18,7 +18,7 @@ package convert
import (
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
)
var authTypes = map[common.AuthorizationType]consts.AuthzType{

View File

@ -18,7 +18,7 @@ package convert
import (
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
)
var assistTypeToFormat = map[consts.APIFileAssistType]string{

View File

@ -20,7 +20,7 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
)
var httpParamLocations = map[common.ParameterLocation]consts.HTTPParamLocation{

View File

@ -18,7 +18,7 @@ package convert
import (
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
)
var pluginTypes = map[common.PluginType]consts.PluginType{

View File

@ -23,7 +23,7 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
)

View File

@ -26,7 +26,7 @@ import (
"github.com/cloudwego/eino/schema"
"github.com/getkin/kin-openapi/openapi3"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"

View File

@ -16,7 +16,7 @@
package model
import "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
import "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
type ExecuteToolOption struct {
ProjectInfo *ProjectInfo

View File

@ -23,7 +23,7 @@ import (
"strings"
api "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt"
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
"github.com/coze-dev/coze-studio/backend/types/errno"

View File

@ -28,8 +28,8 @@ import (
"github.com/coze-dev/coze-studio/backend/api/model/app/bot_common"
productAPI "github.com/coze-dev/coze-studio/backend/api/model/marketplace/product_public_api"
"github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/convert"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/convert"
"github.com/coze-dev/coze-studio/backend/pkg/lang/ptr"
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"
)

View File

@ -21,8 +21,8 @@ import (
"github.com/cloudwego/eino/schema"
model "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
workflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
model "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
)

View File

@ -30,8 +30,8 @@ import (
reflect "reflect"
schema "github.com/cloudwego/eino/schema"
workflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
model "github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
workflow "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
model "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
entity "github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
gomock "go.uber.org/mock/gomock"
)

View File

@ -19,7 +19,7 @@ package search
import (
"context"
model "github.com/coze-dev/coze-studio/backend/crossdomain/search/model"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
)
type Search interface {

View File

@ -19,9 +19,9 @@ package variables
import (
"context"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
variables "github.com/coze-dev/coze-studio/backend/crossdomain/variables/model"
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"
)

View File

@ -23,7 +23,7 @@ import (
einoCompose "github.com/cloudwego/eino/compose"
"github.com/cloudwego/eino/schema"
workflowModel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
"github.com/coze-dev/coze-studio/backend/domain/workflow"
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
workflowEntity "github.com/coze-dev/coze-studio/backend/domain/workflow/entity"

View File

@ -14,12 +14,12 @@
* limitations under the License.
*/
package impl
package agentrun
import (
"context"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun"
"github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
agentrun "github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/service"
)

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package impl
package connector
import (
"context"
crossconnector "github.com/coze-dev/coze-studio/backend/crossdomain/connector"
model "github.com/coze-dev/coze-studio/backend/crossdomain/connector/model"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/connector"
crossconnector "github.com/coze-dev/coze-studio/backend/crossdomain/contract/connector"
connector "github.com/coze-dev/coze-studio/backend/domain/connector/service"
)

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package impl
package conversation
import (
"context"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/conversation"
model "github.com/coze-dev/coze-studio/backend/crossdomain/conversation/model"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/conversation"
crossconversation "github.com/coze-dev/coze-studio/backend/crossdomain/contract/conversation"
"github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
conversation "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/service"
)

View File

@ -14,12 +14,12 @@
* limitations under the License.
*/
package impl
package crossuser
import (
"context"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/user"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
"github.com/coze-dev/coze-studio/backend/domain/user/entity"
"github.com/coze-dev/coze-studio/backend/domain/user/service"
)

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package impl
package database
import (
"context"
@ -23,10 +23,10 @@ import (
"github.com/spf13/cast"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/database"
"github.com/coze-dev/coze-studio/backend/api/model/data/database/table"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/database"
model "github.com/coze-dev/coze-studio/backend/crossdomain/database/model"
crossdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/contract/database"
"github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
database "github.com/coze-dev/coze-studio/backend/domain/memory/database/service"
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package impl
package datacopy
import (
"context"
@ -22,7 +22,7 @@ import (
"gorm.io/gorm"
"github.com/coze-dev/coze-studio/backend/application/base/appinfra"
crossdatacopy "github.com/coze-dev/coze-studio/backend/crossdomain/datacopy"
crossdatacopy "github.com/coze-dev/coze-studio/backend/crossdomain/contract/datacopy"
"github.com/coze-dev/coze-studio/backend/domain/datacopy"
"github.com/coze-dev/coze-studio/backend/domain/datacopy/service"
)

View File

@ -14,16 +14,17 @@
* limitations under the License.
*/
package impl
package knowledge
import (
"context"
"errors"
"fmt"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/knowledge"
"github.com/coze-dev/coze-studio/backend/application/base/ctxutil"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge"
model "github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
crossknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/contract/knowledge"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/entity"
"github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
"github.com/coze-dev/coze-studio/backend/infra/document/parser"
@ -98,11 +99,11 @@ func (i *impl) Store(ctx context.Context, document *model.CreateDocumentRequest)
cs.Overlap = document.ChunkingStrategy.Overlap
req := &entity.Document{
Info: model.Info{
Info: knowledge.Info{
Name: document.FileName,
},
KnowledgeID: document.KnowledgeID,
Type: model.DocumentTypeText,
Type: knowledge.DocumentTypeText,
URL: document.FileURL,
Source: entity.DocumentSourceLocal,
ParsingStrategy: ps,
@ -167,7 +168,7 @@ func (i *impl) ListKnowledgeDetail(ctx context.Context, req *model.ListKnowledge
}
resp := &model.ListKnowledgeDetailResponse{
KnowledgeDetails: slices.Transform(response.Knowledge, func(a *model.Knowledge) *model.KnowledgeDetail {
KnowledgeDetails: slices.Transform(response.Knowledge, func(a *knowledge.Knowledge) *model.KnowledgeDetail {
return &model.KnowledgeDetail{
ID: a.ID,
Name: a.Name,

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package impl
package message
import (
"context"
@ -23,9 +23,9 @@ import (
"github.com/cloudwego/eino/schema"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/message"
model "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
crossagentrun "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agentrun"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
agententity "github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
"github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"
"github.com/coze-dev/coze-studio/backend/domain/workflow"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package impl
package message
import (
"context"
@ -24,8 +24,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/message"
message "github.com/coze-dev/coze-studio/backend/crossdomain/message/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/message"
crossmessage "github.com/coze-dev/coze-studio/backend/crossdomain/contract/message"
"github.com/coze-dev/coze-studio/backend/domain/conversation/message/entity"
"github.com/coze-dev/coze-studio/backend/domain/workflow"
"github.com/coze-dev/coze-studio/backend/infra/storage"

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package impl
package plugin
import (
"context"
crossplugin "github.com/coze-dev/coze-studio/backend/crossdomain/plugin"
"github.com/coze-dev/coze-studio/backend/crossdomain/plugin/model"
crossplugin "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
plugin "github.com/coze-dev/coze-studio/backend/domain/plugin/service"
"github.com/coze-dev/coze-studio/backend/infra/storage"

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package impl
package search
import (
"context"
crosssearch "github.com/coze-dev/coze-studio/backend/crossdomain/search"
model "github.com/coze-dev/coze-studio/backend/crossdomain/search/model"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/search"
crosssearch "github.com/coze-dev/coze-studio/backend/crossdomain/contract/search"
"github.com/coze-dev/coze-studio/backend/domain/search/service"
)

View File

@ -14,16 +14,16 @@
* limitations under the License.
*/
package impl
package agent
import (
"context"
"github.com/cloudwego/eino/schema"
crossagent "github.com/coze-dev/coze-studio/backend/crossdomain/agent"
model "github.com/coze-dev/coze-studio/backend/crossdomain/agent/model"
agentrun "github.com/coze-dev/coze-studio/backend/crossdomain/agentrun/model"
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/agentrun"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent"
crossagent "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agent"
singleagent "github.com/coze-dev/coze-studio/backend/domain/agent/singleagent/service"
"github.com/coze-dev/coze-studio/backend/pkg/lang/conv"
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"

View File

@ -14,12 +14,12 @@
* limitations under the License.
*/
package impl
package upload
import (
"context"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/upload"
crossupload "github.com/coze-dev/coze-studio/backend/crossdomain/contract/upload"
"github.com/coze-dev/coze-studio/backend/domain/upload/service"
)

View File

@ -14,15 +14,15 @@
* limitations under the License.
*/
package impl
package variables
import (
"context"
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/variables"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/kvmemory"
"github.com/coze-dev/coze-studio/backend/api/model/data/variable/project_memory"
crossvariables "github.com/coze-dev/coze-studio/backend/crossdomain/variables"
model "github.com/coze-dev/coze-studio/backend/crossdomain/variables/model"
crossvariables "github.com/coze-dev/coze-studio/backend/crossdomain/contract/variables"
"github.com/coze-dev/coze-studio/backend/domain/memory/variables/entity"
variables "github.com/coze-dev/coze-studio/backend/domain/memory/variables/service"
)

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package impl
package workflow
import (
"context"
@ -23,8 +23,8 @@ import (
einoCompose "github.com/cloudwego/eino/compose"
"github.com/cloudwego/eino/schema"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/workflow"
workflowModel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
crossworkflow "github.com/coze-dev/coze-studio/backend/crossdomain/contract/workflow"
"github.com/coze-dev/coze-studio/backend/domain/workflow"
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
workflowEntity "github.com/coze-dev/coze-studio/backend/domain/workflow/entity"

View File

@ -1,45 +0,0 @@
/*
* 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.
*/
package knowledge
import (
"context"
"github.com/coze-dev/coze-studio/backend/crossdomain/knowledge/model"
)
//go:generate mockgen -destination knowledgemock/knowledge_mock.go --package knowledgemock -source model.go
type Knowledge interface {
ListKnowledge(ctx context.Context, request *model.ListKnowledgeRequest) (response *model.ListKnowledgeResponse, err error)
GetKnowledgeByID(ctx context.Context, request *model.GetKnowledgeByIDRequest) (response *model.GetKnowledgeByIDResponse, err error)
Retrieve(ctx context.Context, req *model.RetrieveRequest) (*model.RetrieveResponse, error)
DeleteKnowledge(ctx context.Context, request *model.DeleteKnowledgeRequest) error
MGetKnowledgeByID(ctx context.Context, request *model.MGetKnowledgeByIDRequest) (response *model.MGetKnowledgeByIDResponse, err error)
Store(ctx context.Context, document *model.CreateDocumentRequest) (*model.CreateDocumentResponse, error)
Delete(ctx context.Context, r *model.DeleteDocumentRequest) (*model.DeleteDocumentResponse, error)
ListKnowledgeDetail(ctx context.Context, req *model.ListKnowledgeDetailRequest) (*model.ListKnowledgeDetailResponse, error)
}
var defaultSVC Knowledge
func DefaultSVC() Knowledge {
return defaultSVC
}
func SetDefaultSVC(c Knowledge) {
defaultSVC = c
}

Some files were not shown because too many files have changed in this diff Show More