Skip to content

Commit 08e7c01

Browse files
authored
Add gpt-4 and FAQ to readme (TheoKanning#226)
1 parent 4d5e496 commit 08e7c01

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
> ⚠️OpenAI has deprecated all Engine-based APIs. See [Deprecated Endpoints](https://github.com/TheoKanning/openai-java#deprecated-endpoints) below for more info.
55
66
# 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.
88

99
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
1212
- `service` : A basic service class that creates and calls the client. This is the easiest way to get started.
1313

1414
as well as an example project using the service.
@@ -106,6 +106,19 @@ export OPENAI_TOKEN="sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
106106
./gradlew example:run
107107
```
108108

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+
109122
## Deprecated Endpoints
110123
OpenAI has deprecated engine-based endpoints in favor of model-based endpoints.
111124
For example, instead of using `v1/engines/{engine_id}/completions`, switch to `v1/completions` and specify the model in the `CompletionRequest`.

0 commit comments

Comments
 (0)