Sdílet prostřednictvím


OpenAIClientBuilder Class

  • java.lang.Object
    • com.azure.ai.openai.OpenAIClientBuilder

Implements

public final class OpenAIClientBuilder
implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, KeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder>

A builder for creating a new instance of the OpenAIClient type.

Constructor Summary

Constructor Description
OpenAIClientBuilder()

Create an instance of the OpenAIClientBuilder.

Method Summary

Modifier and Type Method and Description
OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

OpenAIAsyncClient buildAsyncClient()

Builds an instance of OpenAIAsyncClient class.

OpenAIClient buildClient()

Builds an instance of OpenAIClient class.

OpenAIClientBuilder clientOptions(ClientOptions clientOptions)

.

OpenAIClientBuilder configuration(Configuration configuration)

.

OpenAIClientBuilder credential(KeyCredential keyCredential)

.

OpenAIClientBuilder credential(TokenCredential tokenCredential)

.

OpenAIClientBuilder endpoint(String endpoint)

.

OpenAIClientBuilder httpClient(HttpClient httpClient)

.

OpenAIClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

.

OpenAIClientBuilder pipeline(HttpPipeline pipeline)

.

OpenAIClientBuilder retryOptions(RetryOptions retryOptions)

.

OpenAIClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion)

Sets Service version.

Methods inherited from java.lang.Object

Constructor Details

OpenAIClientBuilder

public OpenAIClientBuilder()

Create an instance of the OpenAIClientBuilder.

Method Details

addPolicy

public OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

Parameters:

customPolicy

buildAsyncClient

public OpenAIAsyncClient buildAsyncClient()

Builds an instance of OpenAIAsyncClient class.

Returns:

an instance of OpenAIAsyncClient.

buildClient

public OpenAIClient buildClient()

Builds an instance of OpenAIClient class.

Returns:

an instance of OpenAIClient.

clientOptions

public OpenAIClientBuilder clientOptions(ClientOptions clientOptions)

.

Parameters:

clientOptions

configuration

public OpenAIClientBuilder configuration(Configuration configuration)

.

Parameters:

configuration

credential

public OpenAIClientBuilder credential(KeyCredential keyCredential)

.

Parameters:

keyCredential

credential

public OpenAIClientBuilder credential(TokenCredential tokenCredential)

.

Parameters:

tokenCredential

endpoint

public OpenAIClientBuilder endpoint(String endpoint)

.

Parameters:

endpoint

httpClient

public OpenAIClientBuilder httpClient(HttpClient httpClient)

.

Parameters:

httpClient

httpLogOptions

public OpenAIClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

.

Parameters:

httpLogOptions

pipeline

public OpenAIClientBuilder pipeline(HttpPipeline pipeline)

.

Parameters:

pipeline

retryOptions

public OpenAIClientBuilder retryOptions(RetryOptions retryOptions)

.

Parameters:

retryOptions

retryPolicy

public OpenAIClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

Parameters:

retryPolicy - the retryPolicy value.

Returns:

the OpenAIClientBuilder.

serviceVersion

public OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion)

Sets Service version.

Parameters:

serviceVersion - the serviceVersion value.

Returns:

the OpenAIClientBuilder.

Applies to