id stringlengths 14 16 | text stringlengths 31 2.41k | source stringlengths 53 121 |
|---|---|---|
81b746c66a31-90 | },
"table": {
"title": "Table",
"default": "langchain",
"env_names": "{'myscale_table'}",
"type": "string"
},
"metric": {
"title": "Metric",
"default": "cosine",
"env_names": "{'myscale_metric'}",
"type": "string"
}
},
... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-91 | Bases: langchain.vectorstores.base.VectorStore
Wrapper around Pinecone vector database.
To use, you should have the pinecone-client python package installed.
Example
from langchain.vectorstores import Pinecone
from langchain.embeddings.openai import OpenAIEmbeddings
import pinecone
# The environment should be the one s... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-92 | k (int) β Number of Documents to return. Defaults to 4.
filter (Optional[dict]) β Dictionary of argument(s) to filter on metadata
namespace (Optional[str]) β Namespace to search in. Default will search in ββ namespace.
Returns
List of Documents most similar to the query and score for each
Return type
List[Tuple[langcha... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-93 | Defaults to 0.5.
filter (Optional[dict]) β
namespace (Optional[str]) β
kwargs (Any) β
Returns
List of Documents selected by maximal marginal relevance.
Return type
List[langchain.schema.Document]
max_marginal_relevance_search(query, k=4, fetch_k=20, lambda_mult=0.5, filter=None, namespace=None, **kwargs)[source]ο
Re... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-94 | # in your Pinecone console
pinecone.init(api_key="***", environment="...")
embeddings = OpenAIEmbeddings()
pinecone = Pinecone.from_texts(
texts,
embeddings,
index_name="langchain-demo"
)
Parameters
texts (List[str]) β
embedding (langchain.embeddings.base.Embeddings) β
metadatas (Optional[List[dict]]) β
... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-95 | client = QdrantClient()
collection_name = "MyCollection"
qdrant = Qdrant(client, collection_name, embedding_function)
Parameters
client (Any) β
collection_name (str) β
embeddings (Optional[Embeddings]) β
content_payload_key (str) β
metadata_payload_key (str) β
embedding_function (Optional[Callable]) β
CONTENT_KEY... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-96 | May be used to paginate results.
Note: large offset values may cause performance issues.
score_threshold (Optional[float]) β Define a minimal score threshold for the result.
If defined, less similar results will not be returned.
Score of the returned result might be higher or smaller than the
threshold depending on the... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-97 | If defined, less similar results will not be returned.
Score of the returned result might be higher or smaller than the
threshold depending on the Distance function used.
E.g. for cosine similarity only higher scores will be returned.
consistency (Optional[common_types.ReadConsistency]) β Read consistency of the search... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-98 | Score of the returned result might be higher or smaller than the
threshold depending on the Distance function used.
E.g. for cosine similarity only higher scores will be returned.
consistency (Optional[common_types.ReadConsistency]) β Read consistency of the search. Defines how many replicas should be
queried before re... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-99 | E.g. for cosine similarity only higher scores will be returned.
consistency (Optional[common_types.ReadConsistency]) β Read consistency of the search. Defines how many replicas should be
queried before returning the result.
Values:
- int - number of replicas to query, values should present in all
queried replicas
βmajo... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-100 | Return type
List[langchain.schema.Document]
classmethod from_texts(texts, embedding, metadatas=None, ids=None, location=None, url=None, port=6333, grpc_port=6334, prefer_grpc=False, https=None, api_key=None, prefix=None, timeout=None, host=None, path=None, collection_name=None, distance_func='Cosine', content_payload_k... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-101 | Default: False
https (Optional[bool]) β If true - use HTTPS(SSL) protocol. Default: None
api_key (Optional[str]) β API key for authentication in Qdrant Cloud. Default: None
prefix (Optional[str]) β If not None - add prefix to the REST URL path.
Example: service/v1 will result in
http://localhost:6333/service/v1/{qdrant... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-102 | Defines how many copies of each shard will be created.
Have effect only in distributed mode.
write_consistency_factor (Optional[int]) β Write consistency factor for collection. Default is 1, minimum is 1.
Defines how many replicas should apply the operation for us to consider
it successful. Increasing this number will ... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-103 | 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")
class langchain.vectorstores.Redis(redis_url, index_name, embedding_function, content_key='... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-104 | embeddings. Defaults to None.
keys (List[str]) or ids (List[str]) β Identifiers of entries.
Defaults to None.
batch_size (int, optional) β Batch size to use for writes. Defaults to 1000.
kwargs (Any) β
Returns
List of ids added to the vectorstore
Return type
List[str]
similarity_search(query, k=4, **kwargs)[source]ο
R... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-105 | k (int) β
score_threshold (float) β
kwargs (Any) β
Note
If there are no documents that satisfy the score_threshold value,
an empty list is returned.
similarity_search_with_score(query, k=4)[source]ο
Return docs most similar to query.
Parameters
query (str) β Text to look up documents similar to.
k (int) β Number of ... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-106 | Return type
Tuple[langchain.vectorstores.redis.Redis, List[str]]
classmethod from_texts(texts, embedding, metadatas=None, index_name=None, content_key='content', metadata_key='metadata', vector_key='content_vector', **kwargs)[source]ο
Create a Redis vectorstore from raw documents.
This is a user-friendly interface that... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-107 | Connect to an existing Redis index.
Parameters
embedding (langchain.embeddings.base.Embeddings) β
index_name (str) β
content_key (str) β
metadata_key (str) β
vector_key (str) β
kwargs (Any) β
Return type
langchain.vectorstores.redis.Redis
as_retriever(**kwargs)[source]ο
Parameters
kwargs (Any) β
Return type
lang... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-108 | Parameters
client (Any) β
embeddings (Embeddings) β
collection_name (str) β
text_key (str) β
embedding_key (str) β
add_texts(texts, metadatas=None, ids=None, batch_size=32, **kwargs)[source]ο
Run more texts through the embeddings and add to the vectorstore
Args:
texts: Iterable of strings to add to the vectorstore... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-109 | Return type
langchain.vectorstores.rocksetdb.Rockset
class DistanceFunction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]ο
Bases: enum.Enum
COSINE_SIM = 'COSINE_SIM'ο
EUCLIDEAN_DIST = 'EUCLIDEAN_DIST'ο
DOT_PRODUCT = 'DOT_PRODUCT'ο
order_by()[source]ο
Return type
str
simila... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-110 | kwargs (Any) β
Return type
List[Document]
similarity_search_by_vector(embedding, k=4, distance_func=DistanceFunction.COSINE_SIM, where_str=None, **kwargs)[source]ο
Accepts a query_embedding (vector), and returns documents with
similar embeddings.
Parameters
embedding (List[float]) β
k (int) β
distance_func (Distance... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-111 | Return type
None
persist()[source]ο
Return type
None
add_texts(texts, metadatas=None, ids=None, **kwargs)[source]ο
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts (Iterable[str]) β Iterable of strings to add to the vectorstore.
metadatas (Optional[List[dict]]) β Optional list of metad... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-112 | to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
Parameters
embedding (List[float]) β
k (int) β
fetch_k (int) β
lambda_mult (float) β
kwargs (Any) β
Return type
List[langchain.schema.Document]
max_marginal_relevance_search(query, k=... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-113 | persist_path (Optional[str]) β
kwargs (Any) β
Return type
langchain.vectorstores.sklearn.SKLearnVectorStore
class langchain.vectorstores.StarRocks(embedding, config=None, **kwargs)[source]ο
Bases: langchain.vectorstores.base.VectorStore
Wrapper around StarRocks vector database
You need a pymysql python package, and a... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-114 | List of ids from adding the texts into the VectorStore.
Return type
List[str]
classmethod from_texts(texts, embedding, metadatas=None, config=None, text_ids=None, batch_size=32, **kwargs)[source]ο
Create StarRocks wrapper with existing texts
Parameters
embedding_function (Embeddings) β Function to extract text embeddin... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-115 | Returns
List of Documents
Return type
List[Document]
similarity_search_by_vector(embedding, k=4, where_str=None, **kwargs)[source]ο
Perform a similarity search with StarRocks by vectors
Parameters
query (str) β query string
k (int, optional) β Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], option... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-116 | Bases: langchain.vectorstores.base.VectorStore
VectorStore for a Supabase postgres database. Assumes you have the pgvector
extension installed and a match_documents (or similar) function. For more details:
https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase
You can implement your own match... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-117 | Parameters
texts (List[str]) β
embedding (Embeddings) β
metadatas (Optional[List[dict]]) β
client (Optional[supabase.client.Client]) β
table_name (Optional[str]) β
query_name (Union[str, None]) β
ids (Optional[List[str]]) β
kwargs (Any) β
Return type
SupabaseVectorStore
add_vectors(vectors, documents, ids)[sour... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-118 | **kwargs β kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
kwargs (Any) β
Returns
List of Tuples of (doc, similarity_score)
Return type
List[Tuple[langchain.schema.Document, float]]
similarity_searc... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-119 | Return type
List[langchain.schema.Document]
max_marginal_relevance_search(query, k=4, fetch_k=20, lambda_mult=0.5, **kwargs)[source]ο
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query (str) β T... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-120 | Parameters
ids (List[str]) β List of ids to delete.
Return type
None
class langchain.vectorstores.Tair(embedding_function, url, index_name, content_key='content', metadata_key='metadata', search_params=None, **kwargs)[source]ο
Bases: langchain.vectorstores.base.VectorStore
Wrapper around Tair Vector store.
Parameters
e... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-121 | Return type
List[Document]
classmethod from_texts(texts, embedding, metadatas=None, index_name='langchain', content_key='content', metadata_key='metadata', **kwargs)[source]ο
Return VectorStore initialized from texts and embeddings.
Parameters
texts (List[str]) β
embedding (langchain.embeddings.base.Embeddings) β
met... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-122 | index_name (str) β
content_key (str) β
metadata_key (str) β
kwargs (Any) β
Return type
langchain.vectorstores.tair.Tair
class langchain.vectorstores.Tigris(client, embeddings, index_name)[source]ο
Bases: langchain.vectorstores.base.VectorStore
Parameters
client (TigrisClient) β
embeddings (Embeddings) β
index_nam... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-123 | filter (Optional[TigrisFilter]) β Filter by metadata. Defaults to None.
Returns
List of documents most similar to the querytext with distance in float.
Return type
List[Tuple[Document, float]]
classmethod from_texts(texts, embedding, metadatas=None, ids=None, client=None, index_name=None, **kwargs)[source]ο
Return Vect... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-124 | typesense_client=typesense_client,
embedding=embedding,
typesense_collection_name=typesense_collection_name,
text_key="text",
)
Parameters
typesense_client (Client) β
embedding (Embeddings) β
typesense_collection_name (Optional[str]) β
text_key (str) β
add_texts(texts, metadatas=None, ids=None, **kwargs... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-125 | Minimum 10 results would be returned.
filter (Optional[str]) β typesense filter_by expression to filter documents on
kwargs (Any) β
Returns
List of Documents most similar to the query and score for each
Return type
List[langchain.schema.Document]
classmethod from_client_params(embedding, *, host='localhost', port='810... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-126 | typesense_client_params (Optional[dict]) β
typesense_collection_name (Optional[str]) β
text_key (str) β
kwargs (Any) β
Return type
Typesense
class langchain.vectorstores.Vectara(vectara_customer_id=None, vectara_corpus_id=None, vectara_api_key=None)[source]ο
Bases: langchain.vectorstores.base.VectorStore
Implementa... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-127 | lambda_val (float) β lexical match parameter for hybrid search.
filter (Optional[str]) β 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.vectara.com/docs/search-apis/sql/filter-overview
for more details.
n_sentence_context (int) β n... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-128 | .. rubric:: Example
from langchain import Vectara
vectara = Vectara.from_texts(
texts,
vectara_customer_id=customer_id,
vectara_corpus_id=corpus_id,
vectara_api_key=api_key,
)
Parameters
texts (List[str]) β
embedding (Optional[langchain.embeddings.base.Embeddings]) β
metadatas (Optional[List[dict]]) β... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-129 | texts (Iterable[str]) β
metadatas (Optional[List[dict]]) β
kwargs (Any) β
Return type
List[str]
add_documents(documents, **kwargs)[source]ο
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) β Documents to add to the vectorstore.
documents (List[langchain.sch... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-130 | kwargs (Any) β
Return type
List[langchain.schema.Document]
similarity_search_with_relevance_scores(query, k=4, **kwargs)[source]ο
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query (str) β input text
k (int) β Number of Documents to return. Defaults to 4.
**kwarg... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-131 | Return type
List[langchain.schema.Document]
async asimilarity_search_by_vector(embedding, k=4, **kwargs)[source]ο
Return docs most similar to embedding vector.
Parameters
embedding (List[float]) β
k (int) β
kwargs (Any) β
Return type
List[langchain.schema.Document]
max_marginal_relevance_search(query, k=4, fetch_k=2... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-132 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding (List[float]) β Embedding to look up documents similar to.
k (int) β Number of Documents to return. Defaults to 4.
fetch_k (int) β Number o... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-133 | kwargs (Any) β
Return type
langchain.vectorstores.base.VST
abstract classmethod from_texts(texts, embedding, metadatas=None, **kwargs)[source]ο
Return VectorStore initialized from texts and embeddings.
Parameters
texts (List[str]) β
embedding (langchain.embeddings.base.Embeddings) β
metadatas (Optional[List[dict]]) ... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-134 | embedding (Optional[Embeddings]) β
attributes (Optional[List[str]]) β
relevance_score_fn (Optional[Callable[[float], float]]) β
by_text (bool) β
add_texts(texts, metadatas=None, **kwargs)[source]ο
Upload texts with metadata (properties) to Weaviate.
Parameters
texts (Iterable[str]) β
metadatas (Optional[List[dict]... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-135 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query (str) β Text to look up documents similar to.
k (int) β Number of Documents to return. Defaults to 4.
fetch_k (int) β Number of Documents to fe... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
81b746c66a31-136 | text and cosine distance in float for each.
Lower score represents more similarity.
Parameters
query (str) β
k (int) β
kwargs (Any) β
Return type
List[Tuple[langchain.schema.Document, float]]
classmethod from_texts(texts, embedding, metadatas=None, **kwargs)[source]ο
Construct Weaviate wrapper from raw documents.
Th... | https://api.python.langchain.com/en/latest/modules/vectorstores.html |
39d4921beaba-0 | Agent Toolkitsο
Agent toolkits. | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-1 | 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 JSON you are interacting with.\... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-2 | a section of the JSON, as this is not a valid answer. Keep digging until you find the answer and explicitly return it.\n', suffix='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='Use the following format:\n\nQues... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-3 | Construct a json agent from an LLM and tools.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
toolkit (langchain.agents.agent_toolkits.json.toolkit.JsonToolkit) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
prefix (str) β
suffix (str) β
format_instructions (str) β
inpu... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-4 | langchain.agents.agent_toolkits.create_sql_agent(llm, toolkit, agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager=None, prefix='You are an agent designed to interact with a SQL database.\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the quer... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-5 | max_iterations=15, max_execution_time=None, early_stopping_method='force', verbose=False, agent_executor_kwargs=None, **kwargs)[source]ο | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-6 | Construct a sql agent from an LLM and tools.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
toolkit (langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit) β
agent_type (langchain.agents.agent_types.AgentType) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
prefi... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-7 | langchain.agents.agent_toolkits.create_openapi_agent(llm, toolkit, callback_manager=None, prefix="You are an agent designed to answer questions by making web requests to an API given the openapi spec.\n\nIf the question does not seem related to the API, return I don't know. Do not make up an answer.\nOnly use informati... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-8 | Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables=None, max_iterations=15, max_execution_time=None, early_stopping_method='force', verbose=False, return_intermediate_steps=False, agent_executor_kwargs=None, **kwar... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-9 | Construct a json agent from an LLM and tools.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
toolkit (langchain.agents.agent_toolkits.openapi.toolkit.OpenAPIToolkit) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
prefix (str) β
suffix (str) β
format_instructions (str) β... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-10 | langchain.agents.agent_toolkits.create_pbi_agent(llm, toolkit, powerbi=None, callback_manager=None, prefix='You are an agent designed to help users interact with a PowerBI Dataset.\n\nAgent has access to a tool that can write a query based on the question and then run those against PowerBI, Microsofts business intellig... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-11 | know the final answer\nFinal Answer: the final answer to the original input question', examples=None, input_variables=None, top_k=10, verbose=False, agent_executor_kwargs=None, **kwargs)[source]ο | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-12 | Construct a pbi agent from an LLM and tools.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
toolkit (Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit]) β
powerbi (Optional[langchain.utilities.powerbi.PowerBIDataset]) β
callback_manager (Optional[langchain.callbacks.base.BaseCallb... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-13 | Return type
langchain.agents.agent.AgentExecutor
langchain.agents.agent_toolkits.create_pbi_chat_agent(llm, toolkit, powerbi=None, callback_manager=None, output_parser=None, prefix='Assistant is a large language model built to help users interact with a PowerBI Dataset.\n\nAssistant has access to a tool that can write ... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-14 | 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.
Parameters
llm (langchain.chat_models.base.BaseChatModel) β
toolkit (Optional[langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit]) β
powerbi (Optional[langchain.utilities.p... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-15 | Construct a python agent from an LLM and tool.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
tool (langchain.tools.python.tool.PythonREPLTool) β
agent_type (langchain.agents.agent_types.AgentType) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
verbose (bool) β
prefix (... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-16 | class langchain.agents.agent_toolkits.JsonToolkit(*, spec)[source]ο
Bases: langchain.agents.agent_toolkits.base.BaseToolkit
Toolkit for interacting with a JSON spec.
Parameters
spec (langchain.tools.json.tool.JsonSpec) β
Return type
None
attribute spec: langchain.tools.json.tool.JsonSpec [Required]ο
get_tools()[source... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-17 | get_tools()[source]ο
Get the tools in the toolkit.
Return type
List[langchain.tools.base.BaseTool]
class langchain.agents.agent_toolkits.NLAToolkit(*, nla_tools)[source]ο
Bases: langchain.agents.agent_toolkits.base.BaseToolkit
Natural Language API Toolkit Definition.
Parameters
nla_tools (Sequence[langchain.agents.agen... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-18 | Instantiate the toolkit by creating tools for each operation.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
spec (langchain.utilities.openapi.OpenAPISpec) β
requests (Optional[langchain.requests.Requests]) β
verbose (bool) β
kwargs (Any) β
Return type
langchain.agents.agent_toolkits.nla.toolkit.NLAT... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-19 | attribute examples: Optional[str] = Noneο
attribute llm: langchain.base_language.BaseLanguageModel [Required]ο
attribute max_iterations: int = 5ο
attribute powerbi: langchain.utilities.powerbi.PowerBIDataset [Required]ο
get_tools()[source]ο
Get the tools in the toolkit.
Return type
List[langchain.tools.base.BaseTool]
c... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-20 | Toolkit for interacting with a vector store.
Parameters
vectorstore_info (langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo) β
llm (langchain.base_language.BaseLanguageModel) β
Return type
None
attribute llm: langchain.base_language.BaseLanguageModel [Optional]ο
attribute vectorstore_info: langchain... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-21 | Bases: pydantic.main.BaseModel
Information about a vectorstore.
Parameters
vectorstore (langchain.vectorstores.base.VectorStore) β
name (str) β
description (str) β
Return type
None
attribute description: str [Required]ο
attribute name: str [Required]ο
attribute vectorstore: langchain.vectorstores.base.VectorStore [R... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-22 | agent_type (langchain.agents.agent_types.AgentType) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
prefix (Optional[str]) β
suffix (Optional[str]) β
input_variables (Optional[List[str]]) β
verbose (bool) β
return_intermediate_steps (bool) β
max_iterations (Optional[int]) β
max_exe... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-23 | max_iterations (Optional[int]) β
max_execution_time (Optional[float]) β
early_stopping_method (str) β
agent_executor_kwargs (Optional[Dict[str, Any]]) β
kwargs (Dict[str, Any]) β
Return type
langchain.agents.agent.AgentExecutor | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-24 | langchain.agents.agent_toolkits.create_spark_sql_agent(llm, toolkit, callback_manager=None, prefix='You are an agent designed to interact with Spark SQL.\nGiven an input question, create a syntactically correct Spark SQL query to run, then look at the results of the query and return the answer.\nUnless the user specifi... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-25 | Answer: the final answer to the original input question', input_variables=None, top_k=10, max_iterations=15, max_execution_time=None, early_stopping_method='force', verbose=False, agent_executor_kwargs=None, **kwargs)[source]ο | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-26 | Construct a sql agent from an LLM and tools.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
toolkit (langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
prefix (str) β
suffix (str) β
format_instructions (str)... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-27 | Create a toolkit from a ZapierNLAWrapper.
Parameters
zapier_nla_wrapper (langchain.utilities.zapier.ZapierNLAWrapper) β
Return type
langchain.agents.agent_toolkits.zapier.toolkit.ZapierToolkit
classmethod from_zapier_nla_wrapper(zapier_nla_wrapper)[source]ο
Create a toolkit from a ZapierNLAWrapper.
Parameters
zapier_n... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-28 | get_tools()[source]ο
Get the tools in the toolkit.
Return type
List[langchain.tools.base.BaseTool]
class langchain.agents.agent_toolkits.FileManagementToolkit(*, root_dir=None, selected_tools=None)[source]ο
Bases: langchain.agents.agent_toolkits.base.BaseToolkit
Toolkit for interacting with a Local Files.
Parameters
ro... | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
39d4921beaba-29 | class langchain.agents.agent_toolkits.AzureCognitiveServicesToolkit[source]ο
Bases: langchain.agents.agent_toolkits.base.BaseToolkit
Toolkit for Azure Cognitive Services.
Return type
None
get_tools()[source]ο
Get the tools in the toolkit.
Return type
List[langchain.tools.base.BaseTool] | https://api.python.langchain.com/en/latest/modules/agent_toolkits.html |
57cc15045056-0 | 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 |
57cc15045056-1 | Parameters
text (str) β
Return type
List[str]
class langchain.output_parsers.DatetimeOutputParser(*, format='%Y-%m-%dT%H:%M:%S.%fZ')[source]ο
Bases: langchain.schema.BaseOutputParser[datetime.datetime]
Parameters
format (str) β
Return type
None
attribute format: str = '%Y-%m-%dT%H:%M:%S.%fZ'ο
get_format_instructions(... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-2 | Bases: langchain.schema.BaseOutputParser
Parameters
guard (Any) β
api (Optional[Callable]) β
args (Any) β
kwargs (Any) β
Return type
None
attribute api: Optional[Callable] = Noneο
attribute args: Any = Noneο
attribute guard: Any = Noneο
attribute kwargs: Any = Noneο
classmethod from_pydantic(output_class, num_reask... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-3 | str
parse(text)[source]ο
Parse the output of an LLM call.
A method which takes in a string (assumed output of a language model )
and parses it into some structure.
Parameters
text (str) β output of language model
Returns
structured output
Return type
Dict
class langchain.output_parsers.ListOutputParser[source]ο
Bases: ... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-4 | attribute retry_chain: langchain.chains.llm.LLMChain [Required]ο
classmethod from_llm(llm, parser, prompt=PromptTemplate(input_variables=['completion', 'error', 'instructions'], output_parser=None, partial_variables={}, template='Instructions:\n--------------\n{instructions}\n--------------\nCompletion:\n--------------... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-5 | Return type
None
attribute pydantic_object: Type[langchain.output_parsers.pydantic.T] [Required]ο
get_format_instructions()[source]ο
Instructions on how the LLM output should be formatted.
Return type
str
parse(text)[source]ο
Parse the output of an LLM call.
A method which takes in a string (assumed output of a languag... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-6 | default_output_key (Optional[str]) β
Return type
None
attribute default_output_key: Optional[str] = Noneο
attribute output_keys: List[str] [Required]ο
attribute regex: str [Required]ο
parse(text)[source]ο
Parse the output of an LLM call.
Parameters
text (str) β
Return type
Dict[str, str]
class langchain.output_parser... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-7 | attribute retry_chain: langchain.chains.llm.LLMChain [Required]ο
classmethod from_llm(llm, parser, prompt=PromptTemplate(input_variables=['completion', 'prompt'], output_parser=None, partial_variables={}, template='Prompt:\n{prompt}\nCompletion:\n{completion}\n\nAbove, the Completion did not satisfy the constraints giv... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-8 | Returns
structured output
Return type
langchain.output_parsers.retry.T
class langchain.output_parsers.RetryWithErrorOutputParser(*, parser, retry_chain)[source]ο
Bases: langchain.schema.BaseOutputParser[langchain.output_parsers.retry.T]
Wraps a parser and tries to fix parsing errors.
Does this by passing the original p... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-9 | get_format_instructions()[source]ο
Instructions on how the LLM output should be formatted.
Return type
str
parse(completion)[source]ο
Parse the output of an LLM call.
A method which takes in a string (assumed output of a language model )
and parses it into some structure.
Parameters
text β output of language model
comp... | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
57cc15045056-10 | str
parse(text)[source]ο
Parse the output of an LLM call.
A method which takes in a string (assumed output of a language model )
and parses it into some structure.
Parameters
text (str) β output of language model
Returns
structured output
Return type
Any | https://api.python.langchain.com/en/latest/modules/output_parsers.html |
46d47edcfcf7-0 | 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 |
46d47edcfcf7-1 | from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(
deployment="your-embeddings-deployment-name",
model="your-embeddings-model-name",
openai_api_base="https://your-endpoint.openai.azure.com/",
openai_api_type="azure",
)
text = "This is a test query."
query_result = em... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-2 | The model name to pass to tiktoken when using this class.
Tiktoken is used to count the number of tokens in documents to constrain
them to be under a certain limit. By default, when set to None, this will
be the same as the embedding model name. However, there are some cases
where you may want to use this Embedding cla... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-3 | Return type
List[List[float]]
embed_query(text)[source]ο
Call out to OpenAIβs embedding endpoint for embedding query text.
Parameters
text (str) β The text to embed.
Returns
Embedding for the text.
Return type
List[float]
class langchain.embeddings.HuggingFaceEmbeddings(*, client=None, model_name='sentence-transformers... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-4 | Model name to use.
embed_documents(texts)[source]ο
Compute doc embeddings using a HuggingFace transformer model.
Parameters
texts (List[str]) β The list of texts to embed.
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query(text)[source]ο
Compute query embeddings using a HuggingFace... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-5 | Parameters
texts (List[str]) β The list of texts to embed.
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query(text)[source]ο
Call out to Cohereβs embedding endpoint.
Parameters
text (str) β The text to embed.
Returns
Embeddings for the text.
Return type
List[float]
class langchain.... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-6 | es_password (Optional[str]) β (str, optional): Elasticsearch password.
Return type
langchain.embeddings.elasticsearch.ElasticsearchEmbeddings
Example
from langchain.embeddings import ElasticsearchEmbeddings
# Define the model ID and input field name (if different from default)
model_id = "your_model_id"
# Optional, onl... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-7 | Example
from elasticsearch import Elasticsearch
from langchain.embeddings import ElasticsearchEmbeddings
# Define the model ID and input field name (if different from default)
model_id = "your_model_id"
# Optional, only if different from 'text_field'
input_field = "your_input_field"
# Create Elasticsearch connection
es... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-8 | Bases: pydantic.main.BaseModel, langchain.embeddings.base.Embeddings
Wrapper around llama.cpp embedding models.
To use, you should have the llama-cpp-python library installed, and provide the
path to the Llama model as a named parameter to the constructor.
Check out: https://github.com/abetlen/llama-cpp-python
Example
... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-9 | Number of threads to use. If None, the number
of threads is automatically determined.
attribute seed: int = -1ο
Seed. If -1, a random seed is used.
attribute use_mlock: bool = Falseο
Force system to keep model in RAM.
attribute vocab_only: bool = Falseο
Only load the vocabulary, no weights.
embed_documents(texts)[sourc... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-10 | )
Parameters
client (Any) β
repo_id (str) β
task (Optional[str]) β
model_kwargs (Optional[dict]) β
huggingfacehub_api_token (Optional[str]) β
Return type
None
attribute model_kwargs: Optional[dict] = Noneο
Key word arguments to pass to the model.
attribute repo_id: str = 'sentence-transformers/all-mpnet-base-v2'ο
... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-11 | embed (Any) β
model_id (str) β
Return type
None
attribute model_id: str = 'damo/nlp_corom_sentence-embedding_english-base'ο
Model name to use.
embed_documents(texts)[source]ο
Compute doc embeddings using a modelscope embedding model.
Parameters
texts (List[str]) β The list of texts to embed.
Returns
List of embedding... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.