Class OpenAiOfficialSetup

java.lang.Object
dev.langchain4j.model.openaiofficial.setup.OpenAiOfficialSetup

public class OpenAiOfficialSetup extends Object
Helps configure the OpenAI Java SDK, depending on the platform used.
  • Constructor Details

    • OpenAiOfficialSetup

      public OpenAiOfficialSetup()
  • Method Details

    • setupSyncClient

      public static com.openai.client.OpenAIClient setupSyncClient(String baseUrl, String apiKey, com.openai.credential.Credential credential, String azureDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isAzure, boolean isGitHubModels, String modelName, Duration timeout, Integer maxRetries, Proxy proxy, Map<String,String> customHeaders)
    • setupAsyncClient

      public static com.openai.client.OpenAIClientAsync setupAsyncClient(String baseUrl, String apiKey, com.openai.credential.Credential credential, String azureDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isAzure, boolean isGitHubModels, String modelName, Duration timeout, Integer maxRetries, Proxy proxy, Map<String,String> customHeaders)
      The asynchronous client setup is the same as the synchronous one in the OpenAI Java SDK, but uses a different client implementation.
    • detectModelProvider

      public static ModelProvider detectModelProvider(boolean isAzure, boolean isGitHubModels, String baseUrl, String azureDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion)