id
stringlengths
14
16
text
stringlengths
36
2.73k
source
stringlengths
49
117
8f62ee4b5d44-48
Returns List of ids from adding the texts into the vectorstore. classmethod from_existing_index(index_name: str, embedding: langchain.embeddings.base.Embeddings, text_key: str = 'text', namespace: Optional[str] = None) β†’ langchain.vectorstores.pinecone.Pinecone[source]# Load pinecone vectorstore from index name. classm...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-49
k – Number of Documents to return. Defaults to 4. filter – Dictionary of argument(s) to filter on metadata namespace – Namespace to search in. Default will search in β€˜β€™ namespace. Returns List of Documents most similar to the query and score for each similarity_search_with_score(query: str, k: int = 4, filter: Optional...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-50
Run more texts through the embeddings and add to the vectorstore. Parameters texts – Iterable of strings to add to the vectorstore. metadatas – Optional list of metadatas associated with the texts. Returns List of ids from adding the texts into the vectorstore. classmethod from_texts(texts: List[str], embedding: langch...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-51
port – Port of the REST API interface. Default: 6333 grpc_port – Port of the gRPC interface. Default: 6334 prefer_grpc – If true - use gPRC interface whenever possible in custom methods. Default: False https – If true - use HTTPS(SSL) protocol. Default: None api_key – API key for authentication in Qdrant Cloud. Default...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-52
This is intended to be a quick way to get started. Example from langchain import Qdrant from langchain.embeddings import OpenAIEmbeddings embeddings = OpenAIEmbeddings() qdrant = Qdrant.from_texts(texts, embeddings, "localhost") max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-53
Returns List of Documents most similar to the query. similarity_search_with_score(query: str, k: int = 4, filter: Optional[Dict[str, Union[str, int, bool, dict, list]]] = None) β†’ List[Tuple[langchain.schema.Document, float]][source]# Return docs most similar to query. Parameters query – Text to look up documents simila...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-54
Parameters texts (Iterable[str]) – Iterable of strings/text to add to the vectorstore. metadatas (Optional[List[dict]], optional) – Optional list of metadatas. Defaults to None. embeddings (Optional[List[List[float]]], optional) – Optional pre-generated embeddings. Defaults to None. keys (Optional[List[str]], optional)...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-55
Create a Redis vectorstore from raw documents. This is a user-friendly interface that: Embeds documents. Creates a new index for the embeddings in Redis. Adds the documents to the newly created Redis index. This is intended to be a quick way to get started. .. rubric:: Example classmethod from_texts_return_keys(texts: ...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-56
Returns the most similar indexed documents to the query text within the score_threshold range. Parameters query (str) – The query text for which to find similar documents. k (int) – The number of documents to return. Default is 4. score_threshold (float) – The minimum matching score required for a document 0.2. (to be ...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-57
Note that the Supabase Python client does not yet support async operations. If you’d like to use max_marginal_relevance_search, please review the instructions below on modifying the match_documents function to return matched embeddings. add_texts(texts: Iterable[str], metadatas: Optional[List[dict[Any, Any]]] = None, *...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-58
fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_mar...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-59
to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. query_name: str# similarity_search(query: str, k: int = 4, **kwargs: Any) β†’ List[langchain.schema.Document][source]# Return docs most similar to query. similarity_search_by_vector(embeddin...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-60
Returns List of Tuples of (doc, similarity_score) table_name: str# class langchain.vectorstores.Tair(embedding_function: langchain.embeddings.base.Embeddings, url: str, index_name: str, content_key: str = 'content', metadata_key: str = 'metadata', search_params: Optional[dict] = None, **kwargs: Any)[source]# add_texts(...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-61
Connect to an existing Tair index. classmethod from_texts(texts: List[str], embedding: langchain.embeddings.base.Embeddings, metadatas: Optional[List[dict]] = None, index_name: str = 'langchain', content_key: str = 'content', metadata_key: str = 'metadata', **kwargs: Any) β†’ langchain.vectorstores.tair.Tair[source]# Ret...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-62
"connection_timeout_seconds": 2 } ) typesense_collection_name = "langchain-memory" embedding = OpenAIEmbeddings() vectorstore = Typesense( typesense_client, typesense_collection_name, embedding.embed_query, "text", ) add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Option...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-63
protocol="http", typesense_collection_name="langchain-memory", ) classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, typesense_client: Optional[Client] = None, typesense_client_params: Optional[dict] = None, typesense_collection_na...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-64
Implementation of Vector Store using Vectara (https://vectara.com). .. rubric:: Example from langchain.vectorstores import Vectara vectorstore = Vectara( vectara_customer_id=vectara_customer_id, vectara_corpus_id=vectara_corpus_id, vectara_api_key=vectara_api_key ) add_texts(texts: Iterable[str], metadatas:...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-65
Return Vectara documents most similar to query, along with scores. Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults to 5. filter – Dictionary of argument(s) to filter on metadata. For example a filter can be β€œdoc.rating > 3.0 and part.lang = β€˜deu’”} see https://docs.v...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-66
Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) β†’ List[str][source]# Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[langchain.schema.Document], **kwargs: Any) β†’ Li...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-67
Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) β†’ List[langchain.schema.Document][source]# Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-68
Return VectorStore initialized from documents and embeddings. abstract classmethod from_texts(texts: List[str], embedding: langchain.embeddings.base.Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) β†’ langchain.vectorstores.base.VST[source]# Return VectorStore initialized from texts and embeddings. max...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-69
lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. search(query: str, search_type: str, **kwargs: Any) β†’ List[langchain.sch...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-70
Returns List of Tuples of (doc, similarity_score) class langchain.vectorstores.Weaviate(client: typing.Any, index_name: str, text_key: str, embedding: typing.Optional[langchain.embeddings.base.Embeddings] = None, attributes: typing.Optional[typing.List[str]] = None, relevance_score_fn: typing.Optional[typing.Callable[[...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-71
weaviate = Weaviate.from_texts( texts, embeddings, weaviate_url="http://localhost:8080" ) max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) β†’ List[langchain.schema.Document][source]# Return docs selected using the maximal marginal relevance. Ma...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-72
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. similarity_search(query: str, k: int = 4, **kwargs: Any) β†’ List[langchain.schema.Document][source]# Return docs most similar to query. Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults t...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
8f62ee4b5d44-73
classmethod from_texts(texts: List[str], embedding: langchain.embeddings.base.Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'LangChainCollection', connection_args: dict[str, Any] = {}, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = N...
https://python.langchain.com/en/latest/reference/modules/vectorstores.html
21ef99f17701-0
.rst .pdf Text Splitter Text Splitter# Functionality for splitting text. class langchain.text_splitter.CharacterTextSplitter(separator: str = '\n\n', **kwargs: Any)[source]# Implementation of splitting text that looks at characters. split_text(text: str) β†’ List[str][source]# Split incoming text and return chunks. class...
https://python.langchain.com/en/latest/reference/modules/text_splitter.html
21ef99f17701-1
Split incoming text and return chunks. class langchain.text_splitter.TextSplitter(chunk_size: int = 4000, chunk_overlap: int = 200, length_function: typing.Callable[[str], int] = <built-in function len>)[source]# Interface for splitting text into chunks. async atransform_documents(documents: Sequence[langchain.schema.D...
https://python.langchain.com/en/latest/reference/modules/text_splitter.html
21ef99f17701-2
Transform sequence of documents by splitting them. class langchain.text_splitter.TokenTextSplitter(encoding_name: str = 'gpt2', model_name: Optional[str] = None, allowed_special: Union[Literal['all'], AbstractSet[str]] = {}, disallowed_special: Union[Literal['all'], Collection[str]] = 'all', **kwargs: Any)[source]# Imp...
https://python.langchain.com/en/latest/reference/modules/text_splitter.html
114975c2dd78-0
.rst .pdf Python REPL Python REPL# For backwards compatibility. pydantic model langchain.python.PythonREPL[source]# Simulates a standalone Python REPL. field globals: Optional[Dict] [Optional] (alias '_globals')# field locals: Optional[Dict] [Optional] (alias '_locals')# run(command: str) β†’ str[source]# Run command wit...
https://python.langchain.com/en/latest/reference/modules/python.html
4e352f5663fd-0
.rst .pdf SearxNG Search Contents Quick Start Searching Engine Parameters Search Tips SearxNG Search# Utility for using SearxNG meta search API. SearxNG is a privacy-friendly free metasearch engine that aggregates results from multiple search engines and databases and supports the OpenSearch specification. More detai...
https://python.langchain.com/en/latest/reference/modules/searx_search.html
4e352f5663fd-1
# assuming the searx host is set as above or exported as an env variable s = SearxSearchWrapper(engines=['google', 'bing'], language='es') Search Tips# Searx offers a special search syntax that can also be used instead of passing engine parameters. For example the following query: s = SearxSearchWra...
https://python.langchain.com/en/latest/reference/modules/searx_search.html
4e352f5663fd-2
use a self hosted instance and disable the rate limiter. If you are self-hosting an instance you can customize the rate limiter for your own network as described here. For a list of public SearxNG instances see https://searx.space/ class langchain.utilities.searx_search.SearxResults(data: str)[source]# Dict like wrappe...
https://python.langchain.com/en/latest/reference/modules/searx_search.html
4e352f5663fd-3
field params: dict [Optional]# field query_suffix: Optional[str] = ''# field searx_host: str = ''# field unsecure: bool = False# async aresults(query: str, num_results: int, engines: Optional[List[str]] = None, query_suffix: Optional[str] = '', **kwargs: Any) β†’ List[Dict][source]# Asynchronously query with json results...
https://python.langchain.com/en/latest/reference/modules/searx_search.html
4e352f5663fd-4
Run query through Searx API and parse results. You can pass any other params to the searx query API. Parameters query – The query to search for. query_suffix – Extra suffix appended to the query. engines – List of engines to use for the query. categories – List of categories to use for the query. **kwargs – extra param...
https://python.langchain.com/en/latest/reference/modules/searx_search.html
66474bea995d-0
.rst .pdf SerpAPI SerpAPI# For backwards compatiblity. pydantic model langchain.serpapi.SerpAPIWrapper[source]# Wrapper around SerpAPI. To use, you should have the google-search-results python package installed, and the environment variable SERPAPI_API_KEY set with your API key, or pass serpapi_api_key as a named param...
https://python.langchain.com/en/latest/reference/modules/serpapi.html
b563c20af20f-0
.rst .pdf Experimental Modules Contents Autonomous Agents Generative Agents Experimental Modules# 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 ...
https://python.langchain.com/en/latest/reference/modules/experimental.html
b563c20af20f-1
Get the next task. property input_keys: List[str]# Input keys this chain expects. property output_keys: List[str]# Output keys this chain expects. prioritize_tasks(this_task_id: int, objective: str) β†’ List[Dict][source]# Prioritize tasks. class langchain.experimental.AutoGPT(ai_name: str, memory: langchain.vectorstores...
https://python.langchain.com/en/latest/reference/modules/experimental.html
b563c20af20f-2
Summary of the events in the plan that the agent took. generate_dialogue_response(observation: str, now: Optional[datetime.datetime] = None) β†’ Tuple[bool, str][source]# React to a given observation. generate_reaction(observation: str, now: Optional[datetime.datetime] = None) β†’ Tuple[bool, str][source]# React to a given...
https://python.langchain.com/en/latest/reference/modules/experimental.html
b563c20af20f-3
field traits: str = 'N/A'# Permanent traits to ascribe to the character. class langchain.experimental.GenerativeAgentMemory(*, llm: langchain.base_language.BaseLanguageModel, memory_retriever: langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever, verbose: bool = False, reflection_threshold: Opt...
https://python.langchain.com/en/latest/reference/modules/experimental.html
b563c20af20f-4
The core language model. load_memory_variables(inputs: Dict[str, Any]) β†’ Dict[str, str][source]# Return key-value pairs given the text input to the chain. field memory_retriever: langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever [Required]# The retriever to fetch related memories. property m...
https://python.langchain.com/en/latest/reference/modules/experimental.html
be1c7667ced2-0
.rst .pdf Agent Toolkits Agent Toolkits# Agent toolkits. pydantic model langchain.agents.agent_toolkits.AzureCognitiveServicesToolkit[source]# Toolkit for Azure Cognitive Services. get_tools() β†’ List[langchain.tools.base.BaseTool][source]# Get the tools in the toolkit. pydantic model langchain.agents.agent_toolkits.Fil...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-1
get_tools() β†’ List[langchain.tools.base.BaseTool][source]# Get the tools in the toolkit. pydantic model langchain.agents.agent_toolkits.NLAToolkit[source]# Natural Language API Toolkit Definition. field nla_tools: Sequence[langchain.agents.agent_toolkits.nla.tool.NLATool] [Required]# List of API Endpoint Tools. classme...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-2
Instantiate the toolkit from an OpenAPI Spec URL get_tools() β†’ List[langchain.tools.base.BaseTool][source]# Get the tools for all the API operations. pydantic model langchain.agents.agent_toolkits.OpenAPIToolkit[source]# Toolkit for interacting with a OpenAPI api. field json_agent: langchain.agents.agent.AgentExecutor ...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-3
field max_iterations: int = 5# field powerbi: langchain.utilities.powerbi.PowerBIDataset [Required]# get_tools() β†’ List[langchain.tools.base.BaseTool][source]# Get the tools in the toolkit. pydantic model langchain.agents.agent_toolkits.SQLDatabaseToolkit[source]# Toolkit for interacting with SQL databases. field db: l...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-4
Get the tools in the toolkit. pydantic model langchain.agents.agent_toolkits.VectorStoreToolkit[source]# Toolkit for interacting with a vector store. field llm: langchain.base_language.BaseLanguageModel [Optional]# field vectorstore_info: langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo [Required]# g...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-5
langchain.agents.agent_toolkits.create_json_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.json.toolkit.JsonToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with JSON.\nYour goal...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-6
you cannot use it.\nYou should only add one key at a time to the path. You cannot add multiple keys at once.\nIf you encounter a "KeyError", go back to the previous key, look at the available keys, and try again.\n\nIf the question does not seem to be related to the JSON, just return "I don\'t know" as the answer.\nAlw...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-7
str = 'Begin!"\n\nQuestion: {input}\nThought: I should look at the keys that exist in data to see what I have access to\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to ta...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-8
Construct a json agent from an LLM and tools.
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-9
langchain.agents.agent_toolkits.create_openapi_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by m...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-10
checking which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed.\n\nUse the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters.\nIf you get a not found error, ensure that you are using a p...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-11
None, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, return_intermediate_steps: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β†’ langchain.agents.agent.AgentExecutor[source]#
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-12
Construct a json agent from an LLM and tools. langchain.agents.agent_toolkits.create_pandas_dataframe_agent(llm: langchain.base_language.BaseLanguageModel, df: Any, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: Optional[str] = None, suffix: Optional[str] = None, input_variable...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-13
langchain.agents.agent_toolkits.create_pbi_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManage...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-14
easily readible format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I can first ask ...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-15
None, input_variables: Optional[List[str]] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β†’ langchain.agents.agent.AgentExecutor[source]#
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-16
Construct a pbi agent from an LLM and tools.
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-17
langchain.agents.agent_toolkits.create_pbi_chat_agent(llm: langchain.chat_models.base.BaseChatModel, toolkit: Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit], powerbi: Optional[langchain.utilities.powerbi.PowerBIDataset] = None, callback_manager: Optional[langchain.callbacks.base.BaseCallbackMa...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-18
multiple rows are asked find a way to write that in a easily readible format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = "...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-19
Construct a pbi agent from an Chat LLM and tools. If you supply only a toolkit and no powerbi dataset, the same LLM is used for both. langchain.agents.agent_toolkits.create_python_agent(llm: langchain.base_language.BaseLanguageModel, tool: langchain.tools.python.tool.PythonREPLTool, callback_manager: Optional[langchain...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-20
Construct a python agent from an LLM and tool. langchain.agents.agent_toolkits.create_spark_dataframe_agent(llm: langchain.llms.base.BaseLLM, df: Any, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = '\nYou are working with a spark dataframe in Python. The name of the dataf...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-21
langchain.agents.agent_toolkits.create_spark_sql_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with Sp...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-22
a query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in th...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-23
early_stopping_method: str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β†’ langchain.agents.agent.AgentExecutor[source]#
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-24
Construct a sql agent from an LLM and tools.
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-25
langchain.agents.agent_toolkits.create_sql_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with a SQL datab...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-26
query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the ...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-27
early_stopping_method: str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) β†’ langchain.agents.agent.AgentExecutor[source]#
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-28
Construct a sql agent from an LLM and tools. langchain.agents.agent_toolkits.create_vectorstore_agent(llm: langchain.base_language.BaseLanguageModel, toolkit: langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit, callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None, prefix: ...
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
be1c7667ced2-29
Construct a vectorstore router agent from an LLM and tools. previous Tools next Utilities By Harrison Chase Β© Copyright 2023, Harrison Chase. Last updated on May 28, 2023.
https://python.langchain.com/en/latest/reference/modules/agent_toolkits.html
b7aa0ce8e292-0
.rst .pdf Document Transformers Document Transformers# Transform documents pydantic model langchain.document_transformers.EmbeddingsRedundantFilter[source]# Filter that drops redundant documents by comparing their embeddings. field embeddings: langchain.embeddings.base.Embeddings [Required]# Embeddings to use for embed...
https://python.langchain.com/en/latest/reference/modules/document_transformers.html
0922f2054fee-0
.rst .pdf Tools Tools# Core toolkit implementations. pydantic model langchain.tools.AIPluginTool[source]# field api_spec: str [Required]# field args_schema: Type[AIPluginToolSchema] = <class 'langchain.tools.plugin.AIPluginToolSchema'># Pydantic model class to validate and parse the tool’s input arguments. field plugin...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-1
to_typescript() β†’ str[source]# Get typescript string representation of the operation. static ts_type_from_python(type_: Union[str, Type, tuple, None, enum.Enum]) β†’ str[source]# property body_params: List[str]# property path_params: List[str]# property query_params: List[str]# pydantic model langchain.tools.AzureCogsFor...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-2
pydantic model langchain.tools.BaseTool[source]# Interface LangChain tools must implement. field args_schema: Optional[Type[pydantic.main.BaseModel]] = None# Pydantic model class to validate and parse the tool’s input arguments. field callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = None# Depr...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-3
Run the tool. property args: dict# property is_single_input: bool# Whether the tool only accepts a single input. pydantic model langchain.tools.BingSearchResults[source]# Tool that has capability to query the Bing Search API and get back json. field api_wrapper: langchain.utilities.bing_search.BingSearchAPIWrapper [Req...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-4
Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Create a copy of a file in a specified location'# Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. field name: str = 'copy_file'# The unique name of the to...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-5
field num_results: int = 4# pydantic model langchain.tools.DuckDuckGoSearchRun[source]# Tool that adds the capability to query the DuckDuckGo search API. field api_wrapper: langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper [Optional]# pydantic model langchain.tools.ExtractHyperlinksTool[source]# Extract ...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-6
Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Recursively search for files in a subdirectory that match the regex pattern'# Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. field name: str = 'file_sear...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-7
pydantic model langchain.tools.GmailGetMessage[source]# field args_schema: Type[langchain.tools.gmail.get_message.SearchArgsSchema] = <class 'langchain.tools.gmail.get_message.SearchArgsSchema'># Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Use this tool to fetch an e...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-8
Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Use this tool to search for email messages or threads. The input must be a valid Gmail query. The output is a JSON list of the requested resource.'# Used to tell the model how/when/why to use the tool. You can provide few-s...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-9
Tool that has capability to query the Serper.dev Google Search API and get back json. field api_wrapper: langchain.utilities.google_serper.GoogleSerperAPIWrapper [Optional]# pydantic model langchain.tools.GoogleSerperRun[source]# Tool that adds the capability to query the Serper.dev Google search API. field api_wrapper...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-10
Tool for getting tables names. field powerbi: langchain.utilities.powerbi.PowerBIDataset [Required]# pydantic model langchain.tools.MetaphorSearchResults[source]# Tool that has capability to query the Metaphor Search API and get back json. field api_wrapper: langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper ...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-11
Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Navigate a browser to the specified URL'# Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. field name: str = 'navigate_browser'# The unique name of the too...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-12
Get the operation object for a given path and HTTP method. get_parameters_for_operation(operation: openapi_schema_pydantic.v3.v3_1_0.operation.Operation) β†’ List[openapi_schema_pydantic.v3.v3_1_0.parameter.Parameter][source]# Get the components for a given operation. get_referenced_schema(ref: openapi_schema_pydantic.v3...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-13
Validators raise_deprecation Β» all fields validate_llm_chain_input_variables Β» llm_chain field examples: Optional[str] = '\nQuestion: How many rows are in the table <table>?\nDAX: EVALUATE ROW("Number of rows", COUNTROWS(<table>))\n----\nQuestion: How many rows are in the table <table> where <column> is not empty?\nDAX...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-14
field template: Optional[str] = '\nAnswer the question below with a DAX query that can be sent to Power BI. DAX queries have a simple syntax comprised of just one required keyword, EVALUATE, and several optional keywords: ORDER BY, START AT, DEFINE, MEASURE, VAR, TABLE, and COLUMN. Each keyword defines a statement used...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-15
columns, expressions, and values. However, some functions, such as PI, do not require any arguments, but always require parentheses to indicate the null argument. For example, you must always type PI(), not PI. You can also nest functions within other functions. \n\nSome commonly used functions are:\nEVALUATE <table> -...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-16
VAR; EVALUATE <table> - The optional DEFINE keyword introduces one or more calculated entity definitions that exist only for the duration of the query. Definitions precede the EVALUATE statement and are valid for all EVALUATE statements in the query. Definitions can be variables, measures, tables1, and columns1. Defini...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-17
<filter> is a Boolean expression that is to be evaluated for each row of the table. For example, [Amount] > 0 or [Region] = "France"\nROW(<name>, <expression>) - Returns a table with a single row containing values that result from the expressions given to each column.\nDISTINCT(<column>) - Returns a one-column table th...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-18
Functions names with an X in it can include a expression as an argument, this will be evaluated for each row in the table and the result will be used in the regular function calculation, these are the functions:\nCOUNT(<column>), COUNTA(<column>), COUNTX(<table>,<expression>), COUNTAX(<table>,<expression>), COUNTROWS([...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-19
Returns a date value that represents the specified year, month, and day.\nDATEDIFF(date1, date2, <interval>) - Returns the difference between two date values, in the specified interval, that can be SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR.\nDATEVALUE(<date_text>) - Returns a date value that represents the ...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-20
case you need to rewrite the DAX query to get the correct answer.\n\nThe following tables exist: {tables}\n\nand the schema\'s for some are given here:\n{schemas}\n\nExamples:\n{examples}\n\nQuestion: {tool_input}\nDAX: \n'#
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-21
pydantic model langchain.tools.ReadFileTool[source]# field args_schema: Type[pydantic.main.BaseModel] = <class 'langchain.tools.file_management.read.ReadFileInput'># Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Read file from disk'# Used to tell the model how/when/why...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-22
The input arguments’ schema. The tool schema. field coroutine: Optional[Callable[[...], Awaitable[Any]]] = None# The asynchronous version of the function. field description: str = ''# Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. field func: Callabl...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-23
The function to run when the tool is called. field name: str [Required]# The unique name of the tool that clearly communicates its purpose. field return_direct: bool = False# Whether to return the tool’s output directly. Setting this to True means that after the tool is called, the AgentExecutor will stop looping. fiel...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-24
Pydantic model class to validate and parse the tool’s input arguments. field description: str = 'Write file to disk'# Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. field name: str = 'write_file'# The unique name of the tool that clearly communicates...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-25
Parameters action_id – a specific action ID (from list actions) of the action to execute (the set api_key must be associated with the action owner) instructions – a natural language instruction string for using the action (eg. β€œget the latest email from Mike Knoop” for β€œGmail: find email” action) params – a dict, optio...
https://python.langchain.com/en/latest/reference/modules/tools.html
0922f2054fee-26
field params: Optional[dict] = None# field params_schema: Dict[str, str] [Optional]# field zapier_description: str [Required]# langchain.tools.tool(*args: Union[str, Callable], return_direct: bool = False, args_schema: Optional[Type[pydantic.main.BaseModel]] = None, infer_schema: bool = True) β†’ Callable[source]# Make t...
https://python.langchain.com/en/latest/reference/modules/tools.html
c4e26144932d-0
.rst .pdf Embeddings Embeddings# Wrappers around embedding modules. pydantic model langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding[source]# Wrapper for Aleph Alpha’s Asymmetric Embeddings AA provides you with an endpoint to embed a document and a query. The models were optimized to make the embeddings of doc...
https://python.langchain.com/en/latest/reference/modules/embeddings.html