Class SimpleOpenAI


  • public class SimpleOpenAI
    extends Object
    The factory that generates implementations of the OpenAI interfaces.
    • Constructor Detail

      • SimpleOpenAI

        public SimpleOpenAI​(String apiKey,
                            String organizationId,
                            String urlBase,
                            HttpClient httpClient)
        Constructor used to generate a builder.
        Parameters:
        apiKey - Identifier to be used for authentication. Mandatory.
        organizationId - Organization's id to be charged for usage. Optional.
        urlBase - Host's url, If not provided, it'll be https://api.openai.com. Optional.
        httpClient - A HttpClient object. One is created by default if not provided. Optional.
    • Method Detail

      • audios

        public OpenAI.Audios audios()
        Generates an implementation of the Audios interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • chatCompletions

        public OpenAI.ChatCompletions chatCompletions()
        Generates an implementation of the ChatCompletions interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • completions

        public OpenAI.Completions completions()
        Generates an implementation of the Completions interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • embeddings

        public OpenAI.Embeddings embeddings()
        Generates an implementation of the Embeddings interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • files

        public OpenAI.Files files()
        Generates an implementation of the Files interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • images

        public OpenAI.Images images()
        Generates an implementation of the Images interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • models

        public OpenAI.Models models()
        Generates an implementation of the Models interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • moderations

        public OpenAI.Moderations moderations()
        Generates an implementation of the Moderations interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.
      • fineTunings

        public OpenAI.FineTunings fineTunings()
        Generates an implementation of the FineTunings interface to handle requests.
        Returns:
        An instance of the interface. It is created only once.