prompt

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prompt

type Prompt struct {
	// Human readable name of the prompt, used for logging
	Name string

	// Prompt template, using Golang template syntax, e.g. "What is the capital of {{.Country}}?"
	Prompt string

	// Optional field to specify which LLM to use, e.g. "base", "micro", "small", "medium", "large", "xlarge"
	RunsOn string

	// Optional field to specify how many times to retry the prompt in case of failure.
	// Default is 3
	Retry int

	// Optional debugging mode
	Debug bool

	// Input/ Output schema
	Schema Schema

	// List of servers required for the task
	Servers []Server
}

Prompt is a markdown document with YAMLs based metadata, it containts: * prompt itself as a temaplate with variables * expected input/output format (json schema) * list of servers

func Parse

func Parse(r io.Reader) (*Prompt, error)

Build a prompt from a markdown content, the content might contain YAML metadata and must markdown content

func ParseFile

func ParseFile(fs fs.FS, path string) (*Prompt, error)

Build a prompt from a markdown file, the file might contain YAML metadata and must markdown content

type Schema

type Schema struct {
	Format string
	Input  *jsonschema.Schema
	Reply  *jsonschema.Schema
}

Input and output schema, using JSON Schema format, e.g. {"type": "object", "properties": {"Country": {"type": "string"}}}

type Server

type Server struct {
	Type    string
	Name    string
	Command []string
	Url     string
}

Server specification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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