Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 0297756

Browse files
authored
fixed failing tests (#50)
1 parent 4fb7f47 commit 0297756

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/test/java/dev/ai4j/openai4j/chat/ChatCompletionAsyncTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void testCustomizableApi(ChatCompletionModel model) throws Exception {
9696
void testTools(ChatCompletionModel model) throws Exception {
9797

9898
// given
99-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
99+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
100100

101101
ChatCompletionRequest request = ChatCompletionRequest.builder()
102102
.model(model)
@@ -158,7 +158,7 @@ void testTools(ChatCompletionModel model) throws Exception {
158158
void testFunctions(ChatCompletionModel model) throws Exception {
159159

160160
// given
161-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
161+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
162162

163163
ChatCompletionRequest request = ChatCompletionRequest.builder()
164164
.model(model)
@@ -214,7 +214,7 @@ void testFunctions(ChatCompletionModel model) throws Exception {
214214
void testToolChoice(ChatCompletionModel model) throws Exception {
215215

216216
// given
217-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
217+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
218218

219219
ChatCompletionRequest request = ChatCompletionRequest.builder()
220220
.model(model)
@@ -276,7 +276,7 @@ void testToolChoice(ChatCompletionModel model) throws Exception {
276276
void testFunctionChoice(ChatCompletionModel model) throws Exception {
277277

278278
// given
279-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
279+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
280280

281281
ChatCompletionRequest request = ChatCompletionRequest.builder()
282282
.model(model)

src/test/java/dev/ai4j/openai4j/chat/ChatCompletionStreamingTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void testCustomizableApi(ChatCompletionModel model) throws Exception {
150150
void testTools(ChatCompletionModel model) throws Exception {
151151

152152
// given
153-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
153+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
154154

155155
ChatCompletionRequest request = ChatCompletionRequest.builder()
156156
.model(model)
@@ -167,7 +167,7 @@ void testTools(ChatCompletionModel model) throws Exception {
167167
client.chatCompletion(request)
168168
.onPartialResponse(partialResponse -> {
169169
Delta delta = partialResponse.choices().get(0).delta();
170-
assertThat(delta.content()).isNull();
170+
assertThat(delta.content()).isNullOrEmpty();
171171
assertThat(delta.functionCall()).isNull();
172172

173173
if (delta.toolCalls() != null) {
@@ -265,7 +265,7 @@ void testTools(ChatCompletionModel model) throws Exception {
265265
void testFunctions(ChatCompletionModel model) throws Exception {
266266

267267
// given
268-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
268+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
269269

270270
ChatCompletionRequest request = ChatCompletionRequest.builder()
271271
.model(model)
@@ -281,7 +281,7 @@ void testFunctions(ChatCompletionModel model) throws Exception {
281281
client.chatCompletion(request)
282282
.onPartialResponse(partialResponse -> {
283283
Delta delta = partialResponse.choices().get(0).delta();
284-
assertThat(delta.content()).isNull();
284+
assertThat(delta.content()).isNullOrEmpty();
285285
assertThat(delta.toolCalls()).isNull();
286286

287287
if (delta.functionCall() != null) {
@@ -359,7 +359,7 @@ void testFunctions(ChatCompletionModel model) throws Exception {
359359
void testToolChoice(ChatCompletionModel model) throws Exception {
360360

361361
// given
362-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
362+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
363363

364364
ChatCompletionRequest request = ChatCompletionRequest.builder()
365365
.model(model)
@@ -474,7 +474,7 @@ void testToolChoice(ChatCompletionModel model) throws Exception {
474474
void testFunctionChoice(ChatCompletionModel model) throws Exception {
475475

476476
// given
477-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
477+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
478478

479479
ChatCompletionRequest request = ChatCompletionRequest.builder()
480480
.model(model)

src/test/java/dev/ai4j/openai4j/chat/ChatCompletionTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void testCustomizableApi(ChatCompletionModel model) {
128128
void testTools(ChatCompletionModel model) {
129129

130130
// given
131-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
131+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
132132

133133
ChatCompletionRequest request = ChatCompletionRequest.builder()
134134
.model(model)
@@ -308,7 +308,7 @@ void testToolWithoutParameters() {
308308
void testFunctions(ChatCompletionModel model) {
309309

310310
// given
311-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
311+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
312312

313313
ChatCompletionRequest request = ChatCompletionRequest.builder()
314314
.model(model)
@@ -357,7 +357,7 @@ void testFunctions(ChatCompletionModel model) {
357357
void testToolChoice(ChatCompletionModel model) {
358358

359359
// given
360-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
360+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
361361

362362
ChatCompletionRequest request = ChatCompletionRequest.builder()
363363
.model(model)
@@ -412,7 +412,7 @@ void testToolChoice(ChatCompletionModel model) {
412412
void testFunctionChoice(ChatCompletionModel model) {
413413

414414
// given
415-
UserMessage userMessage = UserMessage.from("What is the weather in Boston?");
415+
UserMessage userMessage = UserMessage.from("What is the weather in Boston in Celsius?");
416416

417417
ChatCompletionRequest request = ChatCompletionRequest.builder()
418418
.model(model)

0 commit comments

Comments
 (0)