Class OpenAiResponsesChatModel.Builder
java.lang.Object
dev.langchain4j.model.openai.OpenAiResponsesChatModel.Builder
- Enclosing class:
OpenAiResponsesChatModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()customHeaders(Supplier<Map<String, String>> customHeadersSupplier) Sets a supplier for custom HTTP headers to be added to each HTTP request.customHeaders(Map<String, String> customHeaders) Sets custom HTTP headers to be added to each HTTP request.defaultRequestParameters(ChatRequestParameters parameters) httpClientBuilder(HttpClientBuilder httpClientBuilder) listeners(ChatModelListener... listeners) listeners(List<ChatModelListener> listeners) logRequests(Boolean logRequests) logResponses(Boolean logResponses) maxOutputTokens(Integer maxOutputTokens) maxToolCalls(Integer maxToolCalls) organizationId(String organizationId) parallelToolCalls(Boolean parallelToolCalls) previousResponseId(String previousResponseId) promptCacheKey(String promptCacheKey) promptCacheRetention(String promptCacheRetention) reasoningEffort(String reasoningEffort) reasoningSummary(String reasoningSummary) responseFormat(ResponseFormat responseFormat) safetyIdentifier(String safetyIdentifier) serverTools(List<Map<String, Object>> serverTools) serviceTier(String serviceTier) strictJsonSchema(Boolean strictJsonSchema) strictTools(Boolean strictTools) temperature(Double temperature) textVerbosity(String textVerbosity) toolChoice(ToolChoice toolChoice) toolSpecifications(ToolSpecification... toolSpecifications) toolSpecifications(List<ToolSpecification> toolSpecifications) topLogprobs(Integer topLogprobs) truncation(String truncation)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpClientBuilder
-
baseUrl
-
apiKey
-
organizationId
-
modelName
-
temperature
-
topP
-
maxOutputTokens
-
maxToolCalls
-
parallelToolCalls
-
previousResponseId
-
topLogprobs
-
truncation
-
include
-
serviceTier
-
safetyIdentifier
-
promptCacheKey
-
promptCacheRetention
-
reasoningEffort
-
reasoningSummary
-
textVerbosity
-
store
-
strictTools
-
strictJsonSchema
-
responseFormat
-
toolSpecifications
public OpenAiResponsesChatModel.Builder toolSpecifications(List<ToolSpecification> toolSpecifications) -
toolSpecifications
-
serverTools
-
toolChoice
-
logRequests
-
logResponses
-
listeners
-
listeners
-
customHeaders
Sets custom HTTP headers to be added to each HTTP request.- Parameters:
customHeaders- a map of headers- Returns:
this
-
customHeaders
public OpenAiResponsesChatModel.Builder customHeaders(Supplier<Map<String, String>> customHeadersSupplier) Sets a supplier for custom HTTP headers to be added to each HTTP request. The supplier is called before each request, allowing dynamic header values. For example, this is useful for OAuth2 tokens that expire and need refreshing.- Parameters:
customHeadersSupplier- a supplier that provides a map of headers- Returns:
this
-
defaultRequestParameters
-
build
-