id
stringlengths 14
15
| text
stringlengths 35
2.07k
| embedding
sequence | source
stringlengths 61
154
|
---|---|---|---|
59eb3f9cbcce-2 | 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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, is_duplicate_texts: Optional[bool] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
:param texts: Iterable of strings to add to the vectorstore.
:param metadatas: Optional list of metadatas associated with the texts.
:param is_duplicate_texts: Optional whether to duplicate texts.
:param kwargs: vectorstore specific parameters.
Returns
List of ids from adding the texts into the vectorstore.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶ | [
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
374,
71534,
80746,
25,
12536,
58,
2707,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
68416,
22755,
25,
39116,
315,
9246,
311,
923,
311,
279,
4724,
4412,
627,
68416,
2322,
329,
19907,
25,
12536,
1160,
315,
2322,
329,
19907,
5938,
449,
279,
22755,
627,
68416,
374,
71534,
80746,
25,
12536,
3508,
311,
23329,
22755,
627,
68416,
16901,
25,
4724,
4412,
3230,
5137,
627,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4724,
4412,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html |
59eb3f9cbcce-3 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
create_table(table_name: str, **kwargs: Any) → bool[source]¶
Create a new table.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, table_name: str = 'langchain_awadb', log_and_data_dir: Optional[str] = None, client: Optional[awadb.Client] = None, **kwargs: Any) → AwaDB[source]¶ | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
3261,
5350,
16138,
1292,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1845,
76747,
60,
55609,
198,
4110,
264,
502,
2007,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
12536,
58,
26566,
25624,
60,
284,
2290,
11,
2007,
1292,
25,
610,
284,
364,
5317,
8995,
55268,
40691,
518,
1515,
8543,
1807,
4432,
25,
12536,
17752,
60,
284,
2290,
11,
3016,
25,
12536,
58,
675,
40691,
11978,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
362,
10196,
3590,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html |
59eb3f9cbcce-4 | Create an AwaDB vectorstore from a list of documents.
If a log_and_data_dir specified, the table will be persisted there.
Parameters
documents (List[Document]) – List of documents to add to the vectorstore.
embedding (Optional[Embeddings]) – Embedding function. Defaults to None.
table_name (str) – Name of the table to create.
log_and_data_dir (Optional[str]) – Directory to persist the table.
client (Optional[awadb.Client]) – AwaDB client
Returns
AwaDB vectorstore.
Return type
AwaDB
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, table_name: str = 'langchain_awadb', log_and_data_dir: Optional[str] = None, client: Optional[awadb.Client] = None, **kwargs: Any) → AwaDB[source]¶
Create an AwaDB vectorstore from a raw documents.
Parameters
texts (List[str]) – List of texts to add to the table.
embedding (Optional[Embeddings]) – Embedding function. Defaults to None.
metadatas (Optional[List[dict]]) – List of metadatas. Defaults to None.
table_name (str) – Name of the table to create.
log_and_data_dir (Optional[str]) – Directory of logging and persistence.
client (Optional[awadb.Client]) – AwaDB client
Returns
AwaDB vectorstore.
Return type
AwaDB
get_current_table(**kwargs: Any) → str[source]¶
Get the current table.
list_tables(**kwargs: Any) → List[str][source]¶
List all the tables created by the client.
load_local(table_name: str, **kwargs: Any) → bool[source]¶ | [
4110,
459,
362,
10196,
3590,
4724,
4412,
505,
264,
1160,
315,
9477,
627,
2746,
264,
1515,
8543,
1807,
4432,
5300,
11,
279,
2007,
690,
387,
54095,
1070,
627,
9905,
198,
51878,
320,
861,
58,
7676,
2526,
1389,
1796,
315,
9477,
311,
923,
311,
279,
4724,
4412,
627,
95711,
320,
15669,
58,
26566,
25624,
2526,
1389,
38168,
7113,
734,
13,
37090,
311,
2290,
627,
2048,
1292,
320,
496,
8,
1389,
4076,
315,
279,
2007,
311,
1893,
627,
848,
8543,
1807,
4432,
320,
15669,
17752,
2526,
1389,
18524,
311,
23135,
279,
2007,
627,
3045,
320,
15669,
58,
675,
40691,
11978,
2526,
1389,
362,
10196,
3590,
3016,
198,
16851,
198,
32,
10196,
3590,
4724,
4412,
627,
5715,
955,
198,
32,
10196,
3590,
198,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
12536,
58,
26566,
25624,
60,
284,
2290,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
2007,
1292,
25,
610,
284,
364,
5317,
8995,
55268,
40691,
518,
1515,
8543,
1807,
4432,
25,
12536,
17752,
60,
284,
2290,
11,
3016,
25,
12536,
58,
675,
40691,
11978,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
362,
10196,
3590,
76747,
60,
55609,
198,
4110,
459,
362,
10196,
3590,
4724,
4412,
505,
264,
7257,
9477,
627,
9905,
198,
87042,
320,
861,
17752,
2526,
1389,
1796,
315,
22755,
311,
923,
311,
279,
2007,
627,
95711,
320,
15669,
58,
26566,
25624,
2526,
1389,
38168,
7113,
734,
13,
37090,
311,
2290,
627,
4150,
329,
19907,
320,
15669,
53094,
58,
8644,
30716,
1389,
1796,
315,
2322,
329,
19907,
13,
37090,
311,
2290,
627,
2048,
1292,
320,
496,
8,
1389,
4076,
315,
279,
2007,
311,
1893,
627,
848,
8543,
1807,
4432,
320,
15669,
17752,
2526,
1389,
18524,
315,
8558,
323,
42056,
627,
3045,
320,
15669,
58,
675,
40691,
11978,
2526,
1389,
362,
10196,
3590,
3016,
198,
16851,
198,
32,
10196,
3590,
4724,
4412,
627,
5715,
955,
198,
32,
10196,
3590,
198,
456,
11327,
5350,
22551,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
279,
1510,
2007,
627,
1638,
36732,
22551,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
861,
682,
279,
12920,
3549,
555,
279,
3016,
627,
1096,
13876,
16138,
1292,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1845,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html |
59eb3f9cbcce-5 | load_local(table_name: str, **kwargs: Any) → bool[source]¶
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶ | [
1096,
13876,
16138,
1292,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1845,
76747,
60,
55609,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html |
59eb3f9cbcce-6 | Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
similarity_search_by_vector(embedding: Optional[List[float]] = None, k: int = 4, scores: Optional[list] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs and relevance scores, normalized on a scale from 0 to 1.
0 is dissimilar, 1 is most similar.
similarity_search_with_score(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs and relevance scores, normalized on a scale from 0 to 1.
0 is dissimilar, 1 is most similar.
use(table_name: str, **kwargs: Any) → bool[source]¶
Use the specified table. Don’t know the tables, please invoke list_tables. | [
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
12536,
53094,
96481,
5163,
284,
2290,
11,
597,
25,
528,
284,
220,
19,
11,
12483,
25,
12536,
68723,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
323,
41961,
12483,
11,
30510,
389,
264,
5569,
505,
220,
15,
311,
220,
16,
627,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
323,
41961,
12483,
11,
30510,
389,
264,
5569,
505,
220,
15,
311,
220,
16,
627,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
817,
16138,
1292,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1845,
76747,
60,
55609,
198,
10464,
279,
5300,
2007,
13,
4418,
1431,
1440,
279,
12920,
11,
4587,
20466,
1160,
36732,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html |
cd3186dd6166-0 | langchain.vectorstores.clickhouse.has_mul_sub_str¶
langchain.vectorstores.clickhouse.has_mul_sub_str(s: str, *args: Any) → bool[source]¶
Check if a string contains multiple substrings.
:param s: string to check.
:param *args: substrings to check.
Returns
True if all substrings are in the string, False otherwise. | [
5317,
8995,
48203,
44569,
14798,
7830,
7001,
25989,
5341,
2966,
55609,
198,
5317,
8995,
48203,
44569,
14798,
7830,
7001,
25989,
5341,
2966,
1161,
25,
610,
11,
353,
2164,
25,
5884,
8,
11651,
1845,
76747,
60,
55609,
198,
4061,
422,
264,
925,
5727,
5361,
16146,
826,
627,
68416,
274,
25,
925,
311,
1817,
627,
68416,
353,
2164,
25,
16146,
826,
311,
1817,
627,
16851,
198,
2575,
422,
682,
16146,
826,
527,
304,
279,
925,
11,
3641,
6062,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.has_mul_sub_str.html |
afe7fc85dc4f-0 | langchain.vectorstores.sklearn.SKLearnVectorStore¶
class langchain.vectorstores.sklearn.SKLearnVectorStore(embedding: Embeddings, *, persist_path: Optional[str] = None, serializer: Literal['json', 'bson', 'parquet'] = 'json', metric: str = 'cosine', **kwargs: Any)[source]¶
Bases: VectorStore
A simple in-memory vector store based on the scikit-learn library
NearestNeighbors implementation.
Methods
__init__(embedding, *[, persist_path, ...])
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector. | [
5317,
8995,
48203,
44569,
40554,
12964,
92029,
24762,
3866,
6221,
55609,
198,
1058,
8859,
8995,
48203,
44569,
40554,
12964,
92029,
24762,
3866,
6221,
50825,
7113,
25,
38168,
25624,
11,
12039,
23135,
2703,
25,
12536,
17752,
60,
284,
2290,
11,
22508,
25,
50774,
681,
2285,
518,
364,
92823,
518,
364,
1768,
24181,
663,
284,
364,
2285,
518,
18767,
25,
610,
284,
364,
9594,
483,
518,
3146,
9872,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
32,
4382,
304,
65196,
4724,
3637,
3196,
389,
279,
1156,
61503,
12,
12964,
6875,
198,
8989,
15795,
59186,
8292,
627,
18337,
198,
565,
2381,
3889,
95711,
11,
4194,
9,
38372,
4194,
40926,
2703,
11,
4194,
1131,
2608,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
11,
4194,
3447,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-1 | Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param query: Text to look up documents similar to. :param k: Number of Documents to return. Defaults to 4. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param 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.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param embedding: Embedding to look up documents similar to. :param k: Number of Documents to return. Defaults to 4. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param 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.
persist()
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k]) | [
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
11,
4194,
1131,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13,
7639,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
4315,
4183,
9477,
13,
551,
913,
3319,
25,
2991,
311,
1427,
709,
9477,
4528,
311,
13,
551,
913,
597,
25,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
13,
551,
913,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13,
551,
913,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
3909,
315,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
3909,
311,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
13,
37090,
311,
220,
15,
13,
20,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13,
7639,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
4315,
4183,
9477,
13,
551,
913,
40188,
25,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
13,
551,
913,
597,
25,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
13,
551,
913,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13,
551,
913,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
3909,
315,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
3909,
311,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
13,
37090,
311,
220,
15,
13,
20,
627,
40926,
746,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2526
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-2 | Return docs most similar to query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query, *[, k])
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
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.
kwargs – vectorstore specific parameters
Returns
List of ids from adding the texts into the vectorstore.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ | [
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
11,
4194,
9,
38372,
4194,
74,
2608,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
87042,
1389,
39116,
315,
9246,
311,
923,
311,
279,
4724,
4412,
627,
4150,
329,
19907,
1389,
12536,
1160,
315,
2322,
329,
19907,
5938,
449,
279,
22755,
627,
9872,
1389,
4724,
4412,
3230,
5137,
198,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4724,
4412,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-3 | Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful, | [
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
11
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-4 | Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, persist_path: Optional[str] = None, **kwargs: Any) → SKLearnVectorStore[source]¶
Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
:param query: Text to look up documents similar to.
:param k: Number of Documents to return. Defaults to 4.
:param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param 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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity | [
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
23135,
2703,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
12343,
24762,
3866,
6221,
76747,
60,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
68416,
3319,
25,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
68416,
597,
25,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
68416,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
68416,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-5 | Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
:param embedding: Embedding to look up documents similar to.
:param k: Number of Documents to return. Defaults to 4.
:param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param 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.
persist() → None[source]¶
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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 | [
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
68416,
40188,
25,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
68416,
597,
25,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
68416,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
68416,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
40926,
368,
11651,
2290,
76747,
60,
55609,
198,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
afe7fc85dc4f-6 | filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, *, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶ | [
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
12039,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStore.html |
18cfd3d955fd-0 | langchain.vectorstores.docarray.base.DocArrayIndex¶
class langchain.vectorstores.docarray.base.DocArrayIndex(doc_index: BaseDocIndex, embedding: Embeddings)[source]¶
Bases: VectorStore, ABC
Initialize a vector store from DocArray’s DocIndex.
Methods
__init__(doc_index, embedding)
Initialize a vector store from DocArray's DocIndex.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs) | [
5317,
8995,
48203,
44569,
24595,
1686,
9105,
43552,
1895,
1581,
55609,
198,
1058,
8859,
8995,
48203,
44569,
24595,
1686,
9105,
43552,
1895,
1581,
19702,
3644,
25,
5464,
9743,
1581,
11,
40188,
25,
38168,
25624,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
11,
19921,
198,
10130,
264,
4724,
3637,
505,
22452,
1895,
753,
22452,
1581,
627,
18337,
198,
565,
2381,
3889,
5349,
3644,
11,
4194,
95711,
340,
10130,
264,
4724,
3637,
505,
22452,
1895,
596,
22452,
1581,
627,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
8
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
18cfd3d955fd-1 | Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k])
Return docs most similar to query.
Attributes
doc_cls
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type | [
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
10738,
198,
5349,
39756,
198,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
18cfd3d955fd-2 | Returns
List of IDs of the added texts.
Return type
List[str]
add_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.
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.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type. | [
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
87042,
1389,
39116,
315,
9246,
311,
923,
311,
279,
4724,
4412,
627,
4150,
329,
19907,
1389,
12536,
1160,
315,
2322,
329,
19907,
5938,
449,
279,
22755,
627,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4724,
4412,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
18cfd3d955fd-3 | Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
abstract classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
Return VectorStore initialized from texts and embeddings.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm. | [
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
16647,
538,
4492,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
18cfd3d955fd-4 | 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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document][source]¶ | [
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
18cfd3d955fd-5 | Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of documents most similar to the query text and
cosine distance in float for each.
Lower score represents more similarity.
property doc_cls: Type[BaseDoc]¶ | [
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
9477,
1455,
4528,
311,
279,
3319,
1495,
323,
198,
9594,
483,
6138,
304,
2273,
369,
1855,
627,
9230,
5573,
11105,
810,
38723,
627,
3784,
4733,
39756,
25,
4078,
58,
4066,
9743,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.docarray.base.DocArrayIndex.html |
17e443edcf7d-0 | langchain.vectorstores.starrocks.StarRocksSettings¶
class langchain.vectorstores.starrocks.StarRocksSettings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, host: str = 'localhost', port: int = 9030, username: str = 'root', password: str = '', column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata'}, database: str = 'default', table: str = 'langchain')[source]¶
Bases: BaseSettings
StarRocks Client Configuration
Attribute:
StarRocks_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
StarRocks_port (int) : URL port to connect with HTTP. Defaults to 8443.
username (str) : Username to login. Defaults to None.
password (str) : Password to login. Defaults to None.
database (str) : Database name to find the table. Defaults to ‘default’.
table (str) : Table name to operate on.
Defaults to ‘vector_table’.
column_map (Dict)Column type map to project column name onto langchainsemantics. Must have keys: text, id, vector,
must be same size to number of columns. For example:
.. code-block:: python
{‘id’: ‘text_id’,
‘embedding’: ‘text_embedding’,
‘document’: ‘text_plain’,
‘metadata’: ‘metadata_dictionary_in_json’,
}
Defaults to identity map. | [
5317,
8995,
48203,
44569,
53682,
299,
14895,
7914,
277,
49,
26246,
6214,
55609,
198,
1058,
8859,
8995,
48203,
44569,
53682,
299,
14895,
7914,
277,
49,
26246,
6214,
2551,
3239,
2517,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
11,
1796,
58,
33758,
17752,
11,
8092,
13246,
21128,
25645,
58,
33758,
17752,
11,
8092,
13246,
1145,
2564,
5163,
60,
284,
3942,
1735,
1665,
20150,
721,
3239,
2517,
38713,
25,
12536,
17752,
60,
284,
2290,
11,
721,
3239,
67379,
18519,
18170,
25,
12536,
17752,
60,
284,
2290,
11,
721,
325,
53810,
4432,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
5163,
284,
2290,
11,
12039,
3552,
25,
610,
284,
364,
8465,
518,
2700,
25,
528,
284,
220,
23305,
15,
11,
6059,
25,
610,
284,
364,
2959,
518,
3636,
25,
610,
284,
9158,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
6190,
1232,
364,
6190,
518,
364,
95711,
1232,
364,
95711,
518,
364,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
25762,
4729,
25,
610,
284,
364,
2309,
518,
2007,
25,
610,
284,
364,
5317,
8995,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
6214,
198,
12988,
49,
26246,
8589,
12499,
198,
3994,
512,
12988,
49,
26246,
13144,
320,
496,
8,
2127,
5665,
311,
4667,
311,
3092,
7092,
19713,
13578,
82,
311,
3451,
8465,
529,
627,
12988,
49,
26246,
8889,
320,
396,
8,
551,
5665,
2700,
311,
4667,
449,
10339,
13,
37090,
311,
220,
24344,
18,
627,
5223,
320,
496,
8,
551,
30645,
311,
5982,
13,
37090,
311,
2290,
627,
3918,
320,
496,
8,
551,
12642,
311,
5982,
13,
37090,
311,
2290,
627,
12494,
320,
496,
8,
551,
10199,
836,
311,
1505,
279,
2007,
13,
37090,
311,
3451,
2309,
529,
627,
2048,
320,
496,
8,
551,
6771,
836,
311,
14816,
389,
627,
16672,
311,
3451,
3295,
5350,
529,
627,
6361,
5489,
320,
13755,
8,
3006,
955,
2472,
311,
2447,
3330,
836,
8800,
8859,
8995,
7143,
37333,
13,
15832,
617,
7039,
25,
1495,
11,
887,
11,
4724,
345,
25849,
387,
1890,
1404,
311,
1396,
315,
8310,
13,
1789,
3187,
512,
497,
2082,
9612,
487,
10344,
198,
90,
14336,
307,
89213,
3451,
1342,
851,
529,
345,
14336,
95711,
89213,
3451,
1342,
52602,
529,
345,
14336,
6190,
89213,
3451,
1342,
42115,
529,
345,
14336,
18103,
89213,
3451,
18103,
43705,
1265,
9643,
529,
345,
534,
16672,
311,
9764,
2472,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocksSettings.html |
17e443edcf7d-1 | ‘metadata’: ‘metadata_dictionary_in_json’,
}
Defaults to identity map.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata'}¶
param database: str = 'default'¶
param host: str = 'localhost'¶
param password: str = ''¶
param port: int = 9030¶
param table: str = 'langchain'¶
param username: str = 'root'¶
model Config[source]¶
Bases: object
env_file = '.env'¶
env_file_encoding = 'utf-8'¶
env_prefix = 'starrocks_'¶ | [
14336,
18103,
89213,
3451,
18103,
43705,
1265,
9643,
529,
345,
534,
16672,
311,
9764,
2472,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
6190,
1232,
364,
6190,
518,
364,
95711,
1232,
364,
95711,
518,
364,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
8439,
55609,
198,
913,
4729,
25,
610,
284,
364,
2309,
6,
55609,
198,
913,
3552,
25,
610,
284,
364,
8465,
6,
55609,
198,
913,
3636,
25,
610,
284,
3436,
55609,
198,
913,
2700,
25,
528,
284,
220,
23305,
15,
55609,
198,
913,
2007,
25,
610,
284,
364,
5317,
8995,
6,
55609,
198,
913,
6059,
25,
610,
284,
364,
2959,
6,
55609,
198,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
3239,
2517,
284,
6389,
3239,
6,
55609,
198,
3239,
2517,
38713,
284,
364,
4867,
12,
23,
6,
55609,
198,
3239,
14301,
284,
364,
12134,
299,
14895,
19893,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocksSettings.html |
a4d08c4e96a8-0 | langchain.vectorstores.faiss.FAISS¶
class langchain.vectorstores.faiss.FAISS(embedding_function: ~typing.Callable, index: ~typing.Any, docstore: ~langchain.docstore.base.Docstore, index_to_docstore_id: ~typing.Dict[int, str], relevance_score_fn: ~typing.Optional[~typing.Callable[[float], float]] = <function _default_relevance_score_fn>, normalize_L2: bool = False)[source]¶
Bases: VectorStore
Wrapper around FAISS vector database.
To use, you should have the faiss python package installed.
Example
from langchain import FAISS
faiss = FAISS(embedding_function, index, docstore, index_to_docstore_id)
Initialize with necessary components.
Methods
__init__(embedding_function, index, ...[, ...])
Initialize with necessary components.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_embeddings(text_embeddings[, metadatas, ids])
Run more texts through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance. | [
5317,
8995,
48203,
44569,
64214,
1056,
1006,
15836,
1242,
55609,
198,
1058,
8859,
8995,
48203,
44569,
64214,
1056,
1006,
15836,
1242,
50825,
7113,
9353,
25,
4056,
90902,
28115,
481,
11,
1963,
25,
4056,
90902,
13614,
11,
4733,
4412,
25,
4056,
5317,
8995,
24595,
4412,
9105,
43552,
4412,
11,
1963,
2401,
19401,
4412,
851,
25,
4056,
90902,
72201,
19155,
11,
610,
1145,
41961,
10622,
15604,
25,
4056,
90902,
37464,
58,
93,
90902,
28115,
481,
15873,
3733,
1145,
2273,
5163,
284,
366,
1723,
721,
2309,
1311,
33194,
10622,
15604,
8226,
22436,
2406,
17,
25,
1845,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
11803,
2212,
15358,
31949,
4724,
4729,
627,
1271,
1005,
11,
499,
1288,
617,
279,
2267,
1056,
10344,
6462,
10487,
627,
13617,
198,
1527,
8859,
8995,
1179,
15358,
31949,
198,
3716,
1056,
284,
15358,
31949,
50825,
7113,
9353,
11,
1963,
11,
4733,
4412,
11,
1963,
2401,
19401,
4412,
851,
340,
10130,
449,
5995,
6956,
627,
18337,
198,
565,
2381,
3889,
95711,
9353,
11,
4194,
1275,
11,
4194,
1131,
38372,
4194,
1131,
2608,
10130,
449,
5995,
6956,
627,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
64872,
7383,
64872,
38372,
4194,
4150,
329,
19907,
11,
4194,
3447,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
11,
4194,
3447,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-1 | Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_embeddings(text_embeddings, embedding)
Construct FAISS wrapper from raw documents.
from_texts(texts, embedding[, metadatas, ids])
Construct FAISS wrapper from raw documents.
load_local(folder_path, embeddings[, index_name])
Load FAISS index, docstore, and index_to_docstore_id from disk.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_with_score_by_vector(...)
Return docs and their similarity scores selected using the maximal marginal
merge_from(target)
Merge another FAISS object with the current one.
save_local(folder_path[, index_name])
Save FAISS index, docstore, and index_to_docstore_id to disk.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, filter, fetch_k])
Return docs most similar to query. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
64872,
7383,
64872,
11,
4194,
95711,
340,
29568,
15358,
31949,
13564,
505,
7257,
9477,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
11,
4194,
3447,
2608,
29568,
15358,
31949,
13564,
505,
7257,
9477,
627,
1096,
13876,
35029,
2703,
11,
4194,
12529,
25624,
38372,
4194,
1275,
1292,
2608,
6003,
15358,
31949,
1963,
11,
4733,
4412,
11,
323,
1963,
2401,
19401,
4412,
851,
505,
13668,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
6753,
10622,
3795,
12526,
73893,
5715,
27437,
323,
872,
38723,
12483,
4183,
1701,
279,
54229,
32873,
198,
19590,
5791,
8807,
340,
53196,
2500,
15358,
31949,
1665,
449,
279,
1510,
832,
627,
6766,
13876,
35029,
2703,
38372,
4194,
1275,
1292,
2608,
8960,
15358,
31949,
1963,
11,
4733,
4412,
11,
323,
1963,
2401,
19401,
4412,
851,
311,
13668,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
11,
4194,
5428,
11,
4194,
9838,
4803,
2608,
5715,
27437,
1455,
4528,
311,
3319,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-2 | Return docs most similar to query.
similarity_search_by_vector(embedding[, k, ...])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Return docs most similar to query.
similarity_search_with_score_by_vector(embedding)
Return docs most similar to query.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_embeddings(text_embeddings: Iterable[Tuple[str, List[float]]], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
text_embeddings – Iterable pairs of string and embedding to
add to the vectorstore.
metadatas – Optional list of metadatas associated with the texts.
ids – Optional list of unique IDs.
Returns | [
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
64872,
7383,
64872,
25,
39116,
20961,
6189,
17752,
11,
1796,
96481,
5163,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
1342,
64872,
1389,
39116,
13840,
315,
925,
323,
40188,
311,
198,
723,
311,
279,
4724,
4412,
627,
4150,
329,
19907,
1389,
12536,
1160,
315,
2322,
329,
19907,
5938,
449,
279,
22755,
627,
3447,
1389,
12536,
1160,
315,
5016,
29460,
627,
16851
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-3 | ids – Optional list of unique IDs.
Returns
List of ids from adding the texts into the vectorstore.
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
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.
ids – Optional list of unique IDs.
Returns
List of ids from adding the texts into the vectorstore.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type. | [
3447,
1389,
12536,
1160,
315,
5016,
29460,
627,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
87042,
1389,
39116,
315,
9246,
311,
923,
311,
279,
4724,
4412,
627,
4150,
329,
19907,
1389,
12536,
1160,
315,
2322,
329,
19907,
5938,
449,
279,
22755,
627,
3447,
1389,
12536,
1160,
315,
5016,
29460,
627,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4724,
4412,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-4 | Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → FAISS[source]¶
Construct FAISS wrapper from raw documents.
This is a user friendly interface that:
Embeds documents.
Creates an in memory docstore
Initializes the FAISS database
This is intended to be a quick way to get started.
Example
from langchain import FAISS
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
text_embeddings = embeddings.embed_documents(texts)
text_embedding_pairs = list(zip(texts, text_embeddings))
faiss = FAISS.from_embeddings(text_embedding_pairs, embeddings) | [
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
64872,
7383,
64872,
25,
1796,
20961,
6189,
17752,
11,
1796,
96481,
5163,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
15358,
31949,
76747,
60,
55609,
198,
29568,
15358,
31949,
13564,
505,
7257,
9477,
627,
2028,
374,
264,
1217,
11919,
3834,
430,
512,
26566,
82,
9477,
627,
55968,
459,
304,
5044,
4733,
4412,
198,
6475,
4861,
279,
15358,
31949,
4729,
198,
2028,
374,
10825,
311,
387,
264,
4062,
1648,
311,
636,
3940,
627,
13617,
198,
1527,
8859,
8995,
1179,
15358,
31949,
198,
1527,
8859,
8995,
41541,
25624,
1179,
5377,
15836,
26566,
25624,
198,
12529,
25624,
284,
5377,
15836,
26566,
25624,
746,
1342,
64872,
284,
71647,
41541,
77027,
7383,
82,
340,
1342,
52602,
37530,
284,
1160,
39349,
7383,
82,
11,
1495,
64872,
1192,
3716,
1056,
284,
15358,
31949,
6521,
64872,
7383,
52602,
37530,
11,
71647,
8
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-5 | faiss = FAISS.from_embeddings(text_embedding_pairs, embeddings)
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → FAISS[source]¶
Construct FAISS wrapper from raw documents.
This is a user friendly interface that:
Embeds documents.
Creates an in memory docstore
Initializes the FAISS database
This is intended to be a quick way to get started.
Example
from langchain import FAISS
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
faiss = FAISS.from_texts(texts, embeddings)
classmethod load_local(folder_path: str, embeddings: Embeddings, index_name: str = 'index') → FAISS[source]¶
Load FAISS index, docstore, and index_to_docstore_id from disk.
Parameters
folder_path – folder path to load index, docstore,
and index_to_docstore_id from.
embeddings – Embeddings to use when generating queries
index_name – for saving with a specific index file name
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch before filtering (if needed) to
pass to MMR algorithm. | [
3716,
1056,
284,
15358,
31949,
6521,
64872,
7383,
52602,
37530,
11,
71647,
340,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
15358,
31949,
76747,
60,
55609,
198,
29568,
15358,
31949,
13564,
505,
7257,
9477,
627,
2028,
374,
264,
1217,
11919,
3834,
430,
512,
26566,
82,
9477,
627,
55968,
459,
304,
5044,
4733,
4412,
198,
6475,
4861,
279,
15358,
31949,
4729,
198,
2028,
374,
10825,
311,
387,
264,
4062,
1648,
311,
636,
3940,
627,
13617,
198,
1527,
8859,
8995,
1179,
15358,
31949,
198,
1527,
8859,
8995,
41541,
25624,
1179,
5377,
15836,
26566,
25624,
198,
12529,
25624,
284,
5377,
15836,
26566,
25624,
746,
3716,
1056,
284,
15358,
31949,
6521,
80746,
7383,
82,
11,
71647,
340,
27853,
2865,
13876,
35029,
2703,
25,
610,
11,
71647,
25,
38168,
25624,
11,
1963,
1292,
25,
610,
284,
364,
1275,
873,
11651,
15358,
31949,
76747,
60,
55609,
198,
6003,
15358,
31949,
1963,
11,
4733,
4412,
11,
323,
1963,
2401,
19401,
4412,
851,
505,
13668,
627,
9905,
198,
18135,
2703,
1389,
8695,
1853,
311,
2865,
1963,
11,
4733,
4412,
345,
438,
1963,
2401,
19401,
4412,
851,
505,
627,
12529,
25624,
1389,
38168,
25624,
311,
1005,
994,
24038,
20126,
198,
1275,
1292,
1389,
369,
14324,
449,
264,
3230,
1963,
1052,
836,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
1603,
30770,
320,
333,
4460,
8,
311,
198,
6519,
311,
386,
18953,
12384,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-6 | 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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch before filtering 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_marginal_relevance_search_with_score_by_vector(embedding: List[float], *, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, filter: Optional[Dict[str, Any]] = None) → List[Tuple[Document, float]][source]¶
Return docs and their similarity scores selected using the maximal marginalrelevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4. | [
6519,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
1603,
30770,
311,
198,
6519,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
12039,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
323,
872,
38723,
12483,
4183,
1701,
279,
54229,
32873,
265,
33194,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-7 | k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch before filtering 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 and similarity scores selected by maximal marginalrelevance and score for each.
merge_from(target: FAISS) → None[source]¶
Merge another FAISS object with the current one.
Add the target FAISS to the current one.
Parameters
target – FAISS object you wish to merge into the current one
Returns
None.
save_local(folder_path: str, index_name: str = 'index') → None[source]¶
Save FAISS index, docstore, and index_to_docstore_id to disk.
Parameters
folder_path – folder path to save index, docstore,
and index_to_docstore_id to.
index_name – for saving with a specific index file name
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
filter – (Optional[Dict[str, str]]): Filter by metadata. Defaults to None.
fetch_k – (Optional[int]) Number of Documents to fetch before filtering.
Defaults to 20.
Returns
List of Documents most similar to the query. | [
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
1603,
30770,
311,
198,
6519,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
323,
38723,
12483,
4183,
555,
54229,
32873,
265,
33194,
323,
5573,
369,
1855,
627,
19590,
5791,
8807,
25,
15358,
31949,
8,
11651,
2290,
76747,
60,
55609,
198,
53196,
2500,
15358,
31949,
1665,
449,
279,
1510,
832,
627,
2261,
279,
2218,
15358,
31949,
311,
279,
1510,
832,
627,
9905,
198,
5775,
1389,
15358,
31949,
1665,
499,
6562,
311,
11117,
1139,
279,
1510,
832,
198,
16851,
198,
4155,
627,
6766,
13876,
35029,
2703,
25,
610,
11,
1963,
1292,
25,
610,
284,
364,
1275,
873,
11651,
2290,
76747,
60,
55609,
198,
8960,
15358,
31949,
1963,
11,
4733,
4412,
11,
323,
1963,
2401,
19401,
4412,
851,
311,
13668,
627,
9905,
198,
18135,
2703,
1389,
8695,
1853,
311,
3665,
1963,
11,
4733,
4412,
345,
438,
1963,
2401,
19401,
4412,
851,
311,
627,
1275,
1292,
1389,
369,
14324,
449,
264,
3230,
1963,
1052,
836,
198,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
5428,
1389,
320,
15669,
58,
13755,
17752,
11,
610,
5163,
1680,
12619,
555,
11408,
13,
37090,
311,
2290,
627,
9838,
4803,
1389,
320,
15669,
19155,
2526,
5742,
315,
45890,
311,
7963,
1603,
30770,
627,
16672,
311,
220,
508,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-8 | Defaults to 20.
Returns
List of Documents most similar to the query.
similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None.
fetch_k – (Optional[int]) Number of Documents to fetch before filtering.
Defaults to 20.
Returns
List of Documents most similar to the embedding.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4. | [
16672,
311,
220,
508,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
5428,
320,
15669,
58,
13755,
17752,
11,
610,
30716,
1389,
12619,
555,
11408,
13,
37090,
311,
2290,
627,
9838,
4803,
1389,
320,
15669,
19155,
2526,
5742,
315,
45890,
311,
7963,
1603,
30770,
627,
16672,
311,
220,
508,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
40188,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
a4d08c4e96a8-9 | k – Number of Documents to return. Defaults to 4.
filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None.
fetch_k – (Optional[int]) Number of Documents to fetch before filtering.
Defaults to 20.
Returns
List of documents most similar to the query text with
L2 distance in float. Lower score represents more similarity.
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
embedding – Embedding vector to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
filter (Optional[Dict[str, Any]]) – Filter by metadata. Defaults to None.
fetch_k – (Optional[int]) Number of Documents to fetch before filtering.
Defaults to 20.
**kwargs – kwargs to be passed to similarity search. Can include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of documents most similar to the query text and L2 distance
in float for each. Lower score represents more similarity. | [
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
5428,
320,
15669,
58,
13755,
17752,
11,
610,
30716,
1389,
12619,
555,
11408,
13,
37090,
311,
2290,
627,
9838,
4803,
1389,
320,
15669,
19155,
2526,
5742,
315,
45890,
311,
7963,
1603,
30770,
627,
16672,
311,
220,
508,
627,
16851,
198,
861,
315,
9477,
1455,
4528,
311,
279,
3319,
1495,
449,
198,
43,
17,
6138,
304,
2273,
13,
28636,
5573,
11105,
810,
38723,
627,
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
4141,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
95711,
1389,
38168,
7113,
4724,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
5428,
320,
15669,
58,
13755,
17752,
11,
5884,
30716,
1389,
12619,
555,
11408,
13,
37090,
311,
2290,
627,
9838,
4803,
1389,
320,
15669,
19155,
2526,
5742,
315,
45890,
311,
7963,
1603,
30770,
627,
16672,
311,
220,
508,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
3053,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
9477,
1455,
4528,
311,
279,
3319,
1495,
323,
445,
17,
6138,
198,
258,
2273,
369,
1855,
13,
28636,
5573,
11105,
810,
38723,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html |
c6ff6ca1b0be-0 | langchain.vectorstores.vectara.VectaraRetriever¶
class langchain.vectorstores.vectara.VectaraRetriever(*, vectorstore: Vectara, search_type: str = 'similarity', search_kwargs: dict = None)[source]¶
Bases: VectorStoreRetriever
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param search_kwargs: dict [Optional]¶
Search params.
k: Number of Documents to return. Defaults to 5.
lambda_val: lexical match parameter for hybrid search.
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.vectara.com/docs/search-apis/sql/filter-overview
for more details.
n_sentence_context: number of sentences before/after the matching segment to add
param search_type: str = 'similarity'¶
param vectorstore: Vectara [Required]¶
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Add documents to vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Add documents to vectorstore.
add_texts(texts: List[str], metadatas: Optional[List[dict]] = None) → None[source]¶
Add text to the Vectara vectorstore.
Parameters
texts (List[str]) – The text
metadatas (List[dict]) – Metadata dicts, must line up with existing store
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents relevant to a query. | [
5317,
8995,
48203,
44569,
3211,
440,
5169,
5168,
440,
5169,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
48203,
44569,
3211,
440,
5169,
5168,
440,
5169,
12289,
462,
2099,
4163,
11,
4724,
4412,
25,
91256,
5169,
11,
2778,
1857,
25,
610,
284,
364,
15124,
49325,
518,
2778,
37335,
25,
6587,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
12289,
462,
2099,
198,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
2778,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
6014,
3712,
627,
74,
25,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
20,
627,
13231,
6320,
25,
78686,
2489,
5852,
369,
26038,
2778,
627,
5428,
25,
10685,
315,
5811,
1161,
8,
311,
4141,
389,
11408,
13,
1789,
3187,
264,
198,
5428,
649,
387,
1054,
5349,
49759,
871,
220,
18,
13,
15,
323,
961,
8178,
284,
3451,
451,
84,
529,
863,
92,
1518,
198,
2485,
1129,
14452,
3211,
440,
5169,
916,
27057,
24042,
12,
14041,
60782,
64624,
29352,
1068,
198,
2000,
810,
3649,
627,
77,
49432,
8634,
25,
1396,
315,
23719,
1603,
14,
10924,
279,
12864,
10449,
311,
923,
198,
913,
2778,
1857,
25,
610,
284,
364,
15124,
49325,
6,
55609,
198,
913,
4724,
4412,
25,
91256,
5169,
510,
8327,
60,
55609,
198,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
2261,
9477,
311,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
2261,
9477,
311,
4724,
4412,
627,
723,
80746,
7383,
82,
25,
1796,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
8,
11651,
2290,
76747,
60,
55609,
198,
2261,
1495,
311,
279,
91256,
5169,
4724,
4412,
627,
9905,
198,
87042,
320,
861,
17752,
2526,
1389,
578,
1495,
198,
4150,
329,
19907,
320,
861,
58,
8644,
2526,
1389,
34689,
98699,
11,
2011,
1584,
709,
449,
6484,
3637,
198,
7847,
264,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
c6ff6ca1b0be-1 | Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
get_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
validator validate_search_type » all fields¶
Validate search type.
allowed_search_types: ClassVar[Collection[str]] = ('similarity', 'similarity_score_threshold', 'mmr')¶
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
88765,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
16503,
9788,
10947,
1857,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
2778,
955,
627,
21642,
10947,
9962,
25,
3308,
4050,
58,
6618,
17752,
5163,
284,
4417,
15124,
49325,
518,
364,
15124,
49325,
10622,
22616,
518,
364,
3906,
81,
873,
55609,
198,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.vectara.VectaraRetriever.html |
911901074805-0 | langchain.vectorstores.sklearn.SKLearnVectorStoreException¶
class langchain.vectorstores.sklearn.SKLearnVectorStoreException[source]¶
Bases: RuntimeError
Exception raised by SKLearnVectorStore.
add_note()¶
Exception.add_note(note) –
add a note to the exception
with_traceback()¶
Exception.with_traceback(tb) –
set self.__traceback__ to tb and return self.
args¶ | [
5317,
8995,
48203,
44569,
40554,
12964,
92029,
24762,
3866,
6221,
1378,
55609,
198,
1058,
8859,
8995,
48203,
44569,
40554,
12964,
92029,
24762,
3866,
6221,
1378,
76747,
60,
55609,
198,
33,
2315,
25,
45643,
198,
1378,
9408,
555,
12343,
24762,
3866,
6221,
627,
723,
28306,
368,
55609,
198,
1378,
1388,
28306,
45151,
8,
1389,
198,
723,
264,
5296,
311,
279,
4788,
198,
4291,
24489,
1445,
368,
55609,
198,
1378,
18662,
24489,
1445,
62514,
8,
1389,
198,
751,
659,
4952,
15417,
1445,
565,
311,
16767,
323,
471,
659,
627,
2164,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.SKLearnVectorStoreException.html |
3a0ff8d4b745-0 | langchain.vectorstores.starrocks.debug_output¶
langchain.vectorstores.starrocks.debug_output(s: Any) → None[source]¶
Print a debug message if DEBUG is True.
:param s: The message to print | [
5317,
8995,
48203,
44569,
53682,
299,
14895,
8042,
7800,
55609,
198,
5317,
8995,
48203,
44569,
53682,
299,
14895,
8042,
7800,
1161,
25,
5884,
8,
11651,
2290,
76747,
60,
55609,
198,
9171,
264,
7542,
1984,
422,
12946,
374,
3082,
627,
68416,
274,
25,
578,
1984,
311,
1194
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.starrocks.debug_output.html |
513aa0af8490-0 | langchain.vectorstores.zilliz.Zilliz¶
class langchain.vectorstores.zilliz.Zilliz(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[dict[str, Any]] = None, consistency_level: str = 'Session', index_params: Optional[dict] = None, search_params: Optional[dict] = None, drop_old: Optional[bool] = False)[source]¶
Bases: Milvus
Initialize wrapper around the milvus vector database.
In order to use this you need to have pymilvus installed and a
running Milvus/Zilliz Cloud instance.
See the following documentation for how to run a Milvus instance:
https://milvus.io/docs/install_standalone-docker.md
If looking for a hosted Milvus, take a looka this documentation:
https://zilliz.com/cloud
IF USING L2/IP metric IT IS HIGHLY SUGGESTED TO NORMALIZE YOUR DATA.
Parameters
embedding_function (Embeddings) – Function used to embed the text.
collection_name (str) – Which Milvus collection to use. Defaults to
“LangChainCollection”.
connection_args (Optional[dict[str, any]]) – The connection args used for
this class comes in the form of a dict, here are a few of the options:
address (str): The actual address of Milvus
instance. Example address: “localhost:19530”
uri (str): The uri of Milvus instance. Example uri:”http://randomwebsite:19530”,
“tcp:foobarsite:19530”,
“https://ok.s3.south.com:19530”. | [
5317,
8995,
48203,
44569,
4025,
484,
450,
13784,
484,
450,
55609,
198,
1058,
8859,
8995,
48203,
44569,
4025,
484,
450,
13784,
484,
450,
50825,
7113,
9353,
25,
38168,
25624,
11,
4526,
1292,
25,
610,
284,
364,
27317,
19368,
6618,
518,
3717,
8550,
25,
12536,
58,
8644,
17752,
11,
5884,
5163,
284,
2290,
11,
29237,
8438,
25,
610,
284,
364,
5396,
518,
1963,
6887,
25,
12536,
58,
8644,
60,
284,
2290,
11,
2778,
6887,
25,
12536,
58,
8644,
60,
284,
2290,
11,
6068,
21792,
25,
12536,
58,
2707,
60,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
10357,
85,
355,
198,
10130,
13564,
2212,
279,
7625,
85,
355,
4724,
4729,
627,
644,
2015,
311,
1005,
420,
499,
1205,
311,
617,
46860,
321,
85,
355,
10487,
323,
264,
198,
28272,
10357,
85,
355,
73060,
484,
450,
15161,
2937,
627,
10031,
279,
2768,
9904,
369,
1268,
311,
1629,
264,
10357,
85,
355,
2937,
512,
2485,
1129,
73370,
85,
355,
4340,
27057,
58051,
1284,
85212,
1773,
13973,
22030,
198,
2746,
3411,
369,
264,
21685,
10357,
85,
355,
11,
1935,
264,
1427,
64,
420,
9904,
512,
2485,
1129,
89,
484,
450,
916,
58900,
198,
2843,
63151,
445,
17,
85538,
18767,
8871,
3507,
38717,
9109,
328,
3014,
82857,
1507,
5257,
53531,
3362,
21592,
14444,
627,
9905,
198,
95711,
9353,
320,
26566,
25624,
8,
1389,
5830,
1511,
311,
11840,
279,
1495,
627,
13727,
1292,
320,
496,
8,
1389,
16299,
10357,
85,
355,
4526,
311,
1005,
13,
37090,
311,
198,
2118,
27317,
19368,
6618,
863,
627,
7898,
8550,
320,
15669,
58,
8644,
17752,
11,
904,
30716,
1389,
578,
3717,
2897,
1511,
369,
198,
576,
538,
4131,
304,
279,
1376,
315,
264,
6587,
11,
1618,
527,
264,
2478,
315,
279,
2671,
512,
5102,
320,
496,
1680,
578,
5150,
2686,
315,
10357,
85,
355,
198,
4956,
13,
13688,
2686,
25,
1054,
8465,
25,
6280,
966,
89874,
6198,
320,
496,
1680,
578,
13371,
315,
10357,
85,
355,
2937,
13,
13688,
13371,
25,
863,
1277,
1129,
11719,
20050,
25,
6280,
966,
863,
345,
2118,
28260,
25,
831,
677,
1590,
635,
25,
6280,
966,
863,
345,
2118,
2485,
1129,
564,
516,
18,
516,
2969,
916,
25,
6280,
966,
11453
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-1 | “https://ok.s3.south.com:19530”.
host (str): The host of Milvus instance. Default at “localhost”,PyMilvus will fill in the default host if only port is provided.
port (str/int): The port of Milvus instance. Default at 19530, PyMilvuswill fill in the default port if only host is provided.
user (str): Use which user to connect to Milvus instance. If user andpassword are provided, we will add related header in every RPC call.
password (str): Required when user is provided. The passwordcorresponding to the user.
secure (bool): Default is false. If set to true, tls will be enabled.
client_key_path (str): If use tls two-way authentication, need to
write the client.key path.
client_pem_path (str): If use tls two-way authentication, need towrite the client.pem path.
ca_pem_path (str): If use tls two-way authentication, need to writethe ca.pem path.
server_pem_path (str): If use tls one-way authentication, need towrite the server.pem path.
server_name (str): If use tls, need to write the common name.
consistency_level (str) – The consistency level to use for a collection.
Defaults to “Session”.
index_params (Optional[dict]) – Which index params to use. Defaults to
HNSW/AUTOINDEX depending on service.
search_params (Optional[dict]) – Which search params to use. Defaults to
default of index.
drop_old (Optional[bool]) – Whether to drop the current collection. Defaults
to False.
The connection args used for this class comes in the form of a dict,
here are a few of the options: | [
2118,
2485,
1129,
564,
516,
18,
516,
2969,
916,
25,
6280,
966,
863,
627,
3875,
320,
496,
1680,
578,
3552,
315,
10357,
85,
355,
2937,
13,
8058,
520,
1054,
8465,
9520,
14149,
60332,
85,
355,
690,
5266,
304,
279,
1670,
3552,
422,
1193,
2700,
374,
3984,
627,
403,
320,
496,
32214,
1680,
578,
2700,
315,
10357,
85,
355,
2937,
13,
8058,
520,
220,
6280,
966,
11,
5468,
60332,
85,
355,
14724,
5266,
304,
279,
1670,
2700,
422,
1193,
3552,
374,
3984,
627,
882,
320,
496,
1680,
5560,
902,
1217,
311,
4667,
311,
10357,
85,
355,
2937,
13,
1442,
1217,
323,
3918,
527,
3984,
11,
584,
690,
923,
5552,
4342,
304,
1475,
35108,
1650,
627,
3918,
320,
496,
1680,
12948,
994,
1217,
374,
3984,
13,
578,
3636,
6133,
6961,
287,
311,
279,
1217,
627,
26189,
320,
2707,
1680,
8058,
374,
905,
13,
1442,
743,
311,
837,
11,
56126,
690,
387,
9147,
627,
3045,
3173,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
198,
5040,
279,
3016,
4840,
1853,
627,
3045,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
5040,
279,
3016,
50473,
1853,
627,
936,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
2155,
19030,
2211,
50473,
1853,
627,
4120,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
832,
27896,
17066,
11,
1205,
311,
5040,
279,
3622,
50473,
1853,
627,
4120,
1292,
320,
496,
1680,
1442,
1005,
56126,
11,
1205,
311,
3350,
279,
4279,
836,
627,
6387,
48194,
8438,
320,
496,
8,
1389,
578,
29237,
2237,
311,
1005,
369,
264,
4526,
627,
16672,
311,
1054,
5396,
863,
627,
1275,
6887,
320,
15669,
58,
8644,
2526,
1389,
16299,
1963,
3712,
311,
1005,
13,
37090,
311,
198,
39,
2507,
54,
10576,
15773,
45431,
11911,
389,
2532,
627,
1874,
6887,
320,
15669,
58,
8644,
2526,
1389,
16299,
2778,
3712,
311,
1005,
13,
37090,
311,
198,
2309,
315,
1963,
627,
6861,
21792,
320,
15669,
58,
2707,
2526,
1389,
13440,
311,
6068,
279,
1510,
4526,
13,
37090,
198,
998,
3641,
627,
791,
3717,
2897,
1511,
369,
420,
538,
4131,
304,
279,
1376,
315,
264,
6587,
345,
6881,
527,
264,
2478,
315,
279,
2671,
25
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-2 | here are a few of the options:
address (str): The actual address of Milvusinstance. Example address: “localhost:19530”
uri (str): The uri of Milvus instance. Example uri:“http://randomwebsite:19530”,
“tcp:foobarsite:19530”,
“https://ok.s3.south.com:19530”.
host (str): The host of Milvus instance. Default at “localhost”,PyMilvus will fill in the default host if only port is provided.
port (str/int): The port of Milvus instance. Default at 19530, PyMilvuswill fill in the default port if only host is provided.
user (str): Use which user to connect to Milvus instance. If user andpassword are provided, we will add related header in every RPC call.
password (str): Required when user is provided. The passwordcorresponding to the user.
secure (bool): Default is false. If set to true, tls will be enabled.
client_key_path (str): If use tls two-way authentication, need to
write the client.key path.
client_pem_path (str): If use tls two-way authentication, need towrite the client.pem path.
ca_pem_path (str): If use tls two-way authentication, need to writethe ca.pem path.
server_pem_path (str): If use tls one-way authentication, need towrite the server.pem path.
server_name (str): If use tls, need to write the common name.
Methods
__init__(embedding_function[, ...])
Initialize wrapper around the milvus vector database.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas]) | [
6881,
527,
264,
2478,
315,
279,
2671,
512,
5102,
320,
496,
1680,
578,
5150,
2686,
315,
10357,
85,
355,
4956,
13,
13688,
2686,
25,
1054,
8465,
25,
6280,
966,
89874,
6198,
320,
496,
1680,
578,
13371,
315,
10357,
85,
355,
2937,
13,
13688,
13371,
25,
2118,
1277,
1129,
11719,
20050,
25,
6280,
966,
863,
345,
2118,
28260,
25,
831,
677,
1590,
635,
25,
6280,
966,
863,
345,
2118,
2485,
1129,
564,
516,
18,
516,
2969,
916,
25,
6280,
966,
863,
627,
3875,
320,
496,
1680,
578,
3552,
315,
10357,
85,
355,
2937,
13,
8058,
520,
1054,
8465,
9520,
14149,
60332,
85,
355,
690,
5266,
304,
279,
1670,
3552,
422,
1193,
2700,
374,
3984,
627,
403,
320,
496,
32214,
1680,
578,
2700,
315,
10357,
85,
355,
2937,
13,
8058,
520,
220,
6280,
966,
11,
5468,
60332,
85,
355,
14724,
5266,
304,
279,
1670,
2700,
422,
1193,
3552,
374,
3984,
627,
882,
320,
496,
1680,
5560,
902,
1217,
311,
4667,
311,
10357,
85,
355,
2937,
13,
1442,
1217,
323,
3918,
527,
3984,
11,
584,
690,
923,
5552,
4342,
304,
1475,
35108,
1650,
627,
3918,
320,
496,
1680,
12948,
994,
1217,
374,
3984,
13,
578,
3636,
6133,
6961,
287,
311,
279,
1217,
627,
26189,
320,
2707,
1680,
8058,
374,
905,
13,
1442,
743,
311,
837,
11,
56126,
690,
387,
9147,
627,
3045,
3173,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
198,
5040,
279,
3016,
4840,
1853,
627,
3045,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
5040,
279,
3016,
50473,
1853,
627,
936,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
1403,
27896,
17066,
11,
1205,
311,
2155,
19030,
2211,
50473,
1853,
627,
4120,
623,
336,
2703,
320,
496,
1680,
1442,
1005,
56126,
832,
27896,
17066,
11,
1205,
311,
5040,
279,
3622,
50473,
1853,
627,
4120,
1292,
320,
496,
1680,
1442,
1005,
56126,
11,
1205,
311,
3350,
279,
4279,
836,
627,
18337,
198,
565,
2381,
3889,
95711,
9353,
38372,
4194,
1131,
2608,
10130,
13564,
2212,
279,
7625,
85,
355,
4724,
4729,
627,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2526
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-3 | aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, timeout, ...])
Insert text data into Milvus.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Create a Zilliz collection, indexes it with HNSW, and insert data.
max_marginal_relevance_search(query[, k, ...])
Perform a search and return results that are reordered by MMR.
max_marginal_relevance_search_by_vector(...)
Perform a search and return results that are reordered by MMR.
search(query, search_type, **kwargs) | [
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
11,
4194,
14482,
11,
4194,
1131,
2608,
14099,
1495,
828,
1139,
10357,
85,
355,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
11,
4194,
1131,
2608,
4110,
264,
1901,
484,
450,
4526,
11,
25998,
433,
449,
473,
2507,
54,
11,
323,
5774,
828,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
48051,
264,
2778,
323,
471,
3135,
430,
527,
50132,
555,
386,
18953,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
48051,
264,
2778,
323,
471,
3135,
430,
527,
50132,
555,
386,
18953,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
8
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-4 | search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, param, expr, ...])
Perform a similarity search against the query string.
similarity_search_by_vector(embedding[, k, ...])
Perform a similarity search against the query string.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Perform a search on a query string and return results with score.
similarity_search_with_score_by_vector(embedding)
Perform a search on a query string and return results with score.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, timeout: Optional[int] = None, batch_size: int = 1000, **kwargs: Any) → List[str]¶ | [
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
11,
4194,
913,
11,
4194,
9600,
11,
4194,
1131,
2608,
48051,
264,
38723,
2778,
2403,
279,
3319,
925,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
11,
4194,
1131,
2608,
48051,
264,
38723,
2778,
2403,
279,
3319,
925,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
48051,
264,
2778,
389,
264,
3319,
925,
323,
471,
3135,
449,
5573,
627,
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
340,
48051,
264,
2778,
389,
264,
3319,
925,
323,
471,
3135,
449,
5573,
627,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
7309,
2424,
25,
528,
284,
220,
1041,
15,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-5 | Insert text data into Milvus.
Inserting data when the collection has not be made yet will result
in creating a new Collection. The data of the first entity decides
the schema of the new collection, the dim is extracted from the first
embedding and the columns are decided by the first metadata dict.
Metada keys will need to be present for all inserted values. At
the moment there is no None equivalent in Milvus.
Parameters
texts (Iterable[str]) – The texts to embed, it is assumed
that they all fit in memory.
metadatas (Optional[List[dict]]) – Metadata dicts attached to each of
the texts. Defaults to None.
timeout (Optional[int]) – Timeout for each batch insert. Defaults
to None.
batch_size (int, optional) – Batch size to use for insertion.
Defaults to 1000.
Raises
MilvusException – Failure to add texts
Returns
The resulting keys for each inserted element.
Return type
List[str]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance. | [
14099,
1495,
828,
1139,
10357,
85,
355,
627,
14099,
287,
828,
994,
279,
4526,
706,
539,
387,
1903,
3686,
690,
1121,
198,
258,
6968,
264,
502,
11348,
13,
578,
828,
315,
279,
1176,
5502,
28727,
198,
1820,
11036,
315,
279,
502,
4526,
11,
279,
5213,
374,
28532,
505,
279,
1176,
198,
95711,
323,
279,
8310,
527,
6773,
555,
279,
1176,
11408,
6587,
627,
35773,
2649,
7039,
690,
1205,
311,
387,
3118,
369,
682,
22306,
2819,
13,
2468,
198,
1820,
4545,
1070,
374,
912,
2290,
13890,
304,
10357,
85,
355,
627,
9905,
198,
87042,
320,
51735,
17752,
2526,
1389,
578,
22755,
311,
11840,
11,
433,
374,
19655,
198,
9210,
814,
682,
5052,
304,
5044,
627,
4150,
329,
19907,
320,
15669,
53094,
58,
8644,
30716,
1389,
34689,
98699,
12673,
311,
1855,
315,
198,
1820,
22755,
13,
37090,
311,
2290,
627,
14482,
320,
15669,
19155,
2526,
1389,
40480,
369,
1855,
7309,
5774,
13,
37090,
198,
998,
2290,
627,
14377,
2424,
320,
396,
11,
10309,
8,
1389,
35004,
1404,
311,
1005,
369,
37027,
627,
16672,
311,
220,
1041,
15,
627,
36120,
198,
60332,
85,
355,
1378,
1389,
33360,
311,
923,
22755,
198,
16851,
198,
791,
13239,
7039,
369,
1855,
22306,
2449,
627,
5715,
955,
198,
861,
17752,
933,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-6 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-7 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: 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] = None, drop_old: bool = False, **kwargs: Any) → Zilliz[source]¶
Create a Zilliz collection, indexes it with HNSW, and insert data.
Parameters
texts (List[str]) – Text data.
embedding (Embeddings) – Embedding function.
metadatas (Optional[List[dict]]) – Metadata for each text if it exists.
Defaults to None.
collection_name (str, optional) – Collection name to use. Defaults to
“LangChainCollection”.
connection_args (dict[str, Any], optional) – Connection args to use. Defaults
to DEFAULT_MILVUS_CONNECTION.
consistency_level (str, optional) – Which consistency level to use. Defaults
to “Session”.
index_params (Optional[dict], optional) – Which index_params to use.
Defaults to None.
search_params (Optional[dict], optional) – Which search params to use.
Defaults to None.
drop_old (Optional[bool], optional) – Whether to drop the collection with
that name if it exists. Defaults to False.
Returns
Zilliz Vector Store
Return type
Zilliz | [
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
4526,
1292,
25,
610,
284,
364,
27317,
19368,
6618,
518,
3717,
8550,
25,
6587,
17752,
11,
5884,
60,
284,
16857,
29237,
8438,
25,
610,
284,
364,
5396,
518,
1963,
6887,
25,
12536,
58,
8644,
60,
284,
2290,
11,
2778,
6887,
25,
12536,
58,
8644,
60,
284,
2290,
11,
6068,
21792,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
1901,
484,
450,
76747,
60,
55609,
198,
4110,
264,
1901,
484,
450,
4526,
11,
25998,
433,
449,
473,
2507,
54,
11,
323,
5774,
828,
627,
9905,
198,
87042,
320,
861,
17752,
2526,
1389,
2991,
828,
627,
95711,
320,
26566,
25624,
8,
1389,
38168,
7113,
734,
627,
4150,
329,
19907,
320,
15669,
53094,
58,
8644,
30716,
1389,
34689,
369,
1855,
1495,
422,
433,
6866,
627,
16672,
311,
2290,
627,
13727,
1292,
320,
496,
11,
10309,
8,
1389,
11348,
836,
311,
1005,
13,
37090,
311,
198,
2118,
27317,
19368,
6618,
863,
627,
7898,
8550,
320,
8644,
17752,
11,
5884,
1145,
10309,
8,
1389,
11278,
2897,
311,
1005,
13,
37090,
198,
998,
12221,
1267,
1750,
53,
2078,
41808,
627,
6387,
48194,
8438,
320,
496,
11,
10309,
8,
1389,
16299,
29237,
2237,
311,
1005,
13,
37090,
198,
998,
1054,
5396,
863,
627,
1275,
6887,
320,
15669,
58,
8644,
1145,
10309,
8,
1389,
16299,
1963,
6887,
311,
1005,
627,
16672,
311,
2290,
627,
1874,
6887,
320,
15669,
58,
8644,
1145,
10309,
8,
1389,
16299,
2778,
3712,
311,
1005,
627,
16672,
311,
2290,
627,
6861,
21792,
320,
15669,
58,
2707,
1145,
10309,
8,
1389,
13440,
311,
6068,
279,
4526,
449,
198,
9210,
836,
422,
433,
6866,
13,
37090,
311,
3641,
627,
16851,
198,
57,
484,
450,
4290,
9307,
198,
5715,
955,
198,
57,
484,
450
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-8 | Returns
Zilliz Vector Store
Return type
Zilliz
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a search and return results that are reordered by MMR.
Parameters
query (str) – The text being searched.
k (int, optional) – How many results to give. Defaults to 4.
fetch_k (int, optional) – Total results to select k from.
Defaults to 20.
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
param (dict, optional) – The search params for the specified index.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Document results for search.
Return type
List[Document]
max_marginal_relevance_search_by_vector(embedding: list[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a search and return results that are reordered by MMR.
Parameters
embedding (str) – The embedding vector being searched. | [
16851,
198,
57,
484,
450,
4290,
9307,
198,
5715,
955,
198,
57,
484,
450,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
48051,
264,
2778,
323,
471,
3135,
430,
527,
50132,
555,
386,
18953,
627,
9905,
198,
1663,
320,
496,
8,
1389,
578,
1495,
1694,
27600,
627,
74,
320,
396,
11,
10309,
8,
1389,
2650,
1690,
3135,
311,
3041,
13,
37090,
311,
220,
19,
627,
9838,
4803,
320,
396,
11,
10309,
8,
1389,
10884,
3135,
311,
3373,
597,
505,
627,
16672,
311,
220,
508,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
198,
913,
320,
8644,
11,
10309,
8,
1389,
578,
2778,
3712,
369,
279,
5300,
1963,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851,
198,
7676,
3135,
369,
2778,
627,
5715,
955,
198,
861,
58,
7676,
933,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1160,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
48051,
264,
2778,
323,
471,
3135,
430,
527,
50132,
555,
386,
18953,
627,
9905,
198,
95711,
320,
496,
8,
1389,
578,
40188,
4724,
1694,
27600,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-9 | Parameters
embedding (str) – The embedding vector being searched.
k (int, optional) – How many results to give. Defaults to 4.
fetch_k (int, optional) – Total results to select k from.
Defaults to 20.
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
param (dict, optional) – The search params for the specified index.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Document results for search.
Return type
List[Document]
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a similarity search against the query string.
Parameters
query (str) – The text to search.
k (int, optional) – How many results to return. Defaults to 4.
param (dict, optional) – The search params for the index type.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Document results for search.
Return type
List[Document] | [
9905,
198,
95711,
320,
496,
8,
1389,
578,
40188,
4724,
1694,
27600,
627,
74,
320,
396,
11,
10309,
8,
1389,
2650,
1690,
3135,
311,
3041,
13,
37090,
311,
220,
19,
627,
9838,
4803,
320,
396,
11,
10309,
8,
1389,
10884,
3135,
311,
3373,
597,
505,
627,
16672,
311,
220,
508,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
198,
913,
320,
8644,
11,
10309,
8,
1389,
578,
2778,
3712,
369,
279,
5300,
1963,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851,
198,
7676,
3135,
369,
2778,
627,
5715,
955,
198,
861,
58,
7676,
933,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
48051,
264,
38723,
2778,
2403,
279,
3319,
925,
627,
9905,
198,
1663,
320,
496,
8,
1389,
578,
1495,
311,
2778,
627,
74,
320,
396,
11,
10309,
8,
1389,
2650,
1690,
3135,
311,
471,
13,
37090,
311,
220,
19,
627,
913,
320,
8644,
11,
10309,
8,
1389,
578,
2778,
3712,
369,
279,
1963,
955,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851,
198,
7676,
3135,
369,
2778,
627,
5715,
955,
198,
861,
58,
7676,
60
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-10 | Returns
Document results for search.
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Document]¶
Perform a similarity search against the query string.
Parameters
embedding (List[float]) – The embedding vector to search.
k (int, optional) – How many results to return. Defaults to 4.
param (dict, optional) – The search params for the index type.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Document results for search.
Return type
List[Document]
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Tuple[Document, float]]¶ | [
16851,
198,
7676,
3135,
369,
2778,
627,
5715,
955,
198,
861,
58,
7676,
933,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
48051,
264,
38723,
2778,
2403,
279,
3319,
925,
627,
9905,
198,
95711,
320,
861,
96481,
2526,
1389,
578,
40188,
4724,
311,
2778,
627,
74,
320,
396,
11,
10309,
8,
1389,
2650,
1690,
3135,
311,
471,
13,
37090,
311,
220,
19,
627,
913,
320,
8644,
11,
10309,
8,
1389,
578,
2778,
3712,
369,
279,
1963,
955,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851,
198,
7676,
3135,
369,
2778,
627,
5715,
955,
198,
861,
58,
7676,
933,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-11 | Perform a search on a query string and return results with score.
For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
query (str) – The text being searched.
k (int, optional) – The amount of results ot return. Defaults to 4.
param (dict) – The search params for the specified index.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Return type
List[float], List[Tuple[Document, any, any]]
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, param: Optional[dict] = None, expr: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any) → List[Tuple[Document, float]]¶
Perform a search on a query string and return results with score.
For more information about the search parameters, take a look at the pymilvus
documentation found here:
https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md
Parameters
embedding (List[float]) – The embedding vector being searched.
k (int, optional) – The amount of results ot return. Defaults to 4.
param (dict) – The search params for the specified index.
Defaults to None.
expr (str, optional) – Filtering expression. Defaults to None.
timeout (int, optional) – How long to wait before timeout error.
Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns | [
48051,
264,
2778,
389,
264,
3319,
925,
323,
471,
3135,
449,
5573,
627,
2520,
810,
2038,
922,
279,
2778,
5137,
11,
1935,
264,
1427,
520,
279,
46860,
321,
85,
355,
198,
77403,
1766,
1618,
512,
2485,
1129,
73370,
85,
355,
4340,
10729,
73723,
4420,
1631,
321,
85,
355,
5574,
17,
13,
17,
13,
21,
14,
6618,
24042,
1020,
2329,
198,
9905,
198,
1663,
320,
496,
8,
1389,
578,
1495,
1694,
27600,
627,
74,
320,
396,
11,
10309,
8,
1389,
578,
3392,
315,
3135,
14479,
471,
13,
37090,
311,
220,
19,
627,
913,
320,
8644,
8,
1389,
578,
2778,
3712,
369,
279,
5300,
1963,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
5715,
955,
198,
861,
96481,
1145,
1796,
20961,
6189,
58,
7676,
11,
904,
11,
904,
14623,
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
1719,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15522,
25,
12536,
17752,
60,
284,
2290,
11,
9829,
25,
12536,
19155,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
48051,
264,
2778,
389,
264,
3319,
925,
323,
471,
3135,
449,
5573,
627,
2520,
810,
2038,
922,
279,
2778,
5137,
11,
1935,
264,
1427,
520,
279,
46860,
321,
85,
355,
198,
77403,
1766,
1618,
512,
2485,
1129,
73370,
85,
355,
4340,
10729,
73723,
4420,
1631,
321,
85,
355,
5574,
17,
13,
17,
13,
21,
14,
6618,
24042,
1020,
2329,
198,
9905,
198,
95711,
320,
861,
96481,
2526,
1389,
578,
40188,
4724,
1694,
27600,
627,
74,
320,
396,
11,
10309,
8,
1389,
578,
3392,
315,
3135,
14479,
471,
13,
37090,
311,
220,
19,
627,
913,
320,
8644,
8,
1389,
578,
2778,
3712,
369,
279,
5300,
1963,
627,
16672,
311,
2290,
627,
9600,
320,
496,
11,
10309,
8,
1389,
82631,
7645,
13,
37090,
311,
2290,
627,
14482,
320,
396,
11,
10309,
8,
1389,
2650,
1317,
311,
3868,
1603,
9829,
1493,
627,
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
513aa0af8490-12 | Defaults to None.
kwargs – Collection.search() keyword arguments.
Returns
Result doc and score.
Return type
List[Tuple[Document, float]] | [
16672,
311,
2290,
627,
9872,
1389,
11348,
9472,
368,
16570,
6105,
627,
16851,
198,
2122,
4733,
323,
5573,
627,
5715,
955,
198,
861,
20961,
6189,
58,
7676,
11,
2273,
5163
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.zilliz.Zilliz.html |
5bfc42a67b62-0 | langchain.vectorstores.azuresearch.AzureSearch¶
class langchain.vectorstores.azuresearch.AzureSearch(azure_search_endpoint: str, azure_search_key: str, index_name: str, embedding_function: Callable, search_type: str = 'hybrid', semantic_configuration_name: Optional[str] = None, semantic_query_language: str = 'en-us', **kwargs: Any)[source]¶
Bases: VectorStore
Initialize with necessary components.
Methods
__init__(azure_search_endpoint, ...[, ...])
Initialize with necessary components.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas])
Add texts data to an existing index.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query. | [
5317,
8995,
48203,
44569,
71340,
1874,
58927,
6014,
55609,
198,
1058,
8859,
8995,
48203,
44569,
71340,
1874,
58927,
6014,
7,
40595,
10947,
37799,
25,
610,
11,
77630,
10947,
3173,
25,
610,
11,
1963,
1292,
25,
610,
11,
40188,
9353,
25,
54223,
11,
2778,
1857,
25,
610,
284,
364,
8671,
16621,
518,
42833,
36826,
1292,
25,
12536,
17752,
60,
284,
2290,
11,
42833,
5857,
30121,
25,
610,
284,
364,
268,
26766,
518,
3146,
9872,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
10130,
449,
5995,
6956,
627,
18337,
198,
565,
2381,
3889,
40595,
10947,
37799,
11,
4194,
1131,
38372,
4194,
1131,
2608,
10130,
449,
5995,
6956,
627,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
2261,
22755,
828,
311,
459,
6484,
1963,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-1 | asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Return VectorStore initialized from texts and embeddings.
hybrid_search(query[, k])
Returns the most similar indexed documents to the query text.
hybrid_search_with_score(query[, k, filters])
Return docs most similar to query with an hybrid query.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
semantic_hybrid_search(query[, k])
Returns the most similar indexed documents to the query text.
semantic_hybrid_search_with_score(query[, ...])
Return docs most similar to query with an hybrid query.
similarity_search(query[, k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
vector_search(query[, k])
Returns the most similar indexed documents to the query text.
vector_search_with_score(query[, k, filters])
Return docs most similar to query.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters | [
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
11,
4194,
1131,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
8671,
16621,
10947,
10974,
38372,
4194,
74,
2608,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
8671,
16621,
10947,
6753,
10622,
10974,
38372,
4194,
74,
11,
4194,
25630,
2608,
5715,
27437,
1455,
4528,
311,
3319,
449,
459,
26038,
3319,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
48958,
1552,
94490,
10947,
10974,
38372,
4194,
74,
2608,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
48958,
1552,
94490,
10947,
6753,
10622,
10974,
38372,
4194,
1131,
2608,
5715,
27437,
1455,
4528,
311,
3319,
449,
459,
26038,
3319,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
3295,
10947,
10974,
38372,
4194,
74,
2608,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
3295,
10947,
6753,
10622,
10974,
38372,
4194,
74,
11,
4194,
25630,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-2 | Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Add texts data to an existing index.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance. | [
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
2261,
22755,
828,
311,
459,
6484,
1963,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-3 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-4 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, azure_search_endpoint: str = '', azure_search_key: str = '', index_name: str = 'langchain-index', **kwargs: Any) → AzureSearch[source]¶
Return VectorStore initialized from texts and embeddings.
hybrid_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Returns the most similar indexed documents to the query text.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to return. Default is 4.
Returns
A list of documents that are most similar to the query text.
Return type
List[Document]
hybrid_search_with_score(query: str, k: int = 4, filters: Optional[str] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to query with an hybrid query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query and score for each
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm. | [
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
77630,
10947,
37799,
25,
610,
284,
9158,
77630,
10947,
3173,
25,
610,
284,
9158,
1963,
1292,
25,
610,
284,
364,
5317,
8995,
22214,
518,
3146,
9872,
25,
5884,
8,
11651,
35219,
6014,
76747,
60,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
8671,
16621,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
9905,
198,
1663,
320,
496,
8,
1389,
578,
3319,
1495,
369,
902,
311,
1505,
4528,
9477,
627,
74,
320,
396,
8,
1389,
578,
1396,
315,
9477,
311,
471,
13,
8058,
374,
220,
19,
627,
16851,
198,
32,
1160,
315,
9477,
430,
527,
1455,
4528,
311,
279,
3319,
1495,
627,
5715,
955,
198,
861,
58,
7676,
933,
8671,
16621,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
13711,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
449,
459,
26038,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
323,
5573,
369,
1855,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-5 | 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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
semantic_hybrid_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Returns the most similar indexed documents to the query text.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to return. Default is 4.
Returns
A list of documents that are most similar to the query text.
Return type
List[Document] | [
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
48958,
1552,
94490,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
9905,
198,
1663,
320,
496,
8,
1389,
578,
3319,
1495,
369,
902,
311,
1505,
4528,
9477,
627,
74,
320,
396,
8,
1389,
578,
1396,
315,
9477,
311,
471,
13,
8058,
374,
220,
19,
627,
16851,
198,
32,
1160,
315,
9477,
430,
527,
1455,
4528,
311,
279,
3319,
1495,
627,
5715,
955,
198,
861,
58,
7676,
60
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-6 | Return type
List[Document]
semantic_hybrid_search_with_score(query: str, k: int = 4, filters: Optional[str] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to query with an hybrid query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query and score for each
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
vector_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Returns the most similar indexed documents to the query text.
Parameters | [
5715,
955,
198,
861,
58,
7676,
933,
48958,
1552,
94490,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
13711,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
449,
459,
26038,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
323,
5573,
369,
1855,
198,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
3295,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
9905
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
5bfc42a67b62-7 | Returns the most similar indexed documents to the query text.
Parameters
query (str) – The query text for which to find similar documents.
k (int) – The number of documents to return. Default is 4.
Returns
A list of documents that are most similar to the query text.
Return type
List[Document]
vector_search_with_score(query: str, k: int = 4, filters: Optional[str] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query and score for each | [
16851,
279,
1455,
4528,
31681,
9477,
311,
279,
3319,
1495,
627,
9905,
198,
1663,
320,
496,
8,
1389,
578,
3319,
1495,
369,
902,
311,
1505,
4528,
9477,
627,
74,
320,
396,
8,
1389,
578,
1396,
315,
9477,
311,
471,
13,
8058,
374,
220,
19,
627,
16851,
198,
32,
1160,
315,
9477,
430,
527,
1455,
4528,
311,
279,
3319,
1495,
627,
5715,
955,
198,
861,
58,
7676,
933,
3295,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
13711,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
323,
5573,
369,
1855
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html |
123e8e4eb860-0 | langchain.vectorstores.myscale.MyScaleSettings¶
class langchain.vectorstores.myscale.MyScaleSettings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, host: str = 'localhost', port: int = 8443, username: Optional[str] = None, password: Optional[str] = None, index_type: str = 'IVFFLAT', index_param: Optional[Dict[str, str]] = None, column_map: Dict[str, str] = {'id': 'id', 'metadata': 'metadata', 'text': 'text', 'vector': 'vector'}, database: str = 'default', table: str = 'langchain', metric: str = 'cosine')[source]¶
Bases: BaseSettings
MyScale Client Configuration
Attribute:
myscale_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
myscale_port (int) : URL port to connect with HTTP. Defaults to 8443.
username (str) : Username to login. Defaults to None.
password (str) : Password to login. Defaults to None.
index_type (str): index type string.
index_param (dict): index build parameter.
database (str) : Database name to find the table. Defaults to ‘default’.
table (str) : Table name to operate on.
Defaults to ‘vector_table’.
metric (str)Metric to compute distance,supported are (‘l2’, ‘cosine’, ‘ip’). Defaults to ‘cosine’. | [
5317,
8995,
48203,
44569,
749,
84009,
28152,
7092,
6214,
55609,
198,
1058,
8859,
8995,
48203,
44569,
749,
84009,
28152,
7092,
6214,
2551,
3239,
2517,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
11,
1796,
58,
33758,
17752,
11,
8092,
13246,
21128,
25645,
58,
33758,
17752,
11,
8092,
13246,
1145,
2564,
5163,
60,
284,
3942,
1735,
1665,
20150,
721,
3239,
2517,
38713,
25,
12536,
17752,
60,
284,
2290,
11,
721,
3239,
67379,
18519,
18170,
25,
12536,
17752,
60,
284,
2290,
11,
721,
325,
53810,
4432,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
5163,
284,
2290,
11,
12039,
3552,
25,
610,
284,
364,
8465,
518,
2700,
25,
528,
284,
220,
24344,
18,
11,
6059,
25,
12536,
17752,
60,
284,
2290,
11,
3636,
25,
12536,
17752,
60,
284,
2290,
11,
1963,
1857,
25,
610,
284,
364,
3166,
1785,
79998,
518,
1963,
4182,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
11,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
518,
364,
1342,
1232,
364,
1342,
518,
364,
3295,
1232,
364,
3295,
25762,
4729,
25,
610,
284,
364,
2309,
518,
2007,
25,
610,
284,
364,
5317,
8995,
518,
18767,
25,
610,
284,
364,
9594,
483,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
6214,
198,
5159,
7092,
8589,
12499,
198,
3994,
512,
8373,
2296,
13144,
320,
496,
8,
2127,
5665,
311,
4667,
311,
3092,
7092,
19713,
13578,
82,
311,
3451,
8465,
529,
627,
8373,
2296,
8889,
320,
396,
8,
551,
5665,
2700,
311,
4667,
449,
10339,
13,
37090,
311,
220,
24344,
18,
627,
5223,
320,
496,
8,
551,
30645,
311,
5982,
13,
37090,
311,
2290,
627,
3918,
320,
496,
8,
551,
12642,
311,
5982,
13,
37090,
311,
2290,
627,
1275,
1857,
320,
496,
1680,
1963,
955,
925,
627,
1275,
4182,
320,
8644,
1680,
1963,
1977,
5852,
627,
12494,
320,
496,
8,
551,
10199,
836,
311,
1505,
279,
2007,
13,
37090,
311,
3451,
2309,
529,
627,
2048,
320,
496,
8,
551,
6771,
836,
311,
14816,
389,
627,
16672,
311,
3451,
3295,
5350,
529,
627,
16282,
320,
496,
8,
55410,
311,
12849,
6138,
10900,
12796,
527,
320,
14336,
75,
17,
20182,
3451,
9594,
483,
20182,
3451,
575,
529,
570,
37090,
311,
3451,
9594,
483,
24535
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
123e8e4eb860-1 | column_map (Dict)Column type map to project column name onto langchainsemantics. Must have keys: text, id, vector,
must be same size to number of columns. For example:
.. code-block:: python
{‘id’: ‘text_id’,
‘vector’: ‘text_embedding’,
‘text’: ‘text_plain’,
‘metadata’: ‘metadata_dictionary_in_json’,
}
Defaults to identity map.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param column_map: Dict[str, str] = {'id': 'id', 'metadata': 'metadata', 'text': 'text', 'vector': 'vector'}¶
param database: str = 'default'¶
param host: str = 'localhost'¶
param index_param: Optional[Dict[str, str]] = None¶
param index_type: str = 'IVFFLAT'¶
param metric: str = 'cosine'¶
param password: Optional[str] = None¶
param port: int = 8443¶
param table: str = 'langchain'¶
param username: Optional[str] = None¶
model Config[source]¶
Bases: object
env_file = '.env'¶
env_file_encoding = 'utf-8'¶
env_prefix = 'myscale_'¶ | [
6361,
5489,
320,
13755,
8,
3006,
955,
2472,
311,
2447,
3330,
836,
8800,
8859,
8995,
7143,
37333,
13,
15832,
617,
7039,
25,
1495,
11,
887,
11,
4724,
345,
25849,
387,
1890,
1404,
311,
1396,
315,
8310,
13,
1789,
3187,
512,
497,
2082,
9612,
487,
10344,
198,
90,
14336,
307,
89213,
3451,
1342,
851,
529,
345,
14336,
3295,
89213,
3451,
1342,
52602,
529,
345,
14336,
1342,
89213,
3451,
1342,
42115,
529,
345,
14336,
18103,
89213,
3451,
18103,
43705,
1265,
9643,
529,
345,
534,
16672,
311,
9764,
2472,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
518,
364,
1342,
1232,
364,
1342,
518,
364,
3295,
1232,
364,
3295,
8439,
55609,
198,
913,
4729,
25,
610,
284,
364,
2309,
6,
55609,
198,
913,
3552,
25,
610,
284,
364,
8465,
6,
55609,
198,
913,
1963,
4182,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
55609,
198,
913,
1963,
1857,
25,
610,
284,
364,
3166,
1785,
79998,
6,
55609,
198,
913,
18767,
25,
610,
284,
364,
9594,
483,
6,
55609,
198,
913,
3636,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
2700,
25,
528,
284,
220,
24344,
18,
55609,
198,
913,
2007,
25,
610,
284,
364,
5317,
8995,
6,
55609,
198,
913,
6059,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
3239,
2517,
284,
6389,
3239,
6,
55609,
198,
3239,
2517,
38713,
284,
364,
4867,
12,
23,
6,
55609,
198,
3239,
14301,
284,
364,
8373,
2296,
19893,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.myscale.MyScaleSettings.html |
616d335039a6-0 | langchain.vectorstores.redis.RedisVectorStoreRetriever¶
class langchain.vectorstores.redis.RedisVectorStoreRetriever(*, vectorstore: Redis, search_type: str = 'similarity', search_kwargs: dict = None, k: int = 4, score_threshold: float = 0.4)[source]¶
Bases: VectorStoreRetriever, BaseModel
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param k: int = 4¶
param score_threshold: float = 0.4¶
param search_kwargs: dict [Optional]¶
param search_type: str = 'similarity'¶
param vectorstore: Redis [Required]¶
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str][source]¶
Add documents to vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str][source]¶
Add documents to vectorstore.
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
get_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
validator validate_search_type » all fields[source]¶
Validate search type. | [
5317,
8995,
48203,
44569,
50979,
83498,
3866,
6221,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
48203,
44569,
50979,
83498,
3866,
6221,
12289,
462,
2099,
4163,
11,
4724,
4412,
25,
35258,
11,
2778,
1857,
25,
610,
284,
364,
15124,
49325,
518,
2778,
37335,
25,
6587,
284,
2290,
11,
597,
25,
528,
284,
220,
19,
11,
5573,
22616,
25,
2273,
284,
220,
15,
13,
19,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
12289,
462,
2099,
11,
65705,
198,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
597,
25,
528,
284,
220,
19,
55609,
198,
913,
5573,
22616,
25,
2273,
284,
220,
15,
13,
19,
55609,
198,
913,
2778,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
913,
2778,
1857,
25,
610,
284,
364,
15124,
49325,
6,
55609,
198,
913,
4724,
4412,
25,
35258,
510,
8327,
60,
55609,
198,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
2261,
9477,
311,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
2261,
9477,
311,
4724,
4412,
627,
7847,
264,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
88765,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
16503,
9788,
10947,
1857,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
2778,
955,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.redis.RedisVectorStoreRetriever.html |
616d335039a6-1 | validator validate_search_type » all fields[source]¶
Validate search type.
allowed_search_types: ClassVar[Collection[str]] = ('similarity', 'similarity_score_threshold', 'mmr')¶
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
16503,
9788,
10947,
1857,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
2778,
955,
627,
21642,
10947,
9962,
25,
3308,
4050,
58,
6618,
17752,
5163,
284,
4417,
15124,
49325,
518,
364,
15124,
49325,
10622,
22616,
518,
364,
3906,
81,
873,
55609,
198,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.redis.RedisVectorStoreRetriever.html |
d2de3b6f73b3-0 | langchain.vectorstores.sklearn.JsonSerializer¶
class langchain.vectorstores.sklearn.JsonSerializer(persist_path: str)[source]¶
Bases: BaseSerializer
Serializes data in json using the json package from python standard library.
Methods
__init__(persist_path)
extension()
The file extension suggested by this serializer (without dot).
load()
Loads the data from the persist_path
save(data)
Saves the data to the persist_path
classmethod extension() → str[source]¶
The file extension suggested by this serializer (without dot).
load() → Any[source]¶
Loads the data from the persist_path
save(data: Any) → None[source]¶
Saves the data to the persist_path | [
5317,
8995,
48203,
44569,
40554,
12964,
13874,
14233,
55609,
198,
1058,
8859,
8995,
48203,
44569,
40554,
12964,
13874,
14233,
1319,
5082,
2703,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
14233,
198,
6040,
4861,
828,
304,
3024,
1701,
279,
3024,
6462,
505,
10344,
5410,
6875,
627,
18337,
198,
565,
2381,
3889,
40926,
2703,
340,
12709,
746,
791,
1052,
9070,
12090,
555,
420,
22508,
320,
30096,
13046,
4390,
1096,
746,
79617,
279,
828,
505,
279,
23135,
2703,
198,
6766,
2657,
340,
50,
4798,
279,
828,
311,
279,
23135,
2703,
198,
27853,
9070,
368,
11651,
610,
76747,
60,
55609,
198,
791,
1052,
9070,
12090,
555,
420,
22508,
320,
30096,
13046,
4390,
1096,
368,
11651,
5884,
76747,
60,
55609,
198,
79617,
279,
828,
505,
279,
23135,
2703,
198,
6766,
2657,
25,
5884,
8,
11651,
2290,
76747,
60,
55609,
198,
50,
4798,
279,
828,
311,
279,
23135,
2703
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.sklearn.JsonSerializer.html |
182cf68d78fb-0 | langchain.vectorstores.clickhouse.ClickhouseSettings¶
class langchain.vectorstores.clickhouse.ClickhouseSettings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, host: str = 'localhost', port: int = 8123, username: Optional[str] = None, password: Optional[str] = None, index_type: str = 'annoy', index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100], index_query_params: Dict[str, str] = {}, column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'}, database: str = 'default', table: str = 'langchain', metric: str = 'angular')[source]¶
Bases: BaseSettings
ClickHouse Client Configuration
Attribute:
clickhouse_host (str)An URL to connect to MyScale backend.Defaults to ‘localhost’.
clickhouse_port (int) : URL port to connect with HTTP. Defaults to 8443.
username (str) : Username to login. Defaults to None.
password (str) : Password to login. Defaults to None.
index_type (str): index type string.
index_param (list): index build parameter.
index_query_params(dict): index query parameters.
database (str) : Database name to find the table. Defaults to ‘default’.
table (str) : Table name to operate on.
Defaults to ‘vector_table’. | [
5317,
8995,
48203,
44569,
14798,
7830,
11566,
7830,
6214,
55609,
198,
1058,
8859,
8995,
48203,
44569,
14798,
7830,
11566,
7830,
6214,
2551,
3239,
2517,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
11,
1796,
58,
33758,
17752,
11,
8092,
13246,
21128,
25645,
58,
33758,
17752,
11,
8092,
13246,
1145,
2564,
5163,
60,
284,
3942,
1735,
1665,
20150,
721,
3239,
2517,
38713,
25,
12536,
17752,
60,
284,
2290,
11,
721,
3239,
67379,
18519,
18170,
25,
12536,
17752,
60,
284,
2290,
11,
721,
325,
53810,
4432,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
5163,
284,
2290,
11,
12039,
3552,
25,
610,
284,
364,
8465,
518,
2700,
25,
528,
284,
220,
19270,
18,
11,
6059,
25,
12536,
17752,
60,
284,
2290,
11,
3636,
25,
12536,
17752,
60,
284,
2290,
11,
1963,
1857,
25,
610,
284,
364,
1036,
2303,
518,
1963,
4182,
25,
12536,
58,
33758,
53094,
11,
30226,
5163,
284,
4482,
6,
43,
17,
15121,
23612,
220,
1041,
1145,
1963,
5857,
6887,
25,
30226,
17752,
11,
610,
60,
284,
16857,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
6190,
1232,
364,
6190,
518,
364,
95711,
1232,
364,
95711,
518,
364,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
518,
364,
17566,
1232,
364,
17566,
25762,
4729,
25,
610,
284,
364,
2309,
518,
2007,
25,
610,
284,
364,
5317,
8995,
518,
18767,
25,
610,
284,
364,
4328,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
6214,
198,
2677,
29707,
8589,
12499,
198,
3994,
512,
3763,
7830,
13144,
320,
496,
8,
2127,
5665,
311,
4667,
311,
3092,
7092,
19713,
13578,
82,
311,
3451,
8465,
529,
627,
3763,
7830,
8889,
320,
396,
8,
551,
5665,
2700,
311,
4667,
449,
10339,
13,
37090,
311,
220,
24344,
18,
627,
5223,
320,
496,
8,
551,
30645,
311,
5982,
13,
37090,
311,
2290,
627,
3918,
320,
496,
8,
551,
12642,
311,
5982,
13,
37090,
311,
2290,
627,
1275,
1857,
320,
496,
1680,
1963,
955,
925,
627,
1275,
4182,
320,
1638,
1680,
1963,
1977,
5852,
627,
1275,
5857,
6887,
32378,
1680,
1963,
3319,
5137,
627,
12494,
320,
496,
8,
551,
10199,
836,
311,
1505,
279,
2007,
13,
37090,
311,
3451,
2309,
529,
627,
2048,
320,
496,
8,
551,
6771,
836,
311,
14816,
389,
627,
16672,
311,
3451,
3295,
5350,
24535
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
182cf68d78fb-1 | table (str) : Table name to operate on.
Defaults to ‘vector_table’.
metric (str)Metric to compute distance,supported are (‘angular’, ‘euclidean’, ‘manhattan’, ‘hamming’,
‘dot’). Defaults to ‘angular’.
https://github.com/spotify/annoy/blob/main/src/annoymodule.cc#L149-L169
column_map (Dict)Column type map to project column name onto langchainsemantics. Must have keys: text, id, vector,
must be same size to number of columns. For example:
.. code-block:: python
{‘id’: ‘text_id’,
‘uuid’: ‘global_unique_id’
‘embedding’: ‘text_embedding’,
‘document’: ‘text_plain’,
‘metadata’: ‘metadata_dictionary_in_json’,
}
Defaults to identity map.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'}¶
param database: str = 'default'¶
param host: str = 'localhost'¶
param index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100]¶
param index_query_params: Dict[str, str] = {}¶
param index_type: str = 'annoy'¶
param metric: str = 'angular'¶
param password: Optional[str] = None¶
param port: int = 8123¶
param table: str = 'langchain'¶
param username: Optional[str] = None¶
model Config[source]¶
Bases: object
env_file = '.env'¶ | [
2048,
320,
496,
8,
551,
6771,
836,
311,
14816,
389,
627,
16672,
311,
3451,
3295,
5350,
529,
627,
16282,
320,
496,
8,
55410,
311,
12849,
6138,
10900,
12796,
527,
320,
14336,
4328,
20182,
3451,
20732,
51178,
20182,
3451,
1543,
26405,
20182,
3451,
5721,
5424,
529,
345,
14336,
16510,
529,
570,
37090,
311,
3451,
4328,
529,
627,
2485,
1129,
5316,
916,
14,
88488,
14,
1036,
2303,
35927,
15711,
13743,
14,
22278,
1631,
1793,
28912,
2,
43,
10161,
8288,
11739,
198,
6361,
5489,
320,
13755,
8,
3006,
955,
2472,
311,
2447,
3330,
836,
8800,
8859,
8995,
7143,
37333,
13,
15832,
617,
7039,
25,
1495,
11,
887,
11,
4724,
345,
25849,
387,
1890,
1404,
311,
1396,
315,
8310,
13,
1789,
3187,
512,
497,
2082,
9612,
487,
10344,
198,
90,
14336,
307,
89213,
3451,
1342,
851,
529,
345,
14336,
17566,
89213,
3451,
9951,
21912,
851,
529,
198,
14336,
95711,
89213,
3451,
1342,
52602,
529,
345,
14336,
6190,
89213,
3451,
1342,
42115,
529,
345,
14336,
18103,
89213,
3451,
18103,
43705,
1265,
9643,
529,
345,
534,
16672,
311,
9764,
2472,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
3330,
5489,
25,
30226,
17752,
11,
610,
60,
284,
5473,
6190,
1232,
364,
6190,
518,
364,
95711,
1232,
364,
95711,
518,
364,
307,
1232,
364,
307,
518,
364,
18103,
1232,
364,
18103,
518,
364,
17566,
1232,
364,
17566,
8439,
55609,
198,
913,
4729,
25,
610,
284,
364,
2309,
6,
55609,
198,
913,
3552,
25,
610,
284,
364,
8465,
6,
55609,
198,
913,
1963,
4182,
25,
12536,
58,
33758,
53094,
11,
30226,
5163,
284,
4482,
6,
43,
17,
15121,
23612,
220,
1041,
60,
55609,
198,
913,
1963,
5857,
6887,
25,
30226,
17752,
11,
610,
60,
284,
4792,
55609,
198,
913,
1963,
1857,
25,
610,
284,
364,
1036,
2303,
6,
55609,
198,
913,
18767,
25,
610,
284,
364,
4328,
6,
55609,
198,
913,
3636,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
2700,
25,
528,
284,
220,
19270,
18,
55609,
198,
913,
2007,
25,
610,
284,
364,
5317,
8995,
6,
55609,
198,
913,
6059,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
3239,
2517,
284,
6389,
3239,
6,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
182cf68d78fb-2 | model Config[source]¶
Bases: object
env_file = '.env'¶
env_file_encoding = 'utf-8'¶
env_prefix = 'clickhouse_'¶ | [
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
3239,
2517,
284,
6389,
3239,
6,
55609,
198,
3239,
2517,
38713,
284,
364,
4867,
12,
23,
6,
55609,
198,
3239,
14301,
284,
364,
3763,
7830,
19893,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.ClickhouseSettings.html |
86ce5a50c6fd-0 | langchain.vectorstores.starrocks.has_mul_sub_str¶
langchain.vectorstores.starrocks.has_mul_sub_str(s: str, *args: Any) → bool[source]¶
Check if a string has multiple substrings.
:param s: The string to check
:param *args: The substrings to check for in the string
Returns
True if all substrings are present in the string, False otherwise
Return type
bool | [
5317,
8995,
48203,
44569,
53682,
299,
14895,
7001,
25989,
5341,
2966,
55609,
198,
5317,
8995,
48203,
44569,
53682,
299,
14895,
7001,
25989,
5341,
2966,
1161,
25,
610,
11,
353,
2164,
25,
5884,
8,
11651,
1845,
76747,
60,
55609,
198,
4061,
422,
264,
925,
706,
5361,
16146,
826,
627,
68416,
274,
25,
578,
925,
311,
1817,
198,
68416,
353,
2164,
25,
578,
16146,
826,
311,
1817,
369,
304,
279,
925,
198,
16851,
198,
2575,
422,
682,
16146,
826,
527,
3118,
304,
279,
925,
11,
3641,
6062,
198,
5715,
955,
198,
2707
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.starrocks.has_mul_sub_str.html |
e93efd9d561f-0 | langchain.vectorstores.weaviate.Weaviate¶
class langchain.vectorstores.weaviate.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[[float], float]] = <function _default_score_normalizer>, by_text: bool = True)[source]¶
Bases: VectorStore
Wrapper around Weaviate vector database.
To use, you should have the weaviate-client python package installed.
Example
import weaviate
from langchain.vectorstores import Weaviate
client = weaviate.Client(url=os.environ["WEAVIATE_URL"], ...)
weaviate = Weaviate(client, index_name, text_key)
Initialize with Weaviate client.
Methods
__init__(client, index_name, text_key[, ...])
Initialize with Weaviate client.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas])
Upload texts with metadata (properties) to Weaviate.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...]) | [
5317,
8995,
48203,
44569,
31339,
6321,
349,
23210,
6321,
349,
55609,
198,
1058,
8859,
8995,
48203,
44569,
31339,
6321,
349,
23210,
6321,
349,
13097,
25,
4056,
90902,
13614,
11,
1963,
1292,
25,
610,
11,
1495,
3173,
25,
610,
11,
40188,
25,
4056,
90902,
37464,
58,
93,
5317,
8995,
41541,
25624,
9105,
58955,
25624,
60,
284,
2290,
11,
8365,
25,
4056,
90902,
37464,
58,
93,
90902,
5937,
17752,
5163,
284,
2290,
11,
41961,
10622,
15604,
25,
4056,
90902,
37464,
58,
93,
90902,
28115,
481,
15873,
3733,
1145,
2273,
5163,
284,
366,
1723,
721,
2309,
10622,
14300,
3213,
8226,
555,
4424,
25,
1845,
284,
3082,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
11803,
2212,
1226,
6321,
349,
4724,
4729,
627,
1271,
1005,
11,
499,
1288,
617,
279,
584,
6321,
349,
31111,
10344,
6462,
10487,
627,
13617,
198,
475,
584,
6321,
349,
198,
1527,
8859,
8995,
48203,
44569,
1179,
1226,
6321,
349,
198,
3045,
284,
584,
6321,
349,
11978,
6659,
51964,
24656,
1204,
12739,
8253,
40,
2390,
8159,
8073,
53368,
906,
6321,
349,
284,
1226,
6321,
349,
13097,
11,
1963,
1292,
11,
1495,
3173,
340,
10130,
449,
1226,
6321,
349,
3016,
627,
18337,
198,
565,
2381,
3889,
3045,
11,
4194,
1275,
1292,
11,
4194,
1342,
3173,
38372,
4194,
1131,
2608,
10130,
449,
1226,
6321,
349,
3016,
627,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
14165,
22755,
449,
11408,
320,
13495,
8,
311,
1226,
6321,
349,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2526
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-1 | amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector IDs.
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas])
Construct Weaviate wrapper from raw documents.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Return docs most similar to query.
similarity_search_by_text(query[, k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k])
Look up similar documents by embedding vector in Weaviate.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k])
Return list of documents most similar to the query text and cosine distance in float for each. | [
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
29460,
627,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
29568,
1226,
6321,
349,
13564,
505,
7257,
9477,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
4424,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
10596,
709,
4528,
9477,
555,
40188,
4724,
304,
1226,
6321,
349,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
38372,
4194,
74,
2608,
5715,
1160,
315,
9477,
1455,
4528,
311,
279,
3319,
1495,
323,
76359,
6138,
304,
2273,
369,
1855,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-2 | Return list of documents most similar to the query text and cosine distance in float for each.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Upload texts with metadata (properties) to Weaviate.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶ | [
5715,
1160,
315,
9477,
1455,
4528,
311,
279,
3319,
1495,
323,
76359,
6138,
304,
2273,
369,
1855,
627,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
14165,
22755,
449,
11408,
320,
13495,
8,
311,
1226,
6321,
349,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-3 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → None[source]¶
Delete by vector IDs.
Parameters
ids – List of ids to delete.
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → Weaviate[source]¶
Construct Weaviate wrapper from raw documents.
This is a user-friendly interface that:
Embeds documents.
Creates a new index for the embeddings in the Weaviate instance. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
2290,
76747,
60,
55609,
198,
6571,
555,
4724,
29460,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1226,
6321,
349,
76747,
60,
55609,
198,
29568,
1226,
6321,
349,
13564,
505,
7257,
9477,
627,
2028,
374,
264,
1217,
22658,
3834,
430,
512,
26566,
82,
9477,
627,
55968,
264,
502,
1963,
369,
279,
71647,
304,
279,
1226,
6321,
349,
2937,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-4 | Embeds documents.
Creates a new index for the embeddings in the Weaviate instance.
Adds the documents to the newly created Weaviate index.
This is intended to be a quick way to get started.
Example
from langchain.vectorstores.weaviate import Weaviate
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
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[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to. | [
26566,
82,
9477,
627,
55968,
264,
502,
1963,
369,
279,
71647,
304,
279,
1226,
6321,
349,
2937,
627,
73211,
279,
9477,
311,
279,
13945,
3549,
1226,
6321,
349,
1963,
627,
2028,
374,
10825,
311,
387,
264,
4062,
1648,
311,
636,
3940,
627,
13617,
198,
1527,
8859,
8995,
48203,
44569,
31339,
6321,
349,
1179,
1226,
6321,
349,
198,
1527,
8859,
8995,
41541,
25624,
1179,
5377,
15836,
26566,
25624,
198,
12529,
25624,
284,
5377,
15836,
26566,
25624,
746,
906,
6321,
349,
284,
1226,
6321,
349,
6521,
80746,
1021,
262,
22755,
345,
262,
71647,
345,
262,
584,
6321,
349,
2975,
429,
1277,
1129,
8465,
25,
11770,
15,
702,
340,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-5 | among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query.
similarity_search_by_text(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document][source]¶
Look up similar documents by embedding vector in Weaviate.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters | [
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
627,
15124,
49325,
10947,
3795,
4424,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
10596,
709,
4528,
9477,
555,
40188,
4724,
304,
1226,
6321,
349,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
e93efd9d561f-6 | 0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Return list of documents most similar to the query
text and cosine distance in float for each.
Lower score represents more similarity. | [
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
1160,
315,
9477,
1455,
4528,
311,
279,
3319,
198,
1342,
323,
76359,
6138,
304,
2273,
369,
1855,
627,
9230,
5573,
11105,
810,
38723,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.weaviate.Weaviate.html |
687707ff151e-0 | langchain.vectorstores.starrocks.get_named_result¶
langchain.vectorstores.starrocks.get_named_result(connection: Any, query: str) → List[dict[str, Any]][source]¶
Get a named result from a query.
:param connection: The connection to the database
:param query: The query to execute
Returns
The result of the query
Return type
List[dict[str, Any]] | [
5317,
8995,
48203,
44569,
53682,
299,
14895,
673,
72934,
5400,
55609,
198,
5317,
8995,
48203,
44569,
53682,
299,
14895,
673,
72934,
5400,
25119,
25,
5884,
11,
3319,
25,
610,
8,
11651,
1796,
58,
8644,
17752,
11,
5884,
28819,
2484,
60,
55609,
198,
1991,
264,
7086,
1121,
505,
264,
3319,
627,
68416,
3717,
25,
578,
3717,
311,
279,
4729,
198,
68416,
3319,
25,
578,
3319,
311,
9203,
198,
16851,
198,
791,
1121,
315,
279,
3319,
198,
5715,
955,
198,
861,
58,
8644,
17752,
11,
5884,
5163
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.starrocks.get_named_result.html |
c633099ad496-0 | langchain.vectorstores.clickhouse.Clickhouse¶
class langchain.vectorstores.clickhouse.Clickhouse(embedding: Embeddings, config: Optional[ClickhouseSettings] = None, **kwargs: Any)[source]¶
Bases: VectorStore
Wrapper around ClickHouse vector database
You need a clickhouse-connect python package, and a valid account
to connect to ClickHouse.
ClickHouse can not only search with simple vector indexes,
it also supports complex query with multiple conditions,
constraints and even sub-queries.
For more information, please visit[ClickHouse official site](https://clickhouse.com/clickhouse)
ClickHouse Wrapper to LangChain
embedding_function (Embeddings):
config (ClickHouseSettings): Configuration to ClickHouse Client
Other keyword arguments will pass into
[clickhouse-connect](https://docs.clickhouse.com/)
Methods
__init__(embedding[, config])
ClickHouse Wrapper to LangChain
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, batch_size, ids])
Insert more texts through the embeddings and add to the VectorStore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...) | [
5317,
8995,
48203,
44569,
14798,
7830,
11566,
7830,
55609,
198,
1058,
8859,
8995,
48203,
44569,
14798,
7830,
11566,
7830,
50825,
7113,
25,
38168,
25624,
11,
2242,
25,
12536,
58,
2677,
7830,
6214,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
11803,
2212,
9369,
29707,
4724,
4729,
198,
2675,
1205,
264,
4299,
7830,
86570,
10344,
6462,
11,
323,
264,
2764,
2759,
198,
998,
4667,
311,
9369,
29707,
627,
2677,
29707,
649,
539,
1193,
2778,
449,
4382,
4724,
25998,
345,
275,
1101,
11815,
6485,
3319,
449,
5361,
4787,
345,
66412,
323,
1524,
1207,
12,
43935,
627,
2520,
810,
2038,
11,
4587,
4034,
58,
2677,
29707,
4033,
2816,
9725,
2485,
1129,
3763,
7830,
916,
2971,
1228,
7830,
340,
2677,
29707,
36588,
311,
23272,
19368,
198,
95711,
9353,
320,
26566,
25624,
997,
1710,
320,
2677,
29707,
6214,
1680,
12499,
311,
9369,
29707,
8589,
198,
11663,
16570,
6105,
690,
1522,
1139,
198,
58,
3763,
7830,
86570,
9725,
2485,
1129,
14452,
14798,
7830,
916,
54660,
18337,
198,
565,
2381,
3889,
95711,
38372,
4194,
1710,
2608,
2677,
29707,
36588,
311,
23272,
19368,
198,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
11,
4194,
14377,
2424,
11,
4194,
3447,
2608,
14099,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4290,
6221,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
48627
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-1 | amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
delete(ids)
Delete by vector ID.
drop()
Helper function: Drop data
escape_str(value)
from_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
from_texts(texts, embedding[, metadatas, ...])
Create ClickHouse wrapper with existing texts
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k, where_str])
Perform a similarity search with ClickHouse
similarity_search_by_vector(embedding[, k, ...])
Perform a similarity search with ClickHouse by vectors
similarity_search_with_relevance_scores(query)
Perform a similarity search with ClickHouse
Attributes
metadata_column
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str] | [
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
6861,
746,
5628,
734,
25,
16110,
828,
198,
13295,
2966,
3764,
340,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
11,
4194,
1131,
2608,
4110,
9369,
29707,
13564,
449,
6484,
22755,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
11,
4194,
2940,
2966,
2608,
48051,
264,
38723,
2778,
449,
9369,
29707,
198,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
11,
4194,
1131,
2608,
48051,
264,
38723,
2778,
449,
9369,
29707,
555,
23728,
198,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
48051,
264,
38723,
2778,
449,
9369,
29707,
198,
10738,
198,
18103,
8918,
198,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
60
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-2 | 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]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, batch_size: int = 32, ids: Optional[Iterable[str]] = None, **kwargs: Any) → List[str][source]¶
Insert more texts through the embeddings and add to the VectorStore.
Parameters
texts – Iterable of strings to add to the VectorStore.
ids – Optional list of ids to associate with the texts.
batch_size – Batch size of insertion
metadata – Optional column data to be inserted
Returns
List of ids from adding the texts into the VectorStore.
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶ | [
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
7309,
2424,
25,
528,
284,
220,
843,
11,
14483,
25,
12536,
58,
51735,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
14099,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4290,
6221,
627,
9905,
198,
87042,
1389,
39116,
315,
9246,
311,
923,
311,
279,
4290,
6221,
627,
3447,
1389,
12536,
1160,
315,
14483,
311,
22712,
449,
279,
22755,
627,
14377,
2424,
1389,
35004,
1404,
315,
37027,
198,
18103,
1389,
12536,
3330,
828,
311,
387,
22306,
198,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
4290,
6221,
627,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-3 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
drop() → None[source]¶
Helper function: Drop data
escape_str(value: str) → str[source]¶
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
6861,
368,
11651,
2290,
76747,
60,
55609,
198,
5628,
734,
25,
16110,
828,
198,
13295,
2966,
3764,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-4 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[Dict[Any, Any]]] = None, config: Optional[ClickhouseSettings] = None, text_ids: Optional[Iterable[str]] = None, batch_size: int = 32, **kwargs: Any) → Clickhouse[source]¶
Create ClickHouse wrapper with existing texts
Parameters
embedding_function (Embeddings) – Function to extract text embedding
texts (Iterable[str]) – List or tuple of strings to be added
config (ClickHouseSettings, Optional) – ClickHouse configuration
text_ids (Optional[Iterable], optional) – IDs for the texts.
Defaults to None.
batch_size (int, optional) – Batchsize when transmitting data to ClickHouse.
Defaults to 32.
metadata (List[dict], optional) – metadata to texts. Defaults to None.
into (Other keyword arguments will pass) – [clickhouse-connect](https://clickhouse.com/docs/en/integrations/python#clickhouse-connect-driver-api)
Returns
ClickHouse Index
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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 | [
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
13755,
71401,
11,
5884,
5163,
60,
284,
2290,
11,
2242,
25,
12536,
58,
2677,
7830,
6214,
60,
284,
2290,
11,
1495,
8237,
25,
12536,
58,
51735,
17752,
5163,
284,
2290,
11,
7309,
2424,
25,
528,
284,
220,
843,
11,
3146,
9872,
25,
5884,
8,
11651,
9369,
7830,
76747,
60,
55609,
198,
4110,
9369,
29707,
13564,
449,
6484,
22755,
198,
9905,
198,
95711,
9353,
320,
26566,
25624,
8,
1389,
5830,
311,
8819,
1495,
40188,
198,
87042,
320,
51735,
17752,
2526,
1389,
1796,
477,
14743,
315,
9246,
311,
387,
3779,
198,
1710,
320,
2677,
29707,
6214,
11,
12536,
8,
1389,
9369,
29707,
6683,
198,
1342,
8237,
320,
15669,
58,
51735,
1145,
10309,
8,
1389,
29460,
369,
279,
22755,
627,
16672,
311,
2290,
627,
14377,
2424,
320,
396,
11,
10309,
8,
1389,
35004,
2190,
994,
78768,
828,
311,
9369,
29707,
627,
16672,
311,
220,
843,
627,
18103,
320,
861,
58,
8644,
1145,
10309,
8,
1389,
11408,
311,
22755,
13,
37090,
311,
2290,
627,
18614,
320,
11663,
16570,
6105,
690,
1522,
8,
1389,
510,
3763,
7830,
86570,
9725,
2485,
1129,
3763,
7830,
916,
27057,
13920,
32214,
14750,
811,
24147,
2,
3763,
7830,
86570,
77590,
24851,
340,
16851,
198,
2677,
29707,
8167,
198,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
1663,
1389,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-5 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
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.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search with ClickHouse
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – where condition string.
Defaults to None.
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection. When dealing with metadatas, remember to
use {self.metadata_column}.attribute instead of attribute
alone. The default name for it is metadata.
Returns
List of Documents
Return type
List[Document] | [
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
9838,
4803,
1389,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
13231,
27386,
1389,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16672,
311,
220,
15,
13,
20,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
1405,
2966,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
48051,
264,
38723,
2778,
449,
9369,
29707,
198,
9905,
198,
1663,
320,
496,
8,
1389,
3319,
925,
198,
74,
320,
396,
11,
10309,
8,
1389,
7054,
735,
19228,
311,
17622,
13,
37090,
311,
220,
19,
627,
2940,
2966,
320,
15669,
17752,
1145,
10309,
8,
1389,
1405,
3044,
925,
627,
16672,
311,
2290,
627,
28892,
1389,
5321,
656,
539,
1095,
842,
8865,
311,
5266,
420,
323,
2744,
387,
8010,
198,
1073,
8029,
26127,
13,
3277,
14892,
449,
2322,
329,
19907,
11,
6227,
311,
198,
817,
314,
726,
28644,
8918,
7966,
9294,
4619,
315,
7180,
198,
32676,
13,
578,
1670,
836,
369,
433,
374,
11408,
627,
16851,
198,
861,
315,
45890,
198,
5715,
955,
198,
861,
58,
7676,
60
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
c633099ad496-6 | Returns
List of Documents
Return type
List[Document]
similarity_search_by_vector(embedding: List[float], k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Perform a similarity search with ClickHouse by vectors
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – where condition string.
Defaults to None.
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection. When dealing with metadatas, remember to
use {self.metadata_column}.attribute instead of attribute
alone. The default name for it is metadata.
Returns
List of (Document, similarity)
Return type
List[Document]
similarity_search_with_relevance_scores(query: str, k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Perform a similarity search with ClickHouse
Parameters
query (str) – query string
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – where condition string.
Defaults to None.
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection. When dealing with metadatas, remember to
use {self.metadata_column}.attribute instead of attribute
alone. The default name for it is metadata.
Returns
List of documents
Return type
List[Document]
property metadata_column: str¶ | [
16851,
198,
861,
315,
45890,
198,
5715,
955,
198,
861,
58,
7676,
933,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
1405,
2966,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
48051,
264,
38723,
2778,
449,
9369,
29707,
555,
23728,
198,
9905,
198,
1663,
320,
496,
8,
1389,
3319,
925,
198,
74,
320,
396,
11,
10309,
8,
1389,
7054,
735,
19228,
311,
17622,
13,
37090,
311,
220,
19,
627,
2940,
2966,
320,
15669,
17752,
1145,
10309,
8,
1389,
1405,
3044,
925,
627,
16672,
311,
2290,
627,
28892,
1389,
5321,
656,
539,
1095,
842,
8865,
311,
5266,
420,
323,
2744,
387,
8010,
198,
1073,
8029,
26127,
13,
3277,
14892,
449,
2322,
329,
19907,
11,
6227,
311,
198,
817,
314,
726,
28644,
8918,
7966,
9294,
4619,
315,
7180,
198,
32676,
13,
578,
1670,
836,
369,
433,
374,
11408,
627,
16851,
198,
861,
315,
320,
7676,
11,
38723,
340,
5715,
955,
198,
861,
58,
7676,
933,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
1405,
2966,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
48051,
264,
38723,
2778,
449,
9369,
29707,
198,
9905,
198,
1663,
320,
496,
8,
1389,
3319,
925,
198,
74,
320,
396,
11,
10309,
8,
1389,
7054,
735,
19228,
311,
17622,
13,
37090,
311,
220,
19,
627,
2940,
2966,
320,
15669,
17752,
1145,
10309,
8,
1389,
1405,
3044,
925,
627,
16672,
311,
2290,
627,
28892,
1389,
5321,
656,
539,
1095,
842,
8865,
311,
5266,
420,
323,
2744,
387,
8010,
198,
1073,
8029,
26127,
13,
3277,
14892,
449,
2322,
329,
19907,
11,
6227,
311,
198,
817,
314,
726,
28644,
8918,
7966,
9294,
4619,
315,
7180,
198,
32676,
13,
578,
1670,
836,
369,
433,
374,
11408,
627,
16851,
198,
861,
315,
9477,
198,
5715,
955,
198,
861,
58,
7676,
933,
3784,
11408,
8918,
25,
610,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.clickhouse.Clickhouse.html |
45c08dfe9a79-0 | langchain.vectorstores.annoy.dependable_annoy_import¶
langchain.vectorstores.annoy.dependable_annoy_import() → Any[source]¶
Import annoy if available, otherwise raise error. | [
5317,
8995,
48203,
44569,
13,
1036,
2303,
60334,
481,
52970,
2303,
18941,
55609,
198,
5317,
8995,
48203,
44569,
13,
1036,
2303,
60334,
481,
52970,
2303,
18941,
368,
11651,
5884,
76747,
60,
55609,
198,
11772,
38292,
422,
2561,
11,
6062,
4933,
1493,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.annoy.dependable_annoy_import.html |
468bdf7cb93d-0 | langchain.vectorstores.cassandra.Cassandra¶
class langchain.vectorstores.cassandra.Cassandra(embedding: Embeddings, session: Session, keyspace: str, table_name: str, ttl_seconds: int | None = None)[source]¶
Bases: VectorStore
Wrapper around Cassandra embeddings platform.
There is no notion of a default table name, since each embedding
function implies its own vector dimension, which is part of the schema.
Example
from langchain.vectorstores import Cassandra
from langchain.embeddings.openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
session = ...
keyspace = 'my_keyspace'
vectorstore = Cassandra(embeddings, session, keyspace, 'my_doc_archive')
Methods
__init__(embedding, session, keyspace, ...)
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more texts through the embeddings and add to the vectorstore.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
asearch(query, search_type, **kwargs) | [
5317,
8995,
48203,
44569,
522,
71193,
732,
71193,
55609,
198,
1058,
8859,
8995,
48203,
44569,
522,
71193,
732,
71193,
50825,
7113,
25,
38168,
25624,
11,
3882,
25,
9343,
11,
7039,
1330,
25,
610,
11,
2007,
1292,
25,
610,
11,
55032,
35925,
25,
528,
765,
2290,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
4290,
6221,
198,
11803,
2212,
82342,
71647,
5452,
627,
3947,
374,
912,
23035,
315,
264,
1670,
2007,
836,
11,
2533,
1855,
40188,
198,
1723,
24897,
1202,
1866,
4724,
13167,
11,
902,
374,
961,
315,
279,
11036,
627,
13617,
198,
1527,
8859,
8995,
48203,
44569,
1179,
82342,
198,
1527,
8859,
8995,
41541,
25624,
5949,
2192,
1179,
5377,
15836,
26566,
25624,
198,
12529,
25624,
284,
5377,
15836,
26566,
25624,
746,
6045,
284,
12515,
798,
8920,
284,
364,
2465,
3173,
8920,
1270,
3295,
4412,
284,
82342,
50825,
25624,
11,
3882,
11,
7039,
1330,
11,
364,
2465,
19401,
43973,
1329,
18337,
198,
565,
2381,
3889,
95711,
11,
4194,
6045,
11,
4194,
798,
8920,
11,
4194,
32318,
64,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
11,
4194,
334,
9872,
340,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
11,
4194,
3447,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
64,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
64,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
90727,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
340,
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
8
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-1 | asearch(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs most similar to query.
clear()
Empty the collection.
delete(ids)
Delete by vector ID.
delete_by_document_id(document_id)
delete_collection()
Just an alias for clear (to better align with other VectorStore implementations).
from_documents(documents, embedding, **kwargs)
Create a Cassandra vectorstore from a document list.
from_texts(texts, embedding[, metadatas])
Create a Cassandra vectorstore from raw texts.
max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param query: Text to look up documents similar to. :param k: Number of Documents to return. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param 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. Optional.
max_marginal_relevance_search_by_vector(...) | [
521,
1132,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
300,
318,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
300,
318,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
300,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
1455,
4528,
311,
3319,
627,
7574,
746,
3606,
279,
4526,
627,
4644,
44548,
340,
6571,
555,
4724,
3110,
627,
4644,
3795,
27326,
851,
15649,
851,
340,
4644,
26071,
746,
10156,
459,
15904,
369,
2867,
320,
998,
2731,
5398,
449,
1023,
4290,
6221,
39437,
4390,
1527,
77027,
19702,
2901,
11,
4194,
95711,
11,
4194,
334,
9872,
340,
4110,
264,
82342,
4724,
4412,
505,
264,
2246,
1160,
627,
1527,
80746,
7383,
82,
11,
4194,
95711,
38372,
4194,
4150,
329,
19907,
2608,
4110,
264,
82342,
4724,
4412,
505,
7257,
22755,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
38372,
4194,
74,
11,
4194,
1131,
2608,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13,
7639,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
4315,
4183,
9477,
13,
551,
913,
3319,
25,
2991,
311,
1427,
709,
9477,
4528,
311,
13,
551,
913,
597,
25,
5742,
315,
45890,
311,
471,
13,
551,
913,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13,
551,
913,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
3909,
315,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
3909,
311,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
13,
12536,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
48627
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-2 | max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param embedding: Embedding to look up documents similar to. :param k: Number of Documents to return. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param 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.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity_search(query[, k])
Return docs most similar to query.
similarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
similarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k])
similarity_search_with_score_by_vector(embedding)
Return docs most similar to embedding vector.
similarity_search_with_score_id(query[, k])
similarity_search_with_score_id_by_vector(...)
Return docs most similar to embedding vector.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
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]¶
Run more texts through the embeddings and add to the vectorstore. | [
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
73893,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13,
7639,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
4315,
4183,
9477,
13,
551,
913,
40188,
25,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
13,
551,
913,
597,
25,
5742,
315,
45890,
311,
471,
13,
551,
913,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
13,
551,
913,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
3909,
315,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
3909,
311,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
1874,
10974,
11,
4194,
1874,
1857,
11,
4194,
334,
9872,
340,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
38372,
4194,
74,
2608,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
340,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15124,
49325,
10947,
6753,
10622,
10974,
38372,
4194,
74,
2608,
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
340,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
15124,
49325,
10947,
6753,
10622,
851,
10974,
38372,
4194,
74,
2608,
15124,
49325,
10947,
6753,
10622,
851,
3795,
12526,
73893,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
264,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
264,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-3 | Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts (Iterable[str]) – Texts to add to the vectorstore.
metadatas (Optional[List[dict]], optional) – Optional list of metadatas.
ids (Optional[List[str]], optional) – Optional list of IDs.
Returns
List of IDs of the added texts.
Return type
List[str]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶
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[Document]¶
Return docs selected using the maximal marginal relevance. | [
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
723,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
60,
55609,
198,
6869,
810,
9477,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
10490,
58,
7676,
60,
320,
51878,
8,
1389,
45890,
311,
923,
311,
279,
4724,
4412,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
4724,
4412,
627,
9905,
198,
87042,
320,
51735,
17752,
2526,
1389,
2991,
82,
311,
923,
311,
279,
4724,
4412,
627,
4150,
329,
19907,
320,
15669,
53094,
58,
8644,
21128,
10309,
8,
1389,
12536,
1160,
315,
2322,
329,
19907,
627,
3447,
320,
15669,
53094,
17752,
21128,
10309,
8,
1389,
12536,
1160,
315,
29460,
627,
16851,
198,
861,
315,
29460,
315,
279,
3779,
22755,
627,
5715,
955,
198,
861,
17752,
933,
7847,
538,
4492,
264,
1527,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
9477,
323,
71647,
627,
7847,
538,
4492,
264,
1527,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
650,
790,
55609,
198,
5715,
4290,
6221,
17719,
505,
22755,
323,
71647,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-4 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStoreRetriever¶
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
clear() → None[source]¶
Empty the collection.
delete(ids: List[str]) → Optional[bool]¶
Delete by vector ID.
Parameters
ids – List of ids to delete.
Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
delete_by_document_id(document_id: str) → None[source]¶
delete_collection() → None[source]¶
Just an alias for clear
(to better align with other VectorStore implementations).
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → CVST[source]¶
Create a Cassandra vectorstore from a document list. | [
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
7847,
1097,
710,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
300,
1311,
9104,
424,
22551,
9872,
25,
5884,
8,
11651,
4290,
6221,
12289,
462,
2099,
55609,
198,
7847,
264,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
7847,
439,
318,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7847,
439,
318,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
7847,
439,
318,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
7574,
368,
11651,
2290,
76747,
60,
55609,
198,
3606,
279,
4526,
627,
4644,
44548,
25,
1796,
17752,
2526,
11651,
12536,
58,
2707,
60,
55609,
198,
6571,
555,
4724,
3110,
627,
9905,
198,
3447,
1389,
1796,
315,
14483,
311,
3783,
627,
16851,
198,
2575,
422,
37166,
374,
6992,
345,
4139,
6062,
11,
2290,
422,
539,
11798,
627,
5715,
955,
198,
15669,
58,
2707,
933,
4644,
3795,
27326,
851,
15649,
851,
25,
610,
8,
11651,
2290,
76747,
60,
55609,
198,
4644,
26071,
368,
11651,
2290,
76747,
60,
55609,
198,
10156,
459,
15904,
369,
2867,
198,
12464,
2731,
5398,
449,
1023,
4290,
6221,
39437,
4390,
27853,
505,
77027,
19702,
2901,
25,
1796,
58,
7676,
1145,
40188,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
14499,
790,
76747,
60,
55609,
198,
4110,
264,
82342,
4724,
4412,
505,
264,
2246,
1160,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-5 | Create a Cassandra vectorstore from a document list.
No support for specifying text IDs
Returns
a Cassandra vectorstore.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → CVST[source]¶
Create a Cassandra vectorstore from raw texts.
No support for specifying text IDs
Returns
a Cassandra vectorstore.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
:param query: Text to look up documents similar to.
:param k: Number of Documents to return.
:param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param 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.
Optional.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
:param embedding: Embedding to look up documents similar to.
:param k: Number of Documents to return.
:param fetch_k: Number of Documents to fetch to pass to MMR algorithm.
:param lambda_mult: Number between 0 and 1 that determines the degree | [
4110,
264,
82342,
4724,
4412,
505,
264,
2246,
1160,
627,
2822,
1862,
369,
38938,
1495,
29460,
198,
16851,
198,
64,
82342,
4724,
4412,
627,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
40188,
25,
38168,
25624,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
14499,
790,
76747,
60,
55609,
198,
4110,
264,
82342,
4724,
4412,
505,
7257,
22755,
627,
2822,
1862,
369,
38938,
1495,
29460,
198,
16851,
198,
64,
82342,
4724,
4412,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
68416,
3319,
25,
2991,
311,
1427,
709,
9477,
4528,
311,
627,
68416,
597,
25,
5742,
315,
45890,
311,
471,
627,
68416,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
68416,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
15669,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
2880,
722,
867,
992,
1311,
33194,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
7963,
4803,
25,
528,
284,
220,
508,
11,
12741,
27386,
25,
2273,
284,
220,
15,
13,
20,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
4183,
1701,
279,
54229,
32873,
41961,
627,
6102,
2931,
32873,
41961,
7706,
4861,
369,
38723,
311,
3319,
3651,
20057,
198,
77405,
4183,
9477,
627,
68416,
40188,
25,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
68416,
597,
25,
5742,
315,
45890,
311,
471,
627,
68416,
7963,
4803,
25,
5742,
315,
45890,
311,
7963,
311,
1522,
311,
386,
18953,
12384,
627,
68416,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-6 | :param 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.
Returns
List of Documents selected by maximal marginal relevance.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
Returns
List of Documents most similar to the query vector.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**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
Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶ | [
68416,
12741,
27386,
25,
5742,
1990,
220,
15,
323,
220,
16,
430,
27667,
279,
8547,
198,
1073,
20057,
4315,
279,
3135,
449,
220,
15,
12435,
198,
998,
7340,
20057,
323,
220,
16,
311,
8187,
20057,
627,
16851,
198,
861,
315,
45890,
4183,
555,
54229,
32873,
41961,
627,
1874,
10974,
25,
610,
11,
2778,
1857,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
1701,
5300,
2778,
955,
627,
15124,
49325,
10947,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
3319,
627,
15124,
49325,
10947,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
9905,
198,
95711,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
45890,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
1311,
33194,
28297,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
5163,
55609,
198,
5715,
27437,
323,
41961,
12483,
304,
279,
2134,
510,
15,
11,
220,
16,
27218,
15,
374,
14091,
79962,
11,
220,
16,
374,
1455,
4528,
627,
9905,
198,
1663,
1389,
1988,
1495,
198,
74,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
334,
9872,
1389,
16901,
311,
387,
5946,
311,
38723,
2778,
13,
12540,
2997,
512,
12618,
22616,
25,
12536,
11,
264,
19596,
1486,
907,
1990,
220,
15,
311,
220,
16,
311,
198,
5428,
279,
13239,
743,
315,
31503,
27437,
198,
16851,
198,
861,
315,
350,
29423,
315,
320,
5349,
11,
38723,
10622,
340,
15124,
49325,
10947,
6753,
10622,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
468bdf7cb93d-7 | similarity_search_with_score_by_vector(embedding: List[float], k: int = 4) → List[Tuple[Document, float]][source]¶
Return docs most similar to embedding vector.
No support for filter query (on metadata) along with vector search.
Parameters
embedding (str) – Embedding to look up documents similar to.
k (int) – Number of Documents to return. Defaults to 4.
Returns
List of (Document, score), the most similar to the query vector.
similarity_search_with_score_id(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float, str]][source]¶
similarity_search_with_score_id_by_vector(embedding: List[float], k: int = 4) → List[Tuple[Document, float, str]][source]¶
Return docs most similar to embedding vector.
No support for filter query (on metadata) along with vector search.
Parameters
embedding (str) – Embedding to look up documents similar to.
k (int) – Number of Documents to return. Defaults to 4.
Returns
List of (Document, score, id), the most similar to the query vector. | [
15124,
49325,
10947,
6753,
10622,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
2822,
1862,
369,
4141,
3319,
320,
263,
11408,
8,
3235,
449,
4724,
2778,
627,
9905,
198,
95711,
320,
496,
8,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
320,
396,
8,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
320,
7676,
11,
5573,
705,
279,
1455,
4528,
311,
279,
3319,
4724,
627,
15124,
49325,
10947,
6753,
10622,
851,
10974,
25,
610,
11,
597,
25,
528,
284,
220,
19,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
11,
610,
28819,
2484,
60,
55609,
198,
15124,
49325,
10947,
6753,
10622,
851,
3795,
12526,
50825,
7113,
25,
1796,
96481,
1145,
597,
25,
528,
284,
220,
19,
8,
11651,
1796,
20961,
6189,
58,
7676,
11,
2273,
11,
610,
28819,
2484,
60,
55609,
198,
5715,
27437,
1455,
4528,
311,
40188,
4724,
627,
2822,
1862,
369,
4141,
3319,
320,
263,
11408,
8,
3235,
449,
4724,
2778,
627,
9905,
198,
95711,
320,
496,
8,
1389,
38168,
7113,
311,
1427,
709,
9477,
4528,
311,
627,
74,
320,
396,
8,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
220,
19,
627,
16851,
198,
861,
315,
320,
7676,
11,
5573,
11,
887,
705,
279,
1455,
4528,
311,
279,
3319,
4724,
13
] | https://langchain.readthedocs.io/en/latest/vectorstores/langchain.vectorstores.cassandra.Cassandra.html |
8b236bbc9d98-0 | langchain.schema.BaseRetriever¶
class langchain.schema.BaseRetriever[source]¶
Bases: ABC
Base interface for a retriever.
Methods
__init__()
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query.
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document][source]¶
Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
get_relevant_documents(query: str, *, callbacks: Callbacks = None, **kwargs: Any) → List[Document][source]¶
Retrieve documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents | [
5317,
8995,
31992,
13316,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
31992,
13316,
12289,
462,
2099,
76747,
60,
55609,
198,
33,
2315,
25,
19921,
198,
4066,
3834,
369,
264,
10992,
424,
627,
18337,
198,
565,
2381,
33716,
85163,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
456,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
88765,
9477,
9959,
311,
264,
3319,
627,
7847,
264,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
456,
1311,
8532,
77027,
10974,
25,
610,
11,
12039,
27777,
25,
23499,
82,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
88765,
9477,
9959,
311,
264,
3319,
627,
68416,
3319,
25,
925,
311,
1505,
9959,
9477,
369,
198,
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.BaseRetriever.html |
7feeaed70a76-0 | langchain.schema.OutputParserException¶
class langchain.schema.OutputParserException(error: Any, observation: str | None = None, llm_output: str | None = None, send_to_llm: bool = False)[source]¶
Bases: ValueError
Exception that output parsers should raise to signify a parsing error.
This exists to differentiate parsing errors from other code or execution errors
that also may arise inside the output parser. OutputParserExceptions will be
available to catch and handle in ways to fix the parsing error, while other
errors will be raised.
add_note()¶
Exception.add_note(note) –
add a note to the exception
with_traceback()¶
Exception.with_traceback(tb) –
set self.__traceback__ to tb and return self.
args¶ | [
5317,
8995,
31992,
35346,
6707,
1378,
55609,
198,
1058,
8859,
8995,
31992,
35346,
6707,
1378,
6524,
25,
5884,
11,
22695,
25,
610,
765,
2290,
284,
2290,
11,
9507,
76,
7800,
25,
610,
765,
2290,
284,
2290,
11,
3708,
2401,
44095,
76,
25,
1845,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
15764,
198,
1378,
430,
2612,
88173,
1288,
4933,
311,
89522,
264,
23115,
1493,
627,
2028,
6866,
311,
54263,
23115,
6103,
505,
1023,
2082,
477,
11572,
6103,
198,
9210,
1101,
1253,
31889,
4871,
279,
2612,
6871,
13,
9442,
6707,
66680,
690,
387,
198,
10547,
311,
2339,
323,
3790,
304,
5627,
311,
5155,
279,
23115,
1493,
11,
1418,
1023,
198,
7805,
690,
387,
9408,
627,
723,
28306,
368,
55609,
198,
1378,
1388,
28306,
45151,
8,
1389,
198,
723,
264,
5296,
311,
279,
4788,
198,
4291,
24489,
1445,
368,
55609,
198,
1378,
18662,
24489,
1445,
62514,
8,
1389,
198,
751,
659,
4952,
15417,
1445,
565,
311,
16767,
323,
471,
659,
627,
2164,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.OutputParserException.html |
1d023f59e837-0 | langchain.schema.FunctionMessage¶
class langchain.schema.FunctionMessage(*, content: str, additional_kwargs: dict = None, name: str)[source]¶
Bases: BaseMessage
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param additional_kwargs: dict [Optional]¶
param content: str [Required]¶
param name: str [Required]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
This class is LangChain serializable.
property type: str¶
Type of the message, used for serialization.
model Config¶
Bases: object
extra = 'ignore'¶ | [
5317,
8995,
31992,
31647,
2097,
55609,
198,
1058,
8859,
8995,
31992,
31647,
2097,
4163,
11,
2262,
25,
610,
11,
5217,
37335,
25,
6587,
284,
2290,
11,
836,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
2097,
198,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
5217,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
913,
2262,
25,
610,
510,
8327,
60,
55609,
198,
913,
836,
25,
610,
510,
8327,
60,
55609,
198,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
2028,
538,
374,
23272,
19368,
6275,
8499,
627,
3784,
955,
25,
610,
55609,
198,
941,
315,
279,
1984,
11,
1511,
369,
48543,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.FunctionMessage.html |
91036536010f-0 | langchain.schema.AIMessage¶
class langchain.schema.AIMessage(*, content: str, additional_kwargs: dict = None, example: bool = False)[source]¶
Bases: BaseMessage
Type of message that is spoken by the AI.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param additional_kwargs: dict [Optional]¶
param content: str [Required]¶
param example: bool = False¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
This class is LangChain serializable.
property type: str¶
Type of the message, used for serialization.
model Config¶
Bases: object
extra = 'ignore'¶ | [
5317,
8995,
31992,
885,
1829,
808,
55609,
198,
1058,
8859,
8995,
31992,
885,
1829,
808,
4163,
11,
2262,
25,
610,
11,
5217,
37335,
25,
6587,
284,
2290,
11,
3187,
25,
1845,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
2097,
198,
941,
315,
1984,
430,
374,
22066,
555,
279,
15592,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
5217,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
913,
2262,
25,
610,
510,
8327,
60,
55609,
198,
913,
3187,
25,
1845,
284,
3641,
55609,
198,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
2028,
538,
374,
23272,
19368,
6275,
8499,
627,
3784,
955,
25,
610,
55609,
198,
941,
315,
279,
1984,
11,
1511,
369,
48543,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.AIMessage.html |
6813683d492f-0 | langchain.schema.BaseMessage¶
class langchain.schema.BaseMessage(*, content: str, additional_kwargs: dict = None)[source]¶
Bases: Serializable
Message object.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param additional_kwargs: dict [Optional]¶
param content: str [Required]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
This class is LangChain serializable.
abstract property type: str¶
Type of the message, used for serialization.
model Config¶
Bases: object
extra = 'ignore'¶ | [
5317,
8995,
31992,
13316,
2097,
55609,
198,
1058,
8859,
8995,
31992,
13316,
2097,
4163,
11,
2262,
25,
610,
11,
5217,
37335,
25,
6587,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
25901,
198,
2097,
1665,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
5217,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
913,
2262,
25,
610,
510,
8327,
60,
55609,
198,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
2028,
538,
374,
23272,
19368,
6275,
8499,
627,
16647,
3424,
955,
25,
610,
55609,
198,
941,
315,
279,
1984,
11,
1511,
369,
48543,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.BaseMessage.html |
573e067c1554-0 | langchain.schema.Document¶
class langchain.schema.Document(*, page_content: str, metadata: dict = None)[source]¶
Bases: Serializable
Interface for interacting with a document.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param metadata: dict [Optional]¶
param page_content: str [Required]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
5317,
8995,
31992,
27352,
55609,
198,
1058,
8859,
8995,
31992,
27352,
4163,
11,
2199,
7647,
25,
610,
11,
11408,
25,
6587,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
25901,
198,
5160,
369,
45830,
449,
264,
2246,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
11408,
25,
6587,
510,
15669,
60,
55609,
198,
913,
2199,
7647,
25,
610,
510,
8327,
60,
55609,
198,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.Document.html |
5f533863bce8-0 | langchain.schema.messages_to_dict¶
langchain.schema.messages_to_dict(messages: List[BaseMessage]) → List[dict][source]¶
Convert messages to dict.
Parameters
messages – List of messages to convert.
Returns
List of dicts. | [
5317,
8995,
31992,
26381,
2401,
5356,
55609,
198,
5317,
8995,
31992,
26381,
2401,
5356,
56805,
25,
1796,
58,
4066,
2097,
2526,
11651,
1796,
58,
8644,
1483,
2484,
60,
55609,
198,
12281,
6743,
311,
6587,
627,
9905,
198,
16727,
1389,
1796,
315,
6743,
311,
5625,
627,
16851,
198,
861,
315,
98699,
13
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.messages_to_dict.html |
e660acdd4761-0 | langchain.schema.BaseMemory¶
class langchain.schema.BaseMemory[source]¶
Bases: Serializable, ABC
Base interface for memory in chains.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
abstract clear() → None[source]¶
Clear memory contents.
abstract load_memory_variables(inputs: Dict[str, Any]) → Dict[str, Any][source]¶
Return key-value pairs given the text input to the chain.
If None, return all memories
abstract save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) → None[source]¶
Save the context of this model run to memory.
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
abstract property memory_variables: List[str]¶
Input keys this memory class will load dynamically.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
31992,
13316,
10869,
55609,
198,
1058,
8859,
8995,
31992,
13316,
10869,
76747,
60,
55609,
198,
33,
2315,
25,
25901,
11,
19921,
198,
4066,
3834,
369,
5044,
304,
27271,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
16647,
2867,
368,
11651,
2290,
76747,
60,
55609,
198,
14335,
5044,
8970,
627,
16647,
2865,
19745,
29282,
35099,
25,
30226,
17752,
11,
5884,
2526,
11651,
30226,
17752,
11,
5884,
1483,
2484,
60,
55609,
198,
5715,
1401,
19625,
13840,
2728,
279,
1495,
1988,
311,
279,
8957,
627,
2746,
2290,
11,
471,
682,
19459,
198,
16647,
3665,
8634,
35099,
25,
30226,
17752,
11,
5884,
1145,
16674,
25,
30226,
17752,
11,
610,
2526,
11651,
2290,
76747,
60,
55609,
198,
8960,
279,
2317,
315,
420,
1646,
1629,
311,
5044,
627,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
16647,
3424,
5044,
29282,
25,
1796,
17752,
60,
55609,
198,
2566,
7039,
420,
5044,
538,
690,
2865,
43111,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.BaseMemory.html |
717f3bf1ee65-0 | langchain.schema.PromptValue¶
class langchain.schema.PromptValue[source]¶
Bases: Serializable, ABC
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
abstract to_messages() → List[BaseMessage][source]¶
Return prompt as messages.
abstract to_string() → str[source]¶
Return prompt as string.
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
5317,
8995,
31992,
1087,
15091,
1150,
55609,
198,
1058,
8859,
8995,
31992,
1087,
15091,
1150,
76747,
60,
55609,
198,
33,
2315,
25,
25901,
11,
19921,
198,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
998,
9643,
368,
11651,
9323,
58,
78621,
13591,
11,
92572,
2688,
18804,
60,
55609,
198,
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
16647,
311,
24321,
368,
11651,
1796,
58,
4066,
2097,
1483,
2484,
60,
55609,
198,
5715,
10137,
439,
6743,
627,
16647,
311,
3991,
368,
11651,
610,
76747,
60,
55609,
198,
5715,
10137,
439,
925,
627,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.PromptValue.html |
bf3aa5bbad00-0 | langchain.schema.AgentFinish¶
class langchain.schema.AgentFinish(return_values: dict, log: str)[source]¶
Bases: NamedTuple
Agent’s return value.
Create new instance of AgentFinish(return_values, log)
Methods
__init__()
count(value, /)
Return number of occurrences of value.
index(value[, start, stop])
Return first index of value.
Attributes
log
Alias for field number 1
return_values
Alias for field number 0
count(value, /)¶
Return number of occurrences of value.
index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
log: str¶
Alias for field number 1
return_values: dict¶
Alias for field number 0 | [
5317,
8995,
31992,
89969,
26748,
55609,
198,
1058,
8859,
8995,
31992,
89969,
26748,
36206,
9324,
25,
6587,
11,
1515,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
41559,
29781,
198,
17230,
753,
471,
907,
627,
4110,
502,
2937,
315,
21372,
26748,
36206,
9324,
11,
1515,
340,
18337,
198,
565,
2381,
33716,
1868,
3764,
11,
4194,
54660,
5715,
1396,
315,
57115,
315,
907,
627,
1275,
3764,
38372,
4194,
2527,
11,
4194,
9684,
2608,
5715,
1176,
1963,
315,
907,
627,
10738,
198,
848,
198,
23555,
369,
2115,
1396,
220,
16,
198,
693,
9324,
198,
23555,
369,
2115,
1396,
220,
15,
198,
1868,
3764,
11,
611,
8,
55609,
198,
5715,
1396,
315,
57115,
315,
907,
627,
1275,
3764,
11,
1212,
28,
15,
11,
3009,
28,
20275,
17609,
9639,
23717,
21144,
18216,
22,
11,
611,
8,
55609,
198,
5715,
1176,
1963,
315,
907,
627,
36120,
15764,
422,
279,
907,
374,
539,
3118,
627,
848,
25,
610,
55609,
198,
23555,
369,
2115,
1396,
220,
16,
198,
693,
9324,
25,
6587,
55609,
198,
23555,
369,
2115,
1396,
220,
15
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.AgentFinish.html |
4a24861d0c29-0 | langchain.schema.LLMResult¶
class langchain.schema.LLMResult(*, generations: List[List[Generation]], llm_output: Optional[dict] = None, run: Optional[List[RunInfo]] = None)[source]¶
Bases: BaseModel
Class that contains all relevant information for an LLM Result.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param generations: List[List[langchain.schema.Generation]] [Required]¶
List of the things generated. This is List[List[]] because
each input could have multiple generations.
param llm_output: Optional[dict] = None¶
For arbitrary LLM provider specific output.
param run: Optional[List[langchain.schema.RunInfo]] = None¶
Run metadata.
flatten() → List[LLMResult][source]¶
Flatten generations into a single list. | [
5317,
8995,
31992,
1236,
11237,
2122,
55609,
198,
1058,
8859,
8995,
31992,
1236,
11237,
2122,
4163,
11,
22540,
25,
1796,
53094,
58,
38238,
21128,
9507,
76,
7800,
25,
12536,
58,
8644,
60,
284,
2290,
11,
1629,
25,
12536,
53094,
58,
6869,
1767,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
1999,
430,
5727,
682,
9959,
2038,
369,
459,
445,
11237,
5832,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
22540,
25,
1796,
53094,
58,
5317,
8995,
31992,
67616,
5163,
510,
8327,
60,
55609,
198,
861,
315,
279,
2574,
8066,
13,
1115,
374,
1796,
53094,
1318,
60,
1606,
198,
9739,
1988,
1436,
617,
5361,
22540,
627,
913,
9507,
76,
7800,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
2520,
25142,
445,
11237,
9287,
3230,
2612,
627,
913,
1629,
25,
12536,
53094,
58,
5317,
8995,
31992,
17123,
1767,
5163,
284,
2290,
55609,
198,
6869,
11408,
627,
48166,
368,
11651,
1796,
58,
4178,
44,
2122,
1483,
2484,
60,
55609,
198,
3968,
14795,
22540,
1139,
264,
3254,
1160,
13
] | https://langchain.readthedocs.io/en/latest/schema/langchain.schema.LLMResult.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.