geocodebook

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader loads spatial SQL codebook patterns from <workspace>/geo-codebook.

func NewLoader

func NewLoader(workspacePath string) *Loader

NewLoader creates a codebook loader for the workspace.

func (*Loader) BuildSummary

func (l *Loader) BuildSummary() (string, error)

BuildSummary returns a concise prompt-ready summary of available codebook patterns.

func (*Loader) ListPatterns

func (l *Loader) ListPatterns(intent string, limit int) ([]Match, error)

ListPatterns ranks patterns against a freeform intent.

func (*Loader) RenderPattern

func (l *Loader) RenderPattern(name string, values map[string]string) (*RenderedPattern, error)

RenderPattern renders a named SQL pattern with supplied variables.

type Match

type Match struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
	Verified    bool     `json:"verified"`
	SuccessRate float64  `json:"success_rate"`
	Score       int      `json:"score"`
	Source      string   `json:"source"`
}

Match describes a ranked pattern result for an intent lookup.

type Pattern

type Pattern struct {
	Name        string              `yaml:"name" json:"name"`
	Description string              `yaml:"description" json:"description"`
	Tags        []string            `yaml:"tags" json:"tags"`
	Template    string              `yaml:"template" json:"template"`
	Variables   map[string]Variable `yaml:"variables" json:"variables"`
	Verified    bool                `yaml:"verified" json:"verified"`
	SuccessRate float64             `yaml:"success_rate" json:"success_rate"`
	Source      string              `yaml:"-" json:"source"`
}

Pattern describes a reusable spatial SQL pattern.

type RenderedPattern

type RenderedPattern struct {
	Pattern   string            `json:"pattern"`
	SQL       string            `json:"sql"`
	Variables map[string]string `json:"variables"`
	Verified  bool              `json:"verified"`
	Source    string            `json:"source"`
}

RenderedPattern is a fully rendered SQL pattern.

type Variable

type Variable struct {
	Type        string `yaml:"type" json:"type"`
	Description string `yaml:"description" json:"description"`
	Required    bool   `yaml:"required" json:"required"`
	Default     string `yaml:"default" json:"default"`
}

Variable describes a codebook template variable.

Jump to

Keyboard shortcuts

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