ValidateDynamicEntries (component/dynamic_params.go)

ragflow · internal/agent/component/dynamic_params.go · go · Apache-2.0
automation

Validation logic for dynamic agent parameters, ensuring no blank or empty entries in DSL configurations.

// Source: https://github.com/infiniflow/ragflow | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package component

import (
	"errors"
	"fmt"
	"strings"
)

// ErrCompilationTemplateRequired identifies a Compiler component without a
// selected compilation template or template group.
var ErrCompilationTemplateRequired = errors.New("Compilation Template Group does not support empty value")

// ValidateDynamicEntries rejects blank values in repeatable Agent parameters.
func ValidateDynamicEntries(dsl map[string]any) error {
	return validateDynamicEntries(dsl)
}

func validateDynamicEntries(value any) error {
	switch node := value.(type) {
	case map[string]any:
		if name, ok := node["

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key