Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f33aea1

Browse filesBrowse files
committed
Rename modules to api and client
openai-api is unecessary here
1 parent 779be1d commit f33aea1
Copy full SHA for f33aea1

File tree

Expand file treeCollapse file tree

15 files changed

+12
-10
lines changed
Filter options
Expand file treeCollapse file tree

15 files changed

+12
-10
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Includes the following artifacts:
77

88
as well as an example project using the client.
99

10-
## How to use this
11-
If you're looking for the fastest solution, import the `client` and use [OpenAiService](openai-client/src/main/java/openai/OpenAiService.java).
10+
## Usage
11+
If you're looking for the fastest solution, import the `client` and use [OpenAiService](client/src/main/java/openai/OpenAiService.java).
1212
```
1313
OpenAiService service = new OpenAiService(your_token)
1414
CompletionRequest completionRequest = new CompletionRequest();
@@ -17,8 +17,8 @@ completionRequest.setEcho(true);
1717
service.createCompletion("ada", completionRequest).getChoices().forEach(System.out::println);
1818
```
1919

20-
If you're using retrofit, you can import the `client` module and use the [OpenAiApi](openai-client/src/main/java/openai/OpenAiApi.java).
21-
You'll have to add your auth token as a header (see [AuthenticationInterceptor](openai-client/src/main/java/openai/AuthenticationInterceptor.java))
20+
If you're using retrofit, you can import the `client` module and use the [OpenAiApi](client/src/main/java/openai/OpenAiApi.java).
21+
You'll have to add your auth token as a header (see [AuthenticationInterceptor](client/src/main/java/openai/AuthenticationInterceptor.java))
2222
and set your converter factory to use snake case and only include non-null fields.
2323

2424
If you want to make your own client, just import the POJOs from the `api` module.
@@ -28,4 +28,7 @@ All the [example](example/src/main/java/example/OpenAiApiExample.java) project r
2828
```
2929
export OPENAI_TOKEN="sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
3030
./gradlew example:run
31-
```
31+
```
32+
33+
## License
34+
Published under the MIT License
File renamed without changes.

‎openai-client/build.gradle renamed to ‎client/build.gradle

Copy file name to clipboardExpand all lines: client/build.gradle
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'java-library'
22
apply plugin: 'com.jfrog.bintray'
33

44
dependencies {
5-
api project(":openai-api")
5+
api project(":api")
66
api 'com.squareup.retrofit2:retrofit:2.9.0'
77
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
88
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'

‎example/build.gradle

Copy file name to clipboardExpand all lines: example/build.gradle
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ application {
66
}
77

88
dependencies {
9-
implementation project(":openai-client")
9+
implementation project(":client")
1010
}

‎settings.gradle

Copy file name to clipboard
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
rootProject.name = 'openai-java'
22

3+
include 'api'
4+
include 'client'
35
include 'example'
4-
include 'openai-api'
5-
include 'openai-client'
6-

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.