Package xyz.felh.openai.interceptor
Class AuthenticationInterceptor
java.lang.Object
xyz.felh.openai.interceptor.AuthenticationInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
OkHttp Interceptor that adds an authorization token header
-
Nested Class Summary
Nested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion -
Field Summary
Fields inherited from interface okhttp3.Interceptor
Companion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)
-
Constructor Details
-
AuthenticationInterceptor
Constructor- Parameters:
token- OPENAI_API_KEYorgId- OPENAI ORGANIZATION ID
-
-
Method Details
-
intercept
@NonNull public @NonNull okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException - Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-