From 61300727c86834bab8e9e273a543bdb8de955d57 Mon Sep 17 00:00:00 2001 From: Theo Kanning Date: Sun, 4 Oct 2020 18:09:48 -0500 Subject: [PATCH] Move data objects into separate openai-api package People can import this if they want to make their own client or don't like retrofit --- example/build.gradle | 2 +- openai-api/build.gradle | 6 ++++++ .../src/main/java/openai/OpenAiResponse.java | 0 .../src/main/java/openai/completion/CompletionChoice.java | 0 .../src/main/java/openai/completion/CompletionRequest.java | 0 .../src/main/java/openai/completion/CompletionResult.java | 0 .../src/main/java/openai/engine/Engine.java | 0 {openai => openai-client}/build.gradle | 1 + .../src/main/java/openai/AuthenticationInterceptor.java | 0 .../src/main/java/openai/OpenAiApi.java | 0 .../src/main/java/openai/OpenAiService.java | 0 settings.gradle | 5 +++-- 12 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 openai-api/build.gradle rename {openai => openai-api}/src/main/java/openai/OpenAiResponse.java (100%) rename {openai => openai-api}/src/main/java/openai/completion/CompletionChoice.java (100%) rename {openai => openai-api}/src/main/java/openai/completion/CompletionRequest.java (100%) rename {openai => openai-api}/src/main/java/openai/completion/CompletionResult.java (100%) rename {openai => openai-api}/src/main/java/openai/engine/Engine.java (100%) rename {openai => openai-client}/build.gradle (92%) rename {openai => openai-client}/src/main/java/openai/AuthenticationInterceptor.java (100%) rename {openai => openai-client}/src/main/java/openai/OpenAiApi.java (100%) rename {openai => openai-client}/src/main/java/openai/OpenAiService.java (100%) diff --git a/example/build.gradle b/example/build.gradle index c465328..c7766a6 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -6,5 +6,5 @@ application { } dependencies { - implementation project(":openai") + implementation project(":openai-client") } \ No newline at end of file diff --git a/openai-api/build.gradle b/openai-api/build.gradle new file mode 100644 index 0000000..e275327 --- /dev/null +++ b/openai-api/build.gradle @@ -0,0 +1,6 @@ +apply plugin: 'java-library' + +dependencies { + compileOnly 'org.projectlombok:lombok:1.18.12' + annotationProcessor 'org.projectlombok:lombok:1.18.12' +} \ No newline at end of file diff --git a/openai/src/main/java/openai/OpenAiResponse.java b/openai-api/src/main/java/openai/OpenAiResponse.java similarity index 100% rename from openai/src/main/java/openai/OpenAiResponse.java rename to openai-api/src/main/java/openai/OpenAiResponse.java diff --git a/openai/src/main/java/openai/completion/CompletionChoice.java b/openai-api/src/main/java/openai/completion/CompletionChoice.java similarity index 100% rename from openai/src/main/java/openai/completion/CompletionChoice.java rename to openai-api/src/main/java/openai/completion/CompletionChoice.java diff --git a/openai/src/main/java/openai/completion/CompletionRequest.java b/openai-api/src/main/java/openai/completion/CompletionRequest.java similarity index 100% rename from openai/src/main/java/openai/completion/CompletionRequest.java rename to openai-api/src/main/java/openai/completion/CompletionRequest.java diff --git a/openai/src/main/java/openai/completion/CompletionResult.java b/openai-api/src/main/java/openai/completion/CompletionResult.java similarity index 100% rename from openai/src/main/java/openai/completion/CompletionResult.java rename to openai-api/src/main/java/openai/completion/CompletionResult.java diff --git a/openai/src/main/java/openai/engine/Engine.java b/openai-api/src/main/java/openai/engine/Engine.java similarity index 100% rename from openai/src/main/java/openai/engine/Engine.java rename to openai-api/src/main/java/openai/engine/Engine.java diff --git a/openai/build.gradle b/openai-client/build.gradle similarity index 92% rename from openai/build.gradle rename to openai-client/build.gradle index dafe32e..6bd130d 100644 --- a/openai/build.gradle +++ b/openai-client/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'java-library' dependencies { + api project(":openai-api") api 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0' implementation 'com.squareup.retrofit2:converter-jackson:2.9.0' diff --git a/openai/src/main/java/openai/AuthenticationInterceptor.java b/openai-client/src/main/java/openai/AuthenticationInterceptor.java similarity index 100% rename from openai/src/main/java/openai/AuthenticationInterceptor.java rename to openai-client/src/main/java/openai/AuthenticationInterceptor.java diff --git a/openai/src/main/java/openai/OpenAiApi.java b/openai-client/src/main/java/openai/OpenAiApi.java similarity index 100% rename from openai/src/main/java/openai/OpenAiApi.java rename to openai-client/src/main/java/openai/OpenAiApi.java diff --git a/openai/src/main/java/openai/OpenAiService.java b/openai-client/src/main/java/openai/OpenAiService.java similarity index 100% rename from openai/src/main/java/openai/OpenAiService.java rename to openai-client/src/main/java/openai/OpenAiService.java diff --git a/settings.gradle b/settings.gradle index d07f296..fcfac6e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ rootProject.name = 'openai-java' -include ':openai' -include ':example' +include 'example' +include 'openai-api' +include 'openai-client'