Updating example to not use new api (#33)
This commit is contained in:
parent
5e14d4f62b
commit
0caab13666
@ -41,12 +41,13 @@ or
|
|||||||
### Using OpenAiService
|
### Using OpenAiService
|
||||||
If you're looking for the fastest solution, import the `client` and use [OpenAiService](client/src/main/java/com/theokanning/openai/OpenAiService.java).
|
If you're looking for the fastest solution, import the `client` and use [OpenAiService](client/src/main/java/com/theokanning/openai/OpenAiService.java).
|
||||||
```
|
```
|
||||||
OpenAiService service = new OpenAiService(your_token)
|
OpenAiService service = new OpenAiService("your_token");
|
||||||
CompletionRequest completionRequest = CompletionRequest.builder()
|
CompletionRequest completionRequest = CompletionRequest.builder()
|
||||||
.prompt("Somebody once told me the world is gonna roll me")
|
.prompt("Somebody once told me the world is gonna roll me")
|
||||||
|
.model("ada")
|
||||||
.echo(true)
|
.echo(true)
|
||||||
.build();
|
.build();
|
||||||
service.createCompletion("ada", completionRequest).getChoices().forEach(System.out::println);
|
service.createCompletion( completionRequest).getChoices().forEach(System.out::println);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using OpenAiApi Retrofit client
|
### Using OpenAiApi Retrofit client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user