ollama_gleam
Types
pub type EmbeddingsRequest {
SingleInput(model: String, input: String)
MultipleInput(model: String, input: List(String))
}
Constructors
-
SingleInput(model: String, input: String)
-
MultipleInput(model: String, input: List(String))
pub type EmbeddingsResponse {
SingleResponse(
model: String,
embeddings: List(List(Float)),
total_duration: Int,
load_duration: option.Option(Int),
prompt_eval_count: Int,
)
MultipleResponse(model: String, embeddings: List(List(Float)))
}
Constructors
-
SingleResponse( model: String, embeddings: List(List(Float)), total_duration: Int, load_duration: option.Option(Int), prompt_eval_count: Int, )
-
MultipleResponse(model: String, embeddings: List(List(Float)))
pub type OllamaError {
Comm
DecodingResp
}
Constructors
-
Comm
-
DecodingResp
Functions
pub fn call_ollama(
path: String,
input: String,
) -> Result(String, OllamaError)
pub fn embedding(
embeddings_request: EmbeddingsRequest,
) -> Result(EmbeddingsResponse, OllamaError)
pub fn embedding_internal_dont_use_or_youll_be_fired(
embeddings_request: EmbeddingsRequest,
ollama_caller: fn(String, String) ->
Result(String, OllamaError),
) -> Result(EmbeddingsResponse, OllamaError)