Class OpenAiOfficialDecisionModel.Builder
java.lang.Object
dev.langchain4j.model.openaiofficial.OpenAiOfficialDecisionModel.Builder
- Enclosing class:
OpenAiOfficialDecisionModel
- Since:
- 1.22.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()customHeaders(Map<String, String> customHeaders) customParameters(Map<String, Object> customParameters) Custom parameters added to the body of every request, for example to use a feature of the OpenAI Decisions API that this class does not support yet.listeners(DecisionModelListener... listeners) listeners(List<DecisionModelListener> listeners) maxRetries(Integer maxRetries) The number of retries of the OpenAI SDK for transient errors such as timeouts, rate limits and server errors.The model to use when a request does not specify one, for examplegpt-6-luna.openAIClient(com.openai.client.OpenAIClient openAIClient) Sets a preconfigured OpenAI client.organizationId(String organizationId) promptCacheKey(String promptCacheKey) A key that separates prompt caching between groups of requests, sent asprompt_cache_key.The timeout of a call.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
baseUrl
-
apiKey
-
organizationId
-
openAIClient
public OpenAiOfficialDecisionModel.Builder openAIClient(com.openai.client.OpenAIClient openAIClient) Sets a preconfigured OpenAI client. The other client settings (base URL, API key, timeout...) are then ignored. -
modelName
The model to use when a request does not specify one, for examplegpt-6-luna. The model name must be set either here or on each request. -
timeout
The timeout of a call. Default value is 60 seconds. -
maxRetries
The number of retries of the OpenAI SDK for transient errors such as timeouts, rate limits and server errors. Default value is 3. -
proxy
-
customHeaders
-
promptCacheKey
A key that separates prompt caching between groups of requests, sent asprompt_cache_key. OpenAI caches the shared input of requests automatically, also without a key. With a key, only requests with the same key reuse each other's cached input, for example to keep cache reuse and the cached token counts separate per customer or user. Not set by default.It can be replaced for a single request with
OpenAiOfficialDecisionRequestParameters.Builder.promptCacheKey(String). See the prompt caching guide. -
customParameters
Custom parameters added to the body of every request, for example to use a feature of the OpenAI Decisions API that this class does not support yet. A custom parameter with the same name as a parameter set by this class replaces it. They can be replaced for a single request withOpenAiOfficialDecisionRequestParameters.Builder.customParameters(Map). -
listeners
-
listeners
-
build
-