Skip to content

Commit 0877106

Browse files
committed
Fix assertion message in AdvisedRequest
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
1 parent 3ab3bbd commit 0877106

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public record AdvisedRequest(
8989
"userText cannot be null or empty unless messages are provided and contain Tool Response message.");
9090
Assert.notNull(media, "media cannot be null");
9191
Assert.noNullElements(media, "media cannot contain null elements");
92-
Assert.notNull(toolNames, "functionNames cannot be null");
93-
Assert.noNullElements(toolNames, "functionNames cannot contain null elements");
92+
Assert.notNull(toolNames, "toolNames cannot be null");
93+
Assert.noNullElements(toolNames, "toolNames cannot contain null elements");
9494
Assert.notNull(toolCallbacks, "toolCallbacks cannot be null");
9595
Assert.noNullElements(toolCallbacks, "toolCallbacks cannot contain null elements");
9696
Assert.notNull(messages, "messages cannot be null");

spring-ai-core/src/test/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequestTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void whenFunctionNamesIsNullThenThrows() {
8080
assertThatThrownBy(() -> new AdvisedRequest(mock(ChatModel.class), "user", null, null, List.of(), null,
8181
List.of(), List.of(), Map.of(), Map.of(), List.of(), Map.of(), Map.of(), Map.of()))
8282
.isInstanceOf(IllegalArgumentException.class)
83-
.hasMessage("functionNames cannot be null");
83+
.hasMessage("toolNames cannot be null");
8484
}
8585

8686
@Test

0 commit comments

Comments
 (0)