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

prompt

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CHARS_PER_TOKEN = 5

how many characters per token on average

View Source
const MAX_TOKENS_IN_PROMPT = 8000

Variables

View Source
var SystemPromptBytes []byte

Functions

func BuildDetectionUserPrompt

func BuildDetectionUserPrompt(ctx context.Context, detectionContext *model.DetectionContext, debugEnabled ...bool) (string, error)

Types

type PromptTemplate

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

PromptTemplate is a simple wrapper around Go's text/template

func NewPromptTemplate

func NewPromptTemplate(templateStr string, _ []string) *PromptTemplate

NewPromptTemplate creates a new prompt template using Go's text/template

func (*PromptTemplate) Format

func (pt *PromptTemplate) Format(variables map[string]any) (string, error)

Format executes the template with the given variables

Jump to

Keyboard shortcuts

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