Add test for CompletionRequest n parameter (#61)

This commit is contained in:
Theo Kanning 2023-01-02 17:17:55 -06:00 committed by GitHub
parent 68e75010fd
commit b9ff2dc177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
@ -21,12 +22,14 @@ public class CompletionTest {
.model("ada") .model("ada")
.prompt("Somebody once told me the world is gonna roll me") .prompt("Somebody once told me the world is gonna roll me")
.echo(true) .echo(true)
.n(5)
.maxTokens(50)
.user("testing") .user("testing")
.logitBias(new HashMap<>()) .logitBias(new HashMap<>())
.build(); .build();
List<CompletionChoice> choices = service.createCompletion(completionRequest).getChoices(); List<CompletionChoice> choices = service.createCompletion(completionRequest).getChoices();
assertFalse(choices.isEmpty()); assertEquals(5, choices.size());
} }
@Test @Test