Add test for CompletionRequest n parameter (#61)
This commit is contained in:
parent
68e75010fd
commit
b9ff2dc177
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue