id
stringlengths
36
36
text
stringlengths
114
429k
url
stringlengths
54
121
d9a37339-4bad-4cf3-9fb5-1dd03debfa69
Models LangChain provides interfaces and integrations for a number of different types of models. LLMs Chat Models
https://api.python.langchain.com/en/latest/models.html
8ff91ce1-7d62-4479-9049-f8f70b82ef58
Model I/O LangChain provides interfaces and integrations for working with language models. Prompts Models Output Parsers
https://api.python.langchain.com/en/latest/model_io.html
2412f67f-00bb-42fb-9975-249ace261d8e
Prompts The reference guides here all relate to objects for working with Prompts. Prompt Templates Example Selector
https://api.python.langchain.com/en/latest/prompts.html
f7f922b9-f340-4163-bd4d-a15304000f03
Data connection LangChain has a number of modules that help you load, structure, store, and retrieve documents. Document Loaders Document Transformers Embeddings Vector Stores Retrievers
https://api.python.langchain.com/en/latest/data_connection.html
583cb37c-049b-4ce1-bba8-5e96effe2285
Embeddings Wrappers around embedding modules. class langchain.embeddings.OpenAIEmbeddings(*, client=None, model='text-embedding-ada-002', deployment='text-embedding-ada-002', openai_api_version=None, openai_api_base=None, openai_api_type=None, openai_proxy=None, embedding_ctx_length=8191, openai_api_key=None, openai_o...
https://api.python.langchain.com/en/latest/modules/embeddings.html
c3d05344-a68a-42c1-a6e5-0cf256519de1
Memory class langchain.memory.CassandraChatMessageHistory(contact_points, session_id, port=9042, username='cassandra', password='cassandra', keyspace_name='chat_history', table_name='message_store')[source] Bases: langchain.schema.BaseChatMessageHistory Chat message history that stores history in Cassandra. Parameter...
https://api.python.langchain.com/en/latest/modules/memory.html
7702ed66-abcf-4761-ad44-02001b146132
Output Parsers class langchain.output_parsers.BooleanOutputParser(*, true_val='YES', false_val='NO')[source] Bases: langchain.schema.BaseOutputParser[bool] Parameters true_val (str) – false_val (str) – Return type None attribute false_val: str = 'NO' attribute true_val: str = 'YES' parse(text)[source] Parse the ...
https://api.python.langchain.com/en/latest/modules/output_parsers.html
392b7fe6-4662-40df-96c9-d94e21dcb8f8
Tools Core toolkit implementations. class langchain.tools.AIPluginTool(*, name, description, args_schema=<class 'langchain.tools.plugin.AIPluginToolSchema'>, return_direct=False, verbose=False, callbacks=None, callback_manager=None, handle_tool_error=False, plugin, api_spec)[source] Bases: langchain.tools.base.BaseTo...
https://api.python.langchain.com/en/latest/modules/tools.html
18521a36-3fee-40f9-86fe-e77cfb18d8be
Callbacks Callback handlers that allow listening to events in LangChain. class langchain.callbacks.AimCallbackHandler(repo=None, experiment_name=None, system_tracking_interval=10, log_system_params=True)[source] Bases: langchain.callbacks.aim_callback.BaseMetadataCallbackHandler, langchain.callbacks.base.BaseCallback...
https://api.python.langchain.com/en/latest/modules/callbacks.html
fb470470-dfc6-4e38-8a18-8c5a864d5999
Document Loaders All different types of document loaders. class langchain.document_loaders.AcreomLoader(path, encoding='UTF-8', collect_metadata=True)[source] Bases: langchain.document_loaders.base.BaseLoader Parameters path (str) – encoding (str) – collect_metadata (bool) – FRONT_MATTER_REGEX = re.compile('^---\\...
https://api.python.langchain.com/en/latest/modules/document_loaders.html
30182965-8330-44d6-a813-300a47ec8ed1
Experimental This module contains experimental modules and reproductions of existing work using LangChain primitives. Autonomous agents Here, we document the BabyAGI and AutoGPT classes from the langchain.experimental module. class langchain.experimental.BabyAGI(*, memory=None, callbacks=None, callback_manager=None, ...
https://api.python.langchain.com/en/latest/modules/experimental.html
93f10def-2cda-45f9-a6d1-df7aedd7480d
Utilities General utilities. class langchain.utilities.ApifyWrapper(*, apify_client=None, apify_client_async=None)[source] Bases: pydantic.main.BaseModel Wrapper around Apify. To use, you should have the apify-client python package installed, and the environment variable APIFY_API_TOKEN set with your API key, or pass...
https://api.python.langchain.com/en/latest/modules/utilities.html
90376b9d-3a12-4a0f-b352-1793ecf6a7af
Vector Stores Wrappers on top of vector stores. class langchain.vectorstores.AlibabaCloudOpenSearch(embedding, config, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Alibaba Cloud OpenSearch Vector Store Parameters embedding (langchain.embeddings.base.Embeddings) – config (langchain.vectorstores.al...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
cd96d496-587c-4066-8f33-4134e0c470ce
LLMs Wrappers on top of large language models APIs. class langchain.llms.AI21(*, cache=None, verbose=None, callbacks=None, callback_manager=None, tags=None, model='j2-jumbo-instruct', temperature=0.7, maxTokens=256, minTokens=0, topP=1.0, presencePenalty=AI21PenaltyData(scale=0, applyToWhitespaces=True, applyToPunctua...
https://api.python.langchain.com/en/latest/modules/llms.html
be397b83-28ad-4be4-b909-eb6e7aca10df
Base classes Common schema objects. langchain.schema.get_buffer_string(messages, human_prefix='Human', ai_prefix='AI')[source] Get buffer string of messages. Parameters messages (List[langchain.schema.BaseMessage]) – human_prefix (str) – ai_prefix (str) – Return type str class langchain.schema.AgentAction(tool, to...
https://api.python.langchain.com/en/latest/modules/base_classes.html
35cde68a-b909-43b6-b918-81c4eb2db5cd
Chains Chains are easily reusable components which can be linked together. class langchain.chains.APIChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, api_request_chain, api_answer_chain, requests_wrapper, api_docs, question_key='question', output_key='output')[source] Bases: langc...
https://api.python.langchain.com/en/latest/modules/chains.html
c08e8bd6-f501-4cbf-bda0-e556a386e559
Agent Toolkits Agent toolkits. langchain.agents.agent_toolkits.create_json_agent(llm, toolkit, callback_manager=None, prefix='You are an agent designed to interact with JSON.\nYour goal is to return a final answer by interacting with the JSON.\nYou have access to the following tools which help you learn more about the...
https://api.python.langchain.com/en/latest/modules/agent_toolkits.html
d234a720-4555-4f2c-8fac-a7f84b4a2f37
Retrievers class langchain.retrievers.AmazonKendraRetriever(index_id, region_name=None, credentials_profile_name=None, top_k=3, attribute_filter=None, client=None)[source] Bases: langchain.schema.BaseRetriever Retriever class to query documents from Amazon Kendra Index. Parameters index_id (str) – Kendra index id reg...
https://api.python.langchain.com/en/latest/modules/retrievers.html
c8bf6033-faa2-4a5c-8dcf-ab5de43b6b09
Chat Models class langchain.chat_models.ChatOpenAI(*, cache=None, verbose=None, callbacks=None, callback_manager=None, tags=None, client=None, model='gpt-3.5-turbo', temperature=0.7, model_kwargs=None, openai_api_key=None, openai_api_base=None, openai_organization=None, openai_proxy=None, request_timeout=None, max_ret...
https://api.python.langchain.com/en/latest/modules/chat_models.html
30ea5497-b36c-4b13-9417-1b31e3763e0e
Prompt Templates Prompt template classes. class langchain.prompts.AIMessagePromptTemplate(*, prompt, additional_kwargs=None)[source] Bases: langchain.prompts.chat.BaseStringMessagePromptTemplate Parameters prompt (langchain.prompts.base.StringPromptTemplate) – additional_kwargs (dict) – Return type None format(**kw...
https://api.python.langchain.com/en/latest/modules/prompts.html
f631b90a-9e53-4c8e-9640-d7fea38e324c
Example Selector Logic for selecting examples to include in prompts. class langchain.prompts.example_selector.LengthBasedExampleSelector(*, examples, example_prompt, get_text_length=<function _get_length_based>, max_length=2048, example_text_lengths=[])[source] Bases: langchain.prompts.example_selector.base.BaseExamp...
https://api.python.langchain.com/en/latest/modules/example_selector.html
cfa50aec-8749-4b8e-af15-9d7641c9caa9
Document Transformers Transform documents langchain.document_transformers.get_stateful_documents(documents)[source] Convert a list of documents to a list of documents with state. Parameters documents (Sequence[langchain.schema.Document]) – The documents to convert. Returns A list of documents with state. Return type ...
https://api.python.langchain.com/en/latest/modules/document_transformers.html
a697e986-4657-4695-97fa-2c921a92a446
Agents Interface for agents. class langchain.agents.Agent(*, llm_chain, output_parser, allowed_tools=None)[source] Bases: langchain.agents.agent.BaseSingleActionAgent Class responsible for calling the language model and deciding the action. This is driven by an LLMChain. The prompt in the LLMChain MUST include a vari...
https://api.python.langchain.com/en/latest/modules/agents.html
00a73b87-368a-4d4b-b6fe-acf310c654c4
Source code for langchain.requests """Lightweight wrapper around requests library, with async support.""" from contextlib import asynccontextmanager from typing import Any, AsyncGenerator, Dict, Optional import aiohttp import requests from pydantic import BaseModel, Extra class Requests(BaseModel): """Wrapper aroun...
https://api.python.langchain.com/en/latest/_modules/langchain/requests.html
64279c2e-c500-4306-9936-fc32d5ed5c43
Source code for langchain.text_splitter """Functionality for splitting text.""" from __future__ import annotations import copy import logging import re from abc import ABC, abstractmethod from dataclasses import dataclass from enum import Enum from typing import ( AbstractSet, Any, Callable, Collection,...
https://api.python.langchain.com/en/latest/_modules/langchain/text_splitter.html
11bb2cef-40ed-4a73-ab1d-b2444d0d686c
Source code for langchain.schema """Common schema objects.""" from __future__ import annotations from abc import ABC, abstractmethod from dataclasses import dataclass from typing import ( Any, Dict, Generic, List, NamedTuple, Optional, Sequence, TypeVar, Union, ) from uuid import UUI...
https://api.python.langchain.com/en/latest/_modules/langchain/schema.html
f90ea9cb-01b6-4419-8455-44ec9c6f15c3
Source code for langchain.document_transformers """Transform documents""" from typing import Any, Callable, List, Sequence import numpy as np from pydantic import BaseModel, Field from langchain.embeddings.base import Embeddings from langchain.math_utils import cosine_similarity from langchain.schema import BaseDocumen...
https://api.python.langchain.com/en/latest/_modules/langchain/document_transformers.html
4899e0e4-1602-471e-8bd2-9c58e78677eb
Source code for langchain.vectorstores.clickhouse """Wrapper around open source ClickHouse VectorSearch capability.""" from __future__ import annotations import json import logging from hashlib import sha1 from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple, Union from pydantic im...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/clickhouse.html
211b670b-f857-449e-9721-b44bc7f2bae3
Source code for langchain.vectorstores.alibabacloud_opensearch import json import logging import numbers from hashlib import sha1 from typing import Any, Dict, Iterable, List, Optional, Tuple from langchain.embeddings.base import Embeddings from langchain.schema import Document from langchain.vectorstores.base import V...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/alibabacloud_opensearch.html
3d3563a0-755a-41b7-8c5d-c7617ff1d62f
Source code for langchain.vectorstores.rocksetdb """Wrapper around Rockset vector database.""" from __future__ import annotations import logging from enum import Enum from typing import Any, Iterable, List, Optional, Tuple from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/rocksetdb.html
46fd788a-4565-4e92-80dc-b71052deb56f
Source code for langchain.vectorstores.base """Interface for vector stores.""" from __future__ import annotations import asyncio import warnings from abc import ABC, abstractmethod from functools import partial from typing import ( Any, ClassVar, Collection, Dict, Iterable, List, Optional, ...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/base.html
e854f09b-19f2-4b3b-9c98-43e5a46926b0
Source code for langchain.vectorstores.awadb """Wrapper around AwaDB for embedding vectors""" from __future__ import annotations import logging import uuid from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Type from langchain.docstore.document import Document from langchain.embeddings.base import ...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/awadb.html
c3b8d61c-2db6-4497-9c84-32f596ffd713
Source code for langchain.vectorstores.milvus """Wrapper around the Milvus vector database.""" from __future__ import annotations import logging from typing import Any, Iterable, List, Optional, Tuple, Union from uuid import uuid4 import numpy as np from langchain.docstore.document import Document from langchain.embedd...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/milvus.html
8fb7cb62-979e-4302-9a82-5bbcf885a61a
Source code for langchain.vectorstores.elastic_vector_search """Wrapper around Elasticsearch vector database.""" from __future__ import annotations import uuid from abc import ABC from typing import ( TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, ) from l...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/elastic_vector_search.html
bc831b53-5810-4ade-a742-d8dc2cc1dba9
Source code for langchain.vectorstores.mongodb_atlas from __future__ import annotations import logging from typing import ( TYPE_CHECKING, Any, Dict, Generator, Iterable, List, Optional, Tuple, TypeVar, Union, ) from langchain.docstore.document import Document from langchain.embe...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/mongodb_atlas.html
0239964e-13d8-4344-9872-2623ed923446
Source code for langchain.vectorstores.clarifai from __future__ import annotations import logging import os import traceback from typing import Any, Iterable, List, Optional, Tuple import requests from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings from langchain.vectorstor...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/clarifai.html
076f8df6-bb46-4200-b23f-a215208be56b
Source code for langchain.vectorstores.chroma """Wrapper around ChromaDB embeddings platform.""" from __future__ import annotations import logging import uuid from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Type import numpy as np from langchain.docstore.document import Document from langc...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/chroma.html
501f6fba-6bcb-410a-bd6f-dabf4ba0ef6a
Source code for langchain.vectorstores.qdrant """Wrapper around Qdrant vector database.""" from __future__ import annotations import uuid import warnings from itertools import islice from operator import itemgetter from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Opti...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/qdrant.html
406b321a-f513-49f7-90b6-c76f3a498f72
Source code for langchain.vectorstores.azuresearch """Wrapper around Azure Cognitive Search.""" from __future__ import annotations import base64 import json import logging import uuid from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, ) im...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/azuresearch.html
ccb07509-aa60-40dd-978e-b0177d7a7122
Source code for langchain.vectorstores.cassandra """Wrapper around Cassandra vector-store capabilities, based on cassIO.""" from __future__ import annotations import hashlib import typing from typing import Any, Iterable, List, Optional, Tuple, Type, TypeVar import numpy as np if typing.TYPE_CHECKING: from cassandr...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/cassandra.html
cd6529f4-b3f5-4c28-8a1a-488d935a11f6
Source code for langchain.vectorstores.lancedb """Wrapper around LanceDB vector database""" from __future__ import annotations import uuid from typing import Any, Iterable, List, Optional from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings from langchain.vectorstores.base i...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/lancedb.html
36705cea-01dc-4cc4-94b5-df9781dee535
Source code for langchain.vectorstores.sklearn """ Wrapper around scikit-learn NearestNeighbors implementation. The vector store can be persisted in json, bson or parquet format. """ import json import math import os from abc import ABC, abstractmethod from typing import Any, Dict, Iterable, List, Literal, Optional, Tu...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/sklearn.html
dc38a84a-1164-4ee2-bc0e-75f3d25ef9b9
Source code for langchain.vectorstores.analyticdb """VectorStore wrapper around a Postgres/PGVector database.""" from __future__ import annotations import logging import uuid from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Type from sqlalchemy import REAL, Column, String, Table, create_engine, ...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/analyticdb.html
31effff9-3e6c-44d4-a659-a0c7bad8fff4
Source code for langchain.vectorstores.opensearch_vector_search """Wrapper around OpenSearch vector database.""" from __future__ import annotations import uuid from typing import Any, Dict, Iterable, List, Optional, Tuple import numpy as np from langchain.embeddings.base import Embeddings from langchain.schema import D...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/opensearch_vector_search.html
2add156e-e6f3-4741-96e0-0478fbeeff90
Source code for langchain.vectorstores.faiss """Wrapper around FAISS vector database.""" from __future__ import annotations import math import os import pickle import uuid from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import numpy as np from langchain.docstore.base imp...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/faiss.html
bd885a6c-4316-45c1-8acf-488b52baea1f
Source code for langchain.vectorstores.matching_engine """Vertex Matching Engine implementation of the vector store.""" from __future__ import annotations import json import logging import time import uuid from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Type from langchain.docstore.document import Docu...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/matching_engine.html
1c2b565f-cb8e-479d-83eb-43d09441a166
Source code for langchain.vectorstores.tair """Wrapper around Tair Vector.""" from __future__ import annotations import json import logging import uuid from typing import Any, Iterable, List, Optional, Type from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings from langchain....
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/tair.html
cc933f7b-c839-473a-8576-4d098bc34605
Source code for langchain.vectorstores.atlas """Wrapper around Atlas by Nomic.""" from __future__ import annotations import logging import uuid from typing import Any, Iterable, List, Optional, Type import numpy as np from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings from...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/atlas.html
021d3dad-6235-48c2-a7ad-042f4258d118
Source code for langchain.vectorstores.singlestoredb """Wrapper around SingleStore DB.""" from __future__ import annotations import enum import json from typing import ( Any, ClassVar, Collection, Iterable, List, Optional, Tuple, Type, ) from sqlalchemy.pool import QueuePool from langcha...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/singlestoredb.html
9ed70bfe-e90e-47c2-801b-d021d45adfcc
Source code for langchain.vectorstores.weaviate """Wrapper around weaviate vector database.""" from __future__ import annotations import datetime from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type from uuid import uuid4 import numpy as np from langchain.docstore.document import Document from ...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/weaviate.html
6182d2e5-b824-4e42-82d5-957546a1ead0
Source code for langchain.vectorstores.myscale """Wrapper around MyScale vector database.""" from __future__ import annotations import json import logging from hashlib import sha1 from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple from pydantic import BaseSettings from langchain....
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/myscale.html
e792d280-4f29-4858-a8c7-aaa8d27403f3
Source code for langchain.vectorstores.deeplake """Wrapper around Activeloop Deep Lake.""" from __future__ import annotations import logging from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union import numpy as np try: import deeplake from deeplake.core.fast_forwarding import version_co...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/deeplake.html
ac87b9c4-9202-4c49-a189-f5178d6556db
Source code for langchain.vectorstores.annoy """Wrapper around Annoy vector database.""" from __future__ import annotations import os import pickle import uuid from configparser import ConfigParser from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import numpy as np from l...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/annoy.html
482a9cdc-7488-4b33-b2cd-472c6c9b817b
Source code for langchain.vectorstores.typesense """Wrapper around Typesense vector search""" from __future__ import annotations import uuid from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Union from langchain.docstore.document import Document from langchain.embeddings.base import Embeddings fro...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/typesense.html
f44e9ce0-6cbc-49e2-87b7-86b774a21511
Source code for langchain.vectorstores.pinecone """Wrapper around Pinecone vector database.""" from __future__ import annotations import logging import uuid from typing import Any, Callable, Iterable, List, Optional, Tuple import numpy as np from langchain.docstore.document import Document from langchain.embeddings.bas...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/pinecone.html
e50fe63e-768d-4199-a74a-dfc314f1633e
Source code for langchain.vectorstores.tigris from __future__ import annotations import itertools from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple from langchain.embeddings.base import Embeddings from langchain.schema import Document from langchain.vectorstores import VectorStore if TYPE_CHECKING:...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/tigris.html
442359b8-1b63-4d9a-bfc7-8924d6a16625
Source code for langchain.vectorstores.starrocks """Wrapper around open source StarRocks VectorSearch capability.""" from __future__ import annotations import json import logging from hashlib import sha1 from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple from pydantic import Base...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/starrocks.html
42a885e8-e2c4-471f-ad50-0e72902b6ef1
Source code for langchain.vectorstores.vectara """Wrapper around Vectara vector database.""" from __future__ import annotations import json import logging import os from hashlib import md5 from typing import Any, Iterable, List, Optional, Tuple, Type import requests from pydantic import Field from langchain.embeddings....
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/vectara.html
4bdb6b26-7ece-428a-be62-8e5e7ea525aa
Source code for langchain.vectorstores.hologres """VectorStore wrapper around a Hologres database.""" from __future__ import annotations import json import logging import uuid from typing import Any, Dict, Iterable, List, Optional, Tuple, Type from langchain.docstore.document import Document from langchain.embeddings.b...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/hologres.html
954a436d-7f80-49e2-945b-995b28e13c49
Source code for langchain.vectorstores.redis """Wrapper around Redis vector database.""" from __future__ import annotations import json import logging import uuid from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Literal, Mapping, Optional, Tuple, Type,...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/redis.html
7fbfe242-ade3-4417-9a1d-07739c573194
Source code for langchain.vectorstores.zilliz from __future__ import annotations import logging from typing import Any, List, Optional from langchain.embeddings.base import Embeddings from langchain.vectorstores.milvus import Milvus logger = logging.getLogger(__name__) [docs]class Zilliz(Milvus): def _create_index(...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/zilliz.html
1d702ba7-c4c3-4606-92ee-5e4697ce140d
Source code for langchain.vectorstores.supabase from __future__ import annotations import uuid from itertools import repeat from typing import ( TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Type, Union, ) import numpy as np from langchain.docstore.document import Document from la...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/supabase.html
4751880f-f062-4611-965a-3ca4d41952a3
Source code for langchain.vectorstores.docarray.in_memory """Wrapper around in-memory storage.""" from __future__ import annotations from typing import Any, Dict, List, Literal, Optional from langchain.embeddings.base import Embeddings from langchain.vectorstores.docarray.base import ( DocArrayIndex, _check_doc...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/docarray/in_memory.html
5d4858bb-0ed9-4df8-8f00-e2fc6a6085ac
Source code for langchain.vectorstores.docarray.hnsw """Wrapper around Hnswlib store.""" from __future__ import annotations from typing import Any, List, Literal, Optional from langchain.embeddings.base import Embeddings from langchain.vectorstores.docarray.base import ( DocArrayIndex, _check_docarray_import, )...
https://api.python.langchain.com/en/latest/_modules/langchain/vectorstores/docarray/hnsw.html
662495a0-0c33-4b77-8265-773409a68b15
Source code for langchain.utilities.powerbi """Wrapper around a Power BI endpoint.""" from __future__ import annotations import asyncio import logging import os from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union import aiohttp import requests from aiohttp import ServerTimeoutError from pydanti...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/powerbi.html
c1806ebd-1bb9-4b13-9431-274a5f229635
Source code for langchain.utilities.bing_search """Util that calls Bing Search. In order to set this up, follow instructions at: https://levelup.gitconnected.com/api-tutorial-how-to-use-bing-web-search-api-in-python-4165d5592a7e """ from typing import Dict, List import requests from pydantic import BaseModel, Extra, ro...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/bing_search.html
473737ff-a320-4c4c-911d-5c3006abf4ae
Source code for langchain.utilities.serpapi """Chain that calls SerpAPI. Heavily borrowed from https://github.com/ofirpress/self-ask """ import os import sys from typing import Any, Dict, Optional, Tuple import aiohttp from pydantic import BaseModel, Extra, Field, root_validator from langchain.utils import get_from_dic...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/serpapi.html
3bc9c5af-9b0b-4e0b-96ef-6845cad761b5
Source code for langchain.utilities.awslambda """Util that calls Lambda.""" import json from typing import Any, Dict, Optional from pydantic import BaseModel, Extra, root_validator [docs]class LambdaWrapper(BaseModel): """Wrapper for AWS Lambda SDK. Docs for using: 1. pip install boto3 2. Create a lambd...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/awslambda.html
c99077d1-6383-4987-b1ed-9ea508a704bb
Source code for langchain.utilities.bash """Wrapper around subprocess to run commands.""" from __future__ import annotations import platform import re import subprocess from typing import TYPE_CHECKING, List, Union from uuid import uuid4 if TYPE_CHECKING: import pexpect def _lazy_import_pexpect() -> pexpect: ""...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/bash.html
0ff2eaf8-e2f2-4547-8de6-3ab87920b44f
Source code for langchain.utilities.google_search """Util that calls Google Search.""" from typing import Any, Dict, List, Optional from pydantic import BaseModel, Extra, root_validator from langchain.utils import get_from_dict_or_env [docs]class GoogleSearchAPIWrapper(BaseModel): """Wrapper for Google Search API. ...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/google_search.html
b22c87b1-aa9b-4db4-85d5-dd4a54ed4e04
Source code for langchain.utilities.max_compute from __future__ import annotations from typing import TYPE_CHECKING, Iterator, List, Optional from langchain.utils import get_from_env if TYPE_CHECKING: from odps import ODPS [docs]class MaxComputeAPIWrapper: """Interface for querying Alibaba Cloud MaxCompute tabl...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/max_compute.html
1770fe1a-05eb-4786-800b-46e436fe2b30
Source code for langchain.utilities.arxiv """Util that calls Arxiv.""" import logging import os from typing import Any, Dict, List, Optional from pydantic import BaseModel, Extra, root_validator from langchain.schema import Document logger = logging.getLogger(__name__) [docs]class ArxivAPIWrapper(BaseModel): """Wra...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/arxiv.html
56b5fa74-4ad1-483e-b944-0d3d4021e5f1
Source code for langchain.utilities.python import sys from io import StringIO from typing import Dict, Optional from pydantic import BaseModel, Field [docs]class PythonREPL(BaseModel): """Simulates a standalone Python REPL.""" globals: Optional[Dict] = Field(default_factory=dict, alias="_globals") locals: O...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/python.html
47a04a73-5e12-42bf-bafb-afdfd2fcff8a
Source code for langchain.utilities.openweathermap """Util that calls OpenWeatherMap using PyOWM.""" from typing import Any, Dict, Optional from pydantic import Extra, root_validator from langchain.tools.base import BaseModel from langchain.utils import get_from_dict_or_env [docs]class OpenWeatherMapAPIWrapper(BaseMode...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/openweathermap.html
7c933dd6-6979-4e97-b0dd-d28277e46393
Source code for langchain.utilities.metaphor_search """Util that calls Metaphor Search API. In order to set this up, follow instructions at: """ import json from typing import Dict, List, Optional import aiohttp import requests from pydantic import BaseModel, Extra, root_validator from langchain.utils import get_from_d...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/metaphor_search.html
cfacfae8-e824-429e-9346-631f7197f444
Source code for langchain.utilities.bibtex """Util that calls bibtexparser.""" import logging from typing import Any, Dict, List, Mapping from pydantic import BaseModel, Extra, root_validator logger = logging.getLogger(__name__) OPTIONAL_FIELDS = [ "annotate", "booktitle", "editor", "howpublished", ...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/bibtex.html
34bb4b5b-0bc0-4726-a0f1-3481669e9b4b
Source code for langchain.utilities.searx_search """Utility for using SearxNG meta search API. SearxNG is a privacy-friendly free metasearch engine that aggregates results from `multiple search engines <https://docs.searxng.org/admin/engines/configured_engines.html>`_ and databases and supports the `OpenSearch <https:/...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/searx_search.html
96522c26-15f1-470e-90eb-d5f487cd7ac3
Source code for langchain.utilities.graphql import json from typing import Any, Callable, Dict, Optional from pydantic import BaseModel, Extra, root_validator [docs]class GraphQLAPIWrapper(BaseModel): """Wrapper around GraphQL API. To use, you should have the ``gql`` python package installed. This wrapper w...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/graphql.html
ab07615c-3462-4621-8f1e-74c08e9cfb71
Source code for langchain.utilities.brave_search import json import requests from pydantic import BaseModel, Field [docs]class BraveSearchWrapper(BaseModel): api_key: str search_kwargs: dict = Field(default_factory=dict) [docs] def run(self, query: str) -> str: headers = { "X-Subscription...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/brave_search.html
efe7d237-1512-4a63-8dc9-a9bda9f0ce20
Source code for langchain.utilities.jira """Util that calls Jira.""" from typing import Any, Dict, List, Optional from pydantic import BaseModel, Extra, root_validator from langchain.tools.jira.prompt import ( JIRA_CATCH_ALL_PROMPT, JIRA_CONFLUENCE_PAGE_CREATE_PROMPT, JIRA_GET_ALL_PROJECTS_PROMPT, JIRA_...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/jira.html
be098da0-8768-4654-9db0-dbab83cea814
Source code for langchain.utilities.spark_sql from __future__ import annotations from typing import TYPE_CHECKING, Any, Iterable, List, Optional if TYPE_CHECKING: from pyspark.sql import DataFrame, Row, SparkSession [docs]class SparkSQL: def __init__( self, spark_session: Optional[SparkSession] ...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/spark_sql.html
25cc11fc-9474-4b07-a527-62c8d56208ef
Source code for langchain.utilities.wikipedia """Util that calls Wikipedia.""" import logging from typing import Any, Dict, List, Optional from pydantic import BaseModel, Extra, root_validator from langchain.schema import Document logger = logging.getLogger(__name__) WIKIPEDIA_MAX_QUERY_LENGTH = 300 [docs]class Wikiped...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/wikipedia.html
868942d1-bfcf-4c0e-b344-7759ae0477c1
Source code for langchain.utilities.apify from typing import Any, Callable, Dict, Optional from pydantic import BaseModel, root_validator from langchain.document_loaders import ApifyDatasetLoader from langchain.document_loaders.base import Document from langchain.utils import get_from_dict_or_env [docs]class ApifyWrapp...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/apify.html
60e598e2-aebf-4932-b73a-efbb639097c8
Source code for langchain.utilities.pupmed import json import logging import time import urllib.error import urllib.request from typing import List from pydantic import BaseModel, Extra from langchain.schema import Document logger = logging.getLogger(__name__) [docs]class PubMedAPIWrapper(BaseModel): """ Wrappe...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/pupmed.html
14d09fd8-2156-4876-ba8b-2abd23eb1055
Source code for langchain.utilities.duckduckgo_search """Util that calls DuckDuckGo Search. No setup required. Free. https://pypi.org/project/duckduckgo-search/ """ from typing import Dict, List, Optional from pydantic import BaseModel, Extra from pydantic.class_validators import root_validator [docs]class DuckDuckGoSe...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/duckduckgo_search.html
cdd185f5-ae08-47a8-8319-2af42c889aec
Source code for langchain.utilities.openapi """Utility functions for parsing an OpenAPI spec.""" import copy import json import logging import re from enum import Enum from pathlib import Path from typing import Dict, List, Optional, Union import requests import yaml from openapi_schema_pydantic import ( Components...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/openapi.html
5e833693-9d36-4683-be68-a76808bcb0db
Source code for langchain.utilities.zapier """Util that can interact with Zapier NLA. Full docs here: https://nla.zapier.com/api/v1/docs Note: this wrapper currently only implemented the `api_key` auth method for testing and server-side production use cases (using the developer's connected accounts on Zapier.com) For u...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/zapier.html
944d4eb5-2f27-4243-b44d-408202f320b7
Source code for langchain.utilities.scenexplain """Util that calls SceneXplain. In order to set this up, you need API key for the SceneXplain API. You can obtain a key by following the steps below. - Sign up for a free account at https://scenex.jina.ai/. - Navigate to the API Access page (https://scenex.jina.ai/api) an...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/scenexplain.html
3b45a8d1-1b02-48cd-8e98-46fbbd049552
Source code for langchain.utilities.wolfram_alpha """Util that calls WolframAlpha.""" from typing import Any, Dict, Optional from pydantic import BaseModel, Extra, root_validator from langchain.utils import get_from_dict_or_env [docs]class WolframAlphaAPIWrapper(BaseModel): """Wrapper for Wolfram Alpha. Docs fo...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/wolfram_alpha.html
4ee1ccdc-5c0f-430b-ac81-1951c131fdc6
Source code for langchain.utilities.google_serper """Util that calls Google Search using the Serper.dev API.""" from typing import Any, Dict, List, Optional import aiohttp import requests from pydantic.class_validators import root_validator from pydantic.main import BaseModel from typing_extensions import Literal from ...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/google_serper.html
83c2fcd0-0a7d-4972-9988-3bb136950bd8
Source code for langchain.utilities.twilio """Util that calls Twilio.""" from typing import Any, Dict, Optional from pydantic import BaseModel, Extra, root_validator from langchain.utils import get_from_dict_or_env [docs]class TwilioAPIWrapper(BaseModel): """Messaging Client using Twilio. To use, you should hav...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/twilio.html
20fb05a6-b810-4862-acdd-baa537f8ce08
Source code for langchain.utilities.google_places_api """Chain that calls Google Places API. """ import logging from typing import Any, Dict, Optional from pydantic import BaseModel, Extra, root_validator from langchain.utils import get_from_dict_or_env [docs]class GooglePlacesAPIWrapper(BaseModel): """Wrapper arou...
https://api.python.langchain.com/en/latest/_modules/langchain/utilities/google_places_api.html
b18be03a-7934-4af2-bcb2-d2f8b925b682
Source code for langchain.document_loaders.tomarkdown """Loader that loads HTML to markdown using 2markdown.""" from __future__ import annotations from typing import Iterator, List import requests from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader [docs]class ToMarkd...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/tomarkdown.html
e886b059-b129-4b34-8297-173d4f226281
Source code for langchain.document_loaders.conllu """Load CoNLL-U files.""" import csv from typing import List from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader [docs]class CoNLLULoader(BaseLoader): """Load CoNLL-U files.""" def __init__(self, file_path: str...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/conllu.html
8060e866-43c5-49aa-905e-a95da957f56f
Source code for langchain.document_loaders.toml import json from pathlib import Path from typing import Iterator, List, Union from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader [docs]class TomlLoader(BaseLoader): """ A TOML document loader that inherits from ...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/toml.html
5f0b5252-763f-434d-9581-959f3987edb3
Source code for langchain.document_loaders.url_playwright """Loader that uses Playwright to load a page, then uses unstructured to load the html. """ import logging from typing import List, Optional from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader logger = logging....
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/url_playwright.html
5c8dd0b6-d119-4485-983f-a024b4c80b88
Source code for langchain.document_loaders.gcs_directory """Loading logic for loading documents from an GCS directory.""" from typing import List from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader from langchain.document_loaders.gcs_file import GCSFileLoader [docs]cl...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/gcs_directory.html
2ea52d58-c3a0-458d-a4df-10fa3c3d93e3
Source code for langchain.document_loaders.joplin import json import urllib from datetime import datetime from typing import Iterator, List, Optional from langchain.document_loaders.base import BaseLoader from langchain.schema import Document from langchain.utils import get_from_env LINK_NOTE_TEMPLATE = "joplin://x-cal...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/joplin.html
32761cf4-9206-4424-9a39-a6c61093a588
Source code for langchain.document_loaders.powerpoint """Loader that loads powerpoint files.""" import os from typing import List from langchain.document_loaders.unstructured import UnstructuredFileLoader [docs]class UnstructuredPowerPointLoader(UnstructuredFileLoader): """Loader that uses unstructured to load powe...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/powerpoint.html
7acc3dea-e63b-4edc-a881-25501a391cf8
Source code for langchain.document_loaders.snowflake_loader from __future__ import annotations from typing import Any, Dict, Iterator, List, Optional, Tuple from langchain.docstore.document import Document from langchain.document_loaders.base import BaseLoader [docs]class SnowflakeLoader(BaseLoader): """Loads a que...
https://api.python.langchain.com/en/latest/_modules/langchain/document_loaders/snowflake_loader.html