Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit b9ff2dc

Browse files
authored
Add test for CompletionRequest n parameter (#61)
1 parent 68e7501 commit b9ff2dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/src/test/java/com/theokanning/openai/CompletionTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.HashMap;
88
import java.util.List;
99

10+
import static org.junit.jupiter.api.Assertions.assertEquals;
1011
import static org.junit.jupiter.api.Assertions.assertFalse;
1112

1213

@@ -21,12 +22,14 @@ void createCompletion() {
2122
.model("ada")
2223
.prompt("Somebody once told me the world is gonna roll me")
2324
.echo(true)
25+
.n(5)
26+
.maxTokens(50)
2427
.user("testing")
2528
.logitBias(new HashMap<>())
2629
.build();
2730

2831
List<CompletionChoice> choices = service.createCompletion(completionRequest).getChoices();
29-
assertFalse(choices.isEmpty());
32+
assertEquals(5, choices.size());
3033
}
3134

3235
@Test

0 commit comments

Comments
 (0)