Skip to content

Commit df70998

Browse files
committed
Improve externalization
1 parent 25ce1ec commit df70998

File tree

2 files changed

+26
-43
lines changed

2 files changed

+26
-43
lines changed

examples-java/src/main/java/com/embabel/example/bookwriter/BookWriter.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.embabel.agent.api.annotation.*;
44
import com.embabel.agent.api.common.OperationContext;
5-
import com.embabel.agent.config.models.OpenAiModels;
65
import com.embabel.agent.core.CoreToolGroups;
76
import com.embabel.agent.domain.library.ResearchReport;
87
import com.embabel.agent.prompt.persona.RoleGoalBackstory;
@@ -63,45 +62,6 @@ record BookWriterConfig(
6362
RoleGoalBackstory outliner,
6463
RoleGoalBackstory writer
6564
) {
66-
public BookWriterConfig {
67-
researcherLlm = (researcherLlm != null)
68-
? researcherLlm
69-
: LlmOptions.withModel(OpenAiModels.GPT_41_MINI);
70-
writerLlm = (writerLlm != null)
71-
? writerLlm
72-
: LlmOptions.withModel(OpenAiModels.GPT_41);
73-
maxConcurrency = (maxConcurrency == 0) ? 8 : maxConcurrency;
74-
researcher = researcher != null ? researcher : RoleGoalBackstory
75-
.withRole("Researcher")
76-
.andGoal("""
77-
Gather comprehensive information about a topic that will be used to create an organized and well-structured book outline.
78-
Consider the author's desired goal for the book.
79-
""")
80-
.andBackstory("""
81-
You're a seasoned researcher, known for gathering the best sources and understanding the key elements of any topic.\s
82-
You aim to collect all relevant information so the book outline can be accurate and informative.
83-
""");
84-
outliner = outliner != null ? outliner : RoleGoalBackstory
85-
.withRole("Outliner")
86-
.andGoal("""
87-
Based on research, generate a book outline about the given topic.
88-
The generated outline should include all chapters in sequential order and provide a title and description for each chapter.
89-
Consider the author's desired goal for the book
90-
""")
91-
.andBackstory("""
92-
You are a skilled organizer, great at turning scattered information into a structured format.
93-
Your goal is to create clear, concise chapter outlines with all key topics and subtopics covered.
94-
""");
95-
writer = writer != null ? writer : RoleGoalBackstory
96-
.withRole("Chapter Writer")
97-
.andGoal("""
98-
Write a well-structured chapter for a book based on the provided chapter title, goal, and outline.
99-
""")
100-
.andBackstory("""
101-
You are an exceptional writer, known for producing engaging, well-researched, and informative content.
102-
You excel at transforming complex ideas into readable and well-organized chapters.
103-
""");
104-
}
10565
}
10666

10767

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
examples:
22
book-writer:
33

4+
max-concurrency: 8
5+
46
researcher-llm:
57
model: gpt-4.1-nano
68
temperature: 0.7
79

10+
writer-llm:
11+
model: gpt-4.1-mini
12+
13+
814
researcher:
9-
role: >
10-
Researcher
15+
role: Researcher
1116
goal: >
1217
Gather comprehensive information about a topic that will be used
1318
to create an organized and well-structured book outline.
@@ -16,4 +21,22 @@ examples:
1621
backstory: >
1722
You are an experienced researcher skilled in finding the most relevant and up-to-date information on any given topic.
1823
Your job is to provide insightful data that supports and enriches the writing process for the chapter.
19-
24+
25+
outliner:
26+
role: Outliner
27+
goal: >
28+
Based on research, generate a book outline about the given topic.
29+
The generated outline should include all chapters in sequential order and provide a title and description for each chapter.
30+
Consider the author's desired goal for the book
31+
backstory: >
32+
You are a skilled organizer, great at turning scattered information into a structured format.
33+
Your goal is to create clear, concise chapter outlines with all key topics and subtopics covered.
34+
35+
36+
writer:
37+
role: Chapter Writer
38+
goal: >
39+
Write a well-structured chapter for a book based on the provided chapter title, goal, and outline.
40+
backstory: >
41+
You are an exceptional writer, known for producing engaging, well-researched, and informative content.
42+
You excel at transforming complex ideas into readable and well-organized chapters.

0 commit comments

Comments
 (0)