Interface OpenAiApi
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Batch> cancelBatch(String batchId) Cancels an in-progress batch.io.reactivex.rxjava3.core.Single<FineTuningJob> cancelFineTuningJob(String fineTuningJobId) Cancel fine-tuningio.reactivex.rxjava3.core.Single<Run> cancelThreadRun(String threadId, String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/cancelio.reactivex.rxjava3.core.Single<VectorStoreFileBatch> cancelVectorStoreFileBatch(String vectorStoreId, String batchId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel <p> Cancel vector store file batch @param vectorStoreId The ID of the vector store that the file batch belongs to. @param batchId The ID of the file batch to cancel. @return The modified {@link VectorStoreFileBatch} object.'io.reactivex.rxjava3.core.Single<Assistant> createAssistant(CreateAssistantRequest request) https://api.openai.com/v1/assistantsio.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranscription(okhttp3.RequestBody request) Create transcriptionBeta Transcribes audio into the input language.io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranslation(okhttp3.RequestBody request) Create translationBeta Translates audio into English.io.reactivex.rxjava3.core.Single<Batch> createBatch(CreateBatchRequest request) Creates and executes a batch from an uploaded file of requestsio.reactivex.rxjava3.core.Single<ChatCompletion> Create chat completionBeta Creates a completion for the chat messageio.reactivex.rxjava3.core.Single<CreateEmbeddingResponse> createEmbedding(CreateEmbeddingRequest request) Create embeddings Creates an embedding vector representing the input text.io.reactivex.rxjava3.core.Single<FineTuningJob> Create fine-tuning jobio.reactivex.rxjava3.core.Single<ImageResponse> createImage(CreateImageRequest request) Create image Beta Creates an image given a prompt.io.reactivex.rxjava3.core.Single<ImageResponse> createImageEdit(okhttp3.RequestBody request) Create image editBeta Creates an edited or extended image given an original image and a prompt.io.reactivex.rxjava3.core.Single<ImageResponse> createImageVariation(okhttp3.RequestBody request) Create image variationBeta Creates a variation of a given image.io.reactivex.rxjava3.core.Single<CreateModerationResponse> createModeration(CreateModerationRequest request) Create moderation Classifies if text violates OpenAI's Content Policyio.reactivex.rxjava3.core.Single<okhttp3.ResponseBody> createSpeech(CreateSpeechRequest request) Generates audio from the input text.io.reactivex.rxjava3.core.Single<Thread> createThread(CreateThreadRequest request) https://api.openai.com/v1/threadsio.reactivex.rxjava3.core.Single<Run> https://api.openai.com/v1/threads/runsio.reactivex.rxjava3.core.Single<Message> createThreadMessage(String threadId, CreateMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messagesio.reactivex.rxjava3.core.Single<Run> createThreadRun(String threadId, CreateRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runsio.reactivex.rxjava3.core.Single<VectorStore> invalid input: 'https://api.openai.com/v1/vector_stores <p> Create a vector store. @param request Request body @return An {@link VectorStore} object.'io.reactivex.rxjava3.core.Single<VectorStoreFile> createVectorStoreFile(String vectorStoreId, CreateVectorStoreFileRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files <p> Create vector store file @param vectorStoreId The ID of the {@link VectorStore} for which to create a File. @param request Request body @return An {@link VectorStoreFile} object.'io.reactivex.rxjava3.core.Single<VectorStoreFileBatch> createVectorStoreFileBatch(String vectorStoreId, CreateVectorStoreFileBatchRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches <p> Create a vector store file batch. @param vectorStoreId The ID of the vector store for which to create a File Batch. @param request Request body @return An {@link VectorStoreFileBatch} object.'io.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistant(String assistantId) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<DeleteResponse> deleteFile(String fileId) Delete fileio.reactivex.rxjava3.core.Single<DeleteResponse> deleteThread(String threadId) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<DeleteResponse> deleteVectorStore(String vectorStoreId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Delete a vector store. @param vectorStoreId The ID of the vector store to delete. @return Deletion status'io.reactivex.rxjava3.core.Single<DeleteResponse> deleteVectorStoreFile(String vectorStoreId, String fileId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} <p> Delete vector store file @param vectorStoreId The ID of the vector store that the file belongs to. @param fileId The ID of the file to delete. @return Deletion status'io.reactivex.rxjava3.core.Single<Model> Retrieve modelio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Assistant>> listAssistants(Integer limit, String order, String after, String before) https://api.openai.com/v1/assistantsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Batch>> listBatches(String after, Integer limit) List your organization's batches.io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<File>> List filesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<FineTuningJobEvent>> listFineTuningEvents(String fineTuningJobId, String after, Integer limit) List fine-tuning eventsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Model>> List modelsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Message>> listThreadMessages(String threadId, Integer limit, String order, String after, String before, String runId) https://api.openai.com/v1/threads/{thread_id}/messagesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Run>> https://api.openai.com/v1/threads/{thread_id}/runsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<RunStep>> listThreadRunSteps(String threadId, String runId, Integer limit, String order, String after, String before) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/stepsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStoreFileBatch>> listVectorStoreFileBatches(String vectorStoreId, String batchId, Integer limit, String order, String after, String before, String filter) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files <p> List vector store files in a batchBeta @param vectorStoreId The ID of the vector store that the files belong to. @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @param batchId The ID of the file batch that the files belong to. @param filter Filter by file status. One of in_progress, completed, failed, cancelled.{@link xyz.felh.openai.assistant.vector.store.file.batch.VectorStoreFileBatch.Status} @return A list of {@link VectorStoreFileBatch} objects.'io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStoreFile>> listVectorStoreFiles(String vectorStoreId, Integer limit, String order, String after, String before, String filter) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files <p> List vector store files @param vectorStoreId The ID of the vector store that the files belong to. @param filter Filter by file status. One of in_progress, completed, failed, cancelled of {@link xyz.felh.openai.assistant.vector.store.file.VectorStoreFile.Status}. @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @return A list of {@link VectorStoreFile} objects.'io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStore>> listVectorStores(Integer limit, String order, String after, String before) invalid input: 'https://api.openai.com/v1/vector_stores <p> List vector stores @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @return A list of {@link VectorStore} objects.'io.reactivex.rxjava3.core.Single<Assistant> modifyAssistant(String assistantId, ModifyAssistantRequest request) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<Thread> modifyThread(String threadId, ModifyThreadRequest request) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<Message> modifyThreadMessage(String threadId, String messageId, ModifyMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}io.reactivex.rxjava3.core.Single<Run> modifyThreadRun(String threadId, String runId, ModifyRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}io.reactivex.rxjava3.core.Single<VectorStore> modifyVectorStore(String vectorStoreId, ModifyVectorStoreRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Modifies a vector store. @param vectorStoreId The ID of the vector store to modify. @param request Request body @return The modified {@link VectorStore} object.'io.reactivex.rxjava3.core.Single<Assistant> retrieveAssistant(String assistantId) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<Batch> retrieveBatch(String batchId) Retrieves a batch.io.reactivex.rxjava3.core.Single<File> retrieveFile(String fileId) Retrieve fileio.reactivex.rxjava3.core.Single<String> retrieveFileContent(String fileId) Retrieve file contentio.reactivex.rxjava3.core.Single<FineTuningJob> retrieveFineTuningJob(String fineTuningJobId) Retrieve fine-tuning jobio.reactivex.rxjava3.core.Single<Thread> retrieveThread(String threadId) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<Message> retrieveThreadMessage(String threadId, String messageId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}io.reactivex.rxjava3.core.Single<Run> retrieveThreadRun(String threadId, String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}io.reactivex.rxjava3.core.Single<RunStep> retrieveThreadRunStep(String threadId, String runId, String stepId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}io.reactivex.rxjava3.core.Single<VectorStore> retrieveVectorStore(String vectorStoreId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Retrieves a vector store. @param vectorStoreId The ID of the vector store to retrieve. @return The {@link VectorStore} object matching the specified ID.'io.reactivex.rxjava3.core.Single<VectorStoreFileBatch> retrieveVectorStoreFileBatch(String vectorStoreId, String batchId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id} <p> Retrieves a vector store file batch. @param vectorStoreId The ID of the vector store that the file batch belongs to. @param batchId The ID of the file batch being retrieved. @return The {@link VectorStoreFileBatch} object matching the specified ID.'io.reactivex.rxjava3.core.Single<Run> submitToolOutputs(String threadId, String runId, SubmitToolOutputsRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputsio.reactivex.rxjava3.core.Single<File> uploadFile(okhttp3.MultipartBody.Part file, okhttp3.RequestBody purpose) Upload file
-
Method Details
-
listModels
List models- Returns:
- Lists the currently available models, and provides basic information about each one such as the owner and availability.
-
getModel
@GET("/v1/models/{model_id}") io.reactivex.rxjava3.core.Single<Model> getModel(@Path("model_id") String modelId) Retrieve model- Parameters:
modelId- model ID- Returns:
- Retrieves a model instance, providing basic information about the model such as the owner and permission.
-
createChatCompletion
@POST("/v1/chat/completions") io.reactivex.rxjava3.core.Single<ChatCompletion> createChatCompletion(@Body CreateChatCompletionRequest request) Create chat completionBeta Creates a completion for the chat message- Parameters:
request- Create chat completion request- Returns:
- Chat Completion information
-
createImage
@POST("/v1/images/generations") io.reactivex.rxjava3.core.Single<ImageResponse> createImage(@Body CreateImageRequest request) Create image Beta Creates an image given a prompt.- Parameters:
request- create image request- Returns:
- Image Information Wrapper
-
createImageEdit
@POST("/v1/images/edits") io.reactivex.rxjava3.core.Single<ImageResponse> createImageEdit(@Body okhttp3.RequestBody request) Create image editBeta Creates an edited or extended image given an original image and a prompt.- Parameters:
request- request body- Returns:
- Image Information Wrapper
-
createImageVariation
@POST("/v1/images/variations") io.reactivex.rxjava3.core.Single<ImageResponse> createImageVariation(@Body okhttp3.RequestBody request) Create image variationBeta Creates a variation of a given image.- Parameters:
request- request body- Returns:
- Image Information Wrapper
-
createEmbedding
@POST("/v1/embeddings") io.reactivex.rxjava3.core.Single<CreateEmbeddingResponse> createEmbedding(@Body CreateEmbeddingRequest request) Create embeddings Creates an embedding vector representing the input text.- Parameters:
request- create embedding request- Returns:
- Embeddings
-
createSpeech
@POST("/v1/audio/speech") io.reactivex.rxjava3.core.Single<okhttp3.ResponseBody> createSpeech(@Body CreateSpeechRequest request) Generates audio from the input text.- Parameters:
request- create speech request- Returns:
- audio file
-
createAudioTranscription
@POST("/v1/audio/transcriptions") io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranscription(@Body okhttp3.RequestBody request) Create transcriptionBeta Transcribes audio into the input language.- Parameters:
request- body- Returns:
- Text of audio
-
createAudioTranslation
@POST("/v1/audio/translations") io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranslation(@Body okhttp3.RequestBody request) Create translationBeta Translates audio into English.- Parameters:
request- body- Returns:
- Text of audio
-
createModeration
@POST("/v1/moderations") io.reactivex.rxjava3.core.Single<CreateModerationResponse> createModeration(@Body CreateModerationRequest request) Create moderation Classifies if text violates OpenAI's Content Policy- Parameters:
request- create moderation request- Returns:
- Moderation
-
listFiles
List filesRReturns a list of files that belong to the user's organization.
- Returns:
- A list of
Fileobjects.
-
uploadFile
@Multipart @POST("/v1/files") io.reactivex.rxjava3.core.Single<File> uploadFile(@Part okhttp3.MultipartBody.Part file, @Part("purpose") okhttp3.RequestBody purpose) Upload fileUpload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.
The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl files.
Please contact us if you need to increase these storage limits.
- Parameters:
file- The File object (not file name) to be uploaded.purpose- The intended purpose of the uploaded file. Use "fine-tune" for Fine-tuning and "assistants" for Assistants and Messages. This allows us to validate the format of the uploaded file is correct for fine-tuning.- Returns:
- The uploaded
Fileobject.
-
deleteFile
@DELETE("/v1/files/{file_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteFile(@Path("file_id") String fileId) Delete fileDelete a file.
- Parameters:
fileId- fileId- Returns:
- Deletion status
-
retrieveFile
@GET("/v1/files/{file_id}") io.reactivex.rxjava3.core.Single<File> retrieveFile(@Path("file_id") String fileId) Retrieve fileReturns information about a specific file.
- Parameters:
fileId- fileId- Returns:
- The
Fileobject matching the specified ID.
-
retrieveFileContent
@GET("/v1/files/{file_id}/content") io.reactivex.rxjava3.core.Single<String> retrieveFileContent(@Path("file_id") String fileId) Retrieve file contentReturns the contents of the specified file.
- Parameters:
fileId- The ID of the file to use for this request.- Returns:
- The file content.
-
createFineTuningJob
@POST("/v1/fine_tuning/jobs") io.reactivex.rxjava3.core.Single<FineTuningJob> createFineTuningJob(@Body CreateFineTuningJobRequest request) Create fine-tuning jobCreates a job that fine-tunes a specified model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
- Parameters:
request- create fine tuning job request- Returns:
- A
FineTuningJobobject.
-
cancelFineTuningJob
@POST("/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel") io.reactivex.rxjava3.core.Single<FineTuningJob> cancelFineTuningJob(@Path("fine_tuning_job_id") String fineTuningJobId) Cancel fine-tuningImmediately cancel a fine-tune job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job to cancel.- Returns:
- The cancelled
FineTuningJobobject.
-
retrieveFineTuningJob
@GET("/v1/fine_tuning/jobs/{fine_tuning_job_id}") io.reactivex.rxjava3.core.Single<FineTuningJob> retrieveFineTuningJob(@Path("fine_tuning_job_id") String fineTuningJobId) Retrieve fine-tuning jobGet info about a fine-tuning job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job.- Returns:
- The
FineTuningJobobject with the given ID.
-
listFineTuningEvents
@GET("/v1/fine_tuning/jobs/{fine_tuning_job_id}/events") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<FineTuningJobEvent>> listFineTuningEvents(@Path("fine_tuning_job_id") String fineTuningJobId, @Query("after") String after, @Query("limit") Integer limit) List fine-tuning eventsGet status updates for a fine-tuning job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job to get events for.after- Optional Identifier for the last event from the previous pagination request.limit- Optional Defaults to 20 Number of events to retrieve.- Returns:
- A list of fine-tuning event objects.
-
createBatch
@POST("/v1/batches") io.reactivex.rxjava3.core.Single<Batch> createBatch(@Body CreateBatchRequest request) Creates and executes a batch from an uploaded file of requests- Parameters:
request- create batch request- Returns:
Batch
-
retrieveBatch
@GET("/v1/batches/{batch_id}") io.reactivex.rxjava3.core.Single<Batch> retrieveBatch(@Path("batch_id") String batchId) Retrieves a batch.- Parameters:
batchId- batch id- Returns:
Batch
-
cancelBatch
@POST("/v1/batches/{batch_id}/cancel") io.reactivex.rxjava3.core.Single<Batch> cancelBatch(@Path("batch_id") String batchId) Cancels an in-progress batch.- Parameters:
batchId- batch id- Returns:
Batch
-
listBatches
@GET("/v1/batches") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Batch>> listBatches(@Query("after") String after, @Query("limit") Integer limit) List your organization's batches.- Parameters:
after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.- Returns:
- List of
Batch
-
createAssistant
@POST("/v1/assistants") io.reactivex.rxjava3.core.Single<Assistant> createAssistant(@Body CreateAssistantRequest request) https://api.openai.com/v1/assistantsCreate an assistant with a model and instructions.
- Parameters:
request- Request body- Returns:
- An
Assistantobject.
-
retrieveAssistant
@GET("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<Assistant> retrieveAssistant(@Path("assistant_id") String assistantId) https://api.openai.com/v1/assistants/{assistant_id}The assistant object matching the specified ID.
- Parameters:
assistantId- The ID of the assistant to retrieve.- Returns:
- The ID of the
Assistantto retrieve.
-
modifyAssistant
@POST("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<Assistant> modifyAssistant(@Path("assistant_id") String assistantId, @Body ModifyAssistantRequest request) https://api.openai.com/v1/assistants/{assistant_id}Modifies an assistant.
- Parameters:
assistantId- The ID of the assistant to modify.request- Request body- Returns:
- The modified
Assistantobject.
-
deleteAssistant
@DELETE("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistant(@Path("assistant_id") String assistantId) https://api.openai.com/v1/assistants/{assistant_id}Delete an assistant.
- Parameters:
assistantId- The ID of the assistant to delete.- Returns:
- Deletion status
-
listAssistants
@GET("/v1/assistants") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Assistant>> listAssistants(@Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/assistantsReturns a list of assistants.
- Parameters:
limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
Assistantobjects.
-
createThread
@POST("/v1/threads") io.reactivex.rxjava3.core.Single<Thread> createThread(@Body CreateThreadRequest request) https://api.openai.com/v1/threadsCreate thread
- Parameters:
request- Request body- Returns:
- An
Threadobject.
-
retrieveThread
@GET("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<Thread> retrieveThread(@Path("thread_id") String threadId) https://api.openai.com/v1/threads/{thread_id}Retrieve thread
- Parameters:
threadId- The ID of the thread to retrieve.- Returns:
- The
Threadobject matching the specified ID.
-
modifyThread
@POST("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<Thread> modifyThread(@Path("thread_id") String threadId, @Body ModifyThreadRequest request) https://api.openai.com/v1/threads/{thread_id}Modify thread
- Parameters:
threadId- The ID of the thread to modify. Only the metadata can be modified.request- Request body- Returns:
- The modified
Threadobject matching the specified ID.
-
deleteThread
@DELETE("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteThread(@Path("thread_id") String threadId) https://api.openai.com/v1/threads/{thread_id}Delete thread
- Parameters:
threadId- The ID of the thread to delete.- Returns:
- Deletion status
-
createThreadMessage
@POST("/v1/threads/{thread_id}/messages") io.reactivex.rxjava3.core.Single<Message> createThreadMessage(@Path("thread_id") String threadId, @Body CreateMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messagesCreate message
-
retrieveThreadMessage
@GET("/v1/threads/{thread_id}/messages/{message_id}") io.reactivex.rxjava3.core.Single<Message> retrieveThreadMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}Retrieve message
-
modifyThreadMessage
@POST("/v1/threads/{thread_id}/messages/{message_id}") io.reactivex.rxjava3.core.Single<Message> modifyThreadMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Body ModifyMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}Modify message
- Parameters:
threadId- The ID of the thread to which this message belongs.messageId- The ID of the message to modify.request- Request body- Returns:
- The modified
Messageobject.
-
listThreadMessages
@GET("/v1/threads/{thread_id}/messages") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Message>> listThreadMessages(@Path("thread_id") String threadId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before, @Query("run_id") String runId) https://api.openai.com/v1/threads/{thread_id}/messagesList messages
- Parameters:
threadId- The ID of theThreadthe messages belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.runId- Filter messages by the run ID that generated them.- Returns:
- A list of
Messageobjects.
-
createThreadRun
@POST("/v1/threads/{thread_id}/runs") io.reactivex.rxjava3.core.Single<Run> createThreadRun(@Path("thread_id") String threadId, @Body CreateRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runsCreate a run.
- Parameters:
threadId- The ID of the thread to run.request- Request body- Returns:
- An
Runobject.
-
retrieveThreadRun
@GET("/v1/threads/{thread_id}/runs/{run_id}") io.reactivex.rxjava3.core.Single<Run> retrieveThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}Retrieves a run.
-
modifyThreadRun
@POST("/v1/threads/{thread_id}/runs/{run_id}") io.reactivex.rxjava3.core.Single<Run> modifyThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body ModifyRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}Modify message
-
listThreadRuns
@GET("/v1/threads/{thread_id}/runs") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Run>> listThreadRuns(@Path("thread_id") String threadId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/runsList messages
- Parameters:
threadId- The ID of theThreadthe messages belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
Runobjects.
-
submitToolOutputs
@GET("/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs") io.reactivex.rxjava3.core.Single<Run> submitToolOutputs(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body SubmitToolOutputsRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs -
cancelThreadRun
@GET("/v1/threads/{thread_id}/runs/{run_id}/cancel") io.reactivex.rxjava3.core.Single<Run> cancelThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/cancelCancels a run that is in_progress.
- Parameters:
threadId- The ID of the thread to which this run belongs.runId- The ID of the run to cancel.- Returns:
- The modified
Runobject matching the specified ID.
-
createThreadAndRun
@POST("/v1/threads/runs") io.reactivex.rxjava3.core.Single<Run> createThreadAndRun(@Body CreateThreadAndRunRequest request) https://api.openai.com/v1/threads/runsCreate a thread and run it in one request.
- Parameters:
request- Request body- Returns:
- A
Runobject.
-
retrieveThreadRunStep
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}") io.reactivex.rxjava3.core.Single<RunStep> retrieveThreadRunStep(@Path("thread_id") String threadId, @Path("run_id") String runId, @Path("step_id") String stepId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}Retrieves a run step.
- Parameters:
threadId- The ID of the thread to which the run and run step belongs.runId- The ID of the run to which the run step belongs.stepId- The ID of the run step to retrieve.- Returns:
- The
RunStepobject matching the specified ID.
-
listThreadRunSteps
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<RunStep>> listThreadRunSteps(@Path("thread_id") String threadId, @Path("run_id") String runId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/stepsList run steps
- Parameters:
threadId- The ID of theThreadthe messages belong to.runId- The ID of the run steps belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
RunStepobjects.
-
createVectorStore
@POST("/v1/vector_stores") io.reactivex.rxjava3.core.Single<VectorStore> createVectorStore(@Body CreateVectorStoreRequest request) invalid input: 'https://api.openai.com/v1/vector_stores <p> Create a vector store. @param request Request body @return An {@link VectorStore} object.' -
retrieveVectorStore
@GET("/v1/vector_stores/{vector_store_id}") io.reactivex.rxjava3.core.Single<VectorStore> retrieveVectorStore(@Path("vector_store_id") String vectorStoreId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Retrieves a vector store. @param vectorStoreId The ID of the vector store to retrieve. @return The {@link VectorStore} object matching the specified ID.' -
modifyVectorStore
@POST("/v1/vector_stores/{vector_store_id}") io.reactivex.rxjava3.core.Single<VectorStore> modifyVectorStore(@Path("vector_store_id") String vectorStoreId, @Body ModifyVectorStoreRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Modifies a vector store. @param vectorStoreId The ID of the vector store to modify. @param request Request body @return The modified {@link VectorStore} object.' -
deleteVectorStore
@DELETE("/v1/vector_stores/{vector_store_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteVectorStore(@Path("vector_store_id") String vectorStoreId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id} <p> Delete a vector store. @param vectorStoreId The ID of the vector store to delete. @return Deletion status' -
listVectorStores
@GET("/v1/vector_stores") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStore>> listVectorStores(@Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) invalid input: 'https://api.openai.com/v1/vector_stores <p> List vector stores @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @return A list of {@link VectorStore} objects.' -
createVectorStoreFile
@POST("/v1/vector_stores/{vector_store_id}/files") io.reactivex.rxjava3.core.Single<VectorStoreFile> createVectorStoreFile(@Path("vector_store_id") String vectorStoreId, @Body CreateVectorStoreFileRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files <p> Create vector store file @param vectorStoreId The ID of the {@link VectorStore} for which to create a File. @param request Request body @return An {@link VectorStoreFile} object.' -
deleteVectorStoreFile
@DELETE("/v1/vector_stores/{vector_store_id}/files/{file_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteVectorStoreFile(@Path("vector_store_id") String vectorStoreId, @Path("file_id") String fileId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} <p> Delete vector store file @param vectorStoreId The ID of the vector store that the file belongs to. @param fileId The ID of the file to delete. @return Deletion status' -
listVectorStoreFiles
@GET("/v1/vector_stores/{vector_store_id}/files") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStoreFile>> listVectorStoreFiles(@Path("vector_store_id") String vectorStoreId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before, @Query("filter") String filter) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/files <p> List vector store files @param vectorStoreId The ID of the vector store that the files belong to. @param filter Filter by file status. One of in_progress, completed, failed, cancelled of {@link xyz.felh.openai.assistant.vector.store.file.VectorStoreFile.Status}. @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @return A list of {@link VectorStoreFile} objects.' -
createVectorStoreFileBatch
@POST("/v1/vector_stores/{vector_store_id}/file_batches") io.reactivex.rxjava3.core.Single<VectorStoreFileBatch> createVectorStoreFileBatch(@Path("vector_store_id") String vectorStoreId, @Body CreateVectorStoreFileBatchRequest request) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches <p> Create a vector store file batch. @param vectorStoreId The ID of the vector store for which to create a File Batch. @param request Request body @return An {@link VectorStoreFileBatch} object.' -
retrieveVectorStoreFileBatch
@GET("/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}") io.reactivex.rxjava3.core.Single<VectorStoreFileBatch> retrieveVectorStoreFileBatch(@Path("vector_store_id") String vectorStoreId, @Path("batch_id") String batchId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id} <p> Retrieves a vector store file batch. @param vectorStoreId The ID of the vector store that the file batch belongs to. @param batchId The ID of the file batch being retrieved. @return The {@link VectorStoreFileBatch} object matching the specified ID.' -
cancelVectorStoreFileBatch
@POST("/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel") io.reactivex.rxjava3.core.Single<VectorStoreFileBatch> cancelVectorStoreFileBatch(@Path("vector_store_id") String vectorStoreId, @Path("batch_id") String batchId) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel <p> Cancel vector store file batch @param vectorStoreId The ID of the vector store that the file batch belongs to. @param batchId The ID of the file batch to cancel. @return The modified {@link VectorStoreFileBatch} object.' -
listVectorStoreFileBatches
@GET("/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<VectorStoreFileBatch>> listVectorStoreFileBatches(@Path("vector_store_id") String vectorStoreId, @Path("batch_id") String batchId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before, @Query("filter") String filter) invalid input: 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files <p> List vector store files in a batchBeta @param vectorStoreId The ID of the vector store that the files belong to. @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. @param order Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. @param after A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. @param before A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. @param batchId The ID of the file batch that the files belong to. @param filter Filter by file status. One of in_progress, completed, failed, cancelled.{@link xyz.felh.openai.assistant.vector.store.file.batch.VectorStoreFileBatch.Status} @return A list of {@link VectorStoreFileBatch} objects.'
-