Package dev.langchain4j.model.language
Interface StreamingLanguageModel
-
- All Implemented Interfaces:
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 dev.langchain4j.model.chat.StreamingChatLanguageModel instead, as it offers more features.
-
-
Method Summary
Modifier and Type Method Description abstract void
generate(String prompt, StreamingResponseHandler<String> handler)
Generates a response from the model based on a prompt. void
generate(Prompt prompt, StreamingResponseHandler<String> handler)
Generates a response from the model based on a prompt. -
-
Method Detail
-
generate
abstract void generate(String prompt, StreamingResponseHandler<String> handler)
Generates a response from the model based on a prompt.
- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-
generate
void generate(Prompt prompt, StreamingResponseHandler<String> handler)
Generates a response from the model based on a prompt.
- Parameters:
prompt
- The prompt.handler
- The handler for streaming the response.
-
-
-
-