|
19 | 19 | import com.embabel.agent.api.annotation.Action; |
20 | 20 | import com.embabel.agent.api.annotation.Agent; |
21 | 21 | import com.embabel.agent.api.annotation.Export; |
22 | | -import com.embabel.agent.api.common.OperationContext; |
| 22 | +import com.embabel.agent.api.common.Ai; |
23 | 23 | import com.embabel.agent.domain.io.UserInput; |
24 | 24 | import com.embabel.agent.domain.library.HasContent; |
25 | 25 | import com.embabel.agent.prompt.persona.Persona; |
@@ -105,9 +105,8 @@ public String getContent() { |
105 | 105 | description = "The story has been crafted and reviewed by a book reviewer", |
106 | 106 | export = @Export(remote = true, name = "writeAndReviewStory")) |
107 | 107 | @Action |
108 | | - ReviewedStory reviewStory(UserInput userInput, Story story, OperationContext context) { |
109 | | - var review = context |
110 | | - .ai() |
| 108 | + ReviewedStory reviewStory(UserInput userInput, Story story, Ai ai) { |
| 109 | + var review = ai |
111 | 110 | .withAutoLlm() |
112 | 111 | .withPromptContributor(Personas.REVIEWER) |
113 | 112 | .generateText(String.format(""" |
@@ -135,8 +134,8 @@ ReviewedStory reviewStory(UserInput userInput, Story story, OperationContext con |
135 | 134 | } |
136 | 135 |
|
137 | 136 | @Action |
138 | | - Story craftStory(UserInput userInput, OperationContext context) { |
139 | | - return context.ai() |
| 137 | + Story craftStory(UserInput userInput, Ai ai) { |
| 138 | + return ai |
140 | 139 | // Higher temperature for more creative output |
141 | 140 | .withLlm(LlmOptions |
142 | 141 | .withAutoLlm() // You can also choose a specific model or role here |
|
0 commit comments