Train

Train is an attempt of providing a set of tools for building applications with LLM. This project is heavily inspired on LangChain.

This has been extracted from a personal project and it is still on its first steps.

Installation

def deps do
  [
    {:train, "~> 0.0.1-dev"}
  ]
end

Example

{:ok, memory_pid} = Train.Memory.BufferAgent.start_link()
tools = [Train.Tools.Calculator, Train.Tools.SerpApi]
chain = Train.LlmChain.new(%{memory_pid: memory_pid, tools: tools})

{:ok, messages, response} = chain |> Train.Chains.ConversationChain.run("Who is Angela Merkel?")
# Angela Dorothea Merkel is a German former politician and scientist who served as Chancellor of Germany from November 2005 to December 2021. A member of the Christian Democratic Union, she previously served as Leader of the Opposition from 2002 to 2005 and as Leader of the Christian Democratic Union from 2000 to 2018.

{:ok, messages, response} = chain |> Train.Chains.ConversationChain.run("Where was she born?")
# Angela Merkel was born in Hamburg, Germany.

Goals