Package dev.langchain4j.model.language
Interface StreamingLanguageModel
- All Known Implementing Classes:
AzureOpenAiStreamingLanguageModel
,DisabledStreamingLanguageModel
,JlamaStreamingLanguageModel
,LocalAiStreamingLanguageModel
,OllamaStreamingLanguageModel
,OpenAiStreamingLanguageModel
,QianfanStreamingLanguageModel
,QwenStreamingLanguageModel
public interface StreamingLanguageModel
Represents a language model that has a simple text interface (as opposed to a chat interface)
and can stream a response one token at a time.
It is recommended to use the
StreamingChatLanguageModel
instead,
as it offers more features.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
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.
-
Method Details
-
generate
Generates a response from the model based on a prompt.- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-
generate
Generates a response from the model based on a prompt.- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-