Class OpenAiService

java.lang.Object
xyz.felh.openai.OpenAiService

public class OpenAiService extends Object
OpenAi Service Class
  • Constructor Details

    • OpenAiService

      public OpenAiService(String token)
      Creates a new OpenAiService that wraps OpenAiApi
      Parameters:
      token - OpenAi token string "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    • OpenAiService

      public OpenAiService(String token, Duration timeout)
      Creates a new OpenAiService that wraps OpenAiApi
      Parameters:
      token - OpenAi token string "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      timeout - http read timeout, Duration.ZERO means no timeout
    • OpenAiService

      public OpenAiService(OpenAiApi api, okhttp3.OkHttpClient client)
      Creates a new OpenAiService that wraps OpenAiApi. Use this if you need more customization.
      Parameters:
      api - OpenAiApi instance to use for all methods
  • Method Details

    • execute

      public static <T> T execute(io.reactivex.rxjava3.core.Single<T> apiCall)
      Calls the Open AI api, returns the response, and parses error messages if the request fails
    • buildApi

      public static OpenAiApi buildApi(String token, Duration timeout)
    • defaultObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()
    • defaultClient

      public static okhttp3.OkHttpClient defaultClient(String token, Duration timeout)
    • defaultClient

      public static okhttp3.OkHttpClient defaultClient(String token, String orgId, String projectId, Duration timeout)
    • defaultRetrofit

      public static retrofit2.Retrofit defaultRetrofit(okhttp3.OkHttpClient client, com.fasterxml.jackson.databind.ObjectMapper mapper)
    • listModels

      public List<Model> listModels()
    • getModel

      public Model getModel(String modelId)
    • createChatCompletion

      public ChatCompletion createChatCompletion(CreateChatCompletionRequest request)
      gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301 gpt-3.5-turbo-1006, gpt-4-1106-preview
      Parameters:
      request - create chat completion request
      Returns:
      chat completion
    • createChatCompletion

      public ChatCompletion createChatCompletion(CreateChatCompletionRequest request, Function<ChatCompletion,CreateChatCompletionRequest> toolCallsHandler)
      Parameters:
      request - create chat completion request
      toolCallsHandler - handle tool calls and then build the next request
      Returns:
      chat completion
    • createSteamChatCompletion

      public void createSteamChatCompletion(String requestId, CreateChatCompletionRequest request, @NonNull @NonNull StreamListener<ChatCompletion> listener)
      create chat completion by stream, user-side handled if there is tool_calls
      Parameters:
      requestId - request ID, every observer is unique
      request - detail of request
      listener - StreamChatCompletionListener
    • createSteamChatCompletion

      public void createSteamChatCompletion(String requestId, CreateChatCompletionRequest request, @NonNull @NonNull StreamListener<ChatCompletion> listener, BiFunction<String,ChatCompletion,StreamToolCallsRequest> toolCallsHandler)
      create chat completion by stream, sdk-side handled if there is tool_calls
      Parameters:
      requestId - request ID, every observer is unique
      request - detail of request
      listener - StreamChatCompletionListener
      toolCallsHandler - handle tool calls and then build the next request
    • createImage

      public ImageResponse createImage(CreateImageRequest request)
    • createImageEdit

      public ImageResponse createImageEdit(CreateEditRequest request)
    • createImageVariation

      public ImageResponse createImageVariation(CreateVariationRequest request)
    • createEmbeddings

      public CreateEmbeddingResponse createEmbeddings(CreateEmbeddingRequest request)
      text-embedding-ada-002, text-search-ada-doc-001
      Parameters:
      request - create Embedding request
      Returns:
      create embedding response
    • createSpeech

      @POST("/v1/audio/speech") public byte[] createSpeech(CreateSpeechRequest request) throws IOException
      Generates audio from the input text.
      Parameters:
      request - create speech request
      Returns:
      audio file
      Throws:
      IOException
    • createAudioTranscription

      public AudioResponse createAudioTranscription(CreateAudioTranscriptionRequest request)
      Transcribes audio into the input language. whisper-1

      Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']

      Parameters:
      request - create audio transcription request
      Returns:
      audio response
    • createAudioTranslation

      public AudioResponse createAudioTranslation(CreateAudioTranslationRequest request)
      whisper-1

      Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']

      Parameters:
      request - create audio traslation request
      Returns:
      audio
    • listFiles

      public List<File> listFiles()
    • uploadFile

      public File uploadFile(File file, File.Purpose purpose)
    • uploadFile

      public File uploadFile(String filepath, File.Purpose purpose)
    • deleteFile

      public DeleteResponse deleteFile(String fileId)
    • retrieveFile

      public File retrieveFile(String fileId)
    • retrieveFileContent

      public String retrieveFileContent(String fileId)
      Parameters:
      fileId - file id
      Returns:
      file content
    • createModeration

      public CreateModerationResponse createModeration(CreateModerationRequest request)
      text-moderation-stable, text-moderation-latest
      Parameters:
      request - create moderation request
      Returns:
      moderation response
    • createFineTuningJob

      public FineTuningJob createFineTuningJob(CreateFineTuningJobRequest request)
      Creates a job that fine-tunes a specified model from a given dataset.
      Parameters:
      request - CreateFineTuningJobRequest
      Returns:
      A fine-tuning.job object.
    • retrieveFineTuningJob

      public FineTuningJob retrieveFineTuningJob(String fineTuningJobId)
      Get info about a fine-tuning job.
      Parameters:
      fineTuningJobId - fineTuningJobId
      Returns:
      The fine-tuning object with the given ID.
    • cancelFineTuningJob

      public FineTuningJob cancelFineTuningJob(String fineTuningJobId)
      Immediately cancel a fine-tune job.
      Parameters:
      fineTuningJobId - fineTuningJobId
      Returns:
      The cancelled fine-tuning object.
    • listFineTuningEvents

      public List<FineTuningJobEvent> listFineTuningEvents(String fineTuningJobId, String after, Integer limit)
      Get status updates for a fine-tuning job.
      Parameters:
      fineTuningJobId - fineTuningJobId
      after - Identifier for the last event from the previous pagination request.
      limit - Number of events to retrieve.
      Returns:
      A list of fine-tuning event objects.
    • createBatch

      public Batch createBatch(CreateBatchRequest request)
      Creates and executes a batch from an uploaded file of requests
      Parameters:
      request - create batch request
      Returns:
      a batch object
    • retrieveBatch

      public Batch retrieveBatch(String batchId)
      Retrieves a batch.
      Parameters:
      batchId - batch id
      Returns:
      a batch object
    • cancelBatch

      public Batch cancelBatch(String batchId)
      Cancels an in-progress batch.
      Parameters:
      batchId - batch id
      Returns:
      a batch object
    • listBatches

      public List<Batch> listBatches(String after, Integer limit)
      List your organization's batches.
      Parameters:
      after - A cursor for use in pagination
      limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
      Returns:
      a list of batch
    • createAssistant

      public Assistant createAssistant(CreateAssistantRequest request)
      POST https://api.openai.com/v1/assistants

      Create an assistant with a model and instructions.

      Parameters:
      request - Request body
      Returns:
      An Assistant object.
    • retrieveAssistant

      public Assistant retrieveAssistant(String assistantId)
      Retrieves an assistant.
      Parameters:
      assistantId - The ID of the assistant to retrieve.
      Returns:
      The Assistant object matching the specified ID.
    • modifyAssistant

      public Assistant modifyAssistant(String assistantId, ModifyAssistantRequest request)
      POST 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 Assistant object.
    • deleteAssistant

      public DeleteResponse deleteAssistant(String assistantId)
      DELETE https://api.openai.com/v1/assistants/{assistant_id}

      Delete an assistant.

      Parameters:
      assistantId - The ID of the assistant to delete.
      Returns:
      Deletion status
    • listAssistants

      public OpenAiApiListResponse<Assistant> listAssistants(Integer limit, String order, String after, String before)
      GET https://api.openai.com/v1/assistants

      Returns 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 Assistant objects.
    • listAssistants

      public OpenAiApiListResponse<Assistant> listAssistants()
    • createThread

      public Thread createThread(CreateThreadRequest request)
      POST https://api.openai.com/v1/threads

      Create thread

      Parameters:
      request - Request body
      Returns:
      An Thread object.
    • retrieveThread

      public Thread retrieveThread(String threadId)
      GET https://api.openai.com/v1/threads/{thread_id}

      Retrieve thread

      Parameters:
      threadId - The ID of the thread to retrieve.
      Returns:
      The Thread object matching the specified ID.
    • modifyThread

      public Thread modifyThread(String threadId, ModifyThreadRequest request)
      GET 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 Thread object matching the specified ID.
    • deleteThread

      public DeleteResponse deleteThread(String threadId)
      DELETE https://api.openai.com/v1/threads/{thread_id}

      Delete thread

      Parameters:
      threadId - The ID of the thread to delete.
      Returns:
      Deletion status
    • createThreadMessage

      public Message createThreadMessage(String threadId, CreateMessageRequest request)
      POST https://api.openai.com/v1/threads/{thread_id}/messages

      Create message

      Parameters:
      threadId - The ID of the Thread to create a message for.
      request - Request body
      Returns:
      An Message object.
    • retrieveThreadMessage

      public Message retrieveThreadMessage(String threadId, String messageId)
      GET https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}

      Retrieve message

      Parameters:
      threadId - The ID of the Thread to which this message belongs.
      messageId - The ID of the message to retrieve.
      Returns:
      The Message object matching the specified ID.
    • modifyThreadMessage

      public Message modifyThreadMessage(String threadId, String messageId, ModifyMessageRequest request)
      GET 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 Message object.
    • listThreadMessages

      public OpenAiApiListResponse<Message> listThreadMessages(String threadId, Integer limit, String order, String after, String before, String runId)
      GET https://api.openai.com/v1/threads/{thread_id}/messages

      List messages

      Parameters:
      threadId - The ID of the Thread the 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 Message objects.
    • listThreadMessages

      public OpenAiApiListResponse<Message> listThreadMessages(String threadId, String runId)
    • createThreadRun

      public Run createThreadRun(String threadId, CreateRunRequest request)
      POST https://api.openai.com/v1/threads/{thread_id}/runs

      Create a run.

      Parameters:
      threadId - The ID of the thread to run.
      request - Request body
      Returns:
      An Run object.
    • createThreadRun

      public void createThreadRun(String requestId, String threadId, CreateRunRequest request, @NonNull @NonNull StreamListener<IOpenAiApiObject> listener)
      POST https://api.openai.com/v1/threads/{thread_id}/runs

      Create a run with stream = true.

      Parameters:
      threadId - The ID of the thread to run.
      request - Request body
      listener - listener
    • retrieveThreadRun

      public Run retrieveThreadRun(String threadId, String runId)
      GET https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}

      Retrieves a run.

      Parameters:
      threadId - The ID of the Thread that was run.
      runId - The ID of the run to retrieve.
      Returns:
      The Run object matching the specified ID.
    • modifyThreadRun

      public Run modifyThreadRun(String threadId, String runId, ModifyRunRequest request)
      GET https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}

      Modify message

      Parameters:
      threadId - The ID of the Thread that was run.
      runId - The ID of the run to modify.
      request - Request body
      Returns:
      The modified Run object.
    • listThreadRuns

      public OpenAiApiListResponse<Run> listThreadRuns(String threadId, Integer limit, String order, String after, String before)
      GET https://api.openai.com/v1/threads/{thread_id}/runs

      List messages

      Parameters:
      threadId - The ID of the Thread the 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 Run objects.
    • listThreadRuns

      public OpenAiApiListResponse<Run> listThreadRuns(String threadId)
    • submitToolOutputs

      public Run submitToolOutputs(String threadId, String runId, SubmitToolOutputsRequest request)
      POST https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs
      Parameters:
      threadId - The ID of the Thread to which this run belongs.
      runId - The ID of the run that requires the tool output submission.
      request - Request body
      Returns:
      The modified Run object matching the specified ID.
    • submitToolOutputs

      public void submitToolOutputs(String requestId, String threadId, String runId, SubmitToolOutputsRequest request, @NonNull @NonNull StreamListener<IOpenAiApiObject> listener)
      POST https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs
      Parameters:
      threadId - The ID of the Thread to which this run belongs.
      runId - The ID of the run that requires the tool output submission.
      request - Request body
      listener - stream event listener
    • cancelThreadRun

      public Run cancelThreadRun(String threadId, String runId)
      POST https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/cancel

      Cancels 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 Run object matching the specified ID.
    • createThreadAndRun

      public Run createThreadAndRun(CreateThreadAndRunRequest request)
      POST https://api.openai.com/v1/threads/runs

      Create a thread and run it in one request.

      Parameters:
      request - Request body
      Returns:
      A Run object.
    • createThreadAndRun

      public void createThreadAndRun(String requestId, CreateThreadAndRunRequest request, @NonNull @NonNull StreamListener<IOpenAiApiObject> listener)
      POST https://api.openai.com/v1/threads/runs

      Create a thread and run it in one request with stream = true.

      Parameters:
      request - Request body
    • retrieveThreadRunStep

      public RunStep retrieveThreadRunStep(String threadId, String runId, String stepId)
      GET 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 RunStep object matching the specified ID.
    • listThreadRunSteps

      public OpenAiApiListResponse<RunStep> listThreadRunSteps(String threadId, String runId, Integer limit, String order, String after, String before)
      GET https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps

      List run steps

      Parameters:
      threadId - The ID of the Thread the 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 RunStep objects.
    • listThreadRunSteps

      public OpenAiApiListResponse<RunStep> listThreadRunSteps(String threadId, String runId)
    • createVectorStore

      public VectorStore createVectorStore(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

      public 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.'
    • modifyVectorStore

      public 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.'
    • deleteVectorStore

      public 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'
    • listVectorStores

      public 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.'
    • listVectorStores

      public OpenAiApiListResponse<VectorStore> listVectorStores()
    • createVectorStoreFile

      public 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.'
    • deleteVectorStoreFile

      public 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'
    • listVectorStoreFiles

      public 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.'
    • listVectorStoreFiles

      public OpenAiApiListResponse<VectorStoreFile> listVectorStoreFiles(String vectorStoreId, String filter)
    • createVectorStoreFileBatch

      public 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.'
    • retrieveVectorStoreFileBatch

      public 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.'
    • cancelVectorStoreFileBatch

      public 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.'
    • listVectorStoreFileBatches

      public 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.'
    • listVectorStoreFileBatches

      public OpenAiApiListResponse<VectorStoreFileBatch> listVectorStoreFileBatches(String vectorStoreId, String batchId, String filter)