rules

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Input

func Input(_ *http.Request, request interface{}) (bool, string, error)

Types

type InputTypes

type InputTypes struct {
	LanguageDetection  string
	PromptInjection    string
	PIIFilter          string
	InvisibleChars     string
	Moderation         string
	LlamaGuard         string
	PromptGuard        string
	LangKit            string
	VigilLLM           string
	NvidiaNimJailbreak string
}

type LanguageScore

type LanguageScore struct {
	Label string  `json:"label"`
	Score float64 `json:"score"`
}

type Rule

type Rule struct {
	Prompt interface{} `json:"prompt"`
	Config lib.Config  `json:"config"`
}

type RuleInspection

type RuleInspection struct {
	CheckResult       bool                   `json:"check_result"`
	Score             float64                `json:"score"`
	AnonymizedContent string                 `json:"anonymized_content"`
	Details           map[string]interface{} `json:"details"`
}

type RuleResult

type RuleResult struct {
	Match      bool           `json:"match"`
	Inspection RuleInspection `json:"inspection"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL