Interface Prompt
- All Known Implementing Classes:
TextPrompt
public interface Prompt
A named, identified, guardrailed unit of instructional content destined for an LLM.
Every Prompt is produced through the Prompts facade, which is the only
public entry point for obtaining Prompt instances. Direct construction is not supported.
A Prompt has three invariants:
key()- semantic identifier; first-class. Two Prompts with identical content under different keys are distinct Prompts.content()- canonical content as aJsonNode. Text prompts produceTextNode; structured prompts (e.g., skills) produceObjectNode.context()- lineage metadata (content hash, produced-at, optional version/variant). Not serialized over the wire; marked@JsonIgnore. Represents identity, not content.
Polymorphism of content shape lives inside JsonNode, not in the Prompt type.
The single shipped implementation is TextPrompt.
- Since:
- 0.1 (2026-04-20)
- Author:
- Andrey Santrosyan
-
Method Details
-
key
String key()Semantic identifier. Shape:<domain>.<feature>.<role>, e.g.pharma.drugbank.system-msg. -
content
com.fasterxml.jackson.databind.JsonNode content()Canonical content:TextNodefor text,ObjectNodefor structured prompts. -
context
PromptContext context()Lineage metadata. Never serialized into the wire or persisted within the Prompt itself.
-