Skip to main content

PromptFragment

Project-scoped reusable prompt-template text. Profiles and other fragments include it with {{template "fragment_id" .}}; variables come from the conversation’s prompt_variables.

Usage profiles​

UsageFields and validation
In requestsView fields
In responsesView fields

In requests​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
fragmentIdstringOptionalStable template name, unique within the project library and used by include actions.
namestringOptionalDisplay name for the reusable prompt fragment.
contentstringOptionalRaw template text, supporting {{.variable}} placeholders and nested {{template "id" .}} includes.

In responses​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
fragmentIdstringOptionalStable template name, unique within the project library and used by include actions.
namestringOptionalDisplay name for the reusable prompt fragment.
contentstringOptionalRaw template text, supporting {{.variable}} placeholders and nested {{template "id" .}} includes.

Where used​

ReferenceRelationship
Create a prompt fragmentPOST /api/v1/prompt-fragments/create
Update a prompt fragmentPOST /api/v1/prompt-fragments/update
Get a prompt fragmentPOST /api/v1/prompt-fragments/get
Get a fragment set by versionPOST /api/v1/prompt-fragments/get-set
Import a prompt libraryPOST /api/v1/agent-profiles/import
List prompt fragmentsPOST /api/v1/prompt-fragments/list

Download the public reference contract.

Document: DOC-API-MODEL-prompt-fragment.