public interface ChatLanguageModel
| Modifier and Type | Method and Description |
|---|---|
default Response<AiMessage> |
generate(ChatMessage... messages)
Generates a response from the model based on a sequence of messages.
|
Response<AiMessage> |
generate(List<ChatMessage> messages)
Generates a response from the model based on a sequence of messages.
|
Response<AiMessage> |
generate(List<ChatMessage> messages,
List<ToolSpecification> toolSpecifications)
Generates a response from the model based on a list of messages and a list of tool specifications.
|
Response<AiMessage> |
generate(List<ChatMessage> messages,
ToolSpecification toolSpecification)
Generates a response from the model based on a list of messages and a single tool specification.
|
default String |
generate(String userMessage)
Generates a response from the model based on a message from a user.
|
default String generate(String userMessage)
userMessage - The message from the user.default Response<AiMessage> generate(ChatMessage... messages)
messages - An array of messages.Response<AiMessage> generate(List<ChatMessage> messages)
messages - A list of messages.Response<AiMessage> generate(List<ChatMessage> messages, List<ToolSpecification> toolSpecifications)
messages - A list of messages.toolSpecifications - A list of tools that the model is allowed to execute.
The model autonomously decides whether to use any of these tools.AiMessage can contain either a textual response or a request to execute one of the tools.Response<AiMessage> generate(List<ChatMessage> messages, ToolSpecification toolSpecification)
messages - A list of messages.toolSpecification - The specification of a tool that must be executed.
The model is forced to execute this tool.AiMessage contains a request to execute the specified tool.Copyright © 2023. All rights reserved.