overlay/llm/provider/ollama

Types

pub type Config {
  Config(origin: origin.Origin, api_key: option.Option(String))
}

Constructors

Values

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 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)
pub fn tool_encode(tool: tool.Tool) -> json.Json
Search Document