Tony20100/langchain_full huggingface dataset:
langchain_elasticsearch 0.2.2¶
langchain_elasticsearch.cache¶
Classes¶
cache.ElasticsearchCache(index_name[, ...])
An Elasticsearch cache integration for LLMs.
cache.ElasticsearchEmbeddingsCache(index_name)
An Elasticsearch store for caching embeddings.
langchain_elasticsearch.chat_history¶
Classes¶
chat_history.ElasticsearchChatMessageHistory(...)
Chat message history that stores history in Elasticsearch.
langchain_elasticsearch.client¶
Functions¶
client.create_elasticsearch_client([url, ...])
langchain_elasticsearch.embeddings¶
Classes¶
embeddings.ElasticsearchEmbeddings(client, ...)
Elasticsearch embedding models.
embeddings.EmbeddingServiceAdapter(...)
Adapter for LangChain Embeddings to support the EmbeddingService interface from elasticsearch.helpers.vectorstore.
langchain_elasticsearch.retrievers¶
Classes¶
retrievers.ElasticsearchRetriever
Elasticsearch retriever
langchain_elasticsearch.vectorstores¶
Classes¶
vectorstores.ApproxRetrievalStrategy([...])
[Deprecated] Approximate retrieval strategy using the HNSW algorithm.
vectorstores.BM25RetrievalStrategy([k1, b])
[Deprecated] Retrieval strategy using the native BM25 algorithm of Elasticsearch.
vectorstores.BaseRetrievalStrategy(*args, ...)
[Deprecated] Base class for Elasticsearch retrieval strategies.
vectorstores.ElasticsearchStore(index_name, ...)
Elasticsearch vector store.
vectorstores.ExactRetrievalStrategy(*args, ...)
[Deprecated] Exact retrieval strategy using the script_score query.
vectorstores.SparseRetrievalStrategy([model_id])
[Deprecated] Sparse retrieval strategy using the text_expansion processor.
langchain_together 0.1.3¶
langchain_together.chat_models¶
Wrapper around Together AI’s Chat Completions API.
Classes¶
chat_models.ChatTogether
ChatTogether chat model.
langchain_together.embeddings¶
Wrapper around Together AI’s Embeddings API.
Classes¶
embeddings.TogetherEmbeddings
TogetherEmbeddings embedding model.
langchain_together.llms¶
Wrapper around Together AI’s Completion API.
Classes¶
llms.Together
LLM models from Together.
langchain_chroma 0.1.1¶
langchain_chroma.vectorstores¶
Classes¶
vectorstores.Chroma([collection_name, ...])
ChromaDB vector store.
Functions¶
vectorstores.cosine_similarity(X, Y)
Row-wise cosine similarity between two equal-width matrices.
vectorstores.maximal_marginal_relevance(...)
Calculate maximal marginal relevance.
langchain_prompty 0.0.2¶
langchain_prompty.core¶
Classes¶
core.Frontmatter()
core.Invoker(prompty)
core.InvokerFactory()
core.ModelSettings
Create a new model by parsing and validating input data from keyword arguments.
core.NoOpParser(prompty)
core.Prompty
Create a new model by parsing and validating input data from keyword arguments.
core.PropertySettings
Create a new model by parsing and validating input data from keyword arguments.
core.SimpleModel
Create a new model by parsing and validating input data from keyword arguments.
core.TemplateSettings
Create a new model by parsing and validating input data from keyword arguments.
Functions¶
core.param_hoisting(top, bottom[, top_key])
langchain_prompty.langchain¶
Functions¶
langchain.create_chat_prompt(path[, ...])
langchain_prompty.parsers¶
Classes¶
parsers.PromptyChatParser(prompty)
langchain_prompty.renderers¶
Classes¶
renderers.MustacheRenderer(prompty)
langchain_prompty.utils¶
Functions¶
utils.execute(prompt[, configuration, ...])
utils.load(prompt_path[, configuration])
utils.prepare(prompt[, inputs])
utils.run(prompt, content[, configuration, ...])
langchain_openai 0.1.8¶
langchain_openai.chat_models¶
Classes¶
chat_models.azure.AzureChatOpenAI
Azure OpenAI Chat Completion API.
chat_models.base.BaseChatOpenAI
Create a new model by parsing and validating input data from keyword arguments.
chat_models.base.ChatOpenAI
OpenAI chat model integration.
langchain_openai.embeddings¶
Classes¶
embeddings.azure.AzureOpenAIEmbeddings
Azure OpenAI Embeddings API.
embeddings.base.OpenAIEmbeddings
OpenAI embedding models.
langchain_openai.llms¶
Classes¶
llms.azure.AzureOpenAI
Azure-specific OpenAI large language models.
llms.base.BaseOpenAI
Base OpenAI large language model class.
llms.base.OpenAI
OpenAI large language models.
langchain_huggingface 0.0.3¶
langchain_huggingface.chat_models¶
Classes¶
chat_models.huggingface.ChatHuggingFace
Wrapper for using Hugging Face LLM's as ChatModels.
chat_models.huggingface.TGI_MESSAGE(role, ...)
chat_models.huggingface.TGI_RESPONSE(...)
langchain_huggingface.embeddings¶
Classes¶
embeddings.huggingface.HuggingFaceEmbeddings
HuggingFace sentence_transformers embedding models.
embeddings.huggingface_endpoint.HuggingFaceEndpointEmbeddings
HuggingFaceHub embedding models.
langchain_huggingface.llms¶
Classes¶
llms.huggingface_endpoint.HuggingFaceEndpoint
HuggingFace Endpoint.
llms.huggingface_pipeline.HuggingFacePipeline
HuggingFace Pipeline API.
langchain_core 0.2.5¶
langchain_core.agents¶
Agent is a class that uses an LLM to choose a sequence of actions to take.
In Chains, a sequence of actions is hardcoded. In Agents,
a language model is used as a reasoning engine to determine which actions
to take and in which order.
Agents select and use Tools and Toolkits for actions.
Class hierarchy:
BaseSingleActionAgent --> LLMSingleActionAgent
                          OpenAIFunctionsAgent
                          XMLAgent
                          Agent --> <name>Agent  # Examples: ZeroShotAgent, ChatAgent
BaseMultiActionAgent  --> OpenAIMultiFunctionsAgent
Main helpers:
AgentType, AgentExecutor, AgentOutputParser, AgentExecutorIterator,
AgentAction, AgentFinish, AgentStep
Classes¶
agents.AgentAction
A full description of an action for an ActionAgent to execute.
agents.AgentActionMessageLog
Override init to support instantiation by position for backward compat.
agents.AgentFinish
The final return value of an ActionAgent.
agents.AgentStep
The result of running an AgentAction.
langchain_core.beta¶
Some beta features that are not yet ready for production.
Classes¶
beta.runnables.context.Context()
Context for a runnable.
beta.runnables.context.ContextGet
[Beta] Get a context value.
beta.runnables.context.ContextSet
[Beta] Set a context value.
beta.runnables.context.PrefixContext([prefix])
Context for a runnable with a prefix.
Functions¶
beta.runnables.context.aconfig_with_context(...)
Asynchronously patch a runnable config with context getters and setters.
beta.runnables.context.config_with_context(...)
Patch a runnable config with context getters and setters.
langchain_core.caches¶
Warning
Beta Feature!
Cache provides an optional caching layer for LLMs.
Warning
Beta Feature!
Cache provides an optional caching layer for LLMs.
Cache is useful for two reasons:
It can save you money by reducing the number of API calls you make to the LLM
provider if you’re often requesting the same completion multiple times.
It can speed up your application by reducing the number of API calls you make
to the LLM provider.
Cache directly competes with Memory. See documentation for Pros and Cons.
Class hierarchy:
BaseCache --> <name>Cache  # Examples: InMemoryCache, RedisCache, GPTCache
Classes¶
caches.BaseCache()
This interfaces provides a caching layer for LLMs and Chat models.
caches.InMemoryCache()
Cache that stores things in memory.
langchain_core.callbacks¶
Callback handlers allow listening to events in LangChain.
Class hierarchy:
BaseCallbackHandler --> <name>CallbackHandler  # Example: AimCallbackHandler
Classes¶
callbacks.base.AsyncCallbackHandler()
Async callback handler that handles callbacks from LangChain.
callbacks.base.BaseCallbackHandler()
Base callback handler that handles callbacks from LangChain.
callbacks.base.BaseCallbackManager(handlers)
Base callback manager that handles callbacks from LangChain.
callbacks.base.CallbackManagerMixin()
Mixin for callback manager.
callbacks.base.ChainManagerMixin()
Mixin for chain callbacks.
callbacks.base.LLMManagerMixin()
Mixin for LLM callbacks.
callbacks.base.RetrieverManagerMixin()
Mixin for Retriever callbacks.
callbacks.base.RunManagerMixin()
Mixin for run manager.
callbacks.base.ToolManagerMixin()
Mixin for tool callbacks.
callbacks.file.FileCallbackHandler(filename)
Callback Handler that writes to a file.
callbacks.manager.AsyncCallbackManager(handlers)
Async callback manager that handles callbacks from LangChain.
callbacks.manager.AsyncCallbackManagerForChainGroup(...)
Async callback manager for the chain group.
Generic event handler for AsyncCallbackManager.
callbacks.manager.atrace_as_chain_group(...)
Get an async callback manager for a chain group in a context manager.
callbacks.manager.handle_event(handlers, ...)
Generic event handler for CallbackManager.
callbacks.manager.shielded(func)
Makes so an awaitable method is always shielded from cancellation
callbacks.manager.trace_as_chain_group(...)
Get a callback manager for a chain group in a context manager.
langchain_core.chat_history¶
Chat message history stores a history of the message interactions in a chat.
Class hierarchy:
BaseChatMessageHistory --> <name>ChatMessageHistory  # Examples: FileChatMessageHistory, PostgresChatMessageHistory
Main helpers:
AIMessage, HumanMessage, BaseMessage
Classes¶
chat_history.BaseChatMessageHistory()
Abstract base class for storing chat message history.
chat_history.InMemoryChatMessageHistory
In memory implementation of chat message history.
langchain_core.chat_loaders¶
Classes¶
chat_loaders.BaseChatLoader()
Base class for chat loaders.
langchain_core.chat_sessions¶
Chat Sessions are a collection of messages and function calls.
Classes¶
chat_sessions.ChatSession
Chat Session represents a single conversation, channel, or other group of messages.
langchain_core.document_loaders¶
Classes¶
document_loaders.base.BaseBlobParser()
Abstract interface for blob parsers.
document_loaders.base.BaseLoader()
Interface for Document Loader.
document_loaders.blob_loaders.Blob
Blob represents raw data by either reference or value.
document_loaders.blob_loaders.BlobLoader()
Abstract interface for blob loaders implementation.
langchain_core.documents¶
Document module is a collection of classes that handle documents
and their transformations.
Classes¶
documents.base.Document
Class for storing a piece of text and associated metadata.
documents.compressor.BaseDocumentCompressor
Class for storing a piece of text and associated metadata.
documents.compressor.BaseDocumentCompressor
Base class for document compressors.
documents.transformers.BaseDocumentTransformer()
Abstract base class for document transformation systems.
langchain_core.embeddings¶
Classes¶
embeddings.embeddings.Embeddings()
Interface for embedding models.
embeddings.fake.DeterministicFakeEmbedding
Fake embedding model that always returns the same embedding vector for the same text.
embeddings.fake.FakeEmbeddings
Fake embedding model.
langchain_core.example_selectors¶
Example selector implements logic for selecting examples to include them
in prompts.
This allows us to select examples that are most relevant to the input.
Classes¶
example_selectors.base.BaseExampleSelector()
Interface for selecting examples to include in prompts.
example_selectors.length_based.LengthBasedExampleSelector
Select examples based on length.
example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector
Select examples based on Max Marginal Relevance.
example_selectors.semantic_similarity.SemanticSimilarityExampleSelector
Select examples based on semantic similarity.
Functions¶
example_selectors.semantic_similarity.sorted_values(values)
Return a list of values in dict sorted by key.
langchain_core.exceptions¶
Custom exceptions for LangChain.
Classes¶
exceptions.LangChainException
General LangChain exception.
exceptions.OutputParserException(error[, ...])
Exception that output parsers should raise to signify a parsing error.
exceptions.TracerException
Base class for exceptions in tracers module.
langchain_core.globals¶
Global values and configuration that apply to all of LangChain.
Functions¶
globals.get_debug()
Get the value of the debug global setting.
globals.get_llm_cache()
Get the value of the llm_cache global setting.
globals.get_verbose()
Get the value of the verbose global setting.
globals.set_debug(value)
Get the value of the verbose global setting.
globals.set_debug(value)
Set a new value for the debug global setting.
globals.set_llm_cache(value)
Set a new LLM cache, overwriting the previous value, if any.
globals.set_verbose(value)
Set a new value for the verbose global setting.
langchain_core.indexing¶
Code to help indexing data into a vectorstore.
This package contains helper logic to help deal with indexing data into
a vectorstore while avoiding duplicated content and over-writing content
if it’s unchanged.
Classes¶
indexing.api.IndexingResult
Return a detailed a breakdown of the result of the indexing operation.
indexing.base.RecordManager(namespace)
Abstract base class representing the interface for a record manager.
Functions¶
indexing.api.aindex(docs_source, ...[, ...])
Index data from the loader into the vector store.
indexing.api.index(docs_source, ...[, ...])
Index data from the loader into the vector store.
langchain_core.language_models¶
Language Model is a type of model that can generate text or complete
text prompts.
LangChain has two main classes to work with language models:
- LLM classes provide access to the large language model (LLM) APIs and services.
- Chat Models are a variation on language models.
Class hierarchy:
BaseLanguageModel --> BaseLLM --> LLM --> <name>  # Examples: AI21, HuggingFaceHub, OpenAI
                  --> BaseChatModel --> <name>    # Examples: ChatOpenAI, ChatGooglePalm
Main helpers:
LLMResult, PromptValue,
CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun,
CallbackManager, AsyncCallbackManager,
AIMessage, BaseMessage, HumanMessage
Classes¶
language_models.base.BaseLanguageModel
AIMessage, BaseMessage, HumanMessage
Classes¶
language_models.base.BaseLanguageModel
Abstract base class for interfacing with language models.
language_models.chat_models.BaseChatModel
Base class for Chat models.
language_models.chat_models.LangSmithParams
language_models.chat_models.SimpleChatModel
Simplified implementation for a chat model to inherit from.
language_models.fake.FakeListLLM
Fake LLM for testing purposes.
language_models.fake.FakeStreamingListLLM
Fake streaming list LLM for testing purposes.
language_models.fake_chat_models.FakeChatModel
Fake Chat Model wrapper for testing purposes.
language_models.fake_chat_models.FakeListChatModel
Fake ChatModel for testing purposes.
language_models.fake_chat_models.FakeMessagesListChatModel
Fake ChatModel for testing purposes.
language_models.fake_chat_models.GenericFakeChatModel
Generic fake chat model that can be used to test the chat model interface.
language_models.fake_chat_models.ParrotFakeChatModel
Generic fake chat model that can be used to test the chat model interface.
language_models.llms.BaseLLM
Base LLM abstract interface.
language_models.llms.LLM
Simple interface for implementing a custom LLM.
Functions¶
language_models.chat_models.agenerate_from_stream(stream)
Async generate from a stream.
language_models.chat_models.generate_from_stream(stream)
Generate from a stream.
language_models.llms.aget_prompts(params, ...)
Get prompts that are already cached.
language_models.llms.aupdate_cache(cache, ...)
Update the cache and get the LLM output.
language_models.llms.create_base_retry_decorator(...)
Create a retry decorator for a given LLM and provided list of error types.
language_models.llms.get_prompts(params, prompts)
Get prompts that are already cached.
language_models.llms.update_cache(cache, ...)
Get prompts that are already cached.
language_models.llms.update_cache(cache, ...)
Update the cache and get the LLM output.
langchain_core.load¶
Load module helps with serialization and deserialization.
Classes¶
load.load.Reviver([secrets_map, ...])
Reviver for JSON objects.
load.serializable.BaseSerialized
Base class for serialized objects.
load.serializable.Serializable
Serializable base class.
load.serializable.SerializedConstructor
Serialized constructor.
load.serializable.SerializedNotImplemented
Serialized not implemented.
load.serializable.SerializedSecret
Serialized secret.
Functions¶
load.dump.default(obj)
Return a default value for a Serializable object or a SerializedNotImplemented object.
load.dump.dumpd(obj)
Return a json dict representation of an object.
load.dump.dumps(obj, *[, pretty])
Return a json string representation of an object.
load.load.load(obj, *[, secrets_map, ...])
[Beta] Revive a LangChain class from a JSON object.
load.load.loads(text, *[, secrets_map, ...])
[Beta] Revive a LangChain class from a JSON string.
load.serializable.to_json_not_implemented(obj)
Serialize a "not implemented" object.
load.serializable.try_neq_default(value, ...)
Try to determine if a value is different from the default.
langchain_core.memory¶
Memory maintains Chain state, incorporating context from past runs.
Class hierarchy for Memory:
BaseMemory --> <name>Memory --> <name>Memory  # Examples: BaseChatMemory -> MotorheadMemory
Classes¶
memory.BaseMemory
Abstract base class for memory in Chains.
langchain_core.messages¶
Messages are objects used in prompts and chat conversations.
Class hierarchy:
Messages are objects used in prompts and chat conversations.
Class hierarchy:
BaseMessage --> SystemMessage, AIMessage, HumanMessage, ChatMessage, FunctionMessage, ToolMessage
            --> BaseMessageChunk --> SystemMessageChunk, AIMessageChunk, HumanMessageChunk, ChatMessageChunk, FunctionMessageChunk, ToolMessageChunk
Main helpers:
ChatPromptTemplate
Classes¶
messages.ai.AIMessage
Message from an AI.
messages.ai.AIMessageChunk
Message chunk from an AI.
messages.ai.UsageMetadata
Usage metadata for a message, such as token counts.
messages.base.BaseMessage
Base abstract Message class.
messages.base.BaseMessageChunk
Message chunk, which can be concatenated with other Message chunks.
messages.chat.ChatMessage
Message that can be assigned an arbitrary speaker (i.e.
messages.chat.ChatMessageChunk
Chat Message chunk.
messages.function.FunctionMessage
Message for passing the result of executing a function back to a model.
messages.function.FunctionMessageChunk
Function Message chunk.
messages.human.HumanMessage
Message from a human.
messages.human.HumanMessageChunk
Human Message chunk.
messages.system.SystemMessage
Message for priming AI behavior, usually passed in as the first of a sequence of input messages.
messages.system.SystemMessageChunk
System Message chunk.
messages.tool.InvalidToolCall
Allowance for errors made by LLM.
messages.tool.ToolCall
Represents a request to call a tool.
messages.tool.ToolCallChunk
A chunk of a tool call (e.g., as part of a stream).
messages.tool.ToolMessage
Message for passing the result of executing a tool back to a model.
messages.tool.ToolMessageChunk
Tool Message chunk.
Functions¶
messages.base.get_msg_title_repr(title, *[, ...])
Get a title representation for a message.
messages.base.merge_content(first_content, ...)
Get a title representation for a message.
messages.base.merge_content(first_content, ...)
Merge two message contents.
messages.base.message_to_dict(message)
Convert a Message to a dictionary.
messages.base.messages_to_dict(messages)
Convert a sequence of Messages to a list of dictionaries.
messages.tool.default_tool_chunk_parser(...)
Best-effort parsing of tool chunks.
messages.tool.default_tool_parser(raw_tool_calls)
Best-effort parsing of tools.
messages.utils.convert_to_messages(messages)
Convert a sequence of messages to a list of messages.
messages.utils.get_buffer_string(messages[, ...])
Convert a sequence of Messages to strings and concatenate them into one string.
messages.utils.message_chunk_to_message(chunk)
Convert a message chunk to a message.
messages.utils.messages_from_dict(messages)
Convert a sequence of messages from dicts to Message objects.
langchain_core.output_parsers¶
OutputParser classes parse the output of an LLM call.
Class hierarchy:
BaseLLMOutputParser --> BaseOutputParser --> <name>OutputParser  # ListOutputParser, PydanticOutputParser
Main helpers:
Serializable, Generation, PromptValue
Classes¶
output_parsers.base.BaseGenerationOutputParser
Base class to parse the output of an LLM call.
output_parsers.base.BaseLLMOutputParser()
Abstract base class for parsing the outputs of a model.
output_parsers.base.BaseOutputParser
Base class to parse the output of an LLM call.
output_parsers.json.JsonOutputParser
Parse the output of an LLM call to a JSON object.
output_parsers.json.SimpleJsonOutputParser
alias of JsonOutputParser
output_parsers.list.CommaSeparatedListOutputParser
Parse the output of an LLM call to a comma-separated list.
output_parsers.list.ListOutputParser
Parse the output of an LLM call to a list.
Parse the output of an LLM call to a list.
output_parsers.list.MarkdownListOutputParser
Parse a markdown list.
output_parsers.list.NumberedListOutputParser
Parse a numbered list.
output_parsers.openai_functions.JsonKeyOutputFunctionsParser
Parse an output as the element of the Json object.
output_parsers.openai_functions.JsonOutputFunctionsParser
Parse an output as the Json object.
output_parsers.openai_functions.OutputFunctionsParser
Parse an output that is one of sets of values.
output_parsers.openai_functions.PydanticAttrOutputFunctionsParser
Parse an output as an attribute of a pydantic object.
output_parsers.openai_functions.PydanticOutputFunctionsParser
Parse an output as a pydantic object.
output_parsers.openai_tools.JsonOutputKeyToolsParser
Parse tools from OpenAI response.
output_parsers.openai_tools.JsonOutputToolsParser
Parse tools from OpenAI response.
output_parsers.openai_tools.PydanticToolsParser
Parse tools from OpenAI response.
output_parsers.pydantic.PydanticOutputParser
Parse an output using a pydantic model.
output_parsers.string.StrOutputParser
OutputParser that parses LLMResult into the top likely string.
output_parsers.transform.BaseCumulativeTransformOutputParser
Base class for an output parser that can handle streaming input.
output_parsers.transform.BaseTransformOutputParser
Base class for an output parser that can handle streaming input.
output_parsers.xml.XMLOutputParser
Parse an output using xml format.
Functions¶
output_parsers.list.droplastn(iter, n)
Drop the last n elements of an iterator.
output_parsers.openai_tools.make_invalid_tool_call(...)
Create an InvalidToolCall from a raw tool call.
output_parsers.openai_tools.parse_tool_call(...)
output_parsers.openai_tools.parse_tool_call(...)
Parse a single tool call.
output_parsers.openai_tools.parse_tool_calls(...)
Parse a list of tool calls.
output_parsers.xml.nested_element(path, elem)
Get nested element from path.
langchain_core.outputs¶
Output classes are used to represent the output of a language model call
and the output of a chat.
Classes¶
outputs.chat_generation.ChatGeneration
A single chat generation output.
outputs.chat_generation.ChatGenerationChunk
ChatGeneration chunk, which can be concatenated with other
outputs.chat_result.ChatResult
Class that contains all results for a single chat model call.
outputs.generation.Generation
A single text generation output.
outputs.generation.GenerationChunk
Generation chunk, which can be concatenated with other Generation chunks.
outputs.llm_result.LLMResult
Class that contains all results for a batched LLM call.
outputs.run_info.RunInfo
Class that contains metadata for a single execution of a Chain or model.
langchain_core.prompt_values¶
Prompt values for language model prompts.
Prompt values are used to represent different pieces of prompts.
They can be used to represent text, images, or chat message pieces.
Classes¶
prompt_values.ChatPromptValue
Chat prompt value.
prompt_values.ChatPromptValueConcrete
Chat prompt value which explicitly lists out the message types it accepts.
prompt_values.ImagePromptValue
Image prompt value.
prompt_values.ImageURL
Image URL.
prompt_values.PromptValue
Base abstract class for inputs to any language model.
prompt_values.StringPromptValue
String prompt value.
langchain_core.prompts¶
Prompt is the input to the model.
Prompt is often constructed
from multiple components and prompt values. Prompt classes and functions make constructing
and working with prompts easy.
Class hierarchy:
BasePromptTemplate --> PipelinePromptTemplate
                       StringPromptTemplate --> PromptTemplate