prompts

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package prompts provides the Celeste persona prompt.

Slider anchor-point prompt snippets.

Each slider has 4 authored anchor points (indices 0-3, corresponding to slider values 0/3/7/10). Each anchor is a prompt fragment that composes into the system prompt at position 6 (after voice_and_tone, before active register). The slider value snaps to the nearest anchor via config.SnapToAnchor.

Authoring rules (P1-P6 from celeste-core-persona):

  • P1: technique over tokens. No canonized catchphrases.
  • P2: no developer vocabulary in LLM-facing text.
  • P3: rotate, don't canonize. Examples are one-of-many.
  • P4: restraint blocks for known failure modes.
  • P5: invariants inherit; anchors never displace them.
  • P6: no external style lifts.

User identity prompt composition.

Injects a block into the system prompt that tells Celeste who she's currently talking to. Without this, the persona's hardcoded references to Kusanagi cause her to address every user as "twin" / "Onii-chan."

When user is Kusanagi: no override needed — the persona handles it. When user is anyone else: calibrate relationship dynamic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeSliderPrompt added in v1.10.0

func ComposeSliderPrompt(cfg *config.SliderConfig) string

ComposeSliderPrompt builds the voice-modulation prompt fragment from the current slider config. This fragment inserts at position 6 in the system prompt assembly order. Returns an empty string if all sliders are at default (no modulation needed).

func ComposeUserPrompt added in v1.10.0

func ComposeUserPrompt(user *config.UserIdentity) string

ComposeUserPrompt builds the user-identity prompt block. Returns empty string for Kusanagi (persona already handles him).

func GetContentPrompt

func GetContentPrompt(platform, format, tone, topic string) string

GetContentPrompt returns a prompt tailored for content generation.

func GetNSFWPrompt

func GetNSFWPrompt() string

GetNSFWPrompt returns an enhanced prompt for NSFW mode.

func GetSystemPrompt

func GetSystemPrompt(skipPrompt bool) string

GetSystemPrompt generates the system prompt from the essence, with slider-composed voice modulation inserted at position 6 in the assembly order.

func GetSystemPromptWithContext added in v1.8.0

func GetSystemPromptWithContext(skipPersona bool, grimoireContent string, gitSnapshot string) string

GetSystemPromptWithContext generates the system prompt and appends optional grimoire and git snapshot context.

Types

type BehaviorTier

type BehaviorTier struct {
	ScoreRange  string `json:"score_range"`
	Behavior    string `json:"behavior"`
	Description string `json:"description"`
}

BehaviorTier defines behavior based on score.

type CelesteEssence

type CelesteEssence struct {
	Version     string `json:"version"`
	Character   string `json:"character"`   // v1.x
	Description string `json:"description"` // v1.x
	Voice       struct {
		Style       string   `json:"style"`
		Constraints []string `json:"constraints"`
		EmojiUsage  string   `json:"emoji_usage"`
		EmotesUsage string   `json:"emotes_usage"`
	} `json:"voice"` // v1.x
	CoreRules        []string          `json:"core_rules"`     // v1.x
	BehaviorTiers    []BehaviorTier    `json:"behavior_tiers"` // v1.x
	Safety           SafetyConfig      `json:"safety"`         // v1.x
	OperationalLaws  map[string]string `json:"operational_laws"`
	InteractionRules []string          `json:"interaction_rules"`
	KnowledgeUsage   string            `json:"knowledge_usage"`
	// v3.x fields
	SystemPrompt  string `json:"system_prompt"`  // canonical prompt blob (v3.0.0+)
	CanonicalName string `json:"canonical_name"` // "Celeste" (v3.0.0+)
	CharacterID   string `json:"character_id"`   // "celeste" (v3.0.0+)
}

CelesteEssence holds the parsed essence configuration. Supports both v1.x (structured fields) and v3.x (system_prompt blob) schemas.

func LoadEssence

func LoadEssence() (*CelesteEssence, error)

LoadEssence loads the Celeste essence from file or embedded.

type SafetyConfig

type SafetyConfig struct {
	PlatformSafety   string   `json:"platform_safety"`
	RefuseList       []string `json:"refuse_list"`
	SafeAlternatives string   `json:"safe_alternatives"`
}

SafetyConfig defines safety constraints.

Jump to

Keyboard shortcuts

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