Class OpenAiResponsesChatOptions.AbstractBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>
java.lang.Object
org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder<B>
org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder<B>
org.springframework.ai.openai.responses.OpenAiResponsesChatOptions.AbstractBuilder<B>
- All Implemented Interfaces:
Cloneable,ChatOptions.Builder<B>,StructuredOutputChatOptions.Builder<B>,ToolCallingChatOptions.Builder<B>
- Direct Known Subclasses:
OpenAiResponsesChatOptions.Builder
- Enclosing class:
- OpenAiResponsesChatOptions
protected abstract static class OpenAiResponsesChatOptions.AbstractBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>
extends DefaultToolCallingChatOptions.Builder<B>
implements StructuredOutputChatOptions.Builder<B>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable Stringprotected @Nullable Stringprotected @Nullable com.openai.credential.Credentialprotected @Nullable List<HostedTool>protected @Nullable Booleanprotected @Nullable Integerprotected @Nullable Integerprotected @Nullable Stringprotected @Nullable com.openai.azure.AzureOpenAIServiceVersionprotected @Nullable Stringprotected @Nullable Booleanprotected @Nullable Stringprotected @Nullable Proxyprotected @Nullable Stringprotected @Nullable Stringprotected @Nullable OpenAiChatModel.ResponseFormatprotected @Nullable Stringprotected @Nullable Stringprotected @Nullable Booleanprotected @Nullable Durationprotected @Nullable Objectprotected @Nullable Stringprotected @Nullable StringFields inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
toolCallbacks, toolContextFields inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
frequencyPenalty, maxTokens, model, presencePenalty, stopSequences, temperature, topK, topP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the API key using anApiKeyinstance.build()Build theChatOptions.clone()combineWith(ChatOptions.Builder<?> other) Mutate this builder by taking allother's values that are non-null, retainingthisother values.credential(@Nullable com.openai.credential.Credential credential) customHeaders(@Nullable Map<String, String> customHeaders) deploymentName(@Nullable String deploymentName) frequencyPenalty(@Nullable Double frequencyPenalty) Builds with the frequency penalty to use for the chat.hostedTools(@Nullable List<HostedTool> hostedTools) hostedTools(HostedTool... hostedTools) maxOutputTokens(@Nullable Integer maxOutputTokens) Alias forDefaultChatOptionsBuilder.maxTokens(Integer), named after the wire field.maxRetries(@Nullable Integer maxRetries) maxToolCalls(@Nullable Integer maxToolCalls) microsoftFoundry(@Nullable Boolean microsoftFoundry) microsoftFoundryServiceVersion(@Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion) organizationId(@Nullable String organizationId) outputSchema(@Nullable String outputSchema) parallelToolCalls(@Nullable Boolean parallelToolCalls) presencePenalty(@Nullable Double presencePenalty) Builds with the presence penalty to use for the chat.promptCacheKey(@Nullable String promptCacheKey) reasoningEffort(@Nullable String reasoningEffort) reasoningSummary(@Nullable String reasoningSummary) responseFormat(@Nullable OpenAiChatModel.ResponseFormat responseFormat) safetyIdentifier(@Nullable String safetyIdentifier) serviceTier(@Nullable String serviceTier) stopSequences(@Nullable List<String> stopSequences) Builds with the stop sequences to use for the chat.toolChoice(@Nullable Object toolChoice) Builds with the top K to use for the chat.truncation(@Nullable String truncation) Methods inherited from class org.springframework.ai.model.tool.DefaultToolCallingChatOptions.Builder
toolCallbacks, toolCallbacks, toolContext, toolContextMethods inherited from class org.springframework.ai.chat.prompt.DefaultChatOptionsBuilder
maxTokens, model, self, temperature, topPMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions.Builder
maxTokens, model, temperature, topP
-
Field Details
-
baseUrl
-
apiKey
-
credential
protected @Nullable com.openai.credential.Credential credential -
microsoftDeploymentName
-
microsoftFoundryServiceVersion
protected @Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion -
organizationId
-
isMicrosoftFoundry
-
timeout
-
maxRetries
-
proxy
-
customHeaders
-
reasoningEffort
-
reasoningSummary
-
verbosity
-
responseFormat
-
strict
-
toolChoice
-
parallelToolCalls
-
maxToolCalls
-
hostedTools
-
include
-
truncation
-
serviceTier
-
promptCacheKey
-
safetyIdentifier
-
metadata
-
extraBody
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
clone
- Specified by:
clonein interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
clonein classDefaultToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>
-
stopSequences
Description copied from interface:ChatOptions.BuilderBuilds with the stop sequences to use for the chat.- Specified by:
stopSequencesin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Specified by:
stopSequencesin interfaceToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
stopSequencesin classDefaultChatOptionsBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Returns:
- the builder.
-
frequencyPenalty
Description copied from interface:ChatOptions.BuilderBuilds with the frequency penalty to use for the chat.- Specified by:
frequencyPenaltyin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Specified by:
frequencyPenaltyin interfaceToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
frequencyPenaltyin classDefaultChatOptionsBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Returns:
- the builder.
-
presencePenalty
Description copied from interface:ChatOptions.BuilderBuilds with the presence penalty to use for the chat.- Specified by:
presencePenaltyin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Specified by:
presencePenaltyin interfaceToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
presencePenaltyin classDefaultChatOptionsBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Returns:
- the builder.
-
topK
Description copied from interface:ChatOptions.BuilderBuilds with the top K to use for the chat.- Specified by:
topKin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Specified by:
topKin interfaceToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
topKin classDefaultChatOptionsBuilder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Returns:
- the builder.
-
baseUrl
-
apiKey
-
apiKey
Sets the API key using anApiKeyinstance. Pass aNoopApiKeyto disable authentication. -
credential
-
deploymentName
-
microsoftFoundryServiceVersion
public B microsoftFoundryServiceVersion(@Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion) -
organizationId
-
microsoftFoundry
-
timeout
-
maxRetries
-
proxy
-
customHeaders
-
maxOutputTokens
Alias forDefaultChatOptionsBuilder.maxTokens(Integer), named after the wire field. -
reasoningEffort
-
reasoningSummary
-
verbosity
-
responseFormat
-
strict
-
toolChoice
-
parallelToolCalls
-
maxToolCalls
-
hostedTools
-
hostedTools
-
include
-
truncation
-
serviceTier
-
promptCacheKey
-
safetyIdentifier
-
metadata
-
extraBody
-
outputSchema
- Specified by:
outputSchemain interfaceStructuredOutputChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>
-
combineWith
Description copied from interface:ChatOptions.BuilderMutate this builder by taking allother's values that are non-null, retainingthisother values.- Specified by:
combineWithin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
combineWithin classDefaultToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>
-
build
Description copied from interface:ChatOptions.BuilderBuild theChatOptions.- Specified by:
buildin interfaceChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Specified by:
buildin interfaceToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Overrides:
buildin classDefaultToolCallingChatOptions.Builder<B extends OpenAiResponsesChatOptions.AbstractBuilder<B>>- Returns:
- the Chat options.
-