Class OpenAI.Builder

java.lang.Object
io.github.stefanbratanov.jvm.openai.OpenAI.Builder
Enclosing class:
OpenAI

public static class OpenAI.Builder extends Object
  • Constructor Details

    • Builder

      public Builder(String apiKey)
  • Method Details

    • baseUrl

      public OpenAI.Builder baseUrl(String baseUrl)
      Parameters:
      baseUrl - the url which exposes the OpenAI API
    • organization

      public OpenAI.Builder organization(String organization)
      Parameters:
      organization - for users who belong to multiple organizations and are accessing their projects through their legacy user API key, specify which organization will be used for the API requests
    • project

      public OpenAI.Builder project(String project)
      Parameters:
      project - for users who are accessing their projects through their legacy user API key, specify which project will be used for the API requests
    • httpClient

      public OpenAI.Builder httpClient(HttpClient httpClient)
      Parameters:
      httpClient - a custom HttpClient which will be used for the API requests
    • requestTimeout

      public OpenAI.Builder requestTimeout(Duration requestTimeout)
      Parameters:
      requestTimeout - a timeout in the form of a Duration which will be set for the API requests. If none is set, there will be no timeout.
    • build

      public OpenAI build()