feat: remove fallback mode and max AI reply rounds from AIAgent model and related components
This commit is contained in:
@@ -3,6 +3,8 @@ package registry
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"cs-agent/internal/pkg/toolx"
|
||||
|
||||
einotool "github.com/cloudwego/eino/components/tool"
|
||||
)
|
||||
|
||||
@@ -28,7 +30,7 @@ func (r *Registry) Resolve(ctx Context) (*ToolSet, error) {
|
||||
}
|
||||
toolCode := strings.TrimSpace(toolDef.Code())
|
||||
if len(allowedToolCodes) > 0 {
|
||||
if _, ok := allowedToolCodes[toolCode]; !ok {
|
||||
if _, ok := allowedToolCodes[toolCode]; !ok && !isAlwaysAllowedToolCode(toolCode) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -63,3 +65,7 @@ func makeAllowedToolCodeSet(input []string) map[string]struct{} {
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func isAlwaysAllowedToolCode(toolCode string) bool {
|
||||
return strings.TrimSpace(toolCode) == toolx.GraphHandoffConversationToolCode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user