Prompt¶
This docs was updated at: 2026-02-23
com.paragon.prompts.Prompt ยท Class
Represents an immutable text prompt that can contain template expressions.
A Prompt instance manages text content that can include various template features like
variable placeholders ({{variable_name}}), conditional blocks ({{#if
condition}...{{/if}}}), and iteration blocks ({{#each items}...{{/each}}}).
This class is immutable and thread-safe. All template processing methods return new Prompt instances.
Builder Features¶
- Order Independent: All builder methods can be called in any order
- No Dependencies: No method requires another method to be called first
- Additive: Methods add to existing configuration rather than replacing
- Multi-language: Supports English (US) and Portuguese (BR)
Builder Usage Examples¶
// Methods can be called in any order - these produce equivalent results:
Prompt prompt1 = Prompt.builder()
.task("Analyze the data")
.role("data analyst")
.withChainOfThought()
.build();
Prompt prompt2 = Prompt.builder()
.withChainOfThought()
.role("data analyst")
.task("Analyze the data")
.build();
// Multi-language support
Prompt ptBrPrompt = Prompt.builder()
.language(Language.PT_BR)
.role("analista de dados")
.task("Analise os dados de vendas")
.build();
Since: 1.0
Methods¶
of¶
Creates a new Prompt from text content.
fromText¶
Creates a new Prompt from text content (alias for .of(String)).
empty¶
Creates a new empty Prompt.
builder¶
Creates a new Builder for constructing prompts with best practices.
Order Independence: All builder methods can be called in any order. The final prompt
is assembled when Builder.build() is called.
No Dependencies: No method requires another method to be called. Each method is independent and optional.
Returns
a new Builder instance
builder¶
Creates a Builder pre-configured for a specific use case.
builder¶
Creates a Builder with a specific language.
Parameters
| Name | Description |
|---|---|
language |
the language for the prompt |
Returns
a new Builder with the language set
forTask¶
Creates a Builder starting with a specific task instruction.
forExtraction¶
Creates a Builder configured for extracting structured data.
forClassification¶
Creates a Builder configured for classification tasks.
forReasoning¶
Creates a Builder configured for multi-step reasoning problems.
forCode¶
Creates a Builder configured for code generation.
forRAG¶
Creates a Builder configured for RAG (Retrieval Augmented Generation).
forConversation¶
Creates a Builder configured for conversational AI.
forTranslation¶
Creates a Builder configured for translation tasks.
forSummarization¶
Creates a Builder configured for summarization tasks.
forQA¶
Creates a Builder configured for question answering.
forCreativeWriting¶
Creates a Builder configured for creative writing.
forDataAnalysis¶
Creates a Builder configured for data analysis.
forInterview¶
Configures for conducting an interview.
forDebate¶
Configures for a debate format.
forRolePlay¶
Configures for role-playing scenarios.
forSWOTAnalysis¶
Configures for SWOT analysis.
forProsConsAnalysis¶
Configures for pros and cons analysis.
forDecisionMaking¶
Configures for decision-making framework.
forRootCauseAnalysis¶
Configures for root cause analysis (5 Whys).
forEmailDrafting¶
Configures for email drafting.
forTechnicalWriting¶
Configures for technical writing.
forAcademicWriting¶
Configures for scientific/academic writing.
forMarketingCopy¶
Configures for persuasive/marketing copy.
forStorytelling¶
Configures for storytelling/narrative.
forLegalAnalysis¶
Configures for legal document analysis (with disclaimer).
forMedicalInformation¶
Configures for medical information (with strong disclaimer).
forLanguageLearning¶
Configures for language learning assistance.
forELI5¶
Configures for ELI5 (Explain Like I'm 5) style explanations.
forExpertExplanation¶
Configures for expert-level explanation.
forQuizGeneration¶
Configures for quiz/test generation.
forAPIDocumentation¶
Configures for API documentation generation.
forChangelog¶
Configures for changelog generation.
forUserStories¶
Configures for user story generation.
forDataVisualization¶
Configures for data visualization suggestions.
forAccessibilityReview¶
Configures for accessibility review.
forSecurityReview¶
Configures for security review.
forPerformanceOptimization¶
Configures for performance optimization suggestions.
bulletPointsOnly¶
Requests a response in bullet points only.
executiveSummary¶
Requests an executive summary style response.
stepByStep¶
Requests step-by-step format.
wordCount¶
Requests response with specific word count.
sentenceCount¶
Requests response with specific sentence count.
avoid¶
Configures to avoid certain topics or words.
focusOn¶
Configures to focus on specific topics.
withFallback¶
Adds a fallback instruction for when the AI cannot complete the task.
withSelfAssessment¶
Requests self-assessment of the response quality.
handleAmbiguity¶
Configures for handling ambiguous inputs.
difficultyLevel¶
Sets the difficulty level for explanations or content.
thinkingStyle¶
Sets the thinking style to use.
thinkingStyles¶
Combines multiple thinking styles.
withNumberedReferences¶
Requests numbered references/citations in the response.
withInlineCitations¶
Requests inline citations.
forDomain¶
Configures for a specific domain/industry.
withTimeContext¶
Adds time constraints context.
withRegionalContext¶
Adds geographical/regional context.
withSummaryAtEnd¶
Requests a summary at the end of the response.
withTLDR¶
Requests a TL;DR at the beginning of the response.
withStructuredThinking¶
Configures for structured thinking with explicit sections.
includeExamples¶
Requests examples to be included in the response.
useAnalogies¶
Requests analogies to be used in explanations.
neutral¶
Configures for balanced/neutral perspective.
enthusiastic¶
Configures for enthusiastic/positive tone.
empathetic¶
Configures for empathetic response style.
actionable¶
Configures response to be actionable.
withMetrics¶
Requests specific metrics or quantification.
asTimeline¶
Requests timeline or schedule format.
asPrioritizedList¶
Requests prioritized list format.
quickResponse¶
Configures for quick/immediate response needs.
comprehensive¶
Configures for comprehensive/thorough response.
forVersion¶
Adds version/compatibility context.
forUseCase¶
Specifies the intended use case for the response.
withBudgetContext¶
Specifies budget constraints context.
compliantWith¶
Configures for compliance with specific standards.