Download the PHP package semitexa/prompt without Composer
On this page you can find all versions of the php package semitexa/prompt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package prompt
semitexa/prompt
A prompt catalog for the Semitexa Framework — an "ORM for prompts".
LLM prompt text tends to sprawl: system prompts hard-coded as heredocs at every call site, few-shot examples buried inline, no way to see what was actually sent. This package gives prompts the same treatment the framework gives skills and translations: discoverable, addressable, composable records.
Install
Included in every project created by the installer (https://semitexa.com/install.sh).
What it gives you
- Models — a
PromptTemplateis the durable, id-keyed record of a prompt. - A repository —
PromptRegistrydiscovers every#[AsPrompt]class and exposes the catalog behindPromptRepositoryInterface. - Relationships — prompt bodies are Twig templates: they compose with
{{ include('other.id') }}and bind runtime data via variables ({{ name }}). - Per-tenant overrides —
LayeredPromptRepositoryresolves a tenant's DB override (prompt_override, versioned inprompt_override_history) before the code catalog;prompt_guidanceadds operator guidance where a template prints{{ guidance }}. - Observability —
prompt:list/prompt:show/prompt:renderlet you inspect exactly what an LLM would receive, before you send it.
The package is provider-agnostic: it renders text and role-tagged messages,
never a wire format. A downstream adapter (e.g. in semitexa/llm) maps a
RenderedPrompt onto whatever the provider needs.
Defining a prompt
The class carries metadata; the body is a Twig file under the owning package's
or module's resources/prompts/ (named by template:, or {id}.twig by default).
Ship few-shot examples by also implementing FewShotProviderInterface. A class
can instead return its body from PromptDefinitionInterface::system(); the
registry uses that only when no template file exists.
Rendering
A prompt class that implements BoundPromptInterface can be passed to
render() directly; its template reads it as prompt (for example
{{ prompt.assistantName }} in core.identity).
Rendering is fail-closed: an unbound variable, an unknown include, or a
broken template raises PromptRenderException rather than sending a
half-substituted prompt.
CLI
Docs: https://semitexa.com/docs/prompt
License
MIT — part of the Semitexa Ultimate distribution.
All versions of prompt with dependencies
semitexa/core Version *
semitexa/orm Version *
twig/twig Version ^3.10
semitexa/update Version *