类 DisabledStreamingChatLanguageModel
java.lang.Object
dev.langchain4j.model.chat.DisabledStreamingChatLanguageModel
- 所有已实现的接口:
StreamingChatLanguageModel
public class DisabledStreamingChatLanguageModel
extends Object
implements StreamingChatLanguageModel
A
StreamingChatLanguageModel which throws a ModelDisabledException for all of its methods
This could be used in tests, or in libraries that extend this one to conditionally enable or disable functionality.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidgenerate(String userMessage, StreamingResponseHandler<AiMessage> handler) Generates a response from the model based on a message from a user.voidgenerate(List<ChatMessage> messages, ToolSpecification toolSpecification, StreamingResponseHandler<AiMessage> handler) Generates a response from the model based on a list of messages and a tool specification.voidgenerate(List<ChatMessage> messages, StreamingResponseHandler<AiMessage> handler) Generates a response from the model based on a sequence of messages.voidgenerate(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.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 dev.langchain4j.model.chat.StreamingChatLanguageModel
generate
-
构造器详细资料
-
DisabledStreamingChatLanguageModel
public DisabledStreamingChatLanguageModel()
-
-
方法详细资料
-
generate
从接口复制的说明:StreamingChatLanguageModelGenerates a response from the model based on a message from a user.- 指定者:
generate在接口中StreamingChatLanguageModel- 参数:
userMessage- The message from the user.handler- The handler for streaming the response.
-
generate
从接口复制的说明:StreamingChatLanguageModelGenerates a response from the model based on a sequence of messages. Typically, the sequence contains messages in the following order: System (optional) - User - AI - User - AI - User ...- 指定者:
generate在接口中StreamingChatLanguageModel- 参数:
messages- A list of messages.handler- The handler for streaming the response.
-
generate
public void generate(List<ChatMessage> messages, List<ToolSpecification> toolSpecifications, StreamingResponseHandler<AiMessage> handler) 从接口复制的说明:StreamingChatLanguageModelGenerates a response from the model based on a list of messages and a list of tool specifications. The response may either be a text message or a request to execute one of the specified tools. Typically, the list contains messages in the following order: System (optional) - User - AI - User - AI - User ...- 指定者:
generate在接口中StreamingChatLanguageModel- 参数:
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.AiMessagecan contain either a textual response or a request to execute one of the tools.
-
generate
public void generate(List<ChatMessage> messages, ToolSpecification toolSpecification, StreamingResponseHandler<AiMessage> handler) 从接口复制的说明:StreamingChatLanguageModelGenerates a response from the model based on a list of messages and a tool specification.- 指定者:
generate在接口中StreamingChatLanguageModel- 参数:
messages- A list of messages.toolSpecification- A tool that the model is allowed to execute.handler- The handler for streaming the response.
-