你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
OpenAIClientBuilder 类
- java.
lang. Object - com.
azure. ai. openai. OpenAIClientBuilder
- com.
实现
public final class OpenAIClientBuilder
implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, com.azure.core.client.traits.KeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder>
用于创建 OpenAIClient 类型的新实例的生成器。
构造函数摘要
构造函数 | 说明 |
---|---|
OpenAIClientBuilder() |
创建 Open |
方法摘要
方法继承自 java.lang.Object
构造函数详细信息
OpenAIClientBuilder
public OpenAIClientBuilder()
创建 OpenAIClientBuilder 的实例。
方法详细信息
addPolicy
public OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy)
.
Parameters:
buildAsyncClient
public OpenAIAsyncClient buildAsyncClient()
生成 OpenAIAsyncClient 类的实例。
Returns:
buildClient
public OpenAIClient buildClient()
生成 OpenAIClient 类的实例。
Returns:
clientOptions
public OpenAIClientBuilder clientOptions(ClientOptions clientOptions)
.
Parameters:
configuration
public OpenAIClientBuilder configuration(Configuration configuration)
.
Parameters:
credential
public OpenAIClientBuilder credential(KeyCredential keyCredential)
.
Parameters:
credential
public OpenAIClientBuilder credential(TokenCredential tokenCredential)
.
Parameters:
endpoint
public OpenAIClientBuilder endpoint(String endpoint)
.
Parameters:
httpClient
public OpenAIClientBuilder httpClient(HttpClient httpClient)
.
Parameters:
httpLogOptions
public OpenAIClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)
.
Parameters:
pipeline
public OpenAIClientBuilder pipeline(HttpPipeline pipeline)
.
Parameters:
retryOptions
public OpenAIClientBuilder retryOptions(RetryOptions retryOptions)
.
Parameters:
retryPolicy
public OpenAIClientBuilder retryPolicy(RetryPolicy retryPolicy)
设置将尝试重试失败请求的重试策略(如果适用)。
Parameters:
Returns:
serviceVersion
public OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion)
设置服务版本。
Parameters:
Returns: