Skip to content

Commit c61d496

Browse files
committed
added README.md
Signed-off-by: Dmitrii Tikhomirov <[email protected]>
1 parent 254f8bd commit c61d496

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ public void parallelWorkflow() {
180180
assertEquals("Fake conflict response", result.get("movies"));
181181
}
182182

183-
// TODO
184183
@Test
185184
@DisplayName("Error handling with agents")
186185
public void errorHandling() {
@@ -232,20 +231,13 @@ public void conditionalWorkflow() {
232231
p ->
233232
p.onPredicate(
234233
item ->
235-
item.when(
236-
m ->
237-
"unknown"
238-
.equals(
239-
((Map<String, Object>) m).get("category")))
234+
item.when(Agents.RequestCategory.UNKNOWN::equals)
240235
.then(FlowDirectiveEnum.END))))
241236
.tasks(
242237
doTasks(
243-
conditional(
244-
m -> "medical".equals(((Map<String, Object>) m).get("category")), a1),
245-
conditional(
246-
m -> "technical".equals(((Map<String, Object>) m).get("category")), a2),
247-
conditional(
248-
m -> "legal".equals(((Map<String, Object>) m).get("category")), a3)))
238+
conditional(Agents.RequestCategory.MEDICAL::equals, a1),
239+
conditional(Agents.RequestCategory.TECHNICAL::equals, a2),
240+
conditional(Agents.RequestCategory.LEGAL::equals, a3)))
249241
.build();
250242

251243
Map<String, Object> input = Map.of("question", "What is the best treatment for a common cold?");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Implementation of Scenarios from [LangChain4j Agents Tutorials](https://docs.langchain4j.dev/tutorials/agents/) for CNCF Workflow Java DSL
2+
3+
| Scenario | LangChain4j Reference | CNCF Workflow Java DSL Implementation |
4+
|-----------------------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
5+
| Sequential workflow | [Sequential workflow](https://docs.langchain4j.dev/tutorials/agents/#sequential-workflow) | [LC4JEquivalenceIT.java#L43](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L43) |
6+
| Loop workflow | [Loop workflow](https://docs.langchain4j.dev/tutorials/agents/#loop-workflow) | [LC4JEquivalenceIT.java#L76](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L76)<br>[LC4JEquivalenceIT.java#L112](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L112) |
7+
| Parallel workflow | [Parallel workflow](https://docs.langchain4j.dev/tutorials/agents/#parallel-workflow) | [LC4JEquivalenceIT.java#L154](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L154) |
8+
| Conditional workflow | [Conditional workflow](https://docs.langchain4j.dev/tutorials/agents/#conditional-workflow) | [LC4JEquivalenceIT.java#L218](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L218) |
9+
| Error handling | [Error handling](https://docs.langchain4j.dev/tutorials/agents/#error-handling) | [LC4JEquivalenceIT.java#L185](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L185) |
10+
| Human-in-the-loop | [Human-in-the-loop](https://docs.langchain4j.dev/tutorials/agents/#human-in-the-loop) | [LC4JEquivalenceIT.java#L257](https://github.com/treblereel/serverless-workflow-sdk-java/blob/langchain_examples/experimental/fluent/agentic/src/test/java/io/serverlessworkflow/fluent/agentic/LC4JEquivalenceIT.java#L257) |

0 commit comments

Comments
 (0)