Help us shape the future of Go! Take the 2026 Go Developer Survey

prompt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package prompt compiles prompt blocks into deterministic LLM input.

Prompt blocks are model-facing instructions. They are not tools, memory, policy, or orchestration. The default compiler sorts ModeCacheable blocks before ModeDynamic blocks, then sorts by lower Priority, then by Name. Empty block content is omitted from compiled text, and non-empty block content is joined with newlines.

Do not put secrets or raw sensitive data into prompt blocks unless the host intentionally wants that data in model context.

Index

Constants

View Source
const (
	ModeCacheable = ports.PromptModeCacheable
	ModeDynamic   = ports.PromptModeDynamic
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block = ports.PromptBlock

type Compiled

type Compiled = ports.CompiledPrompt

type Compiler

type Compiler struct{}

func NewCompiler

func NewCompiler() *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(ctx context.Context, blocks []Block) (*Compiled, error)

type Mode

type Mode = ports.PromptMode

Jump to

Keyboard shortcuts

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