Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9ff2dc

Browse filesBrowse files
authored
Add test for CompletionRequest n parameter (TheoKanning#61)
1 parent 68e7501 commit b9ff2dc
Copy full SHA for b9ff2dc

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

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

Copy file name to clipboardExpand all lines: client/src/test/java/com/theokanning/openai/CompletionTest.java
+4-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.