public interface ChatLanguageModel
Modifier and Type | Method and Description |
---|---|
default AiMessage |
sendMessages(ChatMessage... messages)
Sends a sequence of messages to the LLM and returns a response.
|
AiMessage |
sendMessages(List<ChatMessage> messages)
Sends a list of messages to the LLM and returns a response.
|
AiMessage |
sendMessages(List<ChatMessage> messages,
List<ToolSpecification> toolSpecifications)
Sends a list of messages and a list of tool specifications to the LLM and returns a response.
|
AiMessage |
sendMessages(List<ChatMessage> messages,
ToolSpecification toolSpecification)
Sends a list of messages and a specification of a tool that must be executed to the LLM and returns a response
that contains a request to execute specified tool.
|
default AiMessage |
sendUserMessage(Object structuredPrompt)
Sends a structured prompt as a user message to the LLM and returns a response.
|
default AiMessage |
sendUserMessage(String userMessage)
Sends a message from a user to the LLM and returns a response.
|
default AiMessage |
sendUserMessage(UserMessage userMessage)
Sends a message from a user to the LLM and returns a response.
|
default AiMessage sendUserMessage(String userMessage)
userMessage
- A user message as a String. Will be wrapped into UserMessage
under the hood.default AiMessage sendUserMessage(UserMessage userMessage)
userMessage
- A user message.default AiMessage sendUserMessage(Object structuredPrompt)
structuredPrompt
- A user message as an object annotated with @StructuredPrompt
. Will be converted into UserMessage
under the hood.default AiMessage sendMessages(ChatMessage... messages)
messages
- An array of messages to be sent.AiMessage sendMessages(List<ChatMessage> messages)
messages
- A list of messages to be sent.AiMessage sendMessages(List<ChatMessage> messages, List<ToolSpecification> toolSpecifications)
messages
- A list of messages to be sent.toolSpecifications
- A list of tools that the LLM is allowed to execute.
The LLM autonomously decides whether to use any of these tools.AiMessage sendMessages(List<ChatMessage> messages, ToolSpecification toolSpecification)
messages
- A list of messages to be sent.toolSpecification
- The specification of a tool that must be executed. LLM is forced to call this tool.Copyright © 2023. All rights reserved.