Class DefaultChatClientBuilder
java.lang.Object
org.springframework.ai.chat.client.DefaultChatClientBuilder
- All Implemented Interfaces:
ChatClient.Builder
DefaultChatClientBuilder is a builder class for creating a ChatClient.
It provides methods to set default values for various properties of the ChatClient.
- Since:
- 1.0.0
- Author:
- Mark Pollack, Christian Tzolov, Josh Long, Arjen Poutsma, Thomas Vitale
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultChatClientBuilder
(ChatModel chatModel, io.micrometer.observation.ObservationRegistry observationRegistry, ChatClientObservationConvention customObservationConvention) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
clone()
defaultAdvisors
(Consumer<ChatClient.AdvisorSpec> advisorSpecConsumer) defaultAdvisors
(List<Advisor> advisors) defaultAdvisors
(Advisor... advisors) <I,
O> ChatClient.Builder defaultFunction
(String name, String description, BiFunction<I, ToolContext, O> biFunction) <I,
O> ChatClient.Builder defaultFunction
(String name, String description, Function<I, O> function) defaultFunctions
(String... functionNames) defaultFunctions
(FunctionCallback... functionCallbacks) defaultOptions
(ChatOptions chatOptions) defaultSystem
(String text) defaultSystem
(Consumer<ChatClient.PromptSystemSpec> systemSpecConsumer) defaultSystem
(org.springframework.core.io.Resource text) defaultSystem
(org.springframework.core.io.Resource text, Charset charset) defaultToolContext
(Map<String, Object> toolContext) defaultUser
(String text) defaultUser
(Consumer<ChatClient.PromptUserSpec> userSpecConsumer) defaultUser
(org.springframework.core.io.Resource text) defaultUser
(org.springframework.core.io.Resource text, Charset charset)
-
Field Details
-
defaultRequest
-
-
Constructor Details
-
DefaultChatClientBuilder
public DefaultChatClientBuilder(ChatModel chatModel, io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable ChatClientObservationConvention customObservationConvention)
-
-
Method Details
-
build
- Specified by:
build
in interfaceChatClient.Builder
-
clone
- Specified by:
clone
in interfaceChatClient.Builder
- Overrides:
clone
in classObject
-
defaultAdvisors
- Specified by:
defaultAdvisors
in interfaceChatClient.Builder
-
defaultAdvisors
- Specified by:
defaultAdvisors
in interfaceChatClient.Builder
-
defaultAdvisors
- Specified by:
defaultAdvisors
in interfaceChatClient.Builder
-
defaultOptions
- Specified by:
defaultOptions
in interfaceChatClient.Builder
-
defaultUser
- Specified by:
defaultUser
in interfaceChatClient.Builder
-
defaultUser
- Specified by:
defaultUser
in interfaceChatClient.Builder
-
defaultUser
- Specified by:
defaultUser
in interfaceChatClient.Builder
-
defaultUser
- Specified by:
defaultUser
in interfaceChatClient.Builder
-
defaultSystem
- Specified by:
defaultSystem
in interfaceChatClient.Builder
-
defaultSystem
- Specified by:
defaultSystem
in interfaceChatClient.Builder
-
defaultSystem
- Specified by:
defaultSystem
in interfaceChatClient.Builder
-
defaultSystem
- Specified by:
defaultSystem
in interfaceChatClient.Builder
-
defaultFunction
public <I,O> ChatClient.Builder defaultFunction(String name, String description, Function<I, O> function) - Specified by:
defaultFunction
in interfaceChatClient.Builder
-
defaultFunction
public <I,O> ChatClient.Builder defaultFunction(String name, String description, BiFunction<I, ToolContext, O> biFunction) - Specified by:
defaultFunction
in interfaceChatClient.Builder
-
defaultFunctions
- Specified by:
defaultFunctions
in interfaceChatClient.Builder
-
defaultFunctions
- Specified by:
defaultFunctions
in interfaceChatClient.Builder
-
defaultToolContext
- Specified by:
defaultToolContext
in interfaceChatClient.Builder
-