diff --git a/src/main/java/com/embabel/template/agent/WriteAndReviewAgent.java b/src/main/java/com/embabel/template/agent/WriteAndReviewAgent.java index 943857a..f57c6b3 100644 --- a/src/main/java/com/embabel/template/agent/WriteAndReviewAgent.java +++ b/src/main/java/com/embabel/template/agent/WriteAndReviewAgent.java @@ -35,7 +35,6 @@ import java.time.ZoneId; import java.time.format.DateTimeFormatter; - abstract class Personas { static final Persona WRITER = Persona.create( "Roald Dahl", @@ -106,26 +105,6 @@ class WriteAndReviewAgent { this.reviewWordCount = reviewWordCount; } - @Action - Story craftStory(UserInput userInput) { - return PromptRunner.usingLlm( - LlmOptions.fromCriteria(AutoModelSelectionCriteria.INSTANCE) - .withTemperature(0.9) // Higher temperature for more creative output - ).withPromptContributor(Personas.WRITER) - .createObject(String.format(""" - Craft a short story in %d words or less. - The story should be engaging and imaginative. - Use the user's input as inspiration if possible. - If the user has provided a name, include it in the story. - - # User input - %s - """, - storyWordCount, - userInput.getContent() - ).trim(), Story.class); - } - @AchievesGoal(description="The story has been crafted and reviewed by a book reviewer") @Action ReviewedStory reviewStory(UserInput userInput, Story story, OperationContext context) { @@ -155,4 +134,24 @@ ReviewedStory reviewStory(UserInput userInput, Story story, OperationContext con Personas.REVIEWER ); } + + @Action + Story craftStory(UserInput userInput) { + return PromptRunner.usingLlm( + LlmOptions.fromCriteria(AutoModelSelectionCriteria.INSTANCE) + .withTemperature(0.9) // Higher temperature for more creative output + ).withPromptContributor(Personas.WRITER) + .createObject(String.format(""" + Craft a short story in %d words or less. + The story should be engaging and imaginative. + Use the user's input as inspiration if possible. + If the user has provided a name, include it in the story. + + # User input + %s + """, + storyWordCount, + userInput.getContent() + ).trim(), Story.class); + } } \ No newline at end of file