Add user to CompletionRequest (#23)
Fixes https://github.com/TheoKanning/openai-java/issues/19
This commit is contained in:
parent
1391f4074d
commit
77219d497b
@ -108,4 +108,9 @@ public class CompletionRequest {
|
||||
* best_of must be greater than n.
|
||||
*/
|
||||
Integer bestOf;
|
||||
|
||||
/**
|
||||
* A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse.
|
||||
*/
|
||||
String user;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ public class CompletionTest {
|
||||
CompletionRequest completionRequest = CompletionRequest.builder()
|
||||
.prompt("Somebody once told me the world is gonna roll me")
|
||||
.echo(true)
|
||||
.user("testing")
|
||||
.build();
|
||||
|
||||
List<CompletionChoice> choices = service.createCompletion("ada", completionRequest).getChoices();
|
||||
|
@ -23,6 +23,7 @@ class OpenAiApiExample {
|
||||
CompletionRequest completionRequest = CompletionRequest.builder()
|
||||
.prompt("Somebody once told me the world is gonna roll me")
|
||||
.echo(true)
|
||||
.user("testing")
|
||||
.build();
|
||||
service.createCompletion("ada", completionRequest).getChoices().forEach(System.out::println);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user