Skip to content

Commit 3949d15

Browse files
mariofuscojmartisk
authored andcommitted
Bump to LangChain4j 1.8.0
1 parent 5ca020f commit 3949d15

File tree

21 files changed

+120
-117
lines changed

21 files changed

+120
-117
lines changed

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/Agents.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public static class NoneAiAgent {
317317
@Inject
318318
Logger logger;
319319

320-
@Agent(value = "Produces a Goodbye", outputName = "goodbye")
320+
@Agent(value = "Produces a Goodbye", outputKey = "goodbye")
321321
public String goodBye() {
322322
logger.info("Good Bye");
323323

@@ -328,19 +328,19 @@ public String goodBye() {
328328

329329
public interface StoryCreator {
330330

331-
@SequenceAgent(outputName = "story", subAgents = {
332-
@SubAgent(type = CreativeWriter.class, outputName = "story"),
333-
@SubAgent(type = AudienceEditor.class, outputName = "story"),
334-
@SubAgent(type = StyleEditor.class, outputName = "story")
331+
@SequenceAgent(outputKey = "story", subAgents = {
332+
@SubAgent(type = CreativeWriter.class, outputKey = "story"),
333+
@SubAgent(type = AudienceEditor.class, outputKey = "story"),
334+
@SubAgent(type = StyleEditor.class, outputKey = "story")
335335
})
336336
String write(@V("topic") String topic, @V("style") String style, @V("audience") String audience);
337337
}
338338

339339
public interface StyleReviewLoopAgent {
340340

341-
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputName = "story", maxIterations = 5, subAgents = {
342-
@SubAgent(type = StyleScorer.class, outputName = "score"),
343-
@SubAgent(type = StyleEditor.class, outputName = "story")
341+
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputKey = "story", maxIterations = 5, subAgents = {
342+
@SubAgent(type = StyleScorer.class, outputKey = "score"),
343+
@SubAgent(type = StyleEditor.class, outputKey = "story")
344344
})
345345
String write(@V("story") String story);
346346

@@ -352,9 +352,9 @@ static boolean exit(@V("score") double score) {
352352

353353
public interface SupervisorStoryCreator {
354354

355-
@SupervisorAgent(outputName = "story", responseStrategy = SupervisorResponseStrategy.LAST, subAgents = {
356-
@SubAgent(type = CreativeWriter.class, outputName = "story"),
357-
@SubAgent(type = StyleReviewLoopAgent.class, outputName = "story")
355+
@SupervisorAgent(outputKey = "story", responseStrategy = SupervisorResponseStrategy.LAST, subAgents = {
356+
@SubAgent(type = CreativeWriter.class, outputKey = "story"),
357+
@SubAgent(type = StyleReviewLoopAgent.class, outputKey = "story")
358358
})
359359
ResultWithAgenticScope<String> write(@V("topic") String topic, @V("style") String style);
360360

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/WorkflowTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public class WorkflowTest extends OpenAiBaseTest {
4545

4646
public interface StoryCreator {
4747

48-
@SequenceAgent(outputName = "story", subAgents = {
49-
@SubAgent(type = CreativeWriter.class, outputName = "story"),
50-
@SubAgent(type = AudienceEditor.class, outputName = "story"),
51-
@SubAgent(type = StyleEditor.class, outputName = "story")
48+
@SequenceAgent(outputKey = "story", subAgents = {
49+
@SubAgent(type = CreativeWriter.class, outputKey = "story"),
50+
@SubAgent(type = AudienceEditor.class, outputKey = "story"),
51+
@SubAgent(type = StyleEditor.class, outputKey = "story")
5252
})
5353
String write(@V("topic") String topic, @V("style") String style, @V("audience") String audience);
5454
}
@@ -96,9 +96,9 @@ void declarative_sequence_with_error_recover_tests() {
9696

9797
public interface StyleReviewLoopAgent {
9898

99-
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputName = "story", maxIterations = 5, subAgents = {
100-
@SubAgent(type = StyleScorer.class, outputName = "score"),
101-
@SubAgent(type = StyleEditor.class, outputName = "story")
99+
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputKey = "story", maxIterations = 5, subAgents = {
100+
@SubAgent(type = StyleScorer.class, outputKey = "score"),
101+
@SubAgent(type = StyleEditor.class, outputKey = "story")
102102
})
103103
String write(@V("story") String story);
104104

@@ -110,9 +110,9 @@ static boolean exit(@V("score") double score) {
110110

111111
public interface StoryCreatorWithReview {
112112

113-
@SequenceAgent(outputName = "story", subAgents = {
114-
@SubAgent(type = CreativeWriter.class, outputName = "story"),
115-
@SubAgent(type = StyleReviewLoopAgent.class, outputName = "story")
113+
@SequenceAgent(outputKey = "story", subAgents = {
114+
@SubAgent(type = CreativeWriter.class, outputKey = "story"),
115+
@SubAgent(type = StyleReviewLoopAgent.class, outputKey = "story")
116116
})
117117
ResultWithAgenticScope<String> write(@V("topic") String topic, @V("style") String style);
118118
}
@@ -136,10 +136,10 @@ void declarative_sequence_and_loop_tests() {
136136

137137
public interface ExpertsAgent {
138138

139-
@ConditionalAgent(outputName = "response", subAgents = {
140-
@SubAgent(type = MedicalExpert.class, outputName = "response"),
141-
@SubAgent(type = TechnicalExpert.class, outputName = "response"),
142-
@SubAgent(type = LegalExpert.class, outputName = "response")
139+
@ConditionalAgent(outputKey = "response", subAgents = {
140+
@SubAgent(type = MedicalExpert.class, outputKey = "response"),
141+
@SubAgent(type = TechnicalExpert.class, outputKey = "response"),
142+
@SubAgent(type = LegalExpert.class, outputKey = "response")
143143
})
144144
String askExpert(@V("request") String request);
145145

@@ -161,9 +161,9 @@ static boolean activateLegal(@V("category") RequestCategory category) {
161161

162162
public interface ExpertRouterAgent {
163163

164-
@SequenceAgent(outputName = "response", subAgents = {
165-
@SubAgent(type = CategoryRouter.class, outputName = "category"),
166-
@SubAgent(type = ExpertsAgent.class, outputName = "response")
164+
@SequenceAgent(outputKey = "response", subAgents = {
165+
@SubAgent(type = CategoryRouter.class, outputKey = "category"),
166+
@SubAgent(type = ExpertsAgent.class, outputKey = "response")
167167
})
168168
ResultWithAgenticScope<String> ask(@V("request") String request);
169169
}

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonBooleanReturnTypeActivationConditionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public void test() {
3434

3535
public interface ExpertsAgent {
3636

37-
@ConditionalAgent(outputName = "response", subAgents = {
38-
@SubAgent(type = Agents.MedicalExpert.class, outputName = "response"),
39-
@SubAgent(type = Agents.TechnicalExpert.class, outputName = "response"),
40-
@SubAgent(type = Agents.LegalExpert.class, outputName = "response")
37+
@ConditionalAgent(outputKey = "response", subAgents = {
38+
@SubAgent(type = Agents.MedicalExpert.class, outputKey = "response"),
39+
@SubAgent(type = Agents.TechnicalExpert.class, outputKey = "response"),
40+
@SubAgent(type = Agents.LegalExpert.class, outputKey = "response")
4141
})
4242
String askExpert(@V("request") String request);
4343

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonBooleanReturnTypeExitConditionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public void test() {
3434

3535
public interface StyleReviewLoopAgentWithCounter {
3636

37-
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputName = "story", maxIterations = 5, subAgents = {
38-
@SubAgent(type = Agents.StyleScorer.class, outputName = "score"),
39-
@SubAgent(type = Agents.StyleEditor.class, outputName = "story")
37+
@LoopAgent(description = "Review the given story to ensure it aligns with the specified style", outputKey = "story", maxIterations = 5, subAgents = {
38+
@SubAgent(type = Agents.StyleScorer.class, outputKey = "score"),
39+
@SubAgent(type = Agents.StyleEditor.class, outputKey = "story")
4040
})
4141
String write(@V("story") String story);
4242

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonEmptyParametersParallelExecutorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public void test() {
3939

4040
public interface EveningPlannerAgent {
4141

42-
@ParallelAgent(outputName = "plans", subAgents = {
43-
@SubAgent(type = Agents.FoodExpert.class, outputName = "meals"),
44-
@SubAgent(type = Agents.MovieExpert.class, outputName = "movies")
42+
@ParallelAgent(outputKey = "plans", subAgents = {
43+
@SubAgent(type = Agents.FoodExpert.class, outputKey = "meals"),
44+
@SubAgent(type = Agents.MovieExpert.class, outputKey = "movies")
4545
})
4646
List<Agents.EveningPlan> plan(@V("mood") String mood);
4747

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonErrorContextParameterTypeErrorHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public void test() {
3434

3535
public interface StoryCreatorWithErrorRecovery {
3636

37-
@SequenceAgent(outputName = "story", subAgents = {
38-
@SubAgent(type = Agents.CreativeWriter.class, outputName = "story"),
39-
@SubAgent(type = Agents.AudienceEditor.class, outputName = "story"),
40-
@SubAgent(type = Agents.StyleEditor.class, outputName = "story")
37+
@SequenceAgent(outputKey = "story", subAgents = {
38+
@SubAgent(type = Agents.CreativeWriter.class, outputKey = "story"),
39+
@SubAgent(type = Agents.AudienceEditor.class, outputKey = "story"),
40+
@SubAgent(type = Agents.StyleEditor.class, outputKey = "story")
4141
})
4242
String write(@V("topic") String topic, @V("style") String style, @V("audience") String audience);
4343

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonErrorResultReturnTypeErrorHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public void test() {
3636

3737
public interface StoryCreatorWithErrorRecovery {
3838

39-
@SequenceAgent(outputName = "story", subAgents = {
40-
@SubAgent(type = Agents.CreativeWriter.class, outputName = "story"),
41-
@SubAgent(type = Agents.AudienceEditor.class, outputName = "story"),
42-
@SubAgent(type = Agents.StyleEditor.class, outputName = "story")
39+
@SequenceAgent(outputKey = "story", subAgents = {
40+
@SubAgent(type = Agents.CreativeWriter.class, outputKey = "story"),
41+
@SubAgent(type = Agents.AudienceEditor.class, outputKey = "story"),
42+
@SubAgent(type = Agents.StyleEditor.class, outputKey = "story")
4343
})
4444
String write(@V("topic") String topic, @V("style") String style, @V("audience") String audience);
4545

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonExecutorReturnTypeParallelExecutorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public void test() {
3838

3939
public interface EveningPlannerAgent {
4040

41-
@ParallelAgent(outputName = "plans", subAgents = {
42-
@SubAgent(type = Agents.FoodExpert.class, outputName = "meals"),
43-
@SubAgent(type = Agents.MovieExpert.class, outputName = "movies")
41+
@ParallelAgent(outputKey = "plans", subAgents = {
42+
@SubAgent(type = Agents.FoodExpert.class, outputKey = "meals"),
43+
@SubAgent(type = Agents.MovieExpert.class, outputKey = "movies")
4444
})
4545
List<Agents.EveningPlan> plan(@V("mood") String mood);
4646

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonStaticReturnActivationConditionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public void test() {
3232

3333
public interface ExpertsAgent {
3434

35-
@ConditionalAgent(outputName = "response", subAgents = {
36-
@SubAgent(type = Agents.MedicalExpert.class, outputName = "response"),
37-
@SubAgent(type = Agents.TechnicalExpert.class, outputName = "response"),
38-
@SubAgent(type = Agents.LegalExpert.class, outputName = "response")
35+
@ConditionalAgent(outputKey = "response", subAgents = {
36+
@SubAgent(type = Agents.MedicalExpert.class, outputKey = "response"),
37+
@SubAgent(type = Agents.TechnicalExpert.class, outputKey = "response"),
38+
@SubAgent(type = Agents.LegalExpert.class, outputKey = "response")
3939
})
4040
String askExpert(@V("request") String request);
4141

agentic/deployment/src/test/java/io/quarkiverse/langchain4j/agentic/deployment/validation/NonStaticReturnErrorHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public void test() {
3636

3737
public interface StoryCreatorWithErrorRecovery {
3838

39-
@SequenceAgent(outputName = "story", subAgents = {
40-
@SubAgent(type = Agents.CreativeWriter.class, outputName = "story"),
41-
@SubAgent(type = Agents.AudienceEditor.class, outputName = "story"),
42-
@SubAgent(type = Agents.StyleEditor.class, outputName = "story")
39+
@SequenceAgent(outputKey = "story", subAgents = {
40+
@SubAgent(type = Agents.CreativeWriter.class, outputKey = "story"),
41+
@SubAgent(type = Agents.AudienceEditor.class, outputKey = "story"),
42+
@SubAgent(type = Agents.StyleEditor.class, outputKey = "story")
4343
})
4444
String write(@V("topic") String topic, @V("style") String style, @V("audience") String audience);
4545

0 commit comments

Comments
 (0)