Package dev.langchain4j.model.ollama
Class OllamaStreamingLanguageModel
java.lang.Object
dev.langchain4j.model.ollama.OllamaStreamingLanguageModel
- All Implemented Interfaces:
StreamingLanguageModel
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
ConstructorDescriptionOllamaStreamingLanguageModel
(String baseUrl, String modelName, Double temperature, Integer topK, Double topP, Double repeatPenalty, Integer seed, Integer numPredict, Integer numCtx, List<String> stop, String format, Duration timeout, Boolean logRequests, Boolean logResponses, Map<String, String> customHeaders) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
void
generate
(String prompt, StreamingResponseHandler<String> handler) Generates a response from the model based on a prompt.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.language.StreamingLanguageModel
generate
-
Constructor Details
-
OllamaStreamingLanguageModel
public OllamaStreamingLanguageModel(String baseUrl, String modelName, Double temperature, Integer topK, Double topP, Double repeatPenalty, Integer seed, Integer numPredict, Integer numCtx, List<String> stop, String format, Duration timeout, Boolean logRequests, Boolean logResponses, Map<String, String> customHeaders)
-
-
Method Details
-
builder
-
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.
-