Package com.tnsai.prompt.strategy
Class EnhancedPrompt
java.lang.Object
com.tnsai.prompt.strategy.EnhancedPrompt
Result of enhancing a prompt with strategies.
Contains the system prompt (with strategy instructions) and the original user message, ready for use with an LLM client.
Usage
EnhancedPrompt prompt = enhancer.enhance("What is the capital of France?");
// Use with LLM client
ChatResponse response = client.chat(
prompt.getUserMessage(),
Optional.of(prompt.getSystemPrompt()),
Optional.empty(),
Optional.empty()
);
// For multi-pass strategies
if (prompt.requiresMultiPass()) {
// Handle verification or refinement passes
}
-
Constructor Summary
ConstructorsConstructorDescriptionEnhancedPrompt(String systemPrompt, String userMessage, List<PromptStrategy> strategies, PromptEnhancer.OutputFormat outputFormat) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if confidence scoring is expected in the response.booleanReturns true if structured thinking sections are expected.booleanReturns true if verification questions are expected.Combines system prompt and user message into a single prompt.intGets the estimated additional token overhead from enhancement.Gets the output format if specified.Gets the list of applied strategies.Gets the enhanced system prompt with strategy instructions.Gets the system prompt as an Optional for convenience with LLMClient.Gets the original user message.booleanReturns true if any strategy requires multiple LLM calls.booleanReturns true if any strategy requires post-processing.toString()
-
Constructor Details
-
EnhancedPrompt
public EnhancedPrompt(String systemPrompt, String userMessage, List<PromptStrategy> strategies, PromptEnhancer.OutputFormat outputFormat)
-
-
Method Details
-
getSystemPrompt
Gets the enhanced system prompt with strategy instructions. -
getUserMessage
Gets the original user message. -
getSystemPromptOptional
Gets the system prompt as an Optional for convenience with LLMClient. -
getStrategies
Gets the list of applied strategies. -
getOutputFormat
Gets the output format if specified. -
requiresMultiPass
public boolean requiresMultiPass()Returns true if any strategy requires multiple LLM calls. -
requiresPostProcessing
public boolean requiresPostProcessing()Returns true if any strategy requires post-processing. -
expectsConfidenceScore
public boolean expectsConfidenceScore()Returns true if confidence scoring is expected in the response. -
expectsStructuredThinking
public boolean expectsStructuredThinking()Returns true if structured thinking sections are expected. -
expectsVerification
public boolean expectsVerification()Returns true if verification questions are expected. -
getCombinedPrompt
Combines system prompt and user message into a single prompt. Useful for models that don't support separate system prompts. -
getEstimatedOverhead
public int getEstimatedOverhead()Gets the estimated additional token overhead from enhancement. Useful for cost estimation. -
toString
-