你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

OpenAIClientBuilder 类

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

实现

public final class OpenAIClientBuilder
implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, com.azure.core.client.traits.KeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder>

用于创建 OpenAIClient 类型的新实例的生成器。

构造函数摘要

构造函数 说明
OpenAIClientBuilder()

创建 OpenAIClientBuilder 的实例。

方法摘要

修饰符和类型 方法和描述
OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

OpenAIAsyncClient buildAsyncClient()

生成 OpenAIAsyncClient 类的实例。

OpenAIClient buildClient()

生成 OpenAIClient 类的实例。

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)

设置将尝试重试失败请求的重试策略(如果适用)。

OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion)

设置服务版本。

方法继承自 java.lang.Object

构造函数详细信息

OpenAIClientBuilder

public OpenAIClientBuilder()

创建 OpenAIClientBuilder 的实例。

方法详细信息

addPolicy

public OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

Parameters:

customPolicy

buildAsyncClient

public OpenAIAsyncClient buildAsyncClient()

生成 OpenAIAsyncClient 类的实例。

Returns:

OpenAIAsyncClient 的实例。

buildClient

public OpenAIClient buildClient()

生成 OpenAIClient 类的实例。

Returns:

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)

设置将尝试重试失败请求的重试策略(如果适用)。

Parameters:

retryPolicy - retryPolicy 值。

Returns:

OpenAIClientBuilder。

serviceVersion

public OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion)

设置服务版本。

Parameters:

serviceVersion - serviceVersion 值。

Returns:

OpenAIClientBuilder。

适用于