overlay/llm/provider/ollama
Types
pub type Config {
Config(origin: origin.Origin, api_key: option.Option(String))
}
Constructors
-
Config(origin: origin.Origin, api_key: option.Option(String))
Values
pub fn chat_stream_event_decoder() -> decode.Decoder(
chat.Completion(tool.Call),
)
pub fn cloud(key: String) -> Config
Default configuration for Ollama cloud, requires and API key.
pub fn completion_chunk_parse(
remaining: BitArray,
chunk: BitArray,
) -> #(List(chat.Completion(tool.Call)), BitArray)
pub fn completion_request(
config: Config,
model: String,
system_prompt: String,
messages: List(chat.Message(tool.Call)),
tools: List(tool.Tool),
) -> request.Request(BitArray)
pub fn local() -> Config
Default configuration for Ollama running locally on the same machine
pub fn message_decoder() -> decode.Decoder(
chat.Completion(tool.Call),
)
pub fn stream_completion_request(
config: Config,
model: String,
system_prompt: String,
messages: List(chat.Message(tool.Call)),
tools: List(tool.Tool),
) -> request.Request(BitArray)
pub fn tool_call_decoder() -> decode.Decoder(tool.Call)