Skip to content

Commit 3b9a277

Browse files
committed
feat: response api client
1 parent 92e548b commit 3b9a277

File tree

18 files changed

+1951
-3526
lines changed

18 files changed

+1951
-3526
lines changed

RESPONSE_API_USAGE.md

Lines changed: 592 additions & 0 deletions
Large diffs are not rendered by default.

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>top.bella</groupId>
88
<artifactId>openai-java</artifactId>
9-
<version>0.23.82</version>
9+
<version>0.23.83</version>
1010
</parent>
1111
<packaging>jar</packaging>
1212
<artifactId>openai-api</artifactId>

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>top.bella</groupId>
88
<artifactId>openai-java</artifactId>
9-
<version>0.23.82</version>
9+
<version>0.23.83</version>
1010
</parent>
1111
<packaging>jar</packaging>
1212

client/src/main/java/com/theokanning/openai/client/OpenAiApi.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,5 +412,28 @@ public interface OpenAiApi {
412412

413413
@POST("web/extract")
414414
Single<WebExtractResponse> webExtract(@Body WebExtractRequest request);
415+
416+
// Response API operations
417+
/**
418+
* Create a new response (non-streaming mode).
419+
* POST /v1/responses
420+
*/
421+
@POST("responses")
422+
Single<com.theokanning.openai.response.Response> createResponse(@Body com.theokanning.openai.response.CreateResponseRequest request);
423+
424+
/**
425+
* Create a new response (streaming mode with SSE).
426+
* POST /v1/responses
427+
*/
428+
@Streaming
429+
@POST("responses")
430+
Call<ResponseBody> createResponseStream(@Body com.theokanning.openai.response.CreateResponseRequest request);
431+
432+
/**
433+
* Retrieve a response by ID.
434+
* GET /v1/responses/{response_id}
435+
*/
436+
@GET("responses/{response_id}")
437+
Single<com.theokanning.openai.response.Response> getResponse(@Path("response_id") String responseId);
415438
}
416439

0 commit comments

Comments
 (0)