Tony20100/langchain_full huggingface dataset:
Load chat sessions from a list of LangSmith "llm" runs.
chat_loaders.slack.SlackChatLoader(path)
Load Slack conversations from a dump zip file.
chat_loaders.telegram.TelegramChatLoader(path)
Load telegram conversations to LangChain chat messages.
chat_loaders.whatsapp.WhatsAppChatLoader(path)
Load WhatsApp conversations from a dump zip file or directory.
Functions¶
chat_loaders.imessage.nanoseconds_from_2001_to_datetime(...)
chat_loaders.utils.map_ai_messages(...)
Convert messages from the specified 'sender' to AI messages.
chat_loaders.utils.map_ai_messages_in_session(...)
Convert messages from the specified 'sender' to AI messages.
chat_loaders.utils.merge_chat_runs(chat_sessions)
Merge chat runs together.
chat_loaders.utils.merge_chat_runs_in_session(...)
Merge chat runs together in a chat session.
langchain_community.chat_message_histories¶
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_message_histories.astradb.AstraDBChatMessageHistory(*, ...)
[Deprecated]
chat_message_histories.cassandra.CassandraChatMessageHistory(...)
Chat message history that stores history in Cassandra.
chat_message_histories.cosmos_db.CosmosDBChatMessageHistory(...)
Chat message history backed by Azure CosmosDB.
chat_message_histories.dynamodb.DynamoDBChatMessageHistory(...)
Chat message history that stores history in AWS DynamoDB.
chat_message_histories.elasticsearch.ElasticsearchChatMessageHistory(...)
[Deprecated] Chat message history that stores history in Elasticsearch.
chat_message_histories.file.FileChatMessageHistory(...)
chat_message_histories.file.FileChatMessageHistory(...)
Chat message history that stores history in a local file.
chat_message_histories.firestore.FirestoreChatMessageHistory(...)
Chat message history backed by Google Firestore.
chat_message_histories.momento.MomentoChatMessageHistory(...)
Chat message history cache that uses Momento as a backend.
chat_message_histories.mongodb.MongoDBChatMessageHistory(...)
[Deprecated] Chat message history that stores history in MongoDB.
chat_message_histories.neo4j.Neo4jChatMessageHistory(...)
Chat message history stored in a Neo4j database.
chat_message_histories.postgres.PostgresChatMessageHistory(...)
[Deprecated] Chat message history stored in a Postgres database.
chat_message_histories.redis.RedisChatMessageHistory(...)
Chat message history stored in a Redis database.
chat_message_histories.rocksetdb.RocksetChatMessageHistory(...)
Uses Rockset to store chat messages.
chat_message_histories.singlestoredb.SingleStoreDBChatMessageHistory(...)
Chat message history stored in a SingleStoreDB database.
chat_message_histories.sql.BaseMessageConverter()
Convert BaseMessage to the SQLAlchemy model.
chat_message_histories.sql.DefaultMessageConverter(...)
The default message converter for SQLChatMessageHistory.
chat_message_histories.sql.SQLChatMessageHistory(...)
Chat message history stored in an SQL database.
chat_message_histories.streamlit.StreamlitChatMessageHistory([key])
Chat message history that stores messages in Streamlit session state.
chat_message_histories.tidb.TiDBChatMessageHistory(...)
Represents a chat message history stored in a TiDB database.
chat_message_histories.upstash_redis.UpstashRedisChatMessageHistory(...)
Chat message history stored in an Upstash Redis database.
chat_message_histories.xata.XataChatMessageHistory(...)
Chat message history stored in a Xata database.
Chat message history stored in a Xata database.
chat_message_histories.zep.SearchScope(value)
Scope for the document search.
chat_message_histories.zep.SearchType(value)
Enumerator of the types of search to perform.
chat_message_histories.zep.ZepChatMessageHistory(...)
Chat message history that uses Zep as a backend.
chat_message_histories.zep_cloud.ZepCloudChatMessageHistory(...)
Chat message history that uses Zep Cloud as a backend.
Functions¶
chat_message_histories.sql.create_message_model(...)
Create a message model for a given table name.
chat_message_histories.zep_cloud.condense_zep_memory_into_human_message(...)
chat_message_histories.zep_cloud.get_zep_message_role_type(role)
langchain_community.chat_models¶
Chat Models are a variation on language models.
While Chat Models use language models under the hood, the interface they expose
is a bit different. Rather than expose a “text in, text out” API, they expose
an interface where “chat messages” are the inputs and outputs.
Class hierarchy:
BaseLanguageModel --> BaseChatModel --> <name>  # Examples: ChatOpenAI, ChatGooglePalm
Main helpers:
AIMessage, BaseMessage, HumanMessage
Classes¶
chat_models.anthropic.ChatAnthropic
[Deprecated] Anthropic chat large language models.
chat_models.anyscale.ChatAnyscale
Anyscale Chat large language models.
chat_models.azure_openai.AzureChatOpenAI
[Deprecated] Azure OpenAI Chat Completion API.
chat_models.azureml_endpoint.AzureMLChatOnlineEndpoint
Azure ML Online Endpoint chat models.
chat_models.azureml_endpoint.CustomOpenAIChatContentFormatter()
Chat Content formatter for models with OpenAI like API scheme.
chat_models.azureml_endpoint.LlamaChatContentFormatter()
Deprecated: Kept for backwards compatibility
chat_models.azureml_endpoint.LlamaChatContentFormatter()
Deprecated: Kept for backwards compatibility
chat_models.azureml_endpoint.LlamaContentFormatter()
Content formatter for LLaMA.
chat_models.azureml_endpoint.MistralChatContentFormatter()
Content formatter for Mistral.
chat_models.baichuan.ChatBaichuan
Baichuan chat models API by Baichuan Intelligent Technology.
chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint
Baidu Qianfan chat models.
chat_models.bedrock.BedrockChat
[Deprecated] Chat model that uses the Bedrock API.
chat_models.bedrock.ChatPromptAdapter()
Adapter class to prepare the inputs from Langchain to prompt format that Chat model expects.
chat_models.cohere.ChatCohere
[Deprecated] Cohere chat large language models.
chat_models.coze.ChatCoze
ChatCoze chat models API by coze.com
chat_models.dappier.ChatDappierAI
Dappier chat large language models.
chat_models.databricks.ChatDatabricks
Databricks chat models API.
chat_models.deepinfra.ChatDeepInfra
A chat model that uses the DeepInfra API.
chat_models.deepinfra.ChatDeepInfraException
Exception raised when the DeepInfra API returns an error.
chat_models.edenai.ChatEdenAI
EdenAI chat large language models.
chat_models.ernie.ErnieBotChat
[Deprecated] ERNIE-Bot large language model.
chat_models.everlyai.ChatEverlyAI
EverlyAI Chat large language models.
chat_models.fake.FakeListChatModel
Fake ChatModel for testing purposes.
chat_models.fake.FakeMessagesListChatModel
Fake ChatModel for testing purposes.
chat_models.fireworks.ChatFireworks
[Deprecated] Fireworks Chat models.
chat_models.friendli.ChatFriendli
[Deprecated] Fireworks Chat models.
chat_models.friendli.ChatFriendli
Friendli LLM for chat.
chat_models.gigachat.GigaChat
GigaChat large language models API.
chat_models.google_palm.ChatGooglePalm
Google PaLM Chat models API.
chat_models.google_palm.ChatGooglePalmError
Error with the Google PaLM API.
chat_models.gpt_router.GPTRouter
GPTRouter by Writesonic Inc.
chat_models.gpt_router.GPTRouterException
Error with the GPTRouter APIs
chat_models.gpt_router.GPTRouterModel
GPTRouter model.
chat_models.huggingface.ChatHuggingFace
[Deprecated] Wrapper for using Hugging Face LLM's as ChatModels.
chat_models.human.HumanInputChatModel
ChatModel which returns user input as the response.
chat_models.hunyuan.ChatHunyuan
Tencent Hunyuan chat models API by Tencent.
chat_models.javelin_ai_gateway.ChatJavelinAIGateway
Javelin AI Gateway chat models API.
chat_models.javelin_ai_gateway.ChatParams
Parameters for the Javelin AI Gateway LLM.
chat_models.jinachat.JinaChat
Jina AI Chat models API.
chat_models.kinetica.ChatKinetica
Kinetica LLM Chat Model API.
chat_models.kinetica.KineticaSqlOutputParser
Fetch and return data from the Kinetica LLM.
chat_models.kinetica.KineticaSqlResponse
Response containing SQL and the fetched data.
chat_models.kinetica.KineticaUtil()
Kinetica utility functions.
chat_models.konko.ChatKonko
ChatKonko Chat large language models API.
chat_models.litellm.ChatLiteLLM
Chat model that uses the LiteLLM API.
Chat model that uses the LiteLLM API.
chat_models.litellm.ChatLiteLLMException
Error with the LiteLLM I/O library
chat_models.litellm_router.ChatLiteLLMRouter
LiteLLM Router as LangChain Model.
chat_models.llama_edge.LlamaEdgeChatService
Chat with LLMs via llama-api-server
chat_models.maritalk.ChatMaritalk
MariTalk Chat models API.
chat_models.maritalk.MaritalkHTTPError(...)
Initialize RequestException with request and response objects.
chat_models.minimax.MiniMaxChat
MiniMax large language models.
chat_models.mlflow.ChatMlflow
MLflow chat models API.
chat_models.mlflow_ai_gateway.ChatMLflowAIGateway
MLflow AI Gateway chat models API.
chat_models.mlflow_ai_gateway.ChatParams
Parameters for the MLflow AI Gateway LLM.
chat_models.mlx.ChatMLX
MLX chat models.
chat_models.moonshot.MoonshotChat
Moonshot large language models.
chat_models.octoai.ChatOctoAI
OctoAI Chat large language models.
chat_models.ollama.ChatOllama
Ollama locally runs large language models.
chat_models.openai.ChatOpenAI
[Deprecated] OpenAI Chat large language models API.
chat_models.pai_eas_endpoint.PaiEasChatEndpoint
Alibaba Cloud PAI-EAS LLM Service chat model API.
chat_models.perplexity.ChatPerplexity
Perplexity AI Chat models API.
chat_models.premai.ChatPremAI
PremAI Chat models.
chat_models.premai.ChatPremAPIError
Error with the PremAI API.
chat_models.promptlayer_openai.PromptLayerChatOpenAI
PromptLayer and OpenAI Chat large language models API.
chat_models.solar.SolarChat
PromptLayer and OpenAI Chat large language models API.
chat_models.solar.SolarChat
[Deprecated] Wrapper around Solar large language models.
chat_models.sparkllm.ChatSparkLLM
iFlyTek Spark large language model.
chat_models.tongyi.ChatTongyi
Alibaba Tongyi Qwen chat models API.
chat_models.vertexai.ChatVertexAI
[Deprecated] Vertex AI Chat large language models API.
chat_models.volcengine_maas.VolcEngineMaasChat
Volc Engine Maas hosts a plethora of models.
chat_models.yandex.ChatYandexGPT
YandexGPT large language models.
chat_models.yuan2.ChatYuan2
Yuan2.0 Chat models API.
chat_models.zhipuai.ChatZhipuAI
ZhipuAI large language chat models API.
Functions¶
chat_models.anthropic.convert_messages_to_prompt_anthropic(...)
Format a list of messages into a full prompt for the Anthropic model
chat_models.baidu_qianfan_endpoint.convert_message_to_dict(message)
Convert a message to a dictionary that can be passed to the API.
chat_models.bedrock.convert_messages_to_prompt_mistral(...)
Convert a list of messages to a prompt for mistral.
chat_models.cohere.get_cohere_chat_request(...)
Get the request for the Cohere chat API.
chat_models.cohere.get_role(message)
Get the role of the message.
chat_models.fireworks.acompletion_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.fireworks.acompletion_with_retry_streaming(...)
Use tenacity to retry the completion call for streaming.
chat_models.fireworks.completion_with_retry(...)
Use tenacity to retry the completion call.
chat_models.fireworks.conditional_decorator(...)
Define conditional decorator.
chat_models.fireworks.conditional_decorator(...)
Define conditional decorator.
chat_models.fireworks.convert_dict_to_message(_dict)
Convert a dict response to a message.
chat_models.friendli.get_chat_request(messages)
Get a request of the Friendli chat API.
chat_models.friendli.get_role(message)
Get role of the message.
chat_models.google_palm.achat_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.google_palm.chat_with_retry(llm, ...)
Use tenacity to retry the completion call.
chat_models.gpt_router.acompletion_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.gpt_router.completion_with_retry(...)
Use tenacity to retry the completion call.
chat_models.gpt_router.get_ordered_generation_requests(...)
Return the body for the model router input.
chat_models.jinachat.acompletion_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.litellm.acompletion_with_retry(llm)
Use tenacity to retry the async completion call.
chat_models.litellm_router.get_llm_output(...)
Get llm output from usage and params.
chat_models.meta.convert_messages_to_prompt_llama(...)
Convert a list of messages to a prompt for llama.
chat_models.minimax.aconnect_httpx_sse(...)
chat_models.minimax.connect_httpx_sse(...)
chat_models.openai.acompletion_with_retry(llm)
Use tenacity to retry the async completion call.
chat_models.premai.chat_with_retry(llm, ...)
Using tenacity for retry in completion call
chat_models.premai.create_prem_retry_decorator(llm, *)
Create a retry decorator for PremAI API errors.
chat_models.tongyi.convert_dict_to_message(_dict)
Convert a dict to a message.
Convert a dict to a message.
chat_models.tongyi.convert_message_chunk_to_message(...)
Convert a message chunk to a message.
chat_models.tongyi.convert_message_to_dict(message)
Convert a message to a dict.
chat_models.volcengine_maas.convert_dict_to_message(_dict)
Convert a dict to a message.
chat_models.yandex.acompletion_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.yandex.completion_with_retry(...)
Use tenacity to retry the completion call.
chat_models.yuan2.acompletion_with_retry(...)
Use tenacity to retry the async completion call.
chat_models.zhipuai.aconnect_sse(client, ...)
chat_models.zhipuai.connect_sse(client, ...)
langchain_community.cross_encoders¶
Cross encoders are wrappers around cross encoder models from different APIs andservices.
Cross encoder models can be LLMs or not.
Class hierarchy:
BaseCrossEncoder --> <name>CrossEncoder  # Examples: SagemakerEndpointCrossEncoder
Classes¶
cross_encoders.fake.FakeCrossEncoder
Fake cross encoder model.
cross_encoders.huggingface.HuggingFaceCrossEncoder
HuggingFace cross encoder models.
cross_encoders.sagemaker_endpoint.CrossEncoderContentHandler()
Content handler for CrossEncoder class.
cross_encoders.sagemaker_endpoint.SagemakerEndpointCrossEncoder
SageMaker Inference CrossEncoder endpoint.
langchain_community.docstore¶
Docstores are classes to store and load Documents.
The Docstore is a simplified version of the Document Loader.
Class hierarchy:
Docstore --> <name> # Examples: InMemoryDocstore, Wikipedia
Main helpers:
Document, AddableMixin
Classes¶
docstore.arbitrary_fn.DocstoreFn(lookup_fn)
Docstore via arbitrary lookup function.
docstore.base.AddableMixin()
Docstore via arbitrary lookup function.
docstore.base.AddableMixin()
Mixin class that supports adding texts.
docstore.base.Docstore()
Interface to access to place that stores documents.
docstore.in_memory.InMemoryDocstore([_dict])
Simple in memory docstore in the form of a dict.
docstore.wikipedia.Wikipedia()
Wikipedia API.
langchain_community.document_compressors¶
Classes¶
document_compressors.dashscope_rerank.DashScopeRerank
Document compressor that uses DashScope Rerank API.
document_compressors.flashrank_rerank.FlashrankRerank
Document compressor using Flashrank interface.
document_compressors.jina_rerank.JinaRerank
Document compressor that uses Jina Rerank API.
document_compressors.llmlingua_filter.LLMLinguaCompressor
Compress using LLMLingua Project.
document_compressors.openvino_rerank.OpenVINOReranker
OpenVINO rerank models.
document_compressors.openvino_rerank.RerankRequest([...])
Request for reranking.
document_compressors.rankllm_rerank.ModelType(value)
An enumeration.
document_compressors.rankllm_rerank.RankLLMRerank
Document compressor using Flashrank interface.
langchain_community.document_loaders¶
Document Loaders  are classes to load Documents.
Document Loaders are usually used to load a lot of Documents in a single run.
Class hierarchy:
BaseLoader --> <name>Loader  # Examples: TextLoader, UnstructuredFileLoader
Main helpers:
Document, <name>TextSplitter
Classes¶
document_loaders.acreom.AcreomLoader(path[, ...])
Load acreom vault from a directory.
document_loaders.airbyte.AirbyteCDKLoader(...)
document_loaders.airbyte.AirbyteCDKLoader(...)
Load with an Airbyte source connector implemented using the CDK.
document_loaders.airbyte.AirbyteGongLoader(...)
Load from Gong using an Airbyte source connector.
document_loaders.airbyte.AirbyteHubspotLoader(...)
Load from Hubspot using an Airbyte source connector.
document_loaders.airbyte.AirbyteSalesforceLoader(...)
Load from Salesforce using an Airbyte source connector.
document_loaders.airbyte.AirbyteShopifyLoader(...)
Load from Shopify using an Airbyte source connector.
document_loaders.airbyte.AirbyteStripeLoader(...)
Load from Stripe using an Airbyte source connector.
document_loaders.airbyte.AirbyteTypeformLoader(...)
Load from Typeform using an Airbyte source connector.
document_loaders.airbyte.AirbyteZendeskSupportLoader(...)
Load from Zendesk Support using an Airbyte source connector.
document_loaders.airbyte_json.AirbyteJSONLoader(...)
Load local Airbyte json files.
document_loaders.airtable.AirtableLoader(...)
Load the Airtable tables.
document_loaders.apify_dataset.ApifyDatasetLoader
Load datasets from Apify web scraping, crawling, and data extraction platform.
document_loaders.arcgis_loader.ArcGISLoader(layer)
Load records from an ArcGIS FeatureLayer.
document_loaders.arxiv.ArxivLoader(query[, ...])
Load a query result from Arxiv.
document_loaders.assemblyai.AssemblyAIAudioLoaderById(...)
Load AssemblyAI audio transcripts.
document_loaders.assemblyai.AssemblyAIAudioTranscriptLoader(...)
Load AssemblyAI audio transcripts.
document_loaders.assemblyai.TranscriptFormat(value)
Transcript format to use for the document loader.
document_loaders.astradb.AstraDBLoader(...)
[Deprecated]
document_loaders.astradb.AstraDBLoader(...)
[Deprecated]
document_loaders.async_html.AsyncHtmlLoader(...)
Load HTML asynchronously.
document_loaders.athena.AthenaLoader(query, ...)
Load documents from AWS Athena.
document_loaders.azlyrics.AZLyricsLoader([...])
Load AZLyrics webpages.
document_loaders.azure_ai_data.AzureAIDataLoader(url)
Load from Azure AI Data.
document_loaders.azure_blob_storage_container.AzureBlobStorageContainerLoader(...)
Load from Azure Blob Storage container.
document_loaders.azure_blob_storage_file.AzureBlobStorageFileLoader(...)
Load from Azure Blob Storage files.
document_loaders.baiducloud_bos_directory.BaiduBOSDirectoryLoader(...)
Load from Baidu BOS directory.
document_loaders.baiducloud_bos_file.BaiduBOSFileLoader(...)
Load from Baidu Cloud BOS file.
document_loaders.base_o365.O365BaseLoader
Base class for all loaders that uses O365 Package
document_loaders.bibtex.BibtexLoader(...[, ...])
Load a bibtex file.
document_loaders.bigquery.BigQueryLoader(query)
[Deprecated] Load from the Google Cloud Platform BigQuery.
document_loaders.bilibili.BiliBiliLoader(...)
Load fetching transcripts from BiliBili videos.
document_loaders.blackboard.BlackboardLoader(...)
Load a Blackboard course.
document_loaders.blob_loaders.cloud_blob_loader.CloudBlobLoader(url, *)
Load blobs from cloud URL or file:.
document_loaders.blob_loaders.file_system.FileSystemBlobLoader(path, *)
Load blobs in the local file system.
document_loaders.blob_loaders.youtube_audio.YoutubeAudioLoader(...)
Load YouTube urls as audio file(s).
document_loaders.blockchain.BlockchainDocumentLoader(...)
Load elements from a blockchain smart contract.
document_loaders.blockchain.BlockchainDocumentLoader(...)
Load elements from a blockchain smart contract.
document_loaders.blockchain.BlockchainType(value)
Enumerator of the supported blockchains.
document_loaders.brave_search.BraveSearchLoader(...)
Load with Brave Search engine.
document_loaders.browserbase.BrowserbaseLoader(urls)
Load pre-rendered web pages using a headless browser hosted on Browserbase.
document_loaders.browserless.BrowserlessLoader(...)
Load webpages with Browserless /content endpoint.
document_loaders.cassandra.CassandraLoader(...)
Document Loader for Apache Cassandra.
document_loaders.chatgpt.ChatGPTLoader(log_file)
Load conversations from exported ChatGPT data.
document_loaders.chm.CHMParser(path)
Microsoft Compiled HTML Help (CHM) Parser.
document_loaders.chm.UnstructuredCHMLoader(...)
Load CHM files using Unstructured.
document_loaders.chromium.AsyncChromiumLoader(urls, *)
Scrape HTML pages from URLs using a headless instance of the Chromium.
document_loaders.college_confidential.CollegeConfidentialLoader([...])
Load College Confidential webpages.
document_loaders.concurrent.ConcurrentLoader(...)
Load and pars Documents concurrently.
document_loaders.confluence.ConfluenceLoader(url)
Load Confluence pages.
document_loaders.confluence.ContentFormat(value)
Enumerator of the content formats of Confluence page.
document_loaders.conllu.CoNLLULoader(file_path)
Load CoNLL-U files.
document_loaders.couchbase.CouchbaseLoader(...)
Load documents from Couchbase.
document_loaders.csv_loader.CSVLoader(file_path)
Load a CSV file into a list of Documents.
document_loaders.csv_loader.UnstructuredCSVLoader(...)
Load CSV files using Unstructured.
document_loaders.cube_semantic.CubeSemanticLoader(...)
document_loaders.cube_semantic.CubeSemanticLoader(...)
Load Cube semantic layer metadata.
document_loaders.datadog_logs.DatadogLogsLoader(...)
Load Datadog logs.
document_loaders.dataframe.BaseDataFrameLoader(...)
Initialize with dataframe object.
document_loaders.dataframe.DataFrameLoader(...)
Load Pandas DataFrame.
document_loaders.diffbot.DiffbotLoader(...)
Load Diffbot json file.
document_loaders.directory.DirectoryLoader(...)
Load from a directory.
document_loaders.discord.DiscordChatLoader(...)
Load Discord chat logs.
document_loaders.doc_intelligence.AzureAIDocumentIntelligenceLoader(...)
Load a PDF with Azure Document Intelligence.
document_loaders.docugami.DocugamiLoader
[Deprecated] Load from Docugami.
document_loaders.docusaurus.DocusaurusLoader(url)
Load from Docusaurus Documentation.
document_loaders.dropbox.DropboxLoader
Load files from Dropbox.
document_loaders.duckdb_loader.DuckDBLoader(query)
Load from DuckDB.
document_loaders.email.OutlookMessageLoader(...)
Loads Outlook Message files using extract_msg.
document_loaders.email.UnstructuredEmailLoader(...)
Load email files using Unstructured.
document_loaders.epub.UnstructuredEPubLoader(...)
Load EPub files using Unstructured.
document_loaders.etherscan.EtherscanLoader(...)
Load transactions from Ethereum mainnet.
document_loaders.evernote.EverNoteLoader(...)
Load from EverNote.
document_loaders.excel.UnstructuredExcelLoader(...)
Load Microsoft Excel files using Unstructured.
document_loaders.facebook_chat.FacebookChatLoader(path)
Load Facebook Chat messages directory dump.
document_loaders.fauna.FaunaLoader(query, ...)
Load from FaunaDB.
document_loaders.figma.FigmaFileLoader(...)
Load Figma file.