File tree Expand file tree Collapse file tree
src/main/java/org/devlive/sdk/openai/interceptor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 - navigation
66---
77
8+ ### 1.2.0
9+
10+ ---
11+
12+ - Support report error message
13+ - Supports custom ` OkHttpClient `
14+ - Add a default interceptor
15+ - Support list api keys
16+ - Support create new api key
17+
818### 1.1.0
919
1020---
Original file line number Diff line number Diff line change 55
66 <groupId >org.devlive.sdk</groupId >
77 <artifactId >openai-java-sdk</artifactId >
8- <version >1.2.0-SNAPSHOT </version >
8+ <version >1.2.0</version >
99
1010 <name >openai-java-sdk</name >
1111 <description >
Original file line number Diff line number Diff line change 66import lombok .extern .slf4j .Slf4j ;
77import okhttp3 .Interceptor ;
88import okhttp3 .Request ;
9+ import okhttp3 .RequestBody ;
910import okhttp3 .Response ;
1011import okhttp3 .ResponseBody ;
1112import okio .Buffer ;
@@ -52,9 +53,10 @@ public Response intercept(Chain chain) throws IOException
5253 Request original = chain .request ();
5354 Request request = this .headers (original );
5455
55- if (ObjectUtils .isNotEmpty (request .body ())) {
56+ RequestBody requestBody = request .body ();
57+ if (ObjectUtils .isNotEmpty (requestBody )) {
5658 Buffer buffer = new Buffer ();
57- request . body () .writeTo (buffer );
59+ requestBody .writeTo (buffer );
5860 log .debug ("Request body {}" , buffer .readUtf8 ());
5961 }
6062
You can’t perform that action at this time.
0 commit comments