File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
task-execution/src/main/java/com/javaaidev/agenticpatterns/taskexecution Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11# Agentic Patterns
22
3+ Reference implementation of [ Agentic Patterns] ( https://javaaidev.com/docs/agentic-patterns/intro/ )
4+
5+ This reference implementation is designed to be reusable.
Original file line number Diff line number Diff line change 1212import org .springframework .ai .chat .client .ChatClient .ChatClientRequestSpec ;
1313import org .springframework .core .ParameterizedTypeReference ;
1414
15+ /**
16+ * Task Execution Agent, refer to the <a
17+ * href="https://javaaidev.com/docs/agentic-patterns/patterns/task-execution">pattern</a>
18+ *
19+ * @param <Request> Type of task input
20+ * @param <Response> Type of task output
21+ */
1522public abstract class TaskExecutionAgent <Request , Response > extends Agent {
1623
24+ /**
25+ * Get the prompt template
26+ *
27+ * @return prompt template
28+ */
1729 protected abstract String getPromptTemplate ();
1830
1931 @ Nullable
@@ -27,6 +39,12 @@ protected TaskExecutionAgent(@Nullable Type responseType) {
2739 this .responseType = responseType ;
2840 }
2941
42+ /**
43+ * Prepare for the values of variables in the prompt template
44+ *
45+ * @param request Task input
46+ * @return Values of values
47+ */
3048 @ Nullable
3149 protected Map <String , Object > getPromptContext (@ Nullable Request request ) {
3250 return new HashMap <>();
You can’t perform that action at this time.
0 commit comments