Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

fix: content type in assistant api calls #466

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions client/src/main/java/com/theokanning/openai/client/OpenAiApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,126 +199,126 @@ public interface OpenAiApi {
@GET("v1/dashboard/billing/usage")
Single<BillingUsage> billingUsage(@Query("start_date") LocalDate starDate, @Query("end_date") LocalDate endDate);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/assistants")
Single<Assistant> createAssistant(@Body AssistantRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/assistants/{assistant_id}")
Single<Assistant> retrieveAssistant(@Path("assistant_id") String assistantId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/assistants/{assistant_id}")
Single<Assistant> modifyAssistant(@Path("assistant_id") String assistantId, @Body ModifyAssistantRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@DELETE("/v1/assistants/{assistant_id}")
Single<DeleteResult> deleteAssistant(@Path("assistant_id") String assistantId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/assistants")
Single<OpenAiResponse<Assistant>> listAssistants(@QueryMap Map<String, Object> filterRequest);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/assistants/{assistant_id}/files")
Single<AssistantFile> createAssistantFile(@Path("assistant_id") String assistantId, @Body AssistantFileRequest fileRequest);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/assistants/{assistant_id}/files/{file_id}")
Single<AssistantFile> retrieveAssistantFile(@Path("assistant_id") String assistantId, @Path("file_id") String fileId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@DELETE("/v1/assistants/{assistant_id}/files/{file_id}")
Single<DeleteResult> deleteAssistantFile(@Path("assistant_id") String assistantId, @Path("file_id") String fileId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/assistants/{assistant_id}/files")
Single<OpenAiResponse<AssistantFile>> listAssistantFiles(@Path("assistant_id") String assistantId, @QueryMap Map<String, Object> filterRequest);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads")
Single<Thread> createThread(@Body ThreadRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}")
Single<Thread> retrieveThread(@Path("thread_id") String threadId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}")
Single<Thread> modifyThread(@Path("thread_id") String threadId, @Body ThreadRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@DELETE("/v1/threads/{thread_id}")
Single<DeleteResult> deleteThread(@Path("thread_id") String threadId);


@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/messages")
Single<Message> createMessage(@Path("thread_id") String threadId, @Body MessageRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages/{message_id}")
Single<Message> retrieveMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/messages/{message_id}")
Single<Message> modifyMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Body ModifyMessageRequest request);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages")
Single<OpenAiResponse<Message>> listMessages(@Path("thread_id") String threadId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages")
Single<OpenAiResponse<Message>> listMessages(@Path("thread_id") String threadId, @QueryMap Map<String, Object> filterRequest);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages/{message_id}/files/{file_id}")
Single<MessageFile> retrieveMessageFile(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Path("file_id") String fileId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages/{message_id}/files")
Single<OpenAiResponse<MessageFile>> listMessageFiles(@Path("thread_id") String threadId, @Path("message_id") String messageId);

@Headers({"OpenAI-Beta: assistants=v1"})
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/messages/{message_id}/files")
Single<OpenAiResponse<MessageFile>> listMessageFiles(@Path("thread_id") String threadId, @Path("message_id") String messageId, @QueryMap Map<String, Object> filterRequest);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/runs")
Single<Run> createRun(@Path("thread_id") String threadId, @Body RunCreateRequest runCreateRequest);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/runs/{run_id}")
Single<Run> retrieveRun(@Path("thread_id") String threadId, @Path("run_id") String runId);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/runs/{run_id}")
Single<Run> modifyRun(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body Map<String, String> metadata);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/runs")
Single<OpenAiResponse<Run>> listRuns(@Path("thread_id") String threadId, @QueryMap Map<String, String> listSearchParameters);


@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs")
Single<Run> submitToolOutputs(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body SubmitToolOutputsRequest submitToolOutputsRequest);


@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/{thread_id}/runs/{run_id}/cancel")
Single<Run> cancelRun(@Path("thread_id") String threadId, @Path("run_id") String runId);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@POST("/v1/threads/runs")
Single<Run> createThreadAndRun(@Body CreateThreadAndRunRequest createThreadAndRunRequest);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}")
Single<RunStep> retrieveRunStep(@Path("thread_id") String threadId, @Path("run_id") String runId, @Path("step_id") String stepId);

@Headers("OpenAI-Beta: assistants=v1")
@Headers({"OpenAI-Beta: assistants=v1", "Content-Type: application/json"})
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps")
Single<OpenAiResponse<RunStep>> listRunSteps(@Path("thread_id") String threadId, @Path("run_id") String runId, @QueryMap Map<String, String> listSearchParameters);
}