Skip to content

Commit 0b9dd4a

Browse files
committed
Agent Classes
Signed-off-by: Dmitrii Tikhomirov <[email protected]>
1 parent 232437a commit 0b9dd4a

File tree

1 file changed

+106
-0
lines changed
  • fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic

1 file changed

+106
-0
lines changed

fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/Agents.java

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package io.serverlessworkflow.fluent.agentic;
1717

1818
import dev.langchain4j.agentic.Agent;
19+
import dev.langchain4j.agentic.internal.AgentInstance;
1920
import dev.langchain4j.service.UserMessage;
2021
import dev.langchain4j.service.V;
2122
import java.util.List;
@@ -34,4 +35,109 @@ interface MovieExpert {
3435
@Agent
3536
List<String> findMovie(@V("mood") String mood);
3637
}
38+
39+
interface SettingAgent extends AgentInstance {
40+
41+
@UserMessage(
42+
"""
43+
Create a vivid {{style}} setting. It should include the time period, the state of technology,
44+
key locations, and a brief description of the world’s political or social situation.
45+
Make it imaginative, atmospheric, and suitable for a {{style}} novel.
46+
""")
47+
@Agent(
48+
"Generates an imaginative setting including timeline, technology level, and world structure")
49+
String invoke(@V("style") String style);
50+
}
51+
52+
interface HeroAgent extends AgentInstance {
53+
54+
@UserMessage(
55+
"""
56+
Invent a compelling protagonist for a {{style}} story. Describe their background, personality,
57+
motivations, and any unique skills or traits.
58+
""")
59+
@Agent("Creates a unique and relatable protagonist with rich backstory and motivations.")
60+
String invoke(@V("style") String style);
61+
}
62+
63+
interface ConflictAgent extends AgentInstance {
64+
65+
@UserMessage(
66+
"""
67+
Generate a central conflict or threat for a {{style}} plot. It can be external or
68+
internal (e.g. moral dilemma, personal transformation).
69+
Make it high-stakes and thematically rich.
70+
""")
71+
@Agent("Proposes a central conflict or dramatic tension to drive a compelling narrative.")
72+
String invoke(@V("style") String style);
73+
}
74+
75+
interface FactAgent extends AgentInstance {
76+
77+
@UserMessage(
78+
"""
79+
Generate a unique sci-fi fact about an alien civilization's {{goal}} environment or evolutionary history. Make it imaginative and specific.
80+
""")
81+
@Agent("Generates a core fact that defines the foundation of an civilization.")
82+
String invoke(@V("fact") String fact);
83+
}
84+
85+
interface CultureAgent extends AgentInstance {
86+
87+
@UserMessage(
88+
"""
89+
Given the following sci-fi fact about an civilization, describe 3–5 unique cultural traits, traditions, or societal structures that naturally emerge from this environment.
90+
Fact:
91+
{{fact}}
92+
""")
93+
@Agent("Derives cultural traits from the environmental/evolutionary fact.")
94+
List<String> invoke(@V("fact") String fact);
95+
}
96+
97+
interface TechnologyAgent extends AgentInstance {
98+
99+
@UserMessage(
100+
"""
101+
Given the following sci-fi fact about an alien civilization, describe 3–5 technologies or engineering solutions they might have developed. Focus on tools, transportation, communication, and survival systems.
102+
Fact:
103+
{{fact}}
104+
""")
105+
@Agent("Derives plausible technological inventions from the fact.")
106+
List<String> invoke(@V("fact") String fact);
107+
}
108+
109+
interface StorySeedAgent extends AgentInstance {
110+
111+
@UserMessage(
112+
"""
113+
You are a science fiction writer. Given the following title, come up with a short story premise. Describe the world, the central concept, and the thematic direction (e.g., dystopia, exploration, AI ethics).
114+
Title: {{title}}
115+
""")
116+
@Agent("Generates a high-level sci-fi premise based on a title.")
117+
String invoke(@V("title") String title);
118+
}
119+
120+
interface PlotAgent extends AgentInstance {
121+
122+
@UserMessage(
123+
"""
124+
Using the following premise, outline a three-act structure for a science fiction short story. Include a brief description of the main character, the inciting incident, the rising conflict, and the resolution.
125+
Premise:
126+
{{premise}}
127+
""")
128+
@Agent("Transforms a premise into a structured sci-fi plot.")
129+
String invoke(@V("premise") String premise);
130+
}
131+
132+
interface SceneAgent extends AgentInstance {
133+
134+
@UserMessage(
135+
"""
136+
Write the opening scene of a science fiction short story based on the following plot outline. Introduce the main character and immerse the reader in the setting. Use vivid, cinematic language.
137+
Plot:
138+
{{plot}}
139+
""")
140+
@Agent("Generates the opening scene of the story from a plot outline.")
141+
String invoke(@V("plot") String plot);
142+
}
37143
}

0 commit comments

Comments
 (0)