API Reference langchainex v0.1.1

modules

Modules

Use this when you want to ask the computer to perform a task using natural-language text, one that will have side-effects in the real world. ActionChain wraps a Chain and handles invoking the Chain. It then handles asking for confirmation if the chain is correct.

A chain of ChainLinks to be processed in order, usually ending in an anchor for user confirmation.

an individual chainLink in a language chain when called, a chainlink will

A Chat is a list of multiple PromptTemplates along with all their input variables

An Effector is used by a daemon to impact the outside world. By default, an Effector should ask for confirmation before actually impacting anything. Daemons are AIs and should not be trusted to do the right thing without supervision.

A generic LLM interface for interacting with different LLM providers

a PromptTemplate is just a normal string template, you can pass it a set of values and it will interpolate them. You can also partially evaluate the template by calling the partial/2 function inputVariables will contain the list of variables that still need to be specified to complete the template.

A module for interacting with OpenAI's API

Use this when you want to extract formatted data from natural-language text, ScrapeChain is basically a special form of QueryChain. ScrapeChain is a wrapper around a special type of Chain that requires 'inputSchema' and 'inputText' in its inputVariables and combines it with an outputParser. Once you define that chain, you can have the chain 'scrape' a text and return the formatted output in virtually any form.

A Scraper is a GenServer that scrapes natural language text and tries to turn it into some kind of structured data. It comes with a built in "default_scraper" that can generally extract data from text according to the schema you gave it. Examples

Documentation for Langchainex.

Use this when you want to ask a question using natural-language text, with no side-effects. QueryChain is a wrapper around a Chain that requires 'inputText' in its inputVariables. Once you define that chain, you can 'ask' the QueryChain to run the chain and return the formatted output.