public interface StreamingChatLanguageModel
Modifier and Type | Method and Description |
---|---|
void |
generate(List<ChatMessage> messages,
List<ToolSpecification> toolSpecifications,
StreamingResponseHandler<AiMessage> handler)
Generates a response from the model based on a list of messages and a list of tool specifications.
|
void |
generate(List<ChatMessage> messages,
StreamingResponseHandler<AiMessage> handler)
Generates a response from the model based on a sequence of messages.
|
void |
generate(List<ChatMessage> messages,
ToolSpecification toolSpecification,
StreamingResponseHandler<AiMessage> handler) |
default void |
generate(String userMessage,
StreamingResponseHandler<AiMessage> handler)
Generates a response from the model based on a message from a user.
|
default void generate(String userMessage, StreamingResponseHandler<AiMessage> handler)
userMessage
- The message from the user.handler
- The handler for streaming the response.void generate(List<ChatMessage> messages, StreamingResponseHandler<AiMessage> handler)
messages
- A list of messages.handler
- The handler for streaming the response.void generate(List<ChatMessage> messages, List<ToolSpecification> toolSpecifications, StreamingResponseHandler<AiMessage> handler)
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.handler
- The handler for streaming the response.
AiMessage
can contain either a textual response or a request to execute one of the tools.void generate(List<ChatMessage> messages, ToolSpecification toolSpecification, StreamingResponseHandler<AiMessage> handler)
Copyright © 2023. All rights reserved.