Package dev.langchain4j.model.language
Class DisabledStreamingLanguageModel
java.lang.Object
dev.langchain4j.model.language.DisabledStreamingLanguageModel
- All Implemented Interfaces:
StreamingLanguageModel
A
StreamingLanguageModel
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
generate
(Prompt prompt, StreamingResponseHandler<String> handler) Generates a response from the model based on a prompt.void
generate
(String prompt, StreamingResponseHandler<String> handler) Generates a response from the model based on a prompt.
-
Constructor Details
-
DisabledStreamingLanguageModel
public DisabledStreamingLanguageModel()
-
-
Method Details
-
generate
Description copied from interface:StreamingLanguageModel
Generates a response from the model based on a prompt.- Specified by:
generate
in interfaceStreamingLanguageModel
- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-
generate
Description copied from interface:StreamingLanguageModel
Generates a response from the model based on a prompt.- Specified by:
generate
in interfaceStreamingLanguageModel
- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-