|
|
|
@ -21,7 +21,9 @@ import ( |
|
|
|
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/singleagent" |
|
|
|
|
crossagent "github.com/coze-dev/coze-studio/backend/crossdomain/contract/agent" |
|
|
|
|
"github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity" |
|
|
|
|
"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/types/errno" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func getAgentHistoryRounds(agentInfo *singleagent.SingleAgent) int32 { |
|
|
|
@ -32,14 +34,18 @@ func getAgentHistoryRounds(agentInfo *singleagent.SingleAgent) int32 { |
|
|
|
|
return conversationTurns |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func getAgentInfo(ctx context.Context, agentID int64, isDraft bool) (*singleagent.SingleAgent, error) { |
|
|
|
|
func getAgentInfo(ctx context.Context, agentID int64, isDraft bool, connID int64) (*singleagent.SingleAgent, error) { |
|
|
|
|
agentInfo, err := crossagent.DefaultSVC().ObtainAgentByIdentity(ctx, &singleagent.AgentIdentity{ |
|
|
|
|
AgentID: agentID, |
|
|
|
|
IsDraft: isDraft, |
|
|
|
|
AgentID: agentID, |
|
|
|
|
IsDraft: isDraft, |
|
|
|
|
ConnectorID: connID, |
|
|
|
|
}) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
if agentInfo == nil { |
|
|
|
|
return nil, errorx.New(errno.ErrAgentNotExists) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return agentInfo, nil |
|
|
|
|
} |
|
|
|
|