Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fluent/agentic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
<scope>test</scope>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.serverlessworkflow</groupId>
<artifactId>serverlessworkflow-experimental-lambda</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.serverlessworkflow.fluent.agentic;

import dev.langchain4j.agentic.Agent;
import dev.langchain4j.agentic.internal.AgentInstance;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import java.util.List;
Expand All @@ -34,4 +35,136 @@ interface MovieExpert {
@Agent
List<String> findMovie(@V("mood") String mood);
}
}

interface SettingAgent extends AgentInstance {

@UserMessage(
"""
Create a vivid {{style}} setting. It should include the time period, the state of technology,
key locations, and a brief description of the world’s political or social situation.
Make it imaginative, atmospheric, and suitable for a {{style}} novel.
""")
@Agent(
"Generates an imaginative setting including timeline, technology level, and world structure")
String invoke(@V("style") String style);
}

interface HeroAgent extends AgentInstance {

@UserMessage(
"""
Invent a compelling protagonist for a {{style}} story. Describe their background, personality,
motivations, and any unique skills or traits.
""")
@Agent("Creates a unique and relatable protagonist with rich backstory and motivations.")
String invoke(@V("style") String style);
}

interface ConflictAgent extends AgentInstance {

@UserMessage(
"""
Generate a central conflict or threat for a {{style}} plot. It can be external or
internal (e.g. moral dilemma, personal transformation).
Make it high-stakes and thematically rich.
""")
@Agent("Proposes a central conflict or dramatic tension to drive a compelling narrative.")
String invoke(@V("style") String style);
}

interface FactAgent extends AgentInstance {

@UserMessage(
"""
Generate a unique sci-fi fact about an alien civilization's {{goal}} environment or evolutionary history. Make it imaginative and specific.
""")
@Agent("Generates a core fact that defines the foundation of an civilization.")
String invoke(@V("fact") String fact);
}

interface CultureAgent extends AgentInstance {

@UserMessage(
"""
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.
Fact:
{{fact}}
""")
@Agent("Derives cultural traits from the environmental/evolutionary fact.")
List<String> invoke(@V("fact") String fact);
}

interface TechnologyAgent extends AgentInstance {

@UserMessage(
"""
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.
Fact:
{{fact}}
""")
@Agent("Derives plausible technological inventions from the fact.")
List<String> invoke(@V("fact") String fact);
}

interface StorySeedAgent extends AgentInstance {

@UserMessage(
"""
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).
Title: {{title}}
""")
@Agent("Generates a high-level sci-fi premise based on a title.")
String invoke(@V("title") String title);
}

interface PlotAgent extends AgentInstance {

@UserMessage(
"""
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.
Premise:
{{premise}}
""")
@Agent("Transforms a premise into a structured sci-fi plot.")
String invoke(@V("premise") String premise);
}

interface SceneAgent extends AgentInstance {

@UserMessage(
"""
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.
Plot:
{{plot}}
""")
@Agent("Generates the opening scene of the story from a plot outline.")
String invoke(@V("plot") String plot);
}

interface MeetingInvitationDraft extends AgentInstance {

@UserMessage(
"""
You are a professional meeting invitation writer. Draft a concise and clear meeting invitation email based on the following details:
Subject: {{subject}}
Date: {{date}}
Time: {{time}}
Location: {{location}}
Agenda: {{agenda}}
""")
@Agent("Drafts a professional meeting invitation email.")
String invoke(@V("subject") String subject, @V("date") String date, @V("time") String time, @V("location") String location, @V("agenda") String agenda);
}

interface MeetingInvitationStyle extends AgentInstance {

@UserMessage(
"""
You are a professional meeting invitation writer. Rewrite the following meeting invitation email to better fit the {{style}} style:
Original Invitation: {{invitation}}
""")
@Agent("Edits a meeting invitation email to better fit a given style.")
String invoke(@V("invitation") String invitation, @V("style") String style);
}

}
Loading