Class OpenAiOfficialSetup
java.lang.Object
dev.langchain4j.model.openaiofficial.setup.OpenAiOfficialSetup
Helps configure the OpenAI Java SDK, depending on the platform used.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelProviderdetectModelProvider(boolean isAzure, boolean isGitHubModels, String baseUrl, String azureDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion) static com.openai.client.OpenAIClientAsyncsetupAsyncClient(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.static com.openai.client.OpenAIClientsetupSyncClient(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)
-
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)
-