|
4 | 4 | > ⚠️OpenAI has deprecated all Engine-based APIs. See [Deprecated Endpoints](https://github.com/TheoKanning/openai-java#deprecated-endpoints) below for more info.
|
5 | 5 |
|
6 | 6 | # OpenAI-Java
|
7 |
| -Java libraries for using OpenAI's GPT-3 api. |
| 7 | +Java libraries for using OpenAI's GPT apis. Supports GPT-3, ChatGPT, and GPT-4. |
8 | 8 |
|
9 | 9 | Includes the following artifacts:
|
10 |
| -- `api` : request/response POJOs for the GPT-3 APIs. |
11 |
| -- `client` : a basic retrofit client for the GPT-3 endpoints, includes the `api` module |
| 10 | +- `api` : request/response POJOs for the GPT APIs. |
| 11 | +- `client` : a basic retrofit client for the GPT endpoints, includes the `api` module |
12 | 12 | - `service` : A basic service class that creates and calls the client. This is the easiest way to get started.
|
13 | 13 |
|
14 | 14 | as well as an example project using the service.
|
@@ -106,6 +106,19 @@ export OPENAI_TOKEN="sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
106 | 106 | ./gradlew example:run
|
107 | 107 | ```
|
108 | 108 |
|
| 109 | +## FAQ |
| 110 | +### Does this support GPT-4? |
| 111 | +Yes! GPT-4 uses the ChatCompletion Api, and you can see the latest model options [here](https://platform.openai.com/docs/models/gpt-4). |
| 112 | +GPT-4 is currently in a limited beta (as of 4/1/23), so make sure you have access before trying to use it. |
| 113 | + |
| 114 | +### Why am I getting connection timeouts? |
| 115 | +Make sure that OpenAI is available in your country. |
| 116 | + |
| 117 | +### Why doesn't OpenAiService support x configuration option? |
| 118 | +Many projects use OpenAiService, and in order to support them best I've kept it extremely simple. |
| 119 | +You can create your own OpenAiApi instance to customize headers, timeouts, base urls etc. |
| 120 | +If you want features like retry logic and async calls, you'll have to make an `OpenAiApi` instance and call it directly instead of using `OpenAiService` |
| 121 | + |
109 | 122 | ## Deprecated Endpoints
|
110 | 123 | OpenAI has deprecated engine-based endpoints in favor of model-based endpoints.
|
111 | 124 | For example, instead of using `v1/engines/{engine_id}/completions`, switch to `v1/completions` and specify the model in the `CompletionRequest`.
|
|
0 commit comments