You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using retrofit, you can import the `client` module and use the [OpenAiApi](client/src/main/java/com/theokanning/openai/OpenAiApi.java).
49
+
You'll have to add your auth token as a header (see [AuthenticationInterceptor](client/src/main/java/com/theokanning/openai/AuthenticationInterceptor.java))
50
+
and set your converter factory to use snake case and only include non-null fields.
52
51
53
-
### Using OpenAiService
54
-
If you're looking for the fastest solution, import the `client` and use [OpenAiService](client/src/main/java/com/theokanning/openai/OpenAiService.java).
52
+
### OpenAiService
53
+
If you're looking for the fastest solution, import the `service` module and use [OpenAiService](client/src/main/java/com/theokanning/openai/OpenAiService.java).
54
+
55
+
> ⚠️The OpenAiService in the client module is deprecated, please switch to the new version in the service module.
55
56
```
56
57
OpenAiService service = new OpenAiService("your_token");
If you're using retrofit, you can import the `client` module and use the [OpenAiApi](client/src/main/java/com/theokanning/openai/OpenAiApi.java).
67
-
You'll have to add your auth token as a header (see [AuthenticationInterceptor](client/src/main/java/com/theokanning/openai/AuthenticationInterceptor.java))
68
-
and set your converter factory to use snake case and only include non-null fields.
66
+
### Customizing OpenAiService
67
+
If you need to customize OpenAiService, create your own Retrofit client and pass it in to the constructor.
68
+
For example, do the following to add request logging (after adding the logging gradle dependency):
0 commit comments