Class DefaultChatClient.DefaultChatClientRequestSpec
java.lang.Object
org.springframework.ai.chat.client.DefaultChatClient.DefaultChatClientRequestSpec
- All Implemented Interfaces:
ChatClient.ChatClientRequestSpec
- Enclosing class:
- DefaultChatClient
public static class DefaultChatClient.DefaultChatClientRequestSpec
extends Object
implements ChatClient.ChatClientRequestSpec
-
Constructor Summary
ConstructorDescriptionDefaultChatClientRequestSpec
(ChatModel chatModel, String userText, Map<String, Object> userParams, String systemText, Map<String, Object> systemParams, List<FunctionCallback> functionCallbacks, List<Message> messages, List<String> functionNames, List<Media> media, ChatOptions chatOptions, List<Advisor> advisors, Map<String, Object> advisorParams, io.micrometer.observation.ObservationRegistry observationRegistry, ChatClientObservationConvention customObservationConvention, Map<String, Object> toolContext) -
Method Summary
Modifier and TypeMethodDescriptionadvisors
(Consumer<ChatClient.AdvisorSpec> consumer) call()
function
(String name, String description, BiFunction<I, ToolContext, O> biFunction) functions
(FunctionCallback... functionCallbacks) getMedia()
mutate()
Return aChatClient2Builder
to create a newChatClient2
whose settings are replicated from thisChatClientRequest
.<T extends ChatOptions>
ChatClient.ChatClientRequestSpecoptions
(T options) stream()
system
(Consumer<ChatClient.PromptSystemSpec> consumer) system
(org.springframework.core.io.Resource text) toolContext
(Map<String, Object> toolContext) user
(Consumer<ChatClient.PromptUserSpec> consumer) user
(org.springframework.core.io.Resource text)
-
Constructor Details
-
DefaultChatClientRequestSpec
public DefaultChatClientRequestSpec(ChatModel chatModel, @Nullable String userText, Map<String, Object> userParams, @Nullable String systemText, Map<String, Object> systemParams, List<FunctionCallback> functionCallbacks, List<Message> messages, List<String> functionNames, List<Media> media, @Nullable ChatOptions chatOptions, List<Advisor> advisors, Map<String, Object> advisorParams, io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable ChatClientObservationConvention customObservationConvention, Map<String, Object> toolContext)
-
-
Method Details
-
getUserText
-
getUserParams
-
getSystemText
-
getSystemParams
-
getChatOptions
-
getAdvisors
-
getAdvisorParams
-
getMessages
-
getMedia
-
getFunctionNames
-
getFunctionCallbacks
-
getToolContext
-
mutate
Return aChatClient2Builder
to create a newChatClient2
whose settings are replicated from thisChatClientRequest
.- Specified by:
mutate
in interfaceChatClient.ChatClientRequestSpec
-
advisors
- Specified by:
advisors
in interfaceChatClient.ChatClientRequestSpec
-
advisors
- Specified by:
advisors
in interfaceChatClient.ChatClientRequestSpec
-
advisors
- Specified by:
advisors
in interfaceChatClient.ChatClientRequestSpec
-
messages
- Specified by:
messages
in interfaceChatClient.ChatClientRequestSpec
-
messages
- Specified by:
messages
in interfaceChatClient.ChatClientRequestSpec
-
options
- Specified by:
options
in interfaceChatClient.ChatClientRequestSpec
-
function
public <I,O> ChatClient.ChatClientRequestSpec function(String name, String description, Function<I, O> function) - Specified by:
function
in interfaceChatClient.ChatClientRequestSpec
-
function
public <I,O> ChatClient.ChatClientRequestSpec function(String name, String description, BiFunction<I, ToolContext, O> biFunction) - Specified by:
function
in interfaceChatClient.ChatClientRequestSpec
-
function
public <I,O> ChatClient.ChatClientRequestSpec function(String name, String description, @Nullable Class<I> inputType, Function<I, O> function) - Specified by:
function
in interfaceChatClient.ChatClientRequestSpec
-
functions
- Specified by:
functions
in interfaceChatClient.ChatClientRequestSpec
-
functions
- Specified by:
functions
in interfaceChatClient.ChatClientRequestSpec
-
toolContext
- Specified by:
toolContext
in interfaceChatClient.ChatClientRequestSpec
-
system
- Specified by:
system
in interfaceChatClient.ChatClientRequestSpec
-
system
public ChatClient.ChatClientRequestSpec system(org.springframework.core.io.Resource text, Charset charset) - Specified by:
system
in interfaceChatClient.ChatClientRequestSpec
-
system
- Specified by:
system
in interfaceChatClient.ChatClientRequestSpec
-
system
- Specified by:
system
in interfaceChatClient.ChatClientRequestSpec
-
user
- Specified by:
user
in interfaceChatClient.ChatClientRequestSpec
-
user
public ChatClient.ChatClientRequestSpec user(org.springframework.core.io.Resource text, Charset charset) - Specified by:
user
in interfaceChatClient.ChatClientRequestSpec
-
user
- Specified by:
user
in interfaceChatClient.ChatClientRequestSpec
-
user
- Specified by:
user
in interfaceChatClient.ChatClientRequestSpec
-
call
- Specified by:
call
in interfaceChatClient.ChatClientRequestSpec
-
stream
- Specified by:
stream
in interfaceChatClient.ChatClientRequestSpec
-