gen

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenCmd = &cobra.Command{
	Use:     "generate",
	Short:   "Generate Manglekit assets",
	Aliases: []string{"gen"},
	Args:    cobra.NoArgs,
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}

Functions

func AddCommands

func AddCommands(rootCmd *cobra.Command)

func GetICLContent

func GetICLContent(userPath string) (string, error)

GetICLContent returns the In-Context Learning content. If userPath is provided, it reads from that file. Otherwise, it returns the embedded golden rules.

func ValidatePolicySyntax

func ValidatePolicySyntax(datalog, schemaDeclarations string) error

ValidatePolicySyntax checks if the generated Datalog code is valid using the Mangle engine.

Types

type GeneratedPolicy

type GeneratedPolicy struct {
	// DatalogContent contains the raw .dl code.
	DatalogContent string `json:"datalog_content"`
	// Explanation provides a human-readable summary of the logic.
	Explanation string `json:"explanation"`
}

GeneratedPolicy represents the structured response from the LLM.

func GenerateWithFeedback

func GenerateWithFeedback(ctx context.Context, gen core.TextGenerator, userReq string, domainVocab []string, schema *inductor.SchemaHint, iclContent string) (*GeneratedPolicy, error)

GenerateWithFeedback orchestrates the Teacher-Student protocol.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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