Updating example to not use new api (#33)

This commit is contained in:
Robin Glauser 2022-12-04 19:39:31 +01:00 committed by GitHub
parent 5e14d4f62b
commit 0caab13666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -41,12 +41,13 @@ or
### 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).
```
OpenAiService service = new OpenAiService(your_token)
OpenAiService service = new OpenAiService("your_token");
CompletionRequest completionRequest = CompletionRequest.builder()
.prompt("Somebody once told me the world is gonna roll me")
.model("ada")
.echo(true)
.build();
service.createCompletion("ada", completionRequest).getChoices().forEach(System.out::println);
service.createCompletion( completionRequest).getChoices().forEach(System.out::println);
```
### Using OpenAiApi Retrofit client