Package io.intino.alexandria.ollama
Interface Ollama
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
OllamaHttpClient
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()static StringbytesToHex(byte[] hash) chat(OllamaChatRequest chatRequest) default OllamaChatResponsechat(String model, OllamaMessage... messages) default OllamaChatResponsechatStream(OllamaChatRequest chatRequest) default Ollama.StreamResponse<OllamaChatResponse> chatStream(String model, OllamaMessage... messages) default Ollama.StreamResponse<OllamaChatResponse> chatStream(String model, String message) voidclose()voidcopy(OllamaCopyRequest copyRequest) voidcreateBlob(File file) voidcreateBlob(File file, String digest) createModel(OllamaCreateModelRequest createModelRequest) createModelStream(OllamaCreateModelRequest createModelRequest) voiddefault booleandeleteIfExists(String name) embed(OllamaEmbedRequest embedRequest) embedFloats(OllamaEmbedRequest embedRequest) default booleanbooleanexistsBlob(String digest) generate(OllamaGenerateRequest generateRequest) default OllamaGenerateResponsegenerateStream(OllamaGenerateRequest generateRequest) generateStream(String model, String prompt) list()static Ollamastatic Ollamastatic Ollamaps()pull(OllamaPullRequest pullRequest) default OllamaPullResponsedefault booleanpullIfNotExists(String model) pullStream(OllamaPullRequest pullRequest) default Ollama.StreamResponse<OllamaPullResponse> pullStream(String model) push(OllamaPushRequest pushRequest) pushStream(OllamaPushRequest pushRequest) setCommonHeader(String name, String value) static Stringshow(OllamaShowRequest showRequest) default OllamaShowResponsetimeout()
-
Method Details
-
newClient
-
newClient
-
newClient
-
chat
- Throws:
OllamaAPIException
-
chat
- Throws:
OllamaAPIException
-
chat
- Throws:
OllamaAPIException
-
chatStream
default Ollama.StreamResponse<OllamaChatResponse> chatStream(String model, String message) throws OllamaAPIException - Throws:
OllamaAPIException
-
chatStream
default Ollama.StreamResponse<OllamaChatResponse> chatStream(String model, OllamaMessage... messages) throws OllamaAPIException - Throws:
OllamaAPIException
-
chatStream
Ollama.StreamResponse<OllamaChatResponse> chatStream(OllamaChatRequest chatRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
generate
- Throws:
OllamaAPIException
-
generate
- Throws:
OllamaAPIException
-
generateStream
default Ollama.StreamResponse<OllamaGenerateResponse> generateStream(String model, String prompt) throws OllamaAPIException - Throws:
OllamaAPIException
-
generateStream
Ollama.StreamResponse<OllamaGenerateResponse> generateStream(OllamaGenerateRequest generateRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
embed
- Throws:
OllamaAPIException
-
embedFloats
- Throws:
OllamaAPIException
-
createModel
OllamaCreateModelResponse createModel(OllamaCreateModelRequest createModelRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
createModelStream
Ollama.StreamResponse<OllamaCreateModelResponse> createModelStream(OllamaCreateModelRequest createModelRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
list
- Throws:
OllamaAPIException
-
show
- Throws:
OllamaAPIException
-
show
- Throws:
OllamaAPIException
-
pullIfNotExists
- Throws:
OllamaAPIException
-
pull
- Throws:
OllamaAPIException
-
pull
- Throws:
OllamaAPIException
-
pullStream
default Ollama.StreamResponse<OllamaPullResponse> pullStream(String model) throws OllamaAPIException - Throws:
OllamaAPIException
-
pullStream
Ollama.StreamResponse<OllamaPullResponse> pullStream(OllamaPullRequest pullRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
push
- Throws:
OllamaAPIException
-
pushStream
Ollama.StreamResponse<OllamaPushResponse> pushStream(OllamaPushRequest pushRequest) throws OllamaAPIException - Throws:
OllamaAPIException
-
ps
- Throws:
OllamaAPIException
-
copy
- Throws:
OllamaAPIException
-
exists
- Throws:
OllamaAPIException
-
delete
- Throws:
OllamaAPIException
-
deleteIfExists
- Throws:
OllamaAPIException
-
existsBlob
- Throws:
OllamaAPIException
-
createBlob
-
createBlob
-
baseUrl
String baseUrl() -
timeout
Duration timeout() -
timeout
-
setCommonHeader
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
sha256
- Throws:
OllamaAPIException
-
bytesToHex
-