overlay/llm/provider

Types

The context before a conversation starts This is loaded once before a conversation starts Different to agent context that might include skills This is driven by the shape of API’s that separate tools from prompt

maybe this is better as chat context

pub type Context {
  Context(system_prompt: String, tools: List(tool.Tool))
}

Constructors

  • Context(system_prompt: String, tools: List(tool.Tool))
pub type Llm {
  Llm(provider: Provider, model: String)
}

Constructors

  • Llm(provider: Provider, model: String)
pub type Provider {
  Ollama(ollama.Config)
  Mistral(mistral.Config)
}

Constructors

Values

pub fn completion_chunk_parse(
  provider: Provider,
  remaining: BitArray,
  chunk: BitArray,
) -> #(List(chat.Completion(tool.Call)), BitArray)
pub fn completion_request(
  provider: Provider,
  model: String,
  system_prompt: String,
  history: List(chat.Message(tool.Call)),
  tools: List(tool.Tool),
) -> request.Request(BitArray)
pub fn stream_completion_request(
  llm: Llm,
  context: Context,
  history: List(chat.Message(tool.Call)),
) -> request.Request(BitArray)
Search Document