diff --git a/README.md b/README.md index 70f901dc..87081965 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ CompletionRequest completionRequest = CompletionRequest.builder() .model("ada") .echo(true) .build(); -service.createCompletion( completionRequest).getChoices().forEach(System.out::println); +service.createCompletion(completionRequest).getChoices().forEach(System.out::println); ``` ### Using OpenAiApi Retrofit client diff --git a/example/src/main/java/example/OpenAiApiExample.java b/example/src/main/java/example/OpenAiApiExample.java index 78e58a39..27b6671f 100644 --- a/example/src/main/java/example/OpenAiApiExample.java +++ b/example/src/main/java/example/OpenAiApiExample.java @@ -2,26 +2,19 @@ import com.theokanning.openai.OpenAiService; import com.theokanning.openai.completion.CompletionRequest; -import com.theokanning.openai.engine.Engine; class OpenAiApiExample { public static void main(String... args) { String token = System.getenv("OPENAI_TOKEN"); OpenAiService service = new OpenAiService(token); - System.out.println("\nGetting available engines..."); - service.getEngines().forEach(System.out::println); - - System.out.println("\nGetting ada engine..."); - Engine ada = service.getEngine("ada"); - System.out.println(ada); - System.out.println("\nCreating completion..."); CompletionRequest completionRequest = CompletionRequest.builder() + .model("ada") .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); + service.createCompletion(completionRequest).getChoices().forEach(System.out::println); } }