Skip to content

Commit 31f820c

Browse files
authored
Merge branch 'main' into ContainerTask
2 parents 7933645 + 9b0b0a2 commit 31f820c

File tree

97 files changed

+1275
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1275
-262
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
* text eol=lf
1+
* text eol=lf
2+
*.db -text -eol -working-tree-encoding -merge -diff

.github/project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# 7.4.0 - (4 round)
12
release:
23
current-version: 7.4.0.Final
34
next-version: 8.0.0-SNAPSHOT

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
types: [closed]
66
paths:
77
- '.github/project.yml'
8+
workflow_dispatch: {}
89

910
permissions:
1011
contents: write
@@ -60,7 +61,12 @@ jobs:
6061
- name: Maven release ${{steps.metadata.outputs.current-version}}
6162
run: |
6263
git checkout -b release
63-
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
64+
mvn -B release:prepare -DperformRelease -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
65+
66+
git restore --staged --worktree -- impl/test/db-samples/** 2>/dev/null || true
67+
git clean -fd -- impl/test/db-samples 2>/dev/null || true
68+
69+
git status --porcelain
6470
cat release.properties
6571
git checkout ${{github.base_ref}}
6672
git rebase release

examples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<groupId>io.serverlessworkflow</groupId>
55
<artifactId>serverlessworkflow-parent</artifactId>
66
<version>8.0.0-SNAPSHOT</version>
7+
<relativePath>../pom.xml</relativePath>
78
</parent>
89
<name>Serverless Workflow :: Examples</name>
910
<artifactId>serverlessworkflow-examples</artifactId>

experimental/fluent/agentic-langchain4j/src/main/java/io/serverlessworkflow/fluent/agentic/langchain4j/AbstractAgentService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public S beforeCall(Consumer<AgenticScope> beforeCall) {
6666
}
6767

6868
@SuppressWarnings("unchecked")
69-
public S outputName(String outputName) {
69+
public S outputKey(String outputName) {
7070
Function<DefaultAgenticScope, Object> outputFunction = cog -> cog.readState(outputName);
7171
this.workflowBuilder.outputAs(outputFunction, DefaultAgenticScope.class);
7272
this.workflowBuilder.document(

experimental/fluent/agentic-langchain4j/src/main/java/io/serverlessworkflow/fluent/agentic/langchain4j/WorkflowInvocationHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private static void writeAgenticScopeState(
6565
}
6666
}
6767

68-
private String outputName() {
68+
private String outputKey() {
6969
Object outputName =
7070
this.workflow
7171
.getDocument()
@@ -81,12 +81,12 @@ private String outputName() {
8181
@Override
8282
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
8383
AgenticScopeRegistry registry = registry();
84-
// outputName
84+
// outputKey
8585
if (method.getDeclaringClass() == AgentSpecification.class) {
8686
return switch (method.getName()) {
8787
case "name" -> this.workflow.getDocument().getName();
8888
case "description" -> this.workflow.getDocument().getSummary();
89-
case "outputName" -> outputName();
89+
case "outputKey" -> outputKey();
9090
default ->
9191
throw new UnsupportedOperationException(
9292
"Unknown method on AgentInstance class : " + method.getName());
@@ -135,7 +135,7 @@ private Object executeWorkflow(AgenticScope agenticScope, Method method, Object[
135135
() ->
136136
new IllegalArgumentException(
137137
"Workflow hasn't returned a AgenticScope object."));
138-
Object result = output.readState(outputName());
138+
Object result = output.readState(outputKey());
139139

140140
return method.getReturnType().equals(ResultWithAgenticScope.class)
141141
? new ResultWithAgenticScope<>(output, result)

experimental/fluent/agentic-langchain4j/src/test/java/io/serverlessworkflow/fluent/agentic/langchain4j/SequentialAgentServiceImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void shouldSetOutputName_inDocumentMetadata() {
6464
String outputName = "myOutputName";
6565
SequentialAgentServiceImpl<DummyAgent> service =
6666
(SequentialAgentServiceImpl<DummyAgent>)
67-
SequentialAgentServiceImpl.builder(DummyAgent.class).outputName(outputName);
67+
SequentialAgentServiceImpl.builder(DummyAgent.class).outputKey(outputName);
6868

6969
// when
7070
Workflow wf = service.getDefinition();

experimental/fluent/agentic-langchain4j/src/test/java/io/serverlessworkflow/fluent/agentic/langchain4j/WorkflowAgentsIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,28 @@ void sequential_agents_tests() {
4040
spy(
4141
AgenticServices.agentBuilder(CreativeWriter.class)
4242
.chatModel(BASE_MODEL)
43-
.outputName("story")
43+
.outputKey("story")
4444
.build());
4545

4646
AudienceEditor audienceEditor =
4747
spy(
4848
AgenticServices.agentBuilder(AudienceEditor.class)
4949
.chatModel(BASE_MODEL)
50-
.outputName("story")
50+
.outputKey("story")
5151
.build());
5252

5353
StyleEditor styleEditor =
5454
spy(
5555
AgenticServices.agentBuilder(StyleEditor.class)
5656
.chatModel(BASE_MODEL)
57-
.outputName("story")
57+
.outputKey("story")
5858
.build());
5959

6060
UntypedAgent novelCreator =
6161
builder
6262
.sequenceBuilder()
6363
.subAgents(creativeWriter, audienceEditor, styleEditor)
64-
.outputName("story")
64+
.outputKey("story")
6565
.build();
6666

6767
Map<String, Object> input =

experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/AgentWorkflowBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void verifyAgentCall() {
4444
Agents.MovieExpert movieExpert =
4545
spy(
4646
AgenticServices.agentBuilder(Agents.MovieExpert.class)
47-
.outputName("movies")
47+
.outputKey("movies")
4848
.chatModel(BASE_MODEL)
4949
.build());
5050

experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/AgenticWorkflowHelperIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ public void errorHandling() {
178178

179179
Map<String, Object> input =
180180
Map.of(
181-
"style", "fantasy",
181+
"topic", "fantasy",
182+
"style", "funny",
182183
"audience", "young adults");
183184

184-
Map<String, Object> result;
185+
Map<String, Object> result = null;
185186
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
186187
result = app.workflowDefinition(wf).instance(input).start().get().asMap().orElseThrow();
187188
} catch (Exception e) {
@@ -191,7 +192,6 @@ public void errorHandling() {
191192
assertThat(result).containsKey("story");
192193
}
193194

194-
@SuppressWarnings("unchecked")
195195
@Test
196196
@DisplayName("Conditional agents via choice(...)")
197197
public void conditionalWorkflow() {
@@ -211,7 +211,7 @@ public void conditionalWorkflow() {
211211
conditional(RequestCategory.LEGAL::equals, legalExpert)))
212212
.build();
213213

214-
Map<String, Object> input = Map.of("question", "What is the best treatment for a common cold?");
214+
Map<String, Object> input = Map.of("request", "What is the best treatment for a common cold?");
215215

216216
Map<String, Object> result;
217217
try (WorkflowApplication app = WorkflowApplication.builder().build()) {

0 commit comments

Comments
 (0)