langchain-experimental: 0.3.3#
agents#
Functions
Create pandas dataframe agent by loading csv to a dataframe. |
|
|
Construct a Pandas agent from an LLM and dataframe(s). |
Construct a python agent from an LLM and tool. |
|
|
Construct a Spark agent from an LLM and dataframe. |
|
Construct a xorbits agent from an LLM and dataframe. |
autonomous_agents#
Classes
Agent for interacting with AutoGPT. |
|
Memory for AutoGPT. |
|
Action returned by AutoGPTOutputParser. |
|
Output parser for AutoGPT. |
|
|
Base Output parser for AutoGPT. |
Prompt for AutoGPT. |
|
|
Generator of custom prompt strings. |
Controller model for the BabyAGI agent. |
|
Chain generating tasks. |
|
|
Chain to execute tasks. |
|
Chain to prioritize tasks. |
Agent for interacting with HuggingGPT. |
|
|
Chain to execute tasks. |
|
Generates a response based on the input. |
Task to be executed. |
|
|
Load tools and execute tasks. |
Base class for a planner. |
|
A plan to execute. |
|
|
Parses the output of the planning stage. |
A step in the plan. |
|
Chain to execute tasks. |
|
Planner for tasks. |
Functions
|
Preprocesses a string to be parsed as json. |
|
Generates a prompt string. |
|
Load the ResponseGenerator. |
|
Load the chat planner. |
chat_models#
Classes
Wrapper for chat LLMs. |
|
Wrapper for Llama-2-chat model. |
|
See https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#instruction-format |
|
Wrapper for Orca-style models. |
|
Wrapper for Vicuna-style models. |
comprehend_moderation#
Classes
cpal#
Classes
Causal program-aided language (CPAL) chain implementation. |
|
Translate the causal narrative into a stack of operations. |
|
Set the hypothetical conditions for the causal model. |
|
Decompose the narrative into its story elements. |
|
Query the outcome table using SQL. |
|
|
Enum for constants used in the CPAL. |
Casual data. |
|
Entity in the story. |
|
Entity initial conditions. |
|
Intervention data of the story aka initial conditions. |
|
Narrative input as three story elements. |
|
Query data of the story. |
|
Result of the story query. |
|
Story data. |
|
System initial conditions. |
data_anonymizer#
Classes
Base abstract class for anonymizers. |
|
Base abstract class for reversible anonymizers. |
|
|
Deanonymizer mapping. |
Anonymizer using Microsoft Presidio. |
|
Base Anonymizer using Microsoft Presidio. |
|
|
Reversible Anonymizer using Microsoft Presidio. |
Functions
fallacy_removal#
Classes
Chain for applying logical fallacy evaluations. |
|
Logical fallacy. |
generative_agents#
Classes
Agent as a character with memory and innate characteristics. |
|
Memory for the generative agent. |
graph_transformers#
Classes
Transform documents into graph documents using Diffbot NLP API. |
|
List of nodes with associated properties. |
|
Simplified schema mapping. |
|
A transformer class for converting documents into graph structures using the GLiNER and GLiREL models. |
|
Transform documents into graph-based documents using a LLM. |
|
Create a new model by parsing and validating input data from keyword arguments. |
|
A transformer class for converting documents into graph structures using the Relik library and models. |
Functions
Formats a string to be used as a property key. |
|
Create a simple graph model with optional constraints on node and relationship types. |
|
Map the SimpleNode to the base Node. |
|
Map the SimpleRelationship to the base Relationship. |
|
Utility function to conditionally create a field with an enum constraint. |
|
|
llm_bash#
Classes
Chain that interprets a prompt and executes bash operations. |
|
|
Wrapper for starting subprocesses. |
Parser for bash output. |
llm_symbolic_math#
Classes
Chain that interprets a prompt and executes python code to do symbolic math. |
llms#
Classes
Parser for the tool tags. |
|
Jsonformer wrapped LLM using HuggingFace Pipeline API. |
|
Chat model using the Llama API. |
|
LMFormatEnforcer wrapped LLM using HuggingFace Pipeline API. |
|
RELLM wrapped LLM using HuggingFace Pipeline API. |
Functions
Lazily import of the jsonformer package. |
|
Lazily import of the lmformatenforcer package. |
|
Convert a tool to an Ollama tool. |
|
|
Extract function_call from AIMessage. |
Lazily import of the rellm package. |
Deprecated classes
open_clip#
Classes
OpenCLIP Embeddings model. |
pal_chain#
Classes
Chain that implements Program-Aided Language Models (PAL). |
|
|
Validation for PAL generated code. |
plan_and_execute#
Classes
Plan and execute a chain of steps. |
|
Base executor. |
|
Chain executor. |
|
Base planner. |
|
LLM planner. |
|
Planning output parser. |
|
Base step container. |
|
Container for List of steps. |
|
Plan. |
|
Plan output parser. |
|
Step. |
|
Step response. |
Functions
|
Load an agent executor. |
|
Load a chat planner. |
prompt_injection_identifier#
Classes
|
Tool that uses HuggingFace Prompt Injection model to detect prompt injection attacks. |
|
Exception raised when prompt injection attack is detected. |
recommenders#
Classes
Amazon Personalize Runtime wrapper for executing real-time operations. |
|
|
Chain for retrieving recommendations from Amazon Personalize, |
retrievers#
Classes
|
Retriever that uses Vector SQL Database. |
rl_chain#
Classes
Auto selection scorer. |
|
|
Abstract class to represent an embedder. |
|
Abstract class to represent an event. |
|
Abstract class to represent a policy. |
Chain that leverages the Vowpal Wabbit (VW) model as a learned policy for reinforcement learning. |
|
|
Chain that leverages the Vowpal Wabbit (VW) model as a learned policy for reinforcement learning. |
Abstract class to represent the selected item. |
|
Abstract class to grade the chosen selection or the response of the llm. |
|
|
Vowpal Wabbit policy. |
Metrics Tracker Average. |
|
Metrics Tracker Rolling Window. |
|
Model Repository. |
|
Chain that leverages the Vowpal Wabbit (VW) model for reinforcement learning with a context, with the goal of modifying the prompt before the LLM call. |
|
Event class for PickBest chain. |
|
Embed the BasedOn and ToSelectFrom inputs into a format that can be used by the learning policy. |
|
Random policy for PickBest chain. |
|
Selected class for PickBest chain. |
|
Vowpal Wabbit custom logger. |
Functions
|
Wrap a value to indicate that it should be based on. |
|
Wrap a value to indicate that it should be embedded. |
|
Wrap a value to indicate that it should be embedded and kept. |
|
Wrap a value to indicate that it should be selected from. |
Get the BasedOn and ToSelectFrom from the inputs. |
|
|
Parse the input string into a list of examples. |
Prepare the inputs for auto embedding. |
|
|
Embed the actions or context using the SentenceTransformer model (or a model that has an encode function). |
|
Embed a dictionary item. |
|
Embed a list item. |
|
Embed a string or an _Embed object. |
Check if an item is a string. |
|
|
Convert an embedding to a string. |
smart_llm#
Classes
Chain for applying self-critique using the SmartGPT workflow. |
sql#
Classes
Chain for interacting with SQL Database. |
|
Chain for querying SQL database that is a sequential chain. |
|
Chain for interacting with Vector SQL Database. |
|
Output Parser for Vector SQL. |
|
Parser based on VectorSQLOutputParser. |
Functions
|
Get result from SQL Database. |
tabular_synthetic_data#
Classes
Generate synthetic data using the given LLM and few-shot template. |
Functions
|
Create an instance of SyntheticDataGenerator tailored for OpenAI models. |
text_splitter#
Classes
|
Split the text based on semantic similarity. |
Functions
Calculate cosine distances between sentences. |
|
|
Combine sentences based on buffer size. |
tools#
Classes
Tool for running python code in a REPL. |
|
Python inputs. |
|
Tool for running python code in a REPL. |
Functions
Sanitize input to the python REPL. |
tot#
Classes
Chain implementing the Tree of Thought (ToT). |
|
Tree of Thought (ToT) checker. |
|
Tree of Thought (ToT) controller. |
|
|
Memory for the Tree of Thought (ToT) chain. |
Parse and check the output of the language model. |
|
Parse the output of a PROPOSE_PROMPT response. |
|
A thought in the ToT. |
|
|
Enum for the validity of a thought. |
Base class for a thought generation strategy. |
|
Strategy that is sequentially using a "propose prompt". |
|
Sample strategy from a Chain-of-Thought (CoT) prompt. |
Functions
Get the prompt for the Chain of Thought (CoT) chain. |
|
Get the prompt for the PROPOSE_PROMPT chain. |
utilities#
Classes
Simulates a standalone Python REPL. |