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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    detectModelProvider(boolean isMicrosoftFoundry, boolean isGitHubModels, String baseUrl, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion)
     
    static com.openai.client.OpenAIClientAsync
    setupAsyncClient(String baseUrl, String apiKey, com.openai.credential.Credential credential, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isMicrosoftFoundry, 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.
    static com.openai.client.OpenAIClient
    setupSyncClient(String baseUrl, String apiKey, com.openai.credential.Credential credential, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isMicrosoftFoundry, boolean isGitHubModels, String modelName, Duration timeout, Integer maxRetries, Proxy proxy, Map<String,String> customHeaders)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isMicrosoftFoundry, 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 microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAiServiceVersion, String organizationId, boolean isMicrosoftFoundry, 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 isMicrosoftFoundry, boolean isGitHubModels, String baseUrl, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion)