id
stringlengths 14
15
| text
stringlengths 35
2.07k
| embedding
sequence | source
stringlengths 61
154
|
---|---|---|---|
00a34504a304-2 | chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False.
async aapply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶
Utilize the LLM generate method for speed gains.
async aapply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶
Call apply and then parse the results.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → Dict[str, Any]¶
Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this
chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False.
async agenerate(input_list: List[Dict[str, Any]], run_manager: Optional[AsyncCallbackManagerForChainRun] = None) → LLMResult¶ | [
8995,
690,
387,
6052,
13,
37090,
311,
3641,
627,
69411,
1389,
23499,
82,
311,
1005,
369,
420,
8957,
1629,
13,
1442,
539,
3984,
11,
690,
198,
817,
279,
27777,
3984,
311,
279,
8957,
627,
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
627,
7847,
264,
10492,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
1796,
58,
13755,
17752,
11,
610,
5163,
55609,
198,
2810,
553,
279,
445,
11237,
7068,
1749,
369,
4732,
20192,
627,
7847,
264,
10492,
8543,
21715,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
33758,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
60,
55609,
198,
7368,
3881,
323,
1243,
4820,
279,
3135,
627,
7847,
1645,
543,
35099,
25,
9323,
58,
13755,
17752,
11,
5884,
1145,
5884,
1145,
471,
18917,
36289,
25,
1845,
284,
3641,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
2997,
14334,
3186,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
6869,
279,
12496,
315,
420,
8957,
323,
923,
311,
2612,
422,
12974,
627,
9905,
198,
25986,
1389,
10685,
315,
11374,
11,
477,
3254,
1988,
422,
8957,
25283,
198,
3323,
832,
1719,
627,
693,
18917,
36289,
1389,
2777,
369,
3508,
311,
471,
1193,
16674,
304,
279,
198,
2376,
13,
1442,
3082,
11,
1193,
502,
7039,
8066,
555,
420,
8957,
690,
387,
198,
78691,
13,
1442,
3641,
11,
2225,
1988,
7039,
323,
502,
7039,
8066,
555,
420,
198,
8995,
690,
387,
6052,
13,
37090,
311,
3641,
627,
69411,
1389,
23499,
82,
311,
1005,
369,
420,
8957,
1629,
13,
1442,
539,
3984,
11,
690,
198,
817,
279,
27777,
3984,
311,
279,
8957,
627,
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
627,
7847,
945,
13523,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
6662,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
445,
11237,
2122,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain.html |
00a34504a304-3 | Generate LLM result from inputs.
apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶
Utilize the LLM generate method for speed gains.
apply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶
Call apply and then parse the results.
async apredict(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶
Format prompt with kwargs and pass to LLM.
Parameters
callbacks – Callbacks to pass to LLMChain
**kwargs – Keys to pass to prompt template.
Returns
Completion from LLM.
Example
completion = llm.predict(adjective="funny")
async apredict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, str]]¶
Call apredict and then parse the results.
async aprep_prompts(input_list: List[Dict[str, Any]], run_manager: Optional[AsyncCallbackManagerForChainRun] = None) → Tuple[List[PromptValue], Optional[List[str]]]¶
Prepare prompts from inputs.
async arun(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
create_outputs(llm_result: LLMResult) → List[Dict[str, Any]]¶
Create outputs from response. | [
32215,
445,
11237,
1121,
505,
11374,
627,
10492,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
1796,
58,
13755,
17752,
11,
610,
5163,
55609,
198,
2810,
553,
279,
445,
11237,
7068,
1749,
369,
4732,
20192,
627,
10492,
8543,
21715,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
33758,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
60,
55609,
198,
7368,
3881,
323,
1243,
4820,
279,
3135,
627,
7847,
1469,
9037,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4152,
10137,
449,
16901,
323,
1522,
311,
445,
11237,
627,
9905,
198,
69411,
1389,
23499,
82,
311,
1522,
311,
445,
11237,
19368,
198,
334,
9872,
1389,
25104,
311,
1522,
311,
10137,
3896,
627,
16851,
198,
34290,
505,
445,
11237,
627,
13617,
198,
44412,
284,
9507,
76,
24706,
44879,
51591,
429,
12158,
3919,
1158,
7847,
1469,
9037,
8543,
21715,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
55609,
198,
7368,
1469,
9037,
323,
1243,
4820,
279,
3135,
627,
7847,
1469,
10200,
48977,
13044,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
6662,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
25645,
53094,
43447,
15091,
1150,
1145,
12536,
53094,
17752,
5163,
60,
55609,
198,
51690,
52032,
505,
11374,
627,
7847,
802,
359,
4163,
2164,
25,
5884,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
6869,
279,
8957,
439,
1495,
304,
11,
1495,
704,
477,
5361,
7482,
11,
1495,
704,
627,
3261,
36289,
36621,
76,
5400,
25,
445,
11237,
2122,
8,
11651,
1796,
58,
13755,
17752,
11,
5884,
5163,
55609,
198,
4110,
16674,
505,
2077,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain.html |
00a34504a304-4 | Create outputs from response.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_llm(llm: BaseLanguageModel, verbose: bool = True) → LLMChain[source]¶
Get the response parser.
classmethod from_string(llm: BaseLanguageModel, template: str) → LLMChain¶
Create LLMChain from LLM and template.
generate(input_list: List[Dict[str, Any]], run_manager: Optional[CallbackManagerForChainRun] = None) → LLMResult¶
Generate LLM result from inputs.
predict(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶
Format prompt with kwargs and pass to LLM.
Parameters
callbacks – Callbacks to pass to LLMChain
**kwargs – Keys to pass to prompt template.
Returns
Completion from LLM.
Example
completion = llm.predict(adjective="funny")
predict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, Any]]¶
Call predict and then parse the results.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
prep_prompts(input_list: List[Dict[str, Any]], run_manager: Optional[CallbackManagerForChainRun] = None) → Tuple[List[PromptValue], Optional[List[str]]]¶
Prepare prompts from inputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used. | [
4110,
16674,
505,
2077,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8957,
627,
27853,
505,
44095,
76,
36621,
76,
25,
5464,
14126,
1747,
11,
14008,
25,
1845,
284,
3082,
8,
11651,
445,
11237,
19368,
76747,
60,
55609,
198,
1991,
279,
2077,
6871,
627,
27853,
505,
3991,
36621,
76,
25,
5464,
14126,
1747,
11,
3896,
25,
610,
8,
11651,
445,
11237,
19368,
55609,
198,
4110,
445,
11237,
19368,
505,
445,
11237,
323,
3896,
627,
19927,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
445,
11237,
2122,
55609,
198,
32215,
445,
11237,
1121,
505,
11374,
627,
35798,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4152,
10137,
449,
16901,
323,
1522,
311,
445,
11237,
627,
9905,
198,
69411,
1389,
23499,
82,
311,
1522,
311,
445,
11237,
19368,
198,
334,
9872,
1389,
25104,
311,
1522,
311,
10137,
3896,
627,
16851,
198,
34290,
505,
445,
11237,
627,
13617,
198,
44412,
284,
9507,
76,
24706,
44879,
51591,
429,
12158,
3919,
1158,
35798,
8543,
21715,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
5884,
5163,
55609,
198,
7368,
7168,
323,
1243,
4820,
279,
3135,
627,
72874,
29657,
35099,
25,
9323,
58,
13755,
17752,
11,
5884,
1145,
5884,
2526,
11651,
30226,
17752,
11,
610,
60,
55609,
198,
18409,
323,
22033,
11374,
627,
72874,
36289,
35099,
25,
30226,
17752,
11,
610,
1145,
16674,
25,
30226,
17752,
11,
610,
1145,
471,
18917,
36289,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
610,
60,
55609,
198,
18409,
323,
22033,
16674,
627,
72874,
48977,
13044,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
25645,
53094,
43447,
15091,
1150,
1145,
12536,
53094,
17752,
5163,
60,
55609,
198,
51690,
52032,
505,
11374,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain.html |
00a34504a304-5 | Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
Save the chain.
Parameters
file_path – Path to file to save the chain to.
Example:
.. code-block:: python
chain.save(file_path=”path/chain.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
This allows users to pass in None as verbose to access the global setting.
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
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6236,
4163,
2164,
25,
5884,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
6869,
279,
8957,
439,
1495,
304,
11,
1495,
704,
477,
5361,
7482,
11,
1495,
704,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8957,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8957,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
8995,
5799,
4971,
2703,
45221,
2398,
14,
8995,
34506,
863,
340,
16503,
743,
69021,
4194,
8345,
4194,
14008,
55609,
198,
2746,
14008,
374,
2290,
11,
743,
433,
627,
2028,
6276,
3932,
311,
1522,
304,
2290,
439,
14008,
311,
2680,
279,
3728,
6376,
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,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain.html |
eff9f6ea64e7-0 | langchain.experimental.plan_and_execute.planners.chat_planner.load_chat_planner¶
langchain.experimental.plan_and_execute.planners.chat_planner.load_chat_planner(llm: BaseLanguageModel, system_prompt: str = "Let's first understand the problem and devise a plan to solve the problem. Please output the plan starting with the header 'Plan:' and then followed by a numbered list of steps. Please make the plan the minimum number of steps required to accurately complete the task. If the task is a question, the final step should almost always be 'Given the above steps taken, please respond to the users original question'. At the end of your plan, say '<END_OF_PLAN>'") → LLMPlanner[source]¶
Load a chat planner.
:param llm: Language model.
:param system_prompt: System prompt.
Returns
LLMPlanner | [
5317,
8995,
88547,
46942,
8543,
45429,
8022,
24960,
27215,
6451,
4992,
5214,
36153,
6451,
4992,
55609,
198,
5317,
8995,
88547,
46942,
8543,
45429,
8022,
24960,
27215,
6451,
4992,
5214,
36153,
6451,
4992,
36621,
76,
25,
5464,
14126,
1747,
11,
1887,
62521,
25,
610,
284,
330,
10267,
596,
1176,
3619,
279,
3575,
323,
53165,
264,
3197,
311,
11886,
279,
3575,
13,
5321,
2612,
279,
3197,
6041,
449,
279,
4342,
364,
21119,
4989,
323,
1243,
8272,
555,
264,
49926,
1160,
315,
7504,
13,
5321,
1304,
279,
3197,
279,
8187,
1396,
315,
7504,
2631,
311,
30357,
4686,
279,
3465,
13,
1442,
279,
3465,
374,
264,
3488,
11,
279,
1620,
3094,
1288,
4661,
2744,
387,
364,
22818,
279,
3485,
7504,
4529,
11,
4587,
6013,
311,
279,
3932,
4113,
3488,
4527,
2468,
279,
842,
315,
701,
3197,
11,
2019,
3942,
4794,
14568,
84748,
5709,
909,
11651,
445,
11237,
2169,
4992,
76747,
60,
55609,
198,
6003,
264,
6369,
50811,
627,
68416,
9507,
76,
25,
11688,
1646,
627,
68416,
1887,
62521,
25,
744,
10137,
627,
16851,
198,
4178,
44,
2169,
4992
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.plan_and_execute.planners.chat_planner.load_chat_planner.html |
a317c8050741-0 | langchain.experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt¶
class langchain.experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt(*, input_variables: List[str], output_parser: Optional[BaseOutputParser] = None, partial_variables: Mapping[str, Union[str, Callable[[], str]]] = None, ai_name: str, ai_role: str, tools: List[BaseTool], token_counter: Callable[[str], int], send_token_limit: int = 4196)[source]¶
Bases: BaseChatPromptTemplate, 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 ai_name: str [Required]¶
param ai_role: str [Required]¶
param input_variables: List[str] [Required]¶
A list of the names of the variables the prompt template expects.
param output_parser: Optional[BaseOutputParser] = None¶
How to parse the output of calling an LLM on this formatted prompt.
param partial_variables: Mapping[str, Union[str, Callable[[], str]]] [Optional]¶
param send_token_limit: int = 4196¶
param token_counter: Callable[[str], int] [Required]¶
param tools: List[langchain.tools.base.BaseTool] [Required]¶
construct_full_prompt(goals: List[str]) → str[source]¶
dict(**kwargs: Any) → Dict¶
Return dictionary representation of prompt.
format(**kwargs: Any) → str¶
Format the prompt with the inputs.
Parameters
kwargs – Any arguments to be passed to the prompt template.
Returns
A formatted string.
Example:
prompt.format(variable1="foo")
format_messages(**kwargs: Any) → List[BaseMessage][source]¶ | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
66499,
6613,
38,
2898,
55715,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
66499,
6613,
38,
2898,
55715,
4163,
11,
1988,
29282,
25,
1796,
17752,
1145,
2612,
19024,
25,
12536,
58,
4066,
5207,
6707,
60,
284,
2290,
11,
7276,
29282,
25,
39546,
17752,
11,
9323,
17752,
11,
54223,
58,
13292,
610,
5163,
60,
284,
2290,
11,
16796,
1292,
25,
610,
11,
16796,
20378,
25,
610,
11,
7526,
25,
1796,
58,
4066,
7896,
1145,
4037,
16107,
25,
54223,
15873,
496,
1145,
528,
1145,
3708,
6594,
15106,
25,
528,
284,
220,
19391,
21,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
16047,
55715,
7423,
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,
16796,
1292,
25,
610,
510,
8327,
60,
55609,
198,
913,
16796,
20378,
25,
610,
510,
8327,
60,
55609,
198,
913,
1988,
29282,
25,
1796,
17752,
60,
510,
8327,
60,
55609,
198,
32,
1160,
315,
279,
5144,
315,
279,
7482,
279,
10137,
3896,
25283,
627,
913,
2612,
19024,
25,
12536,
58,
4066,
5207,
6707,
60,
284,
2290,
55609,
198,
4438,
311,
4820,
279,
2612,
315,
8260,
459,
445,
11237,
389,
420,
24001,
10137,
627,
913,
7276,
29282,
25,
39546,
17752,
11,
9323,
17752,
11,
54223,
58,
13292,
610,
5163,
60,
510,
15669,
60,
55609,
198,
913,
3708,
6594,
15106,
25,
528,
284,
220,
19391,
21,
55609,
198,
913,
4037,
16107,
25,
54223,
15873,
496,
1145,
528,
60,
510,
8327,
60,
55609,
198,
913,
7526,
25,
1796,
58,
5317,
8995,
24029,
9105,
13316,
7896,
60,
510,
8327,
60,
55609,
198,
7750,
16776,
62521,
48515,
1147,
25,
1796,
17752,
2526,
11651,
610,
76747,
60,
55609,
198,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
10137,
627,
2293,
22551,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4152,
279,
10137,
449,
279,
11374,
627,
9905,
198,
9872,
1389,
5884,
6105,
311,
387,
5946,
311,
279,
10137,
3896,
627,
16851,
198,
32,
24001,
925,
627,
13617,
512,
41681,
8180,
46129,
16,
429,
8134,
1158,
2293,
24321,
22551,
9872,
25,
5884,
8,
11651,
1796,
58,
4066,
2097,
1483,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt.html |
a317c8050741-1 | format_messages(**kwargs: Any) → List[BaseMessage][source]¶
Format kwargs into a list of messages.
format_prompt(**kwargs: Any) → PromptValue¶
Create Chat Messages.
partial(**kwargs: Union[str, Callable[[], str]]) → BasePromptTemplate¶
Return a partial of the prompt template.
save(file_path: Union[Path, str]) → None¶
Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
.. code-block:: python
prompt.save(file_path=”path/prompt.yaml”)
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
validator validate_variable_names » all fields¶
Validate variable names do not include restricted names.
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
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
2293,
24321,
22551,
9872,
25,
5884,
8,
11651,
1796,
58,
4066,
2097,
1483,
2484,
60,
55609,
198,
4152,
16901,
1139,
264,
1160,
315,
6743,
627,
2293,
62521,
22551,
9872,
25,
5884,
8,
11651,
60601,
1150,
55609,
198,
4110,
13149,
27827,
627,
38520,
22551,
9872,
25,
9323,
17752,
11,
54223,
58,
13292,
610,
30716,
11651,
5464,
55715,
7423,
55609,
198,
5715,
264,
7276,
315,
279,
10137,
3896,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
10137,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
6352,
311,
3665,
10137,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
41681,
5799,
4971,
2703,
45221,
2398,
4420,
15091,
34506,
863,
340,
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,
16503,
9788,
14977,
9366,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
3977,
5144,
656,
539,
2997,
22486,
5144,
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,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt.html |
c97056533946-0 | langchain.experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input¶
langchain.experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input(input_str: str) → str[source]¶
Preprocesses a string to be parsed as json.
Replace single backslashes with double backslashes,
while leaving already escaped ones intact.
Parameters
input_str – String to be preprocessed
Returns
Preprocessed string | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6357,
4734,
9643,
6022,
55609,
198,
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6357,
4734,
9643,
6022,
5498,
2966,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
4808,
4734,
288,
264,
925,
311,
387,
16051,
439,
3024,
627,
23979,
3254,
1203,
48729,
449,
2033,
1203,
48729,
345,
3556,
9564,
2736,
28883,
6305,
35539,
627,
9905,
198,
1379,
2966,
1389,
935,
311,
387,
864,
35122,
198,
16851,
198,
4808,
35122,
925
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input.html |
32601e5ec605-0 | langchain.experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser¶
class langchain.experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser[source]¶
Bases: PlanOutputParser
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.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str¶
Instructions on how the LLM output should be formatted.
parse(text: str) → Plan[source]¶
Parse into a plan.
parse_result(result: List[Generation]) → T¶
Parse LLM Result.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – output of language model
prompt – prompt value
Returns
structured output
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¶ | [
5317,
8995,
88547,
46942,
8543,
45429,
8022,
24960,
27215,
6451,
4992,
22079,
6073,
5207,
6707,
55609,
198,
1058,
8859,
8995,
88547,
46942,
8543,
45429,
8022,
24960,
27215,
6451,
4992,
22079,
6073,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
9878,
5207,
6707,
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,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
456,
9132,
83527,
368,
11651,
610,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
9878,
76747,
60,
55609,
198,
14802,
1139,
264,
3197,
627,
6534,
5400,
4556,
25,
1796,
58,
38238,
2526,
11651,
350,
55609,
198,
14802,
445,
11237,
5832,
627,
6534,
6753,
62521,
91868,
25,
610,
11,
10137,
25,
60601,
1150,
8,
11651,
5884,
55609,
198,
15669,
1749,
311,
4820,
279,
2612,
315,
459,
445,
11237,
1650,
449,
264,
10137,
627,
791,
10137,
374,
14090,
3984,
304,
279,
1567,
279,
9442,
6707,
6944,
198,
998,
23515,
477,
5155,
279,
2612,
304,
1063,
1648,
11,
323,
3966,
2038,
505,
198,
1820,
10137,
311,
656,
779,
627,
9905,
198,
44412,
1389,
2612,
315,
4221,
1646,
198,
41681,
1389,
10137,
907,
198,
16851,
198,
52243,
2612,
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
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
32601e5ec605-1 | Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
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/experimental/langchain.experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
de22498eaff7-0 | langchain.experimental.plan_and_execute.executors.agent_executor.load_agent_executor¶
langchain.experimental.plan_and_execute.executors.agent_executor.load_agent_executor(llm: BaseLanguageModel, tools: List[BaseTool], verbose: bool = False, include_task_in_prompt: bool = False) → ChainExecutor[source]¶
Load an agent executor.
Parameters
llm – BaseLanguageModel
tools – List[BaseTool]
verbose – bool. Defaults to False.
include_task_in_prompt – bool. Defaults to False.
Returns
ChainExecutor | [
5317,
8995,
88547,
46942,
8543,
45429,
16153,
9663,
45249,
82307,
5214,
26814,
82307,
55609,
198,
5317,
8995,
88547,
46942,
8543,
45429,
16153,
9663,
45249,
82307,
5214,
26814,
82307,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
1796,
58,
4066,
7896,
1145,
14008,
25,
1845,
284,
3641,
11,
2997,
12461,
1265,
62521,
25,
1845,
284,
3641,
8,
11651,
29625,
26321,
76747,
60,
55609,
198,
6003,
459,
8479,
32658,
627,
9905,
198,
657,
76,
1389,
5464,
14126,
1747,
198,
16297,
1389,
1796,
58,
4066,
7896,
933,
15228,
1389,
1845,
13,
37090,
311,
3641,
627,
1012,
12461,
1265,
62521,
1389,
1845,
13,
37090,
311,
3641,
627,
16851,
198,
19368,
26321
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.plan_and_execute.executors.agent_executor.load_agent_executor.html |
89bf87bfc859-0 | langchain.experimental.plan_and_execute.schema.ListStepContainer¶
class langchain.experimental.plan_and_execute.schema.ListStepContainer(*, steps: List[Tuple[Step, StepResponse]] = None)[source]¶
Bases: 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 steps: List[Tuple[langchain.experimental.plan_and_execute.schema.Step, langchain.experimental.plan_and_execute.schema.StepResponse]] [Optional]¶
add_step(step: Step, step_response: StepResponse) → None[source]¶
get_final_response() → str[source]¶
get_steps() → List[Tuple[Step, StepResponse]][source]¶ | [
5317,
8995,
88547,
46942,
8543,
45429,
31992,
5937,
8468,
4603,
55609,
198,
1058,
8859,
8995,
88547,
46942,
8543,
45429,
31992,
5937,
8468,
4603,
4163,
11,
7504,
25,
1796,
20961,
6189,
58,
8468,
11,
15166,
2647,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
7504,
25,
1796,
20961,
6189,
58,
5317,
8995,
88547,
46942,
8543,
45429,
31992,
69502,
11,
8859,
8995,
88547,
46942,
8543,
45429,
31992,
69502,
2647,
5163,
510,
15669,
60,
55609,
198,
723,
12212,
39536,
25,
15166,
11,
3094,
9852,
25,
15166,
2647,
8,
11651,
2290,
76747,
60,
55609,
198,
456,
21333,
9852,
368,
11651,
610,
76747,
60,
55609,
198,
456,
23566,
368,
11651,
1796,
20961,
6189,
58,
8468,
11,
15166,
2647,
28819,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.plan_and_execute.schema.ListStepContainer.html |
d9c6ac297e3b-0 | langchain.experimental.plan_and_execute.schema.PlanOutputParser¶
class langchain.experimental.plan_and_execute.schema.PlanOutputParser[source]¶
Bases: BaseOutputParser
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.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str¶
Instructions on how the LLM output should be formatted.
abstract parse(text: str) → Plan[source]¶
Parse into a plan.
parse_result(result: List[Generation]) → T¶
Parse LLM Result.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – output of language model
prompt – prompt value
Returns
structured output
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 | [
5317,
8995,
88547,
46942,
8543,
45429,
31992,
1087,
10946,
5207,
6707,
55609,
198,
1058,
8859,
8995,
88547,
46942,
8543,
45429,
31992,
1087,
10946,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
5464,
5207,
6707,
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,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
456,
9132,
83527,
368,
11651,
610,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
16647,
4820,
7383,
25,
610,
8,
11651,
9878,
76747,
60,
55609,
198,
14802,
1139,
264,
3197,
627,
6534,
5400,
4556,
25,
1796,
58,
38238,
2526,
11651,
350,
55609,
198,
14802,
445,
11237,
5832,
627,
6534,
6753,
62521,
91868,
25,
610,
11,
10137,
25,
60601,
1150,
8,
11651,
5884,
55609,
198,
15669,
1749,
311,
4820,
279,
2612,
315,
459,
445,
11237,
1650,
449,
264,
10137,
627,
791,
10137,
374,
14090,
3984,
304,
279,
1567,
279,
9442,
6707,
6944,
198,
998,
23515,
477,
5155,
279,
2612,
304,
1063,
1648,
11,
323,
3966,
2038,
505,
198,
1820,
10137,
311,
656,
779,
627,
9905,
198,
44412,
1389,
2612,
315,
4221,
1646,
198,
41681,
1389,
10137,
907,
198,
16851,
198,
52243,
2612,
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
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.plan_and_execute.schema.PlanOutputParser.html |
d9c6ac297e3b-1 | Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
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/experimental/langchain.experimental.plan_and_execute.schema.PlanOutputParser.html |
54e06826c93e-0 | langchain.experimental.autonomous_agents.autogpt.prompt_generator.get_prompt¶
langchain.experimental.autonomous_agents.autogpt.prompt_generator.get_prompt(tools: List[BaseTool]) → str[source]¶
This function generates a prompt string.
It includes various constraints, commands, resources, and performance evaluations.
Returns
The generated prompt string.
Return type
str | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
66499,
26898,
673,
62521,
55609,
198,
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
66499,
26898,
673,
62521,
12464,
3145,
25,
1796,
58,
4066,
7896,
2526,
11651,
610,
76747,
60,
55609,
198,
2028,
734,
27983,
264,
10137,
925,
627,
2181,
5764,
5370,
17413,
11,
11545,
11,
5070,
11,
323,
5178,
56181,
627,
16851,
198,
791,
8066,
10137,
925,
627,
5715,
955,
198,
496
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.prompt_generator.get_prompt.html |
f86d788c9372-0 | langchain.experimental.llms.rellm_decoder.RELLM¶
class langchain.experimental.llms.rellm_decoder.RELLM(*, cache: Optional[bool] = None, verbose: bool = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, tags: Optional[List[str]] = None, pipeline: Any = None, model_id: str = 'gpt2', model_kwargs: Optional[dict] = None, pipeline_kwargs: Optional[dict] = None, regex: RegexPattern, max_new_tokens: int = 200)[source]¶
Bases: HuggingFacePipeline
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 cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param max_new_tokens: int = 200¶
Maximum number of new tokens to generate.
param model_id: str = 'gpt2'¶
Model name to use.
param model_kwargs: Optional[dict] = None¶
Key word arguments passed to the model.
param pipeline_kwargs: Optional[dict] = None¶
Key word arguments passed to the pipeline.
param regex: RegexPattern [Required]¶
The structured format to complete.
param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param verbose: bool [Optional]¶
Whether to print out response text.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶ | [
5317,
8995,
88547,
60098,
1026,
1351,
657,
76,
50943,
15056,
4178,
44,
55609,
198,
1058,
8859,
8995,
88547,
60098,
1026,
1351,
657,
76,
50943,
15056,
4178,
44,
4163,
11,
6636,
25,
12536,
58,
2707,
60,
284,
2290,
11,
14008,
25,
1845,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
15660,
25,
5884,
284,
2290,
11,
1646,
851,
25,
610,
284,
364,
70,
418,
17,
518,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
20791,
25,
27238,
16137,
11,
1973,
6046,
29938,
25,
528,
284,
220,
1049,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
473,
36368,
16680,
35756,
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,
6636,
25,
12536,
58,
2707,
60,
284,
2290,
55609,
198,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
913,
1973,
6046,
29938,
25,
528,
284,
220,
1049,
55609,
198,
28409,
1396,
315,
502,
11460,
311,
7068,
627,
913,
1646,
851,
25,
610,
284,
364,
70,
418,
17,
6,
55609,
198,
1747,
836,
311,
1005,
627,
913,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
1622,
3492,
6105,
5946,
311,
279,
1646,
627,
913,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
1622,
3492,
6105,
5946,
311,
279,
15660,
627,
913,
20791,
25,
27238,
16137,
510,
8327,
60,
55609,
198,
791,
34030,
3645,
311,
4686,
627,
913,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
16309,
311,
923,
311,
279,
1629,
11917,
627,
913,
14008,
25,
1845,
510,
15669,
60,
55609,
198,
25729,
311,
1194,
704,
2077,
1495,
627,
565,
6797,
3889,
41681,
25,
610,
11,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.rellm_decoder.RELLM.html |
f86d788c9372-1 | Check Cache and run the LLM on the given prompt and input.
async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, **kwargs: Any) → LLMResult¶
Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶
Take in a list of prompt values and return an LLMResult.
classmethod all_required_field_names() → Set¶
async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶
Predict text from text.
async apredict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶
Predict message from messages.
validator check_rellm_installation » all fields[source]¶
dict(**kwargs: Any) → Dict¶
Return a dictionary of the LLM.
classmethod from_model_id(model_id: str, task: str, device: int = - 1, model_kwargs: Optional[dict] = None, pipeline_kwargs: Optional[dict] = None, **kwargs: Any) → LLM¶
Construct the pipeline object from model_id and task.
generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, **kwargs: Any) → LLMResult¶
Run the LLM on the given prompt and input. | [
4061,
20044,
323,
1629,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
7847,
945,
13523,
84432,
13044,
25,
1796,
17752,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
6869,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
7847,
945,
13523,
62521,
84432,
13044,
25,
1796,
43447,
15091,
1150,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
18293,
304,
264,
1160,
315,
10137,
2819,
323,
471,
459,
445,
11237,
2122,
627,
27853,
682,
19265,
5121,
9366,
368,
11651,
2638,
55609,
198,
7847,
1469,
9037,
7383,
25,
610,
11,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
54644,
1495,
505,
1495,
627,
7847,
1469,
9037,
24321,
56805,
25,
1796,
58,
4066,
2097,
1145,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5464,
2097,
55609,
198,
54644,
1984,
505,
6743,
627,
16503,
1817,
1311,
657,
76,
35345,
367,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
264,
11240,
315,
279,
445,
11237,
627,
27853,
505,
5156,
851,
7790,
851,
25,
610,
11,
3465,
25,
610,
11,
3756,
25,
528,
284,
482,
220,
16,
11,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
55609,
198,
29568,
279,
15660,
1665,
505,
1646,
851,
323,
3465,
627,
19927,
84432,
13044,
25,
1796,
17752,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
6869,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.rellm_decoder.RELLM.html |
f86d788c9372-2 | Run the LLM on the given prompt and input.
generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶
Take in a list of prompt values and return an LLMResult.
get_num_tokens(text: str) → int¶
Get the number of tokens present in the text.
get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶
Get the number of tokens in the message.
get_token_ids(text: str) → List[int]¶
Get the token present in the text.
predict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶
Predict text from text.
predict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶
Predict message from messages.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
save(file_path: Union[Path, str]) → None¶
Save the LLM.
Parameters
file_path – Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=”path/llm.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
This allows users to pass in None as verbose to access the global setting.
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]¶ | [
6869,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
19927,
62521,
84432,
13044,
25,
1796,
43447,
15091,
1150,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
18293,
304,
264,
1160,
315,
10137,
2819,
323,
471,
459,
445,
11237,
2122,
627,
456,
4369,
29938,
7383,
25,
610,
8,
11651,
528,
55609,
198,
1991,
279,
1396,
315,
11460,
3118,
304,
279,
1495,
627,
456,
4369,
29938,
5791,
24321,
56805,
25,
1796,
58,
4066,
2097,
2526,
11651,
528,
55609,
198,
1991,
279,
1396,
315,
11460,
304,
279,
1984,
627,
456,
6594,
8237,
7383,
25,
610,
8,
11651,
1796,
19155,
60,
55609,
198,
1991,
279,
4037,
3118,
304,
279,
1495,
627,
35798,
7383,
25,
610,
11,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
54644,
1495,
505,
1495,
627,
35798,
24321,
56805,
25,
1796,
58,
4066,
2097,
1145,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5464,
2097,
55609,
198,
54644,
1984,
505,
6743,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
445,
11237,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
445,
11237,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
657,
76,
5799,
4971,
2703,
45221,
2398,
14,
657,
76,
34506,
863,
340,
16503,
743,
69021,
4194,
8345,
4194,
14008,
55609,
198,
2746,
14008,
374,
2290,
11,
743,
433,
627,
2028,
6276,
3932,
311,
1522,
304,
2290,
439,
14008,
311,
2680,
279,
3728,
6376,
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
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.rellm_decoder.RELLM.html |
f86d788c9372-3 | 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
Configuration for this pydantic object.
extra = 'forbid'¶ | [
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,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.rellm_decoder.RELLM.html |
639c11f5fa09-0 | langchain.experimental.autonomous_agents.autogpt.memory.AutoGPTMemory¶
class langchain.experimental.autonomous_agents.autogpt.memory.AutoGPTMemory(*, chat_memory: BaseChatMessageHistory = None, output_key: Optional[str] = None, input_key: Optional[str] = None, return_messages: bool = False, retriever: VectorStoreRetriever)[source]¶
Bases: BaseChatMemory
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 chat_memory: BaseChatMessageHistory [Optional]¶
param input_key: Optional[str] = None¶
param output_key: Optional[str] = None¶
param retriever: langchain.vectorstores.base.VectorStoreRetriever [Required]¶
VectorStoreRetriever object to connect to.
param return_messages: bool = False¶
clear() → None¶
Clear memory contents.
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
save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) → None¶
Save context from this conversation to buffer.
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. | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
37711,
6613,
38,
2898,
10869,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
37711,
6613,
38,
2898,
10869,
4163,
11,
6369,
19745,
25,
5464,
16047,
2097,
13730,
284,
2290,
11,
2612,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
1988,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
471,
24321,
25,
1845,
284,
3641,
11,
10992,
424,
25,
4290,
6221,
12289,
462,
2099,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
16047,
10869,
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,
6369,
19745,
25,
5464,
16047,
2097,
13730,
510,
15669,
60,
55609,
198,
913,
1988,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
2612,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
10992,
424,
25,
8859,
8995,
48203,
44569,
9105,
14621,
6221,
12289,
462,
2099,
510,
8327,
60,
55609,
198,
3866,
6221,
12289,
462,
2099,
1665,
311,
4667,
311,
627,
913,
471,
24321,
25,
1845,
284,
3641,
55609,
198,
7574,
368,
11651,
2290,
55609,
198,
14335,
5044,
8970,
627,
1096,
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,
6766,
8634,
35099,
25,
30226,
17752,
11,
5884,
1145,
16674,
25,
30226,
17752,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
2317,
505,
420,
10652,
311,
4240,
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,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html |
639c11f5fa09-1 | 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.
property memory_variables: List[str]¶
Input keys this memory class will load dynamically.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
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,
3784,
5044,
29282,
25,
1796,
17752,
60,
55609,
198,
2566,
7039,
420,
5044,
538,
690,
2865,
43111,
627,
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/experimental/langchain.experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html |
0e550632215f-0 | langchain.experimental.llms.jsonformer_decoder.JsonFormer¶
class langchain.experimental.llms.jsonformer_decoder.JsonFormer(*, cache: Optional[bool] = None, verbose: bool = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, tags: Optional[List[str]] = None, pipeline: Any = None, model_id: str = 'gpt2', model_kwargs: Optional[dict] = None, pipeline_kwargs: Optional[dict] = None, json_schema: dict, max_new_tokens: int = 200, debug: bool = False)[source]¶
Bases: HuggingFacePipeline
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 cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param debug: bool = False¶
Debug mode.
param json_schema: dict [Required]¶
The JSON Schema to complete.
param max_new_tokens: int = 200¶
Maximum number of new tokens to generate.
param model_id: str = 'gpt2'¶
Model name to use.
param model_kwargs: Optional[dict] = None¶
Key word arguments passed to the model.
param pipeline_kwargs: Optional[dict] = None¶
Key word arguments passed to the pipeline.
param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param verbose: bool [Optional]¶
Whether to print out response text. | [
5317,
8995,
88547,
60098,
1026,
4421,
35627,
50943,
13874,
31945,
55609,
198,
1058,
8859,
8995,
88547,
60098,
1026,
4421,
35627,
50943,
13874,
31945,
4163,
11,
6636,
25,
12536,
58,
2707,
60,
284,
2290,
11,
14008,
25,
1845,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
15660,
25,
5884,
284,
2290,
11,
1646,
851,
25,
610,
284,
364,
70,
418,
17,
518,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
3024,
26443,
25,
6587,
11,
1973,
6046,
29938,
25,
528,
284,
220,
1049,
11,
7542,
25,
1845,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
473,
36368,
16680,
35756,
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,
6636,
25,
12536,
58,
2707,
60,
284,
2290,
55609,
198,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
913,
7542,
25,
1845,
284,
3641,
55609,
198,
8098,
3941,
627,
913,
3024,
26443,
25,
6587,
510,
8327,
60,
55609,
198,
791,
4823,
12824,
311,
4686,
627,
913,
1973,
6046,
29938,
25,
528,
284,
220,
1049,
55609,
198,
28409,
1396,
315,
502,
11460,
311,
7068,
627,
913,
1646,
851,
25,
610,
284,
364,
70,
418,
17,
6,
55609,
198,
1747,
836,
311,
1005,
627,
913,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
1622,
3492,
6105,
5946,
311,
279,
1646,
627,
913,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
1622,
3492,
6105,
5946,
311,
279,
15660,
627,
913,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
16309,
311,
923,
311,
279,
1629,
11917,
627,
913,
14008,
25,
1845,
510,
15669,
60,
55609,
198,
25729,
311,
1194,
704,
2077,
1495,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.jsonformer_decoder.JsonFormer.html |
0e550632215f-1 | param verbose: bool [Optional]¶
Whether to print out response text.
__call__(prompt: str, stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶
Check Cache and run the LLM on the given prompt and input.
async agenerate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, **kwargs: Any) → LLMResult¶
Run the LLM on the given prompt and input.
async agenerate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶
Take in a list of prompt values and return an LLMResult.
classmethod all_required_field_names() → Set¶
async apredict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶
Predict text from text.
async apredict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶
Predict message from messages.
validator check_jsonformer_installation » all fields[source]¶
dict(**kwargs: Any) → Dict¶
Return a dictionary of the LLM.
classmethod from_model_id(model_id: str, task: str, device: int = - 1, model_kwargs: Optional[dict] = None, pipeline_kwargs: Optional[dict] = None, **kwargs: Any) → LLM¶
Construct the pipeline object from model_id and task. | [
913,
14008,
25,
1845,
510,
15669,
60,
55609,
198,
25729,
311,
1194,
704,
2077,
1495,
627,
565,
6797,
3889,
41681,
25,
610,
11,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4061,
20044,
323,
1629,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
7847,
945,
13523,
84432,
13044,
25,
1796,
17752,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
6869,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
7847,
945,
13523,
62521,
84432,
13044,
25,
1796,
43447,
15091,
1150,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
18293,
304,
264,
1160,
315,
10137,
2819,
323,
471,
459,
445,
11237,
2122,
627,
27853,
682,
19265,
5121,
9366,
368,
11651,
2638,
55609,
198,
7847,
1469,
9037,
7383,
25,
610,
11,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
54644,
1495,
505,
1495,
627,
7847,
1469,
9037,
24321,
56805,
25,
1796,
58,
4066,
2097,
1145,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5464,
2097,
55609,
198,
54644,
1984,
505,
6743,
627,
16503,
1817,
9643,
35627,
35345,
367,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
264,
11240,
315,
279,
445,
11237,
627,
27853,
505,
5156,
851,
7790,
851,
25,
610,
11,
3465,
25,
610,
11,
3756,
25,
528,
284,
482,
220,
16,
11,
1646,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
15660,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
55609,
198,
29568,
279,
15660,
1665,
505,
1646,
851,
323,
3465,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.jsonformer_decoder.JsonFormer.html |
0e550632215f-2 | Construct the pipeline object from model_id and task.
generate(prompts: List[str], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, **kwargs: Any) → LLMResult¶
Run the LLM on the given prompt and input.
generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶
Take in a list of prompt values and return an LLMResult.
get_num_tokens(text: str) → int¶
Get the number of tokens present in the text.
get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶
Get the number of tokens in the message.
get_token_ids(text: str) → List[int]¶
Get the token present in the text.
predict(text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → str¶
Predict text from text.
predict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶
Predict message from messages.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
save(file_path: Union[Path, str]) → None¶
Save the LLM.
Parameters
file_path – Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=”path/llm.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
This allows users to pass in None as verbose to access the global setting. | [
29568,
279,
15660,
1665,
505,
1646,
851,
323,
3465,
627,
19927,
84432,
13044,
25,
1796,
17752,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
6869,
279,
445,
11237,
389,
279,
2728,
10137,
323,
1988,
627,
19927,
62521,
84432,
13044,
25,
1796,
43447,
15091,
1150,
1145,
3009,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
445,
11237,
2122,
55609,
198,
18293,
304,
264,
1160,
315,
10137,
2819,
323,
471,
459,
445,
11237,
2122,
627,
456,
4369,
29938,
7383,
25,
610,
8,
11651,
528,
55609,
198,
1991,
279,
1396,
315,
11460,
3118,
304,
279,
1495,
627,
456,
4369,
29938,
5791,
24321,
56805,
25,
1796,
58,
4066,
2097,
2526,
11651,
528,
55609,
198,
1991,
279,
1396,
315,
11460,
304,
279,
1984,
627,
456,
6594,
8237,
7383,
25,
610,
8,
11651,
1796,
19155,
60,
55609,
198,
1991,
279,
4037,
3118,
304,
279,
1495,
627,
35798,
7383,
25,
610,
11,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
54644,
1495,
505,
1495,
627,
35798,
24321,
56805,
25,
1796,
58,
4066,
2097,
1145,
12039,
3009,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5464,
2097,
55609,
198,
54644,
1984,
505,
6743,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
445,
11237,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
445,
11237,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
657,
76,
5799,
4971,
2703,
45221,
2398,
14,
657,
76,
34506,
863,
340,
16503,
743,
69021,
4194,
8345,
4194,
14008,
55609,
198,
2746,
14008,
374,
2290,
11,
743,
433,
627,
2028,
6276,
3932,
311,
1522,
304,
2290,
439,
14008,
311,
2680,
279,
3728,
6376,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.jsonformer_decoder.JsonFormer.html |
0e550632215f-3 | This allows users to pass in None as verbose to access the global setting.
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
Configuration for this pydantic object.
extra = 'forbid'¶ | [
2028,
6276,
3932,
311,
1522,
304,
2290,
439,
14008,
311,
2680,
279,
3728,
6376,
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,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.llms.jsonformer_decoder.JsonFormer.html |
d51460764215-0 | langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser¶
class langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser[source]¶
Bases: BaseAutoGPTOutputParser
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.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str¶
Instructions on how the LLM output should be formatted.
parse(text: str) → AutoGPTAction[source]¶
Return AutoGPTAction
parse_result(result: List[Generation]) → T¶
Parse LLM Result.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – output of language model
prompt – prompt value
Returns
structured output
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¶ | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6613,
38,
2898,
5207,
6707,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6613,
38,
2898,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
5464,
13556,
38,
2898,
5207,
6707,
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,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
456,
9132,
83527,
368,
11651,
610,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
9156,
38,
2898,
2573,
76747,
60,
55609,
198,
5715,
9156,
38,
2898,
2573,
198,
6534,
5400,
4556,
25,
1796,
58,
38238,
2526,
11651,
350,
55609,
198,
14802,
445,
11237,
5832,
627,
6534,
6753,
62521,
91868,
25,
610,
11,
10137,
25,
60601,
1150,
8,
11651,
5884,
55609,
198,
15669,
1749,
311,
4820,
279,
2612,
315,
459,
445,
11237,
1650,
449,
264,
10137,
627,
791,
10137,
374,
14090,
3984,
304,
279,
1567,
279,
9442,
6707,
6944,
198,
998,
23515,
477,
5155,
279,
2612,
304,
1063,
1648,
11,
323,
3966,
2038,
505,
198,
1820,
10137,
311,
656,
779,
627,
9905,
198,
44412,
1389,
2612,
315,
4221,
1646,
198,
41681,
1389,
10137,
907,
198,
16851,
198,
52243,
2612,
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
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html |
d51460764215-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
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/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html |
fc08f9922407-0 | langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction¶
class langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction(name, args)[source]¶
Bases: NamedTuple
Create new instance of AutoGPTAction(name, args)
Methods
__init__()
count(value, /)
Return number of occurrences of value.
index(value[, start, stop])
Return first index of value.
Attributes
args
Alias for field number 1
name
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.
args: Dict¶
Alias for field number 1
name: str¶
Alias for field number 0 | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6613,
38,
2898,
2573,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
6613,
38,
2898,
2573,
3232,
11,
2897,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
41559,
29781,
198,
4110,
502,
2937,
315,
9156,
38,
2898,
2573,
3232,
11,
2897,
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,
2164,
198,
23555,
369,
2115,
1396,
220,
16,
198,
609,
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,
2164,
25,
30226,
55609,
198,
23555,
369,
2115,
1396,
220,
16,
198,
609,
25,
610,
55609,
198,
23555,
369,
2115,
1396,
220,
15
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction.html |
e9cc7985a7d2-0 | langchain.experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser¶
class langchain.experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser[source]¶
Bases: BaseOutputParser
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.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str¶
Instructions on how the LLM output should be formatted.
abstract parse(text: str) → AutoGPTAction[source]¶
Return AutoGPTAction
parse_result(result: List[Generation]) → T¶
Parse LLM Result.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – output of language model
prompt – prompt value
Returns
structured output
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¶ | [
5317,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
13316,
13556,
38,
2898,
5207,
6707,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
32155,
540,
418,
13718,
19024,
13316,
13556,
38,
2898,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
5464,
5207,
6707,
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,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
456,
9132,
83527,
368,
11651,
610,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
16647,
4820,
7383,
25,
610,
8,
11651,
9156,
38,
2898,
2573,
76747,
60,
55609,
198,
5715,
9156,
38,
2898,
2573,
198,
6534,
5400,
4556,
25,
1796,
58,
38238,
2526,
11651,
350,
55609,
198,
14802,
445,
11237,
5832,
627,
6534,
6753,
62521,
91868,
25,
610,
11,
10137,
25,
60601,
1150,
8,
11651,
5884,
55609,
198,
15669,
1749,
311,
4820,
279,
2612,
315,
459,
445,
11237,
1650,
449,
264,
10137,
627,
791,
10137,
374,
14090,
3984,
304,
279,
1567,
279,
9442,
6707,
6944,
198,
998,
23515,
477,
5155,
279,
2612,
304,
1063,
1648,
11,
323,
3966,
2038,
505,
198,
1820,
10137,
311,
656,
779,
627,
9905,
198,
44412,
1389,
2612,
315,
4221,
1646,
198,
41681,
1389,
10137,
907,
198,
16851,
198,
52243,
2612,
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
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html |
e9cc7985a7d2-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
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/experimental/langchain.experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html |
676ce98d43ce-0 | langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain¶
class langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Optional[List[str]] = None, prompt: BasePromptTemplate, llm: BaseLanguageModel, output_key: str = 'text', output_parser: BaseLLMOutputParser = None, return_final_only: bool = True, llm_kwargs: dict = None)[source]¶
Bases: LLMChain
Chain to prioritize tasks.
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 callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated, use callbacks instead.
param callbacks: Callbacks = None¶
Optional list of callback handlers (or callback manager). Defaults to None.
Callback handlers are called throughout the lifecycle of a call to a chain,
starting with on_chain_start, ending with on_chain_end or on_chain_error.
Each custom chain can optionally call additional callback methods, see Callback docs
for full details.
param llm: BaseLanguageModel [Required]¶
Language model to call.
param llm_kwargs: dict [Optional]¶
param memory: Optional[BaseMemory] = None¶
Optional memory object. Defaults to None.
Memory is a class that gets called at the start
and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables. | [
5317,
8995,
88547,
32155,
30946,
77447,
960,
6243,
21233,
72,
15384,
59882,
275,
2065,
29358,
50571,
275,
2065,
19368,
55609,
198,
1058,
8859,
8995,
88547,
32155,
30946,
77447,
960,
6243,
21233,
72,
15384,
59882,
275,
2065,
29358,
50571,
275,
2065,
19368,
4163,
11,
5044,
25,
12536,
58,
4066,
10869,
60,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
14008,
25,
1845,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
10137,
25,
5464,
55715,
7423,
11,
9507,
76,
25,
5464,
14126,
1747,
11,
2612,
3173,
25,
610,
284,
364,
1342,
518,
2612,
19024,
25,
5464,
4178,
44,
5207,
6707,
284,
2290,
11,
471,
21333,
18917,
25,
1845,
284,
3082,
11,
9507,
76,
37335,
25,
6587,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
445,
11237,
19368,
198,
19368,
311,
63652,
9256,
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,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
52444,
11,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
15669,
1160,
315,
4927,
25050,
320,
269,
4927,
6783,
570,
37090,
311,
2290,
627,
7646,
25050,
527,
2663,
6957,
279,
48608,
315,
264,
1650,
311,
264,
8957,
345,
40389,
449,
389,
31683,
5011,
11,
13696,
449,
389,
31683,
6345,
477,
389,
31683,
4188,
627,
4959,
2587,
8957,
649,
46624,
1650,
5217,
4927,
5528,
11,
1518,
23499,
27437,
198,
2000,
2539,
3649,
627,
913,
9507,
76,
25,
5464,
14126,
1747,
510,
8327,
60,
55609,
198,
14126,
1646,
311,
1650,
627,
913,
9507,
76,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
913,
5044,
25,
12536,
58,
4066,
10869,
60,
284,
2290,
55609,
198,
15669,
5044,
1665,
13,
37090,
311,
2290,
627,
10869,
374,
264,
538,
430,
5334,
2663,
520,
279,
1212,
198,
438,
520,
279,
842,
315,
1475,
8957,
13,
2468,
279,
1212,
11,
5044,
21577,
7482,
323,
16609,
198,
49818,
3235,
304,
279,
8957,
13,
2468,
279,
842,
11,
433,
27024,
904,
6052,
7482,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-1 | them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full catalog.
param output_key: str = 'text'¶
param output_parser: BaseLLMOutputParser [Optional]¶
Output parser to use.
Defaults to one that takes the most likely string but does not change it
otherwise.
param prompt: BasePromptTemplate [Required]¶
Prompt object to use.
param return_final_only: bool = True¶
Whether to return only the final parsed result. Defaults to True.
If false, will return a bunch of extra information about the generation.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with the chain. Defaults to None
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param verbose: bool [Optional]¶
Whether or not run in verbose mode. In verbose mode, some intermediate logs
will be printed to the console. Defaults to langchain.verbose value.
__call__(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → Dict[str, Any]¶
Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this | [
49818,
3235,
304,
279,
8957,
13,
2468,
279,
842,
11,
433,
27024,
904,
6052,
7482,
627,
3947,
527,
1690,
2204,
4595,
315,
5044,
482,
4587,
1518,
5044,
27437,
198,
2000,
279,
2539,
16808,
627,
913,
2612,
3173,
25,
610,
284,
364,
1342,
6,
55609,
198,
913,
2612,
19024,
25,
5464,
4178,
44,
5207,
6707,
510,
15669,
60,
55609,
198,
5207,
6871,
311,
1005,
627,
16672,
311,
832,
430,
5097,
279,
1455,
4461,
925,
719,
1587,
539,
2349,
433,
198,
61036,
627,
913,
10137,
25,
5464,
55715,
7423,
510,
8327,
60,
55609,
198,
55715,
1665,
311,
1005,
627,
913,
471,
21333,
18917,
25,
1845,
284,
3082,
55609,
198,
25729,
311,
471,
1193,
279,
1620,
16051,
1121,
13,
37090,
311,
3082,
627,
2746,
905,
11,
690,
471,
264,
15860,
315,
5066,
2038,
922,
279,
9659,
627,
913,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
15669,
1160,
315,
9681,
5938,
449,
279,
8957,
13,
37090,
311,
2290,
198,
9673,
9681,
690,
387,
5938,
449,
1855,
1650,
311,
420,
8957,
345,
438,
5946,
439,
6105,
311,
279,
25050,
4613,
304,
27777,
627,
2675,
649,
1005,
1521,
311,
8866,
10765,
264,
3230,
2937,
315,
264,
8957,
449,
1202,
1005,
1162,
627,
913,
14008,
25,
1845,
510,
15669,
60,
55609,
198,
25729,
477,
539,
1629,
304,
14008,
3941,
13,
763,
14008,
3941,
11,
1063,
29539,
18929,
198,
14724,
387,
17124,
311,
279,
2393,
13,
37090,
311,
8859,
8995,
45749,
907,
627,
565,
6797,
3889,
25986,
25,
9323,
58,
13755,
17752,
11,
5884,
1145,
5884,
1145,
471,
18917,
36289,
25,
1845,
284,
3641,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
2997,
14334,
3186,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
6869,
279,
12496,
315,
420,
8957,
323,
923,
311,
2612,
422,
12974,
627,
9905,
198,
25986,
1389,
10685,
315,
11374,
11,
477,
3254,
1988,
422,
8957,
25283,
198,
3323,
832,
1719,
627,
693,
18917,
36289,
1389,
2777,
369,
3508,
311,
471,
1193,
16674,
304,
279,
198,
2376,
13,
1442,
3082,
11,
1193,
502,
7039,
8066,
555,
420,
8957,
690,
387,
198,
78691,
13,
1442,
3641,
11,
2225,
1988,
7039,
323,
502,
7039,
8066,
555,
420
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-2 | returned. If False, both input keys and new keys generated by this
chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False.
async aapply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶
Utilize the LLM generate method for speed gains.
async aapply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶
Call apply and then parse the results.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → Dict[str, Any]¶
Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this
chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False. | [
78691,
13,
1442,
3641,
11,
2225,
1988,
7039,
323,
502,
7039,
8066,
555,
420,
198,
8995,
690,
387,
6052,
13,
37090,
311,
3641,
627,
69411,
1389,
23499,
82,
311,
1005,
369,
420,
8957,
1629,
13,
1442,
539,
3984,
11,
690,
198,
817,
279,
27777,
3984,
311,
279,
8957,
627,
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
627,
7847,
264,
10492,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
1796,
58,
13755,
17752,
11,
610,
5163,
55609,
198,
2810,
553,
279,
445,
11237,
7068,
1749,
369,
4732,
20192,
627,
7847,
264,
10492,
8543,
21715,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
33758,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
60,
55609,
198,
7368,
3881,
323,
1243,
4820,
279,
3135,
627,
7847,
1645,
543,
35099,
25,
9323,
58,
13755,
17752,
11,
5884,
1145,
5884,
1145,
471,
18917,
36289,
25,
1845,
284,
3641,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
12039,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
2997,
14334,
3186,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
6869,
279,
12496,
315,
420,
8957,
323,
923,
311,
2612,
422,
12974,
627,
9905,
198,
25986,
1389,
10685,
315,
11374,
11,
477,
3254,
1988,
422,
8957,
25283,
198,
3323,
832,
1719,
627,
693,
18917,
36289,
1389,
2777,
369,
3508,
311,
471,
1193,
16674,
304,
279,
198,
2376,
13,
1442,
3082,
11,
1193,
502,
7039,
8066,
555,
420,
8957,
690,
387,
198,
78691,
13,
1442,
3641,
11,
2225,
1988,
7039,
323,
502,
7039,
8066,
555,
420,
198,
8995,
690,
387,
6052,
13,
37090,
311,
3641,
627,
69411,
1389,
23499,
82,
311,
1005,
369,
420,
8957,
1629,
13,
1442,
539,
3984,
11,
690,
198,
817,
279,
27777,
3984,
311,
279,
8957,
627,
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-3 | include_run_info – Whether to include run info in the response. Defaults
to False.
async agenerate(input_list: List[Dict[str, Any]], run_manager: Optional[AsyncCallbackManagerForChainRun] = None) → LLMResult¶
Generate LLM result from inputs.
apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶
Utilize the LLM generate method for speed gains.
apply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶
Call apply and then parse the results.
async apredict(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶
Format prompt with kwargs and pass to LLM.
Parameters
callbacks – Callbacks to pass to LLMChain
**kwargs – Keys to pass to prompt template.
Returns
Completion from LLM.
Example
completion = llm.predict(adjective="funny")
async apredict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, str]]¶
Call apredict and then parse the results.
async aprep_prompts(input_list: List[Dict[str, Any]], run_manager: Optional[AsyncCallbackManagerForChainRun] = None) → Tuple[List[PromptValue], Optional[List[str]]]¶
Prepare prompts from inputs. | [
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
627,
7847,
945,
13523,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
6662,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
445,
11237,
2122,
55609,
198,
32215,
445,
11237,
1121,
505,
11374,
627,
10492,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
1796,
58,
13755,
17752,
11,
610,
5163,
55609,
198,
2810,
553,
279,
445,
11237,
7068,
1749,
369,
4732,
20192,
627,
10492,
8543,
21715,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
33758,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
60,
55609,
198,
7368,
3881,
323,
1243,
4820,
279,
3135,
627,
7847,
1469,
9037,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4152,
10137,
449,
16901,
323,
1522,
311,
445,
11237,
627,
9905,
198,
69411,
1389,
23499,
82,
311,
1522,
311,
445,
11237,
19368,
198,
334,
9872,
1389,
25104,
311,
1522,
311,
10137,
3896,
627,
16851,
198,
34290,
505,
445,
11237,
627,
13617,
198,
44412,
284,
9507,
76,
24706,
44879,
51591,
429,
12158,
3919,
1158,
7847,
1469,
9037,
8543,
21715,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
610,
5163,
55609,
198,
7368,
1469,
9037,
323,
1243,
4820,
279,
3135,
627,
7847,
1469,
10200,
48977,
13044,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
6662,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
25645,
53094,
43447,
15091,
1150,
1145,
12536,
53094,
17752,
5163,
60,
55609,
198,
51690,
52032,
505,
11374,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-4 | Prepare prompts from inputs.
async arun(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
create_outputs(llm_result: LLMResult) → List[Dict[str, Any]]¶
Create outputs from response.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_llm(llm: BaseLanguageModel, verbose: bool = True) → LLMChain[source]¶
Get the response parser.
classmethod from_string(llm: BaseLanguageModel, template: str) → LLMChain¶
Create LLMChain from LLM and template.
generate(input_list: List[Dict[str, Any]], run_manager: Optional[CallbackManagerForChainRun] = None) → LLMResult¶
Generate LLM result from inputs.
predict(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → str¶
Format prompt with kwargs and pass to LLM.
Parameters
callbacks – Callbacks to pass to LLMChain
**kwargs – Keys to pass to prompt template.
Returns
Completion from LLM.
Example
completion = llm.predict(adjective="funny")
predict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, Any]]¶
Call predict and then parse the results.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs. | [
51690,
52032,
505,
11374,
627,
7847,
802,
359,
4163,
2164,
25,
5884,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
6869,
279,
8957,
439,
1495,
304,
11,
1495,
704,
477,
5361,
7482,
11,
1495,
704,
627,
3261,
36289,
36621,
76,
5400,
25,
445,
11237,
2122,
8,
11651,
1796,
58,
13755,
17752,
11,
5884,
5163,
55609,
198,
4110,
16674,
505,
2077,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8957,
627,
27853,
505,
44095,
76,
36621,
76,
25,
5464,
14126,
1747,
11,
14008,
25,
1845,
284,
3082,
8,
11651,
445,
11237,
19368,
76747,
60,
55609,
198,
1991,
279,
2077,
6871,
627,
27853,
505,
3991,
36621,
76,
25,
5464,
14126,
1747,
11,
3896,
25,
610,
8,
11651,
445,
11237,
19368,
55609,
198,
4110,
445,
11237,
19368,
505,
445,
11237,
323,
3896,
627,
19927,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
445,
11237,
2122,
55609,
198,
32215,
445,
11237,
1121,
505,
11374,
627,
35798,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
4152,
10137,
449,
16901,
323,
1522,
311,
445,
11237,
627,
9905,
198,
69411,
1389,
23499,
82,
311,
1522,
311,
445,
11237,
19368,
198,
334,
9872,
1389,
25104,
311,
1522,
311,
10137,
3896,
627,
16851,
198,
34290,
505,
445,
11237,
627,
13617,
198,
44412,
284,
9507,
76,
24706,
44879,
51591,
429,
12158,
3919,
1158,
35798,
8543,
21715,
24885,
82,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
17752,
11,
1796,
17752,
1145,
30226,
17752,
11,
5884,
5163,
55609,
198,
7368,
7168,
323,
1243,
4820,
279,
3135,
627,
72874,
29657,
35099,
25,
9323,
58,
13755,
17752,
11,
5884,
1145,
5884,
2526,
11651,
30226,
17752,
11,
610,
60,
55609,
198,
18409,
323,
22033,
11374,
13
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-5 | Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
prep_prompts(input_list: List[Dict[str, Any]], run_manager: Optional[CallbackManagerForChainRun] = None) → Tuple[List[PromptValue], Optional[List[str]]]¶
Prepare prompts from inputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
Save the chain.
Parameters
file_path – Path to file to save the chain to.
Example:
.. code-block:: python
chain.save(file_path=”path/chain.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
This allows users to pass in None as verbose to access the global setting.
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”} | [
18409,
323,
22033,
11374,
627,
72874,
36289,
35099,
25,
30226,
17752,
11,
610,
1145,
16674,
25,
30226,
17752,
11,
610,
1145,
471,
18917,
36289,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
610,
60,
55609,
198,
18409,
323,
22033,
16674,
627,
72874,
48977,
13044,
5498,
2062,
25,
1796,
58,
13755,
17752,
11,
5884,
21128,
1629,
12418,
25,
12536,
58,
7646,
2087,
2520,
19368,
6869,
60,
284,
2290,
8,
11651,
25645,
53094,
43447,
15091,
1150,
1145,
12536,
53094,
17752,
5163,
60,
55609,
198,
51690,
52032,
505,
11374,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6236,
4163,
2164,
25,
5884,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
55609,
198,
6869,
279,
8957,
439,
1495,
304,
11,
1495,
704,
477,
5361,
7482,
11,
1495,
704,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8957,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8957,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
8995,
5799,
4971,
2703,
45221,
2398,
14,
8995,
34506,
863,
340,
16503,
743,
69021,
4194,
8345,
4194,
14008,
55609,
198,
2746,
14008,
374,
2290,
11,
743,
433,
627,
2028,
6276,
3932,
311,
1522,
304,
2290,
439,
14008,
311,
2680,
279,
3728,
6376,
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,
92
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
676ce98d43ce-6 | eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
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,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/experimental/langchain.experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html |
9d70fb1a1a56-0 | langchain.retrievers.kendra.QueryResultItem¶
class langchain.retrievers.kendra.QueryResultItem(*, DocumentId: str, DocumentTitle: TextWithHighLights, DocumentURI: Optional[str] = None, FeedbackToken: Optional[str] = None, Format: Optional[str] = None, Id: Optional[str] = None, Type: Optional[str] = None, AdditionalAttributes: Optional[List[AdditionalResultAttribute]] = [], DocumentExcerpt: Optional[TextWithHighLights] = None, **extra_data: Any)[source]¶
Bases: 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 AdditionalAttributes: Optional[List[langchain.retrievers.kendra.AdditionalResultAttribute]] = []¶
param DocumentExcerpt: Optional[langchain.retrievers.kendra.TextWithHighLights] = None¶
param DocumentId: str [Required]¶
param DocumentTitle: langchain.retrievers.kendra.TextWithHighLights [Required]¶
param DocumentURI: Optional[str] = None¶
param FeedbackToken: Optional[str] = None¶
param Format: Optional[str] = None¶
param Id: Optional[str] = None¶
param Type: Optional[str] = None¶
get_attribute_value() → str[source]¶
get_excerpt() → str[source]¶
to_doc() → Document[source]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
16060,
2122,
1256,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
16060,
2122,
1256,
4163,
11,
12051,
769,
25,
610,
11,
12051,
3936,
25,
2991,
2409,
12243,
75584,
11,
12051,
10514,
25,
12536,
17752,
60,
284,
2290,
11,
37957,
3404,
25,
12536,
17752,
60,
284,
2290,
11,
15392,
25,
12536,
17752,
60,
284,
2290,
11,
5336,
25,
12536,
17752,
60,
284,
2290,
11,
4078,
25,
12536,
17752,
60,
284,
2290,
11,
24086,
10738,
25,
12536,
53094,
58,
30119,
2122,
3994,
5163,
284,
10277,
12051,
849,
35128,
25,
12536,
58,
1199,
2409,
12243,
75584,
60,
284,
2290,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
24086,
10738,
25,
12536,
53094,
58,
5317,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
3994,
5163,
284,
3132,
55609,
198,
913,
12051,
849,
35128,
25,
12536,
58,
5317,
8995,
1351,
9104,
3078,
5314,
61799,
2021,
2409,
12243,
75584,
60,
284,
2290,
55609,
198,
913,
12051,
769,
25,
610,
510,
8327,
60,
55609,
198,
913,
12051,
3936,
25,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
2021,
2409,
12243,
75584,
510,
8327,
60,
55609,
198,
913,
12051,
10514,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
37957,
3404,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
15392,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
5336,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
4078,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
456,
17209,
3220,
368,
11651,
610,
76747,
60,
55609,
198,
456,
68047,
368,
11651,
610,
76747,
60,
55609,
198,
998,
19401,
368,
11651,
12051,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.QueryResultItem.html |
ab2b2743926a-0 | langchain.retrievers.arxiv.ArxivRetriever¶
class langchain.retrievers.arxiv.ArxivRetriever(*, arxiv_search: Any = None, arxiv_exceptions: Any = None, top_k_results: int = 3, load_max_docs: int = 100, load_all_available_meta: bool = False, doc_content_chars_max: Optional[int] = 4000, ARXIV_MAX_QUERY_LENGTH: int = 300)[source]¶
Bases: BaseRetriever, ArxivAPIWrapper
It is effectively a wrapper for ArxivAPIWrapper.
It wraps load() to get_relevant_documents().
It uses all ArxivAPIWrapper arguments without any change.
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 arxiv_exceptions: Any = None¶
param doc_content_chars_max: Optional[int] = 4000¶
param load_all_available_meta: bool = False¶
param load_max_docs: int = 100¶
param top_k_results: int = 3¶
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
load(query: str) → List[Document]¶ | [
5317,
8995,
1351,
9104,
3078,
17126,
89833,
885,
12940,
344,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
17126,
89833,
885,
12940,
344,
12289,
462,
2099,
4163,
11,
802,
89833,
10947,
25,
5884,
284,
2290,
11,
802,
89833,
81136,
25,
5884,
284,
2290,
11,
1948,
4803,
13888,
25,
528,
284,
220,
18,
11,
2865,
6479,
50792,
25,
528,
284,
220,
1041,
11,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
11,
4733,
7647,
38518,
6479,
25,
12536,
19155,
60,
284,
220,
3443,
15,
11,
6395,
55,
3166,
6949,
32685,
15373,
25,
528,
284,
220,
3101,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
1676,
89833,
7227,
11803,
198,
2181,
374,
13750,
264,
13564,
369,
1676,
89833,
7227,
11803,
627,
2181,
40809,
2865,
368,
311,
636,
1311,
8532,
77027,
26914,
2181,
5829,
682,
1676,
89833,
7227,
11803,
6105,
2085,
904,
2349,
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,
802,
89833,
81136,
25,
5884,
284,
2290,
55609,
198,
913,
4733,
7647,
38518,
6479,
25,
12536,
19155,
60,
284,
220,
3443,
15,
55609,
198,
913,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
55609,
198,
913,
2865,
6479,
50792,
25,
528,
284,
220,
1041,
55609,
198,
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609,
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,
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,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.arxiv.ArxivRetriever.html |
ab2b2743926a-1 | Returns
List of relevant documents
load(query: str) → List[Document]¶
Run Arxiv search and get the article texts plus the article meta information.
See https://lukasschwab.me/arxiv.py/index.html#Search
Returns: a list of documents with the document.page_content in text format
run(query: str) → str¶
Run Arxiv search and get the article meta information.
See https://lukasschwab.me/arxiv.py/index.html#Search
See https://lukasschwab.me/arxiv.py/index.html#Result
It uses only the most informative fields of article meta information.
validator validate_environment » all fields¶
Validate that the python package exists in environment.
model Config¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
16851,
198,
861,
315,
9959,
9477,
198,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
6869,
1676,
89833,
2778,
323,
636,
279,
4652,
22755,
5636,
279,
4652,
8999,
2038,
627,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
6014,
198,
16851,
25,
264,
1160,
315,
9477,
449,
279,
2246,
10678,
7647,
304,
1495,
3645,
198,
6236,
10974,
25,
610,
8,
11651,
610,
55609,
198,
6869,
1676,
89833,
2778,
323,
636,
279,
4652,
8999,
2038,
627,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
6014,
198,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
2122,
198,
2181,
5829,
1193,
279,
1455,
39319,
5151,
315,
4652,
8999,
2038,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
279,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.arxiv.ArxivRetriever.html |
aa1c6163bd1b-0 | langchain.retrievers.svm.SVMRetriever¶
class langchain.retrievers.svm.SVMRetriever(*, embeddings: Embeddings, index: Any = None, texts: List[str], k: int = 4, relevancy_threshold: Optional[float] = None)[source]¶
Bases: BaseRetriever, BaseModel
SVM Retriever.
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 embeddings: langchain.embeddings.base.Embeddings [Required]¶
param index: Any = None¶
param k: int = 4¶
param relevancy_threshold: Optional[float] = None¶
param texts: List[str] [Required]¶
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
classmethod from_texts(texts: List[str], embeddings: Embeddings, **kwargs: Any) → SVMRetriever[source]¶
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
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
1351,
9104,
3078,
516,
7488,
815,
11435,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
516,
7488,
815,
11435,
12289,
462,
2099,
4163,
11,
71647,
25,
38168,
25624,
11,
1963,
25,
5884,
284,
2290,
11,
22755,
25,
1796,
17752,
1145,
597,
25,
528,
284,
220,
19,
11,
79415,
6709,
22616,
25,
12536,
96481,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
50,
11435,
10608,
462,
2099,
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,
71647,
25,
8859,
8995,
41541,
25624,
9105,
58955,
25624,
510,
8327,
60,
55609,
198,
913,
1963,
25,
5884,
284,
2290,
55609,
198,
913,
597,
25,
528,
284,
220,
19,
55609,
198,
913,
79415,
6709,
22616,
25,
12536,
96481,
60,
284,
2290,
55609,
198,
913,
22755,
25,
1796,
17752,
60,
510,
8327,
60,
55609,
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,
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,
27853,
505,
80746,
7383,
82,
25,
1796,
17752,
1145,
71647,
25,
38168,
25624,
11,
3146,
9872,
25,
5884,
8,
11651,
91109,
12289,
462,
2099,
76747,
60,
55609,
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,
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/retrievers/langchain.retrievers.svm.SVMRetriever.html |
c25352af8ecc-0 | langchain.retrievers.self_query.pinecone.PineconeTranslator¶
class langchain.retrievers.self_query.pinecone.PineconeTranslator[source]¶
Bases: Visitor
Logic for converting internal query language elements to valid filters.
Methods
__init__()
visit_comparison(comparison)
Translate a Comparison.
visit_operation(operation)
Translate an Operation.
visit_structured_query(structured_query)
Translate a StructuredQuery.
Attributes
allowed_comparators
allowed_operators
Subset of allowed logical operators.
visit_comparison(comparison: Comparison) → Dict[source]¶
Translate a Comparison.
visit_operation(operation: Operation) → Dict[source]¶
Translate an Operation.
visit_structured_query(structured_query: StructuredQuery) → Tuple[str, dict][source]¶
Translate a StructuredQuery.
allowed_comparators: Optional[Sequence[Comparator]] = None¶
allowed_operators: Optional[Sequence[Operator]] = [<Operator.AND: 'and'>, <Operator.OR: 'or'>]¶
Subset of allowed logical operators. | [
5317,
8995,
1351,
9104,
3078,
28248,
5857,
558,
483,
59182,
1087,
483,
59182,
52753,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
28248,
5857,
558,
483,
59182,
1087,
483,
59182,
52753,
76747,
60,
55609,
198,
33,
2315,
25,
56982,
198,
27849,
369,
34537,
5419,
3319,
4221,
5540,
311,
2764,
13711,
627,
18337,
198,
565,
2381,
33716,
28560,
91897,
14426,
36642,
340,
28573,
264,
43551,
627,
28560,
33665,
53447,
340,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
340,
28573,
264,
16531,
3149,
2929,
627,
10738,
198,
21642,
3038,
1768,
3046,
198,
21642,
26716,
3046,
198,
71684,
315,
5535,
20406,
20197,
627,
28560,
91897,
14426,
36642,
25,
43551,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
264,
43551,
627,
28560,
33665,
53447,
25,
17145,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
25,
16531,
3149,
2929,
8,
11651,
25645,
17752,
11,
6587,
1483,
2484,
60,
55609,
198,
28573,
264,
16531,
3149,
2929,
627,
21642,
3038,
1768,
3046,
25,
12536,
58,
14405,
58,
39758,
5163,
284,
2290,
55609,
198,
21642,
26716,
3046,
25,
12536,
58,
14405,
58,
18968,
5163,
284,
68326,
18968,
885,
8225,
25,
364,
438,
6404,
11,
366,
18968,
78997,
25,
364,
269,
6404,
60,
55609,
198,
71684,
315,
5535,
20406,
20197,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.self_query.pinecone.PineconeTranslator.html |
e9a37d6c8851-0 | langchain.retrievers.multi_query.LineListOutputParser¶
class langchain.retrievers.multi_query.LineListOutputParser[source]¶
Bases: PydanticOutputParser
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 pydantic_object: Type[langchain.output_parsers.pydantic.T] [Required]¶
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str¶
Instructions on how the LLM output should be formatted.
parse(text: str) → LineList[source]¶
Parse the output of an LLM call.
A method which takes in a string (assumed output of a language model )
and parses it into some structure.
Parameters
text – output of language model
Returns
structured output
parse_result(result: List[Generation]) → T¶
Parse LLM Result.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion – output of language model
prompt – prompt value
Returns
structured output
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”] | [
5317,
8995,
1351,
9104,
3078,
52251,
5857,
16825,
861,
5207,
6707,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
52251,
5857,
16825,
861,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
5468,
67,
8322,
5207,
6707,
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,
4611,
67,
8322,
5427,
25,
4078,
58,
5317,
8995,
13718,
623,
41588,
7345,
67,
8322,
844,
60,
510,
8327,
60,
55609,
198,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
456,
9132,
83527,
368,
11651,
610,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
7228,
861,
76747,
60,
55609,
198,
14802,
279,
2612,
315,
459,
445,
11237,
1650,
627,
32,
1749,
902,
5097,
304,
264,
925,
320,
395,
39255,
2612,
315,
264,
4221,
1646,
1763,
438,
71935,
433,
1139,
1063,
6070,
627,
9905,
198,
1342,
1389,
2612,
315,
4221,
1646,
198,
16851,
198,
52243,
2612,
198,
6534,
5400,
4556,
25,
1796,
58,
38238,
2526,
11651,
350,
55609,
198,
14802,
445,
11237,
5832,
627,
6534,
6753,
62521,
91868,
25,
610,
11,
10137,
25,
60601,
1150,
8,
11651,
5884,
55609,
198,
15669,
1749,
311,
4820,
279,
2612,
315,
459,
445,
11237,
1650,
449,
264,
10137,
627,
791,
10137,
374,
14090,
3984,
304,
279,
1567,
279,
9442,
6707,
6944,
198,
998,
23515,
477,
5155,
279,
2612,
304,
1063,
1648,
11,
323,
3966,
2038,
505,
198,
1820,
10137,
311,
656,
779,
627,
9905,
198,
44412,
1389,
2612,
315,
4221,
1646,
198,
41681,
1389,
10137,
907,
198,
16851,
198,
52243,
2612,
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,
60
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.multi_query.LineListOutputParser.html |
e9a37d6c8851-1 | 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'¶ | [
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/retrievers/langchain.retrievers.multi_query.LineListOutputParser.html |
a179da48f6e5-0 | langchain.retrievers.kendra.QueryResult¶
class langchain.retrievers.kendra.QueryResult(*, ResultItems: List[QueryResultItem], **extra_data: Any)[source]¶
Bases: 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 ResultItems: List[langchain.retrievers.kendra.QueryResultItem] [Required]¶
get_top_k_docs(top_n: int) → List[Document][source]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
16060,
2122,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
16060,
2122,
4163,
11,
5832,
4451,
25,
1796,
58,
2929,
2122,
1256,
1145,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
5832,
4451,
25,
1796,
58,
5317,
8995,
1351,
9104,
3078,
5314,
61799,
16060,
2122,
1256,
60,
510,
8327,
60,
55609,
198,
456,
10643,
4803,
50792,
18100,
1107,
25,
528,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.QueryResult.html |
18ad11e000a0-0 | langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever¶
class langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever(*, vectorstore: VectorStore, search_kwargs: dict = None, memory_stream: List[Document] = None, decay_rate: float = 0.01, k: int = 4, other_score_keys: List[str] = [], default_salience: Optional[float] = None)[source]¶
Bases: BaseRetriever, BaseModel
Retriever combining embedding similarity with recency.
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 decay_rate: float = 0.01¶
The exponential decay factor used as (1.0-decay_rate)**(hrs_passed).
param default_salience: Optional[float] = None¶
The salience to assign memories not retrieved from the vector store.
None assigns no salience to documents not fetched from the vector store.
param k: int = 4¶
The maximum number of documents to retrieve in a given call.
param memory_stream: List[langchain.schema.Document] [Optional]¶
The memory_stream of documents to search through.
param other_score_keys: List[str] = []¶
Other keys in the metadata to factor into the score, e.g. ‘importance’.
param search_kwargs: dict [Optional]¶
Keyword arguments to pass to the vectorstore similarity search.
param vectorstore: langchain.vectorstores.base.VectorStore [Required]¶
The vectorstore to store documents and determine salience.
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str][source]¶
Add documents to vectorstore. | [
5317,
8995,
1351,
9104,
3078,
6512,
16255,
291,
1311,
9104,
424,
16698,
8459,
291,
3866,
6221,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
6512,
16255,
291,
1311,
9104,
424,
16698,
8459,
291,
3866,
6221,
12289,
462,
2099,
4163,
11,
4724,
4412,
25,
4290,
6221,
11,
2778,
37335,
25,
6587,
284,
2290,
11,
5044,
12962,
25,
1796,
58,
7676,
60,
284,
2290,
11,
31815,
9430,
25,
2273,
284,
220,
15,
13,
1721,
11,
597,
25,
528,
284,
220,
19,
11,
1023,
10622,
12919,
25,
1796,
17752,
60,
284,
10277,
1670,
63591,
1873,
25,
12536,
96481,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
12289,
462,
2099,
35271,
40188,
38723,
449,
1421,
2301,
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,
31815,
9430,
25,
2273,
284,
220,
15,
13,
1721,
55609,
198,
791,
59855,
31815,
8331,
1511,
439,
320,
16,
13,
15,
6953,
66,
352,
9430,
33395,
7,
66362,
88505,
4390,
913,
1670,
63591,
1873,
25,
12536,
96481,
60,
284,
2290,
55609,
198,
791,
4371,
1873,
311,
9993,
19459,
539,
31503,
505,
279,
4724,
3637,
627,
4155,
51012,
912,
4371,
1873,
311,
9477,
539,
42542,
505,
279,
4724,
3637,
627,
913,
597,
25,
528,
284,
220,
19,
55609,
198,
791,
7340,
1396,
315,
9477,
311,
17622,
304,
264,
2728,
1650,
627,
913,
5044,
12962,
25,
1796,
58,
5317,
8995,
31992,
27352,
60,
510,
15669,
60,
55609,
198,
791,
5044,
12962,
315,
9477,
311,
2778,
1555,
627,
913,
1023,
10622,
12919,
25,
1796,
17752,
60,
284,
3132,
55609,
198,
11663,
7039,
304,
279,
11408,
311,
8331,
1139,
279,
5573,
11,
384,
1326,
13,
3451,
475,
685,
529,
627,
913,
2778,
37335,
25,
6587,
510,
15669,
60,
55609,
198,
35581,
6105,
311,
1522,
311,
279,
4724,
4412,
38723,
2778,
627,
913,
4724,
4412,
25,
8859,
8995,
48203,
44569,
9105,
14621,
6221,
510,
8327,
60,
55609,
198,
791,
4724,
4412,
311,
3637,
9477,
323,
8417,
4371,
1873,
627,
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,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
18ad11e000a0-1 | 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
get_salient_docs(query: str) → Dict[int, Tuple[Document, float]][source]¶
Return documents that are salient to the query.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
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,
456,
63591,
1188,
50792,
10974,
25,
610,
8,
11651,
30226,
19155,
11,
25645,
58,
7676,
11,
2273,
28819,
2484,
60,
55609,
198,
5715,
9477,
430,
527,
4371,
1188,
311,
279,
3319,
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/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
46d493f673d9-0 | langchain.retrievers.llama_index.LlamaIndexGraphRetriever¶
class langchain.retrievers.llama_index.LlamaIndexGraphRetriever(*, graph: Any = None, query_configs: List[Dict] = None)[source]¶
Bases: BaseRetriever, BaseModel
Question-answering with sources over an LlamaIndex graph data structure.
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 graph: Any = None¶
param query_configs: List[Dict] [Optional]¶
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 | [
5317,
8995,
1351,
9104,
3078,
60098,
3105,
3644,
1236,
81101,
1581,
11461,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
60098,
3105,
3644,
1236,
81101,
1581,
11461,
12289,
462,
2099,
4163,
11,
4876,
25,
5884,
284,
2290,
11,
3319,
60250,
25,
1796,
58,
13755,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
14924,
12,
598,
86,
4776,
449,
8336,
927,
459,
445,
81101,
1581,
4876,
828,
6070,
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,
4876,
25,
5884,
284,
2290,
55609,
198,
913,
3319,
60250,
25,
1796,
58,
13755,
60,
510,
15669,
60,
55609,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.llama_index.LlamaIndexGraphRetriever.html |
d366de163668-0 | langchain.retrievers.vespa_retriever.VespaRetriever¶
class langchain.retrievers.vespa_retriever.VespaRetriever(app: Vespa, body: Dict, content_field: str, metadata_fields: Optional[Sequence[str]] = None)[source]¶
Bases: BaseRetriever
Retriever that uses the Vespa.
Parameters
app – Vespa client.
body – query body.
content_field – result field with document contents.
metadata_fields – result fields to include in document metadata.
Methods
__init__(app, body, content_field[, ...])
param app
Vespa client.
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
from_params(url, content_field, *[, k, ...])
Instantiate retriever from params.
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query.
get_relevant_documents_with_filter(query, *)
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
classmethod from_params(url: str, content_field: str, *, k: Optional[int] = None, metadata_fields: Union[Sequence[str], Literal['*']] = (), sources: Optional[Union[Sequence[str], Literal['*']]] = None, _filter: Optional[str] = None, yql: Optional[str] = None, **kwargs: Any) → VespaRetriever[source]¶
Instantiate retriever from params.
Parameters | [
5317,
8995,
1351,
9104,
3078,
13,
2396,
6733,
1311,
9104,
424,
5168,
288,
6733,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
13,
2396,
6733,
1311,
9104,
424,
5168,
288,
6733,
12289,
462,
2099,
11718,
25,
79562,
6733,
11,
2547,
25,
30226,
11,
2262,
5121,
25,
610,
11,
11408,
12406,
25,
12536,
58,
14405,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
12289,
462,
2099,
430,
5829,
279,
79562,
6733,
627,
9905,
198,
680,
1389,
79562,
6733,
3016,
627,
2664,
1389,
3319,
2547,
627,
1834,
5121,
1389,
1121,
2115,
449,
2246,
8970,
627,
18103,
12406,
1389,
1121,
5151,
311,
2997,
304,
2246,
11408,
627,
18337,
198,
565,
2381,
3889,
680,
11,
4194,
2664,
11,
4194,
1834,
5121,
38372,
4194,
1131,
2608,
913,
917,
198,
53,
288,
6733,
3016,
627,
85163,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
1527,
6887,
6659,
11,
4194,
1834,
5121,
11,
4194,
9,
38372,
4194,
74,
11,
4194,
1131,
2608,
81651,
10992,
424,
505,
3712,
627,
456,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
88765,
9477,
9959,
311,
264,
3319,
627,
456,
1311,
8532,
77027,
6753,
8901,
10974,
11,
4194,
39060,
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,
27853,
505,
6887,
6659,
25,
610,
11,
2262,
5121,
25,
610,
11,
12039,
597,
25,
12536,
19155,
60,
284,
2290,
11,
11408,
12406,
25,
9323,
58,
14405,
17752,
1145,
50774,
681,
9,
31940,
284,
39204,
8336,
25,
12536,
58,
33758,
58,
14405,
17752,
1145,
50774,
681,
9,
663,
5163,
284,
2290,
11,
721,
5428,
25,
12536,
17752,
60,
284,
2290,
11,
379,
1498,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
79562,
6733,
12289,
462,
2099,
76747,
60,
55609,
198,
81651,
10992,
424,
505,
3712,
627,
9905
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.vespa_retriever.VespaRetriever.html |
d366de163668-1 | Instantiate retriever from params.
Parameters
url (str) – Vespa app URL.
content_field (str) – Field in results to return as Document page_content.
k (Optional[int]) – Number of Documents to return. Defaults to None.
metadata_fields (Sequence[str] or "*") – Fields in results to include in
document metadata. Defaults to empty tuple ().
sources (Sequence[str] or "*" or None) – Sources to retrieve
from. Defaults to None.
_filter (Optional[str]) – Document filter condition expressed in YQL.
Defaults to None.
yql (Optional[str]) – Full YQL query to be used. Should not be specified
if _filter or sources are specified. Defaults to None.
kwargs (Any) – Keyword arguments added to query body.
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
get_relevant_documents_with_filter(query: str, *, _filter: Optional[str] = None) → List[Document][source]¶ | [
81651,
10992,
424,
505,
3712,
627,
9905,
198,
1103,
320,
496,
8,
1389,
79562,
6733,
917,
5665,
627,
1834,
5121,
320,
496,
8,
1389,
8771,
304,
3135,
311,
471,
439,
12051,
2199,
7647,
627,
74,
320,
15669,
19155,
2526,
1389,
5742,
315,
45890,
311,
471,
13,
37090,
311,
2290,
627,
18103,
12406,
320,
14405,
17752,
60,
477,
16004,
909,
1389,
25599,
304,
3135,
311,
2997,
304,
198,
6190,
11408,
13,
37090,
311,
4384,
14743,
320,
4390,
40751,
320,
14405,
17752,
60,
477,
66993,
477,
2290,
8,
1389,
48132,
311,
17622,
198,
1527,
13,
37090,
311,
2290,
627,
8901,
320,
15669,
17752,
2526,
1389,
12051,
4141,
3044,
13605,
304,
816,
3672,
627,
16672,
311,
2290,
627,
88,
1498,
320,
15669,
17752,
2526,
1389,
8797,
816,
3672,
3319,
311,
387,
1511,
13,
12540,
539,
387,
5300,
198,
333,
721,
5428,
477,
8336,
527,
5300,
13,
37090,
311,
2290,
627,
9872,
320,
8780,
8,
1389,
50070,
6105,
3779,
311,
3319,
2547,
627,
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,
456,
1311,
8532,
77027,
6753,
8901,
10974,
25,
610,
11,
12039,
721,
5428,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.vespa_retriever.VespaRetriever.html |
d4f45d51489d-0 | langchain.retrievers.pubmed.PubMedRetriever¶
class langchain.retrievers.pubmed.PubMedRetriever(*, top_k_results: int = 3, load_max_docs: int = 25, doc_content_chars_max: int = 2000, load_all_available_meta: bool = False, email: str = 'your_email@example.com', base_url_esearch: str = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?', base_url_efetch: str = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?', max_retry: int = 5, sleep_time: float = 0.2, ARXIV_MAX_QUERY_LENGTH: int = 300)[source]¶
Bases: BaseRetriever, PubMedAPIWrapper
It is effectively a wrapper for PubMedAPIWrapper.
It wraps load() to get_relevant_documents().
It uses all PubMedAPIWrapper arguments without any change.
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 doc_content_chars_max: int = 2000¶
param email: str = 'your_email@example.com'¶
param load_all_available_meta: bool = False¶
param load_max_docs: int = 25¶
param top_k_results: int = 3¶
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]¶ | [
5317,
8995,
1351,
9104,
3078,
48873,
2106,
1087,
392,
13613,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
48873,
2106,
1087,
392,
13613,
12289,
462,
2099,
4163,
11,
1948,
4803,
13888,
25,
528,
284,
220,
18,
11,
2865,
6479,
50792,
25,
528,
284,
220,
914,
11,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
1049,
15,
11,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
11,
2613,
25,
610,
284,
364,
22479,
9351,
36587,
916,
518,
2385,
2975,
34841,
2974,
25,
610,
284,
364,
2485,
1129,
68,
6159,
99916,
89488,
70521,
14489,
14,
306,
23577,
16954,
6159,
39528,
2974,
41239,
8376,
50734,
2385,
2975,
80510,
3068,
25,
610,
284,
364,
2485,
1129,
68,
6159,
99916,
89488,
70521,
14489,
14,
306,
23577,
16954,
6159,
14,
830,
3068,
41239,
8376,
50734,
1973,
63845,
25,
528,
284,
220,
20,
11,
6212,
3084,
25,
2273,
284,
220,
15,
13,
17,
11,
6395,
55,
3166,
6949,
32685,
15373,
25,
528,
284,
220,
3101,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
53768,
7227,
11803,
198,
2181,
374,
13750,
264,
13564,
369,
53768,
7227,
11803,
627,
2181,
40809,
2865,
368,
311,
636,
1311,
8532,
77027,
26914,
2181,
5829,
682,
53768,
7227,
11803,
6105,
2085,
904,
2349,
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,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
1049,
15,
55609,
198,
913,
2613,
25,
610,
284,
364,
22479,
9351,
36587,
916,
6,
55609,
198,
913,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
55609,
198,
913,
2865,
6479,
50792,
25,
528,
284,
220,
914,
55609,
198,
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.pubmed.PubMedRetriever.html |
d4f45d51489d-1 | 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
load(query: str) → List[dict]¶
Search PubMed for documents matching the query.
Return a list of dictionaries containing the document metadata.
load_docs(query: str) → List[Document]¶
retrieve_article(uid: str, webenv: str) → dict¶
run(query: str) → str¶
Run PubMed search and get the article meta information.
See https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch
It uses only the most informative fields of article meta information.
model Config¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
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,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
8644,
60,
55609,
198,
6014,
53768,
369,
9477,
12864,
279,
3319,
627,
5715,
264,
1160,
315,
58614,
8649,
279,
2246,
11408,
627,
1096,
50792,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
56627,
38421,
38148,
25,
610,
11,
3566,
3239,
25,
610,
8,
11651,
6587,
55609,
198,
6236,
10974,
25,
610,
8,
11651,
610,
55609,
198,
6869,
53768,
2778,
323,
636,
279,
4652,
8999,
2038,
627,
10031,
3788,
1129,
2185,
99916,
89488,
70521,
14489,
72363,
20906,
89407,
12375,
1484,
27657,
41326,
19,
13,
1600,
2974,
198,
2181,
5829,
1193,
279,
1455,
39319,
5151,
315,
4652,
8999,
2038,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.pubmed.PubMedRetriever.html |
04049477889d-0 | langchain.retrievers.kendra.AdditionalResultAttributeValue¶
class langchain.retrievers.kendra.AdditionalResultAttributeValue(*, TextWithHighlightsValue: TextWithHighLights, **extra_data: Any)[source]¶
Bases: 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 TextWithHighlightsValue: langchain.retrievers.kendra.TextWithHighLights [Required]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
79654,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
79654,
4163,
11,
2991,
2409,
97406,
1150,
25,
2991,
2409,
12243,
75584,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
2991,
2409,
97406,
1150,
25,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
2021,
2409,
12243,
75584,
510,
8327,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttributeValue.html |
b587e46db177-0 | langchain.retrievers.llama_index.LlamaIndexRetriever¶
class langchain.retrievers.llama_index.LlamaIndexRetriever(*, index: Any = None, query_kwargs: Dict = None)[source]¶
Bases: BaseRetriever, BaseModel
Question-answering with sources over an LlamaIndex data structure.
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 index: Any = None¶
param query_kwargs: Dict [Optional]¶
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 | [
5317,
8995,
1351,
9104,
3078,
60098,
3105,
3644,
1236,
81101,
1581,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
60098,
3105,
3644,
1236,
81101,
1581,
12289,
462,
2099,
4163,
11,
1963,
25,
5884,
284,
2290,
11,
3319,
37335,
25,
30226,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
14924,
12,
598,
86,
4776,
449,
8336,
927,
459,
445,
81101,
1581,
828,
6070,
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,
1963,
25,
5884,
284,
2290,
55609,
198,
913,
3319,
37335,
25,
30226,
510,
15669,
60,
55609,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.llama_index.LlamaIndexRetriever.html |
f632a681b84d-0 | langchain.retrievers.contextual_compression.ContextualCompressionRetriever¶
class langchain.retrievers.contextual_compression.ContextualCompressionRetriever(*, base_compressor: BaseDocumentCompressor, base_retriever: BaseRetriever)[source]¶
Bases: BaseRetriever, BaseModel
Retriever that wraps a base retriever and compresses the results.
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 base_compressor: langchain.retrievers.document_compressors.base.BaseDocumentCompressor [Required]¶
Compressor for compressing retrieved documents.
param base_retriever: langchain.schema.BaseRetriever [Required]¶
Base Retriever to use for getting relevant documents.
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
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
5317,
8995,
1351,
9104,
3078,
8852,
940,
3038,
4099,
9512,
940,
82511,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
8852,
940,
3038,
4099,
9512,
940,
82511,
12289,
462,
2099,
4163,
11,
2385,
3038,
57320,
25,
5464,
7676,
1110,
57320,
11,
2385,
1311,
9104,
424,
25,
5464,
12289,
462,
2099,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
12289,
462,
2099,
430,
40809,
264,
2385,
10992,
424,
323,
25633,
288,
279,
3135,
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,
2385,
3038,
57320,
25,
8859,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
9105,
13316,
7676,
1110,
57320,
510,
8327,
60,
55609,
198,
1110,
57320,
369,
25633,
287,
31503,
9477,
627,
913,
2385,
1311,
9104,
424,
25,
8859,
8995,
31992,
13316,
12289,
462,
2099,
510,
8327,
60,
55609,
198,
4066,
10608,
462,
2099,
311,
1005,
369,
3794,
9959,
9477,
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,
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,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html |
1d56b84af1f4-0 | langchain.retrievers.kendra.AdditionalResultAttribute¶
class langchain.retrievers.kendra.AdditionalResultAttribute(*, Key: str, ValueType: Literal['TEXT_WITH_HIGHLIGHTS_VALUE'], Value: AdditionalResultAttributeValue, **extra_data: Any)[source]¶
Bases: 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 Key: str [Required]¶
param Value: langchain.retrievers.kendra.AdditionalResultAttributeValue [Required]¶
param ValueType: Literal['TEXT_WITH_HIGHLIGHTS_VALUE'] [Required]¶
get_value_text() → str[source]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
3994,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
3994,
4163,
11,
5422,
25,
610,
11,
56645,
25,
50774,
681,
12998,
24880,
2083,
91131,
50,
7628,
4181,
5273,
25,
24086,
2122,
79654,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
5422,
25,
610,
510,
8327,
60,
55609,
198,
913,
5273,
25,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
1943,
3079,
2122,
79654,
510,
8327,
60,
55609,
198,
913,
56645,
25,
50774,
681,
12998,
24880,
2083,
91131,
50,
7628,
663,
510,
8327,
60,
55609,
198,
456,
3220,
4424,
368,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttribute.html |
8e3beba95209-0 | langchain.retrievers.merger_retriever.MergerRetriever¶
class langchain.retrievers.merger_retriever.MergerRetriever(retrievers: List[BaseRetriever])[source]¶
Bases: BaseRetriever
This class merges the results of multiple retrievers.
Parameters
retrievers – A list of retrievers to merge.
Initialize the MergerRetriever class.
Parameters
retrievers – A list of retrievers to merge.
Methods
__init__(retrievers)
Initialize the MergerRetriever class.
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
amerge_documents(query, run_manager)
Asynchronously merge the results of the retrievers.
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query.
merge_documents(query, run_manager)
Merge the results of the retrievers.
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
async amerge_documents(query: str, run_manager: AsyncCallbackManagerForRetrieverRun) → List[Document][source]¶
Asynchronously merge the results of the retrievers.
Parameters
query – The query to search for.
Returns
A list of merged 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 | [
5317,
8995,
1351,
9104,
3078,
749,
261,
1414,
1311,
9104,
424,
1345,
261,
1414,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
749,
261,
1414,
1311,
9104,
424,
1345,
261,
1414,
12289,
462,
2099,
5921,
9104,
3078,
25,
1796,
58,
4066,
12289,
462,
2099,
41105,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
2028,
538,
82053,
279,
3135,
315,
5361,
10992,
3078,
627,
9905,
198,
265,
9104,
3078,
1389,
362,
1160,
315,
10992,
3078,
311,
11117,
627,
10130,
279,
8930,
1414,
12289,
462,
2099,
538,
627,
9905,
198,
265,
9104,
3078,
1389,
362,
1160,
315,
10992,
3078,
311,
11117,
627,
18337,
198,
565,
2381,
3889,
265,
9104,
3078,
340,
10130,
279,
8930,
1414,
12289,
462,
2099,
538,
627,
85163,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
309,
10286,
77027,
10974,
11,
4194,
6236,
12418,
340,
2170,
55294,
11117,
279,
3135,
315,
279,
10992,
3078,
627,
456,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
88765,
9477,
9959,
311,
264,
3319,
627,
19590,
77027,
10974,
11,
4194,
6236,
12418,
340,
53196,
279,
3135,
315,
279,
10992,
3078,
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,
7847,
1097,
10286,
77027,
10974,
25,
610,
11,
1629,
12418,
25,
92536,
2087,
2520,
12289,
462,
2099,
6869,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
2170,
55294,
11117,
279,
3135,
315,
279,
10992,
3078,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
16851,
198,
32,
1160,
315,
27092,
9477,
627,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html |
8e3beba95209-1 | :param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
merge_documents(query: str, run_manager: CallbackManagerForRetrieverRun) → List[Document][source]¶
Merge the results of the retrievers.
Parameters
query – The query to search for.
Returns
A list of merged documents. | [
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,
19590,
77027,
10974,
25,
610,
11,
1629,
12418,
25,
23499,
2087,
2520,
12289,
462,
2099,
6869,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
53196,
279,
3135,
315,
279,
10992,
3078,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
16851,
198,
32,
1160,
315,
27092,
9477,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html |
f33f07ad44a0-0 | langchain.retrievers.svm.create_index¶
langchain.retrievers.svm.create_index(contexts: List[str], embeddings: Embeddings) → ndarray[source]¶
Create an index of embeddings for a list of contexts.
:param contexts: List of contexts to embed.
:param embeddings: Embeddings model to use.
Returns
Index of embeddings. | [
5317,
8995,
1351,
9104,
3078,
516,
7488,
2581,
3644,
55609,
198,
5317,
8995,
1351,
9104,
3078,
516,
7488,
2581,
3644,
5491,
82,
25,
1796,
17752,
1145,
71647,
25,
38168,
25624,
8,
11651,
67983,
76747,
60,
55609,
198,
4110,
459,
1963,
315,
71647,
369,
264,
1160,
315,
38697,
627,
68416,
38697,
25,
1796,
315,
38697,
311,
11840,
627,
68416,
71647,
25,
38168,
25624,
1646,
311,
1005,
627,
16851,
198,
1581,
315,
71647,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.svm.create_index.html |
4f87431296de-0 | langchain.retrievers.metal.MetalRetriever¶
class langchain.retrievers.metal.MetalRetriever(client: Any, params: Optional[dict] = None)[source]¶
Bases: BaseRetriever
Retriever that uses the Metal API.
Methods
__init__(client[, params])
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]¶
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 | [
5317,
8995,
1351,
9104,
3078,
749,
22029,
1345,
22029,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
749,
22029,
1345,
22029,
12289,
462,
2099,
13097,
25,
5884,
11,
3712,
25,
12536,
58,
8644,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
12289,
462,
2099,
430,
5829,
279,
19757,
5446,
627,
18337,
198,
565,
2381,
3889,
3045,
38372,
4194,
3603,
2608,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.metal.MetalRetriever.html |
0428b99c7fa5-0 | langchain.retrievers.self_query.weaviate.WeaviateTranslator¶
class langchain.retrievers.self_query.weaviate.WeaviateTranslator[source]¶
Bases: Visitor
Logic for converting internal query language elements to valid filters.
Methods
__init__()
visit_comparison(comparison)
Translate a Comparison.
visit_operation(operation)
Translate an Operation.
visit_structured_query(structured_query)
Translate a StructuredQuery.
Attributes
allowed_comparators
allowed_operators
Subset of allowed logical operators.
visit_comparison(comparison: Comparison) → Dict[source]¶
Translate a Comparison.
visit_operation(operation: Operation) → Dict[source]¶
Translate an Operation.
visit_structured_query(structured_query: StructuredQuery) → Tuple[str, dict][source]¶
Translate a StructuredQuery.
allowed_comparators: Optional[Sequence[Comparator]] = [<Comparator.EQ: 'eq'>]¶
allowed_operators: Optional[Sequence[Operator]] = [<Operator.AND: 'and'>, <Operator.OR: 'or'>]¶
Subset of allowed logical operators. | [
5317,
8995,
1351,
9104,
3078,
28248,
5857,
31339,
6321,
349,
23210,
6321,
349,
52753,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
28248,
5857,
31339,
6321,
349,
23210,
6321,
349,
52753,
76747,
60,
55609,
198,
33,
2315,
25,
56982,
198,
27849,
369,
34537,
5419,
3319,
4221,
5540,
311,
2764,
13711,
627,
18337,
198,
565,
2381,
33716,
28560,
91897,
14426,
36642,
340,
28573,
264,
43551,
627,
28560,
33665,
53447,
340,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
340,
28573,
264,
16531,
3149,
2929,
627,
10738,
198,
21642,
3038,
1768,
3046,
198,
21642,
26716,
3046,
198,
71684,
315,
5535,
20406,
20197,
627,
28560,
91897,
14426,
36642,
25,
43551,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
264,
43551,
627,
28560,
33665,
53447,
25,
17145,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
25,
16531,
3149,
2929,
8,
11651,
25645,
17752,
11,
6587,
1483,
2484,
60,
55609,
198,
28573,
264,
16531,
3149,
2929,
627,
21642,
3038,
1768,
3046,
25,
12536,
58,
14405,
58,
39758,
5163,
284,
68326,
39758,
5253,
48,
25,
364,
11251,
6404,
60,
55609,
198,
21642,
26716,
3046,
25,
12536,
58,
14405,
58,
18968,
5163,
284,
68326,
18968,
885,
8225,
25,
364,
438,
6404,
11,
366,
18968,
78997,
25,
364,
269,
6404,
60,
55609,
198,
71684,
315,
5535,
20406,
20197,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.self_query.weaviate.WeaviateTranslator.html |
d3d54033aa50-0 | langchain.retrievers.kendra.combined_text¶
langchain.retrievers.kendra.combined_text(title: str, excerpt: str) → str[source]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
916,
65,
1619,
4424,
55609,
198,
5317,
8995,
1351,
9104,
3078,
5314,
61799,
916,
65,
1619,
4424,
12787,
25,
610,
11,
50565,
25,
610,
8,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.combined_text.html |
18ab95a214f2-0 | langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever¶
class langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever(*, service_name: str = '', index_name: str = '', api_key: str = '', api_version: str = '2020-06-30', aiosession: Optional[ClientSession] = None, content_key: str = 'content')[source]¶
Bases: BaseRetriever, BaseModel
Wrapper around Azure Cognitive Search.
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 aiosession: Optional[aiohttp.client.ClientSession] = None¶
ClientSession, in case we want to reuse connection for better performance.
param api_key: str = ''¶
API Key. Both Admin and Query keys work, but for reading data it’s
recommended to use a Query key.
param api_version: str = '2020-06-30'¶
API version
param content_key: str = 'content'¶
Key in a retrieved result to set as the Document page_content.
param index_name: str = ''¶
Name of Index inside Azure Cognitive Search service
param service_name: str = ''¶
Name of Azure Cognitive Search service
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 | [
5317,
8995,
1351,
9104,
3078,
71340,
669,
51549,
10947,
58927,
34,
51549,
6014,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
71340,
669,
51549,
10947,
58927,
34,
51549,
6014,
12289,
462,
2099,
4163,
11,
2532,
1292,
25,
610,
284,
9158,
1963,
1292,
25,
610,
284,
9158,
6464,
3173,
25,
610,
284,
9158,
6464,
9625,
25,
610,
284,
364,
2366,
15,
12,
2705,
12,
966,
518,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
11,
2262,
3173,
25,
610,
284,
364,
1834,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
65705,
198,
11803,
2212,
35219,
73235,
7694,
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,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
6718,
11978,
5396,
60,
284,
2290,
55609,
198,
3032,
5396,
11,
304,
1162,
584,
1390,
311,
27068,
3717,
369,
2731,
5178,
627,
913,
6464,
3173,
25,
610,
284,
3436,
55609,
198,
7227,
5422,
13,
11995,
7735,
323,
11615,
7039,
990,
11,
719,
369,
5403,
828,
433,
753,
198,
86447,
311,
1005,
264,
11615,
1401,
627,
913,
6464,
9625,
25,
610,
284,
364,
2366,
15,
12,
2705,
12,
966,
6,
55609,
198,
7227,
2373,
198,
913,
2262,
3173,
25,
610,
284,
364,
1834,
6,
55609,
198,
1622,
304,
264,
31503,
1121,
311,
743,
439,
279,
12051,
2199,
7647,
627,
913,
1963,
1292,
25,
610,
284,
3436,
55609,
198,
678,
315,
8167,
4871,
35219,
73235,
7694,
2532,
198,
913,
2532,
1292,
25,
610,
284,
3436,
55609,
198,
678,
315,
35219,
73235,
7694,
2532,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html |
18ab95a214f2-1 | 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_environment » all fields[source]¶
Validate that service name, index name and api key exists in environment.
model Config[source]¶
Bases: object
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
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,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
2532,
836,
11,
1963,
836,
323,
6464,
1401,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html |
ace72548ef18-0 | langchain.retrievers.kendra.clean_excerpt¶
langchain.retrievers.kendra.clean_excerpt(excerpt: str) → str[source]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
26303,
68047,
55609,
198,
5317,
8995,
1351,
9104,
3078,
5314,
61799,
26303,
68047,
5580,
35128,
25,
610,
8,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.clean_excerpt.html |
2d49e08b0bca-0 | langchain.retrievers.kendra.DocumentAttribute¶
class langchain.retrievers.kendra.DocumentAttribute(*, Key: str, Value: DocumentAttributeValue, **extra_data: Any)[source]¶
Bases: 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 Key: str [Required]¶
param Value: langchain.retrievers.kendra.DocumentAttributeValue [Required]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
27352,
3994,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
27352,
3994,
4163,
11,
5422,
25,
610,
11,
5273,
25,
12051,
79654,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
5422,
25,
610,
510,
8327,
60,
55609,
198,
913,
5273,
25,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
27352,
79654,
510,
8327,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.DocumentAttribute.html |
17096035929e-0 | langchain.retrievers.kendra.DocumentAttributeValue¶
class langchain.retrievers.kendra.DocumentAttributeValue(*, DateValue: Optional[str] = None, LongValue: Optional[int] = None, StringListValue: Optional[List[str]] = None, StringValue: Optional[str] = None, **extra_data: Any)[source]¶
Bases: 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 DateValue: Optional[str] = None¶
param LongValue: Optional[int] = None¶
param StringListValue: Optional[List[str]] = None¶
param StringValue: Optional[str] = None¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
27352,
79654,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
27352,
79654,
4163,
11,
2696,
1150,
25,
12536,
17752,
60,
284,
2290,
11,
5843,
1150,
25,
12536,
19155,
60,
284,
2290,
11,
935,
861,
1150,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
935,
1150,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
2696,
1150,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
5843,
1150,
25,
12536,
19155,
60,
284,
2290,
55609,
198,
913,
935,
861,
1150,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
935,
1150,
25,
12536,
17752,
60,
284,
2290,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.DocumentAttributeValue.html |
459a16fa74a5-0 | langchain.retrievers.multi_query.MultiQueryRetriever¶
class langchain.retrievers.multi_query.MultiQueryRetriever(retriever: BaseRetriever, llm_chain: LLMChain, verbose: bool = True, parser_key: str = 'lines')[source]¶
Bases: BaseRetriever
Given a user query, use an LLM to write a set of queries.
Retrieve docs for each query. Rake the unique union of all retrieved docs.
Initialize MultiQueryRetriever.
Parameters
retriever – retriever to query documents from
llm_chain – llm_chain for query generation
verbose – show the queries that we generated to the user
parser_key – attribute name for the parsed output
Returns
MultiQueryRetriever
Methods
__init__(retriever, llm_chain[, verbose, ...])
Initialize MultiQueryRetriever.
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
from_llm(retriever, llm[, prompt, parser_key])
Initialize from llm using default template.
generate_queries(question, run_manager)
Generate queries based upon user input.
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query.
retrieve_documents(queries, run_manager)
Run all LLM generated queries.
unique_union(documents)
Get uniqe Documents.
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 | [
5317,
8995,
1351,
9104,
3078,
52251,
5857,
58806,
2929,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
52251,
5857,
58806,
2929,
12289,
462,
2099,
5921,
9104,
424,
25,
5464,
12289,
462,
2099,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
14008,
25,
1845,
284,
3082,
11,
6871,
3173,
25,
610,
284,
364,
8128,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
22818,
264,
1217,
3319,
11,
1005,
459,
445,
11237,
311,
3350,
264,
743,
315,
20126,
627,
88765,
27437,
369,
1855,
3319,
13,
432,
731,
279,
5016,
11552,
315,
682,
31503,
27437,
627,
10130,
17896,
2929,
12289,
462,
2099,
627,
9905,
198,
265,
9104,
424,
1389,
10992,
424,
311,
3319,
9477,
505,
198,
657,
76,
31683,
1389,
9507,
76,
31683,
369,
3319,
9659,
198,
15228,
1389,
1501,
279,
20126,
430,
584,
8066,
311,
279,
1217,
198,
9854,
3173,
1389,
7180,
836,
369,
279,
16051,
2612,
198,
16851,
198,
20981,
2929,
12289,
462,
2099,
198,
18337,
198,
565,
2381,
3889,
265,
9104,
424,
11,
4194,
657,
76,
31683,
38372,
4194,
15228,
11,
4194,
1131,
2608,
10130,
17896,
2929,
12289,
462,
2099,
627,
85163,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
1527,
44095,
76,
5921,
9104,
424,
11,
4194,
657,
76,
38372,
4194,
41681,
11,
4194,
9854,
3173,
2608,
10130,
505,
9507,
76,
1701,
1670,
3896,
627,
19927,
66688,
41157,
11,
4194,
6236,
12418,
340,
32215,
20126,
3196,
5304,
1217,
1988,
627,
456,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
88765,
9477,
9959,
311,
264,
3319,
627,
56627,
77027,
7,
43935,
11,
4194,
6236,
12418,
340,
6869,
682,
445,
11237,
8066,
20126,
627,
9782,
52721,
19702,
2901,
340,
1991,
55252,
68,
45890,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
459a16fa74a5-1 | :param callbacks: Callback manager or list of callbacks
Returns
List of relevant documents
classmethod from_llm(retriever: BaseRetriever, llm: BaseLLM, prompt: PromptTemplate = PromptTemplate(input_variables=['question'], output_parser=None, partial_variables={}, template='You are an AI language model assistant. Your task is \n to generate 3 different versions of the given user \n question to retrieve relevant documents from a vector database. \n By generating multiple perspectives on the user question, \n your goal is to help the user overcome some of the limitations \n of distance-based similarity search. Provide these alternative \n questions seperated by newlines. Original question: {question}', template_format='f-string', validate_template=True), parser_key: str = 'lines') → MultiQueryRetriever[source]¶
Initialize from llm using default template.
Parameters
retriever – retriever to query documents from
llm – llm for query generation using DEFAULT_QUERY_PROMPT
Returns
MultiQueryRetriever
generate_queries(question: str, run_manager: CallbackManagerForRetrieverRun) → List[str][source]¶
Generate queries based upon user input.
Parameters
question – user query
Returns
List of LLM generated queries that are similar to the user input
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
retrieve_documents(queries: List[str], run_manager: CallbackManagerForRetrieverRun) → List[Document][source]¶
Run all LLM generated queries.
Parameters
queries – query list
Returns
List of retrived Documents | [
68416,
27777,
25,
23499,
6783,
477,
1160,
315,
27777,
198,
16851,
198,
861,
315,
9959,
9477,
198,
27853,
505,
44095,
76,
5921,
9104,
424,
25,
5464,
12289,
462,
2099,
11,
9507,
76,
25,
5464,
4178,
44,
11,
10137,
25,
60601,
7423,
284,
60601,
7423,
5498,
29282,
14314,
7998,
4181,
2612,
19024,
5980,
11,
7276,
29282,
68525,
3896,
1151,
2675,
527,
459,
15592,
4221,
1646,
18328,
13,
4718,
3465,
374,
1144,
77,
46493,
311,
7068,
220,
18,
2204,
11028,
315,
279,
2728,
1217,
1144,
77,
46493,
3488,
311,
17622,
9959,
9477,
505,
264,
4724,
4194,
4729,
13,
1144,
77,
46493,
3296,
24038,
5361,
39555,
389,
279,
1217,
3488,
11,
1144,
77,
46493,
701,
5915,
374,
311,
1520,
279,
1217,
23075,
1063,
315,
279,
9669,
1144,
77,
46493,
315,
6138,
6108,
38723,
2778,
13,
40665,
1521,
10778,
1144,
77,
46493,
4860,
49454,
660,
555,
502,
8128,
13,
17674,
3488,
25,
314,
7998,
17266,
3896,
9132,
1151,
69,
31981,
518,
9788,
8864,
3702,
705,
6871,
3173,
25,
610,
284,
364,
8128,
873,
11651,
17896,
2929,
12289,
462,
2099,
76747,
60,
55609,
198,
10130,
505,
9507,
76,
1701,
1670,
3896,
627,
9905,
198,
265,
9104,
424,
1389,
10992,
424,
311,
3319,
9477,
505,
198,
657,
76,
1389,
9507,
76,
369,
3319,
9659,
1701,
12221,
32685,
72446,
2898,
198,
16851,
198,
20981,
2929,
12289,
462,
2099,
198,
19927,
66688,
41157,
25,
610,
11,
1629,
12418,
25,
23499,
2087,
2520,
12289,
462,
2099,
6869,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
32215,
20126,
3196,
5304,
1217,
1988,
627,
9905,
198,
7998,
1389,
1217,
3319,
198,
16851,
198,
861,
315,
445,
11237,
8066,
20126,
430,
527,
4528,
311,
279,
1217,
1988,
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,
56627,
77027,
7,
43935,
25,
1796,
17752,
1145,
1629,
12418,
25,
23499,
2087,
2520,
12289,
462,
2099,
6869,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
6869,
682,
445,
11237,
8066,
20126,
627,
9905,
198,
43935,
1389,
3319,
1160,
198,
16851,
198,
861,
315,
38831,
2270,
45890
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
459a16fa74a5-2 | Parameters
queries – query list
Returns
List of retrived Documents
unique_union(documents: List[Document]) → List[Document][source]¶
Get uniqe Documents.
Parameters
documents – List of retrived Documents
Returns
List of unique retrived Documents | [
9905,
198,
43935,
1389,
3319,
1160,
198,
16851,
198,
861,
315,
38831,
2270,
45890,
198,
9782,
52721,
19702,
2901,
25,
1796,
58,
7676,
2526,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
1991,
55252,
68,
45890,
627,
9905,
198,
51878,
1389,
1796,
315,
38831,
2270,
45890,
198,
16851,
198,
861,
315,
5016,
38831,
2270,
45890
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
c82b6df80bb8-0 | langchain.retrievers.pinecone_hybrid_search.PineconeHybridSearchRetriever¶
class langchain.retrievers.pinecone_hybrid_search.PineconeHybridSearchRetriever(*, embeddings: Embeddings, sparse_encoder: Any = None, index: Any = None, top_k: int = 4, alpha: float = 0.5)[source]¶
Bases: BaseRetriever, 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 alpha: float = 0.5¶
param embeddings: langchain.embeddings.base.Embeddings [Required]¶
description
param index: Any = None¶
param sparse_encoder: Any = None¶
param top_k: int = 4¶
add_texts(texts: List[str], ids: Optional[List[str]] = None, metadatas: Optional[List[dict]] = None) → None[source]¶
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_environment » all fields[source]¶
Validate that api key and python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
1351,
9104,
3078,
558,
483,
59182,
1552,
94490,
10947,
1087,
483,
59182,
31916,
16621,
6014,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
558,
483,
59182,
1552,
94490,
10947,
1087,
483,
59182,
31916,
16621,
6014,
12289,
462,
2099,
4163,
11,
71647,
25,
38168,
25624,
11,
34544,
40168,
25,
5884,
284,
2290,
11,
1963,
25,
5884,
284,
2290,
11,
1948,
4803,
25,
528,
284,
220,
19,
11,
8451,
25,
2273,
284,
220,
15,
13,
20,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
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,
8451,
25,
2273,
284,
220,
15,
13,
20,
55609,
198,
913,
71647,
25,
8859,
8995,
41541,
25624,
9105,
58955,
25624,
510,
8327,
60,
55609,
198,
4789,
198,
913,
1963,
25,
5884,
284,
2290,
55609,
198,
913,
34544,
40168,
25,
5884,
284,
2290,
55609,
198,
913,
1948,
4803,
25,
528,
284,
220,
19,
55609,
198,
723,
80746,
7383,
82,
25,
1796,
17752,
1145,
14483,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
2322,
329,
19907,
25,
12536,
53094,
58,
8644,
5163,
284,
2290,
8,
11651,
2290,
76747,
60,
55609,
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,
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,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
10344,
6462,
6866,
304,
4676,
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/retrievers/langchain.retrievers.pinecone_hybrid_search.PineconeHybridSearchRetriever.html |
c82b6df80bb8-1 | Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.pinecone_hybrid_search.PineconeHybridSearchRetriever.html |
020b4e689eb0-0 | langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever¶
class langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever(client: Any, index_name: str)[source]¶
Bases: BaseRetriever
Wrapper around Elasticsearch using BM25 as a retrieval method.
To connect to an Elasticsearch instance that requires login credentials,
including Elastic Cloud, use the Elasticsearch URL format
https://username:password@es_host:9243. For example, to connect to Elastic
Cloud, create the Elasticsearch URL with the required authentication details and
pass it to the ElasticVectorSearch constructor as the named parameter
elasticsearch_url.
You can obtain your Elastic Cloud URL and login credentials by logging in to the
Elastic Cloud console at https://cloud.elastic.co, selecting your deployment, and
navigating to the “Deployments” page.
To obtain your Elastic Cloud password for the default “elastic” user:
Log in to the Elastic Cloud console at https://cloud.elastic.co
Go to “Security” > “Users”
Locate the “elastic” user and click “Edit”
Click “Reset password”
Follow the prompts to reset the password
The format for Elastic Cloud URLs is
https://username:password@cluster_id.region_id.gcp.cloud.es.io:9243.
Methods
__init__(client, index_name)
add_texts(texts[, refresh_indices])
Run more texts through the embeddings and add to the retriever.
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
create(elasticsearch_url, index_name[, k1, b])
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query. | [
5317,
8995,
1351,
9104,
3078,
16230,
5174,
10947,
93022,
914,
5253,
52279,
6014,
30042,
914,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
16230,
5174,
10947,
93022,
914,
5253,
52279,
6014,
30042,
914,
12289,
462,
2099,
13097,
25,
5884,
11,
1963,
1292,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
11803,
2212,
59987,
1701,
20387,
914,
439,
264,
57470,
1749,
627,
1271,
4667,
311,
459,
59987,
2937,
430,
7612,
5982,
16792,
345,
16564,
53010,
15161,
11,
1005,
279,
59987,
5665,
3645,
198,
2485,
1129,
5223,
25,
3918,
31,
288,
13144,
25,
23890,
18,
13,
1789,
3187,
11,
311,
4667,
311,
53010,
198,
16440,
11,
1893,
279,
59987,
5665,
449,
279,
2631,
17066,
3649,
323,
198,
6519,
433,
311,
279,
53010,
3866,
6014,
4797,
439,
279,
7086,
5852,
198,
301,
28891,
2975,
627,
2675,
649,
6994,
701,
53010,
15161,
5665,
323,
5982,
16792,
555,
8558,
304,
311,
279,
198,
36,
52279,
15161,
2393,
520,
3788,
1129,
12641,
16230,
5174,
6973,
11,
27397,
701,
24047,
11,
323,
198,
77,
3030,
1113,
311,
279,
1054,
70564,
1392,
863,
2199,
627,
1271,
6994,
701,
53010,
15161,
3636,
369,
279,
1670,
1054,
63064,
863,
1217,
512,
2250,
304,
311,
279,
53010,
15161,
2393,
520,
3788,
1129,
12641,
16230,
5174,
6973,
198,
11087,
311,
1054,
15712,
863,
871,
1054,
7283,
89874,
9330,
349,
279,
1054,
63064,
863,
1217,
323,
4299,
1054,
4126,
89874,
2677,
1054,
15172,
3636,
89874,
12763,
279,
52032,
311,
7738,
279,
3636,
198,
791,
3645,
369,
53010,
15161,
36106,
374,
198,
2485,
1129,
5223,
25,
3918,
31,
19386,
851,
44076,
851,
1326,
4777,
17365,
19060,
4340,
25,
23890,
18,
627,
18337,
198,
565,
2381,
3889,
3045,
11,
4194,
1275,
1292,
340,
723,
80746,
7383,
82,
38372,
4194,
17611,
18839,
2608,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
10992,
424,
627,
85163,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
2170,
55294,
636,
9477,
9959,
311,
264,
3319,
627,
3261,
19096,
28891,
2975,
11,
4194,
1275,
1292,
38372,
4194,
74,
16,
11,
4194,
65,
2608,
456,
1311,
8532,
77027,
10974,
11,
4194,
9,
38372,
4194,
69411,
2608,
88765,
9477,
9959,
311,
264,
3319,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
020b4e689eb0-1 | Retrieve documents relevant to a query.
add_texts(texts: Iterable[str], refresh_indices: bool = True) → List[str][source]¶
Run more texts through the embeddings and add to the retriever.
Parameters
texts – Iterable of strings to add to the retriever.
refresh_indices – bool to refresh ElasticSearch indices
Returns
List of ids from adding the texts into the retriever.
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
classmethod create(elasticsearch_url: str, index_name: str, k1: float = 2.0, b: float = 0.75) → ElasticSearchBM25Retriever[source]¶
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 | [
88765,
9477,
9959,
311,
264,
3319,
627,
723,
80746,
7383,
82,
25,
39116,
17752,
1145,
10625,
18839,
25,
1845,
284,
3082,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
810,
22755,
1555,
279,
71647,
323,
923,
311,
279,
10992,
424,
627,
9905,
198,
87042,
1389,
39116,
315,
9246,
311,
923,
311,
279,
10992,
424,
627,
17611,
18839,
1389,
1845,
311,
10625,
53010,
6014,
15285,
198,
16851,
198,
861,
315,
14483,
505,
7999,
279,
22755,
1139,
279,
10992,
424,
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,
27853,
1893,
19096,
28891,
2975,
25,
610,
11,
1963,
1292,
25,
610,
11,
597,
16,
25,
2273,
284,
220,
17,
13,
15,
11,
293,
25,
2273,
284,
220,
15,
13,
2075,
8,
11651,
53010,
6014,
30042,
914,
12289,
462,
2099,
76747,
60,
55609,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
ce773adc8274-0 | langchain.retrievers.docarray.SearchType¶
class langchain.retrievers.docarray.SearchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases: str, Enum
Enumerator of the types of search to perform.
Methods
__init__(*args, **kwds)
capitalize()
Return a capitalized version of the string.
casefold()
Return a version of the string suitable for caseless comparisons.
center(width[, fillchar])
Return a centered string of length width.
count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring sub in string S[start:end].
encode([encoding, errors])
Encode the string using the codec registered for encoding.
endswith(suffix[, start[, end]])
Return True if S ends with the specified suffix, False otherwise.
expandtabs([tabsize])
Return a copy where all tab characters are expanded using spaces.
find(sub[, start[, end]])
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
format(*args, **kwargs)
Return a formatted version of S, using substitutions from args and kwargs.
format_map(mapping)
Return a formatted version of S, using substitutions from mapping.
index(sub[, start[, end]])
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
isalnum()
Return True if the string is an alpha-numeric string, False otherwise.
isalpha()
Return True if the string is an alphabetic string, False otherwise.
isascii()
Return True if all characters in the string are ASCII, False otherwise.
isdecimal() | [
5317,
8995,
1351,
9104,
3078,
24595,
1686,
33003,
941,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
24595,
1686,
33003,
941,
3764,
11,
5144,
5980,
11,
12039,
4793,
5980,
11,
5965,
609,
5980,
11,
955,
5980,
11,
1212,
28,
16,
11,
19254,
5980,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
610,
11,
14416,
198,
10679,
315,
279,
4595,
315,
2778,
311,
2804,
627,
18337,
198,
565,
2381,
69106,
2164,
11,
4194,
334,
29700,
5469,
340,
82441,
746,
5715,
264,
98421,
2373,
315,
279,
925,
627,
5756,
20557,
746,
5715,
264,
2373,
315,
279,
925,
14791,
369,
1162,
1752,
36595,
627,
3133,
16830,
38372,
4194,
7712,
1799,
2608,
5715,
264,
31288,
925,
315,
3160,
2430,
627,
1868,
10849,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
279,
1396,
315,
2536,
29352,
91719,
57115,
315,
39549,
1207,
304,
925,
328,
29563,
26874,
27218,
6311,
2625,
17600,
11,
4194,
7805,
2608,
33635,
279,
925,
1701,
279,
35747,
9879,
369,
11418,
627,
1438,
4291,
97566,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
3082,
422,
328,
10548,
449,
279,
5300,
21166,
11,
3641,
6062,
627,
33417,
32093,
2625,
6323,
2190,
2608,
5715,
264,
3048,
1405,
682,
5769,
5885,
527,
17626,
1701,
12908,
627,
3990,
10849,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
279,
15821,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
11,
1778,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
27218,
2293,
4163,
2164,
11,
4194,
334,
9872,
340,
5715,
264,
24001,
2373,
315,
328,
11,
1701,
94750,
505,
2897,
323,
16901,
627,
2293,
5489,
82157,
340,
5715,
264,
24001,
2373,
315,
328,
11,
1701,
94750,
505,
13021,
627,
1275,
10849,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
279,
15821,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
11,
1778,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
27218,
285,
94462,
746,
5715,
3082,
422,
279,
925,
374,
459,
8451,
12,
20173,
925,
11,
3641,
6062,
627,
285,
7288,
746,
5715,
3082,
422,
279,
925,
374,
459,
65695,
45938,
925,
11,
3641,
6062,
627,
285,
24207,
746,
5715,
3082,
422,
682,
5885,
304,
279,
925,
527,
40416,
11,
3641,
6062,
627,
285,
24170,
368
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-1 | Return True if all characters in the string are ASCII, False otherwise.
isdecimal()
Return True if the string is a decimal string, False otherwise.
isdigit()
Return True if the string is a digit string, False otherwise.
isidentifier()
Return True if the string is a valid Python identifier, False otherwise.
islower()
Return True if the string is a lowercase string, False otherwise.
isnumeric()
Return True if the string is a numeric string, False otherwise.
isprintable()
Return True if the string is printable, False otherwise.
isspace()
Return True if the string is a whitespace string, False otherwise.
istitle()
Return True if the string is a title-cased string, False otherwise.
isupper()
Return True if the string is an uppercase string, False otherwise.
join(iterable, /)
Concatenate any number of strings.
ljust(width[, fillchar])
Return a left-justified string of length width.
lower()
Return a copy of the string converted to lowercase.
lstrip([chars])
Return a copy of the string with leading whitespace removed.
maketrans
Return a translation table usable for str.translate().
partition(sep, /)
Partition the string into three parts using the given separator.
removeprefix(prefix, /)
Return a str with the given prefix string removed if present.
removesuffix(suffix, /)
Return a str with the given suffix string removed if present.
replace(old, new[, count])
Return a copy with all occurrences of substring old replaced by new.
rfind(sub[, start[, end]])
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rindex(sub[, start[, end]]) | [
5715,
3082,
422,
682,
5885,
304,
279,
925,
527,
40416,
11,
3641,
6062,
627,
285,
24170,
746,
5715,
3082,
422,
279,
925,
374,
264,
12395,
925,
11,
3641,
6062,
627,
70929,
746,
5715,
3082,
422,
279,
925,
374,
264,
16099,
925,
11,
3641,
6062,
627,
285,
16288,
746,
5715,
3082,
422,
279,
925,
374,
264,
2764,
13325,
13110,
11,
3641,
6062,
627,
285,
15115,
746,
5715,
3082,
422,
279,
925,
374,
264,
43147,
925,
11,
3641,
6062,
627,
285,
20173,
746,
5715,
3082,
422,
279,
925,
374,
264,
25031,
925,
11,
3641,
6062,
627,
285,
1374,
481,
746,
5715,
3082,
422,
279,
925,
374,
43095,
11,
3641,
6062,
627,
82870,
746,
5715,
3082,
422,
279,
925,
374,
264,
37472,
925,
11,
3641,
6062,
627,
380,
1017,
746,
5715,
3082,
422,
279,
925,
374,
264,
2316,
1824,
1503,
925,
11,
3641,
6062,
627,
285,
13886,
746,
5715,
3082,
422,
279,
925,
374,
459,
40582,
925,
11,
3641,
6062,
627,
6115,
28169,
481,
11,
4194,
54660,
79540,
32223,
904,
1396,
315,
9246,
627,
75,
4345,
16830,
38372,
4194,
7712,
1799,
2608,
5715,
264,
2163,
12,
4345,
1908,
925,
315,
3160,
2430,
627,
15115,
746,
5715,
264,
3048,
315,
279,
925,
16489,
311,
43147,
627,
75,
13406,
2625,
19811,
2608,
5715,
264,
3048,
315,
279,
925,
449,
6522,
37472,
7108,
627,
49662,
17820,
598,
198,
5715,
264,
14807,
2007,
41030,
369,
610,
26998,
26914,
42098,
10698,
79,
11,
4194,
54660,
51078,
279,
925,
1139,
2380,
5596,
1701,
279,
2728,
25829,
627,
5514,
12113,
30018,
11,
4194,
54660,
5715,
264,
610,
449,
279,
2728,
9436,
925,
7108,
422,
3118,
627,
1864,
10296,
13866,
97566,
11,
4194,
54660,
5715,
264,
610,
449,
279,
2728,
21166,
925,
7108,
422,
3118,
627,
8319,
22739,
11,
4194,
943,
38372,
4194,
1868,
2608,
5715,
264,
3048,
449,
682,
57115,
315,
39549,
2362,
12860,
555,
502,
627,
81,
3990,
10849,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
279,
8592,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
11,
1778,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
27218,
81,
1275,
10849,
38372,
4194,
2527,
38372,
4194,
408,
30716
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-2 | rindex(sub[, start[, end]])
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rjust(width[, fillchar])
Return a right-justified string of length width.
rpartition(sep, /)
Partition the string into three parts using the given separator.
rsplit([sep, maxsplit])
Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])
Return a copy of the string with trailing whitespace removed.
split([sep, maxsplit])
Return a list of the substrings in the string, using sep as the separator string.
splitlines([keepends])
Return a list of the lines in the string, breaking at line boundaries.
startswith(prefix[, start[, end]])
Return True if S starts with the specified prefix, False otherwise.
strip([chars])
Return a copy of the string with leading and trailing whitespace removed.
swapcase()
Convert uppercase characters to lowercase and lowercase characters to uppercase.
title()
Return a version of the string where each word is titlecased.
translate(table, /)
Replace each character in the string using the given translation table.
upper()
Return a copy of the string converted to uppercase.
zfill(width, /)
Pad a numeric string with zeros on the left, to fill a field of the given width.
Attributes
similarity
mmr
capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower
case.
casefold()¶
Return a version of the string suitable for caseless comparisons.
center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space). | [
81,
1275,
10849,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
279,
8592,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
11,
1778,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
27218,
81,
4345,
16830,
38372,
4194,
7712,
1799,
2608,
5715,
264,
1314,
12,
4345,
1908,
925,
315,
3160,
2430,
627,
81,
42098,
10698,
79,
11,
4194,
54660,
51078,
279,
925,
1139,
2380,
5596,
1701,
279,
2728,
25829,
627,
5544,
2344,
2625,
29136,
11,
4194,
2880,
7105,
2608,
5715,
264,
1160,
315,
279,
16146,
826,
304,
279,
925,
11,
1701,
21693,
439,
279,
25829,
925,
627,
71498,
2625,
19811,
2608,
5715,
264,
3048,
315,
279,
925,
449,
28848,
37472,
7108,
627,
7105,
2625,
29136,
11,
4194,
2880,
7105,
2608,
5715,
264,
1160,
315,
279,
16146,
826,
304,
279,
925,
11,
1701,
21693,
439,
279,
25829,
925,
627,
7105,
8128,
2625,
13397,
1438,
2608,
5715,
264,
1160,
315,
279,
5238,
304,
279,
925,
11,
15061,
520,
1584,
23546,
627,
70425,
30018,
38372,
4194,
2527,
38372,
4194,
408,
27829,
5715,
3082,
422,
328,
8638,
449,
279,
5300,
9436,
11,
3641,
6062,
627,
13406,
2625,
19811,
2608,
5715,
264,
3048,
315,
279,
925,
449,
6522,
323,
28848,
37472,
7108,
627,
26825,
5756,
746,
12281,
40582,
5885,
311,
43147,
323,
43147,
5885,
311,
40582,
627,
2150,
746,
5715,
264,
2373,
315,
279,
925,
1405,
1855,
3492,
374,
2316,
92226,
627,
14372,
16138,
11,
4194,
54660,
23979,
1855,
3752,
304,
279,
925,
1701,
279,
2728,
14807,
2007,
627,
13886,
746,
5715,
264,
3048,
315,
279,
925,
16489,
311,
40582,
627,
89,
7712,
16830,
11,
4194,
54660,
14047,
264,
25031,
925,
449,
17975,
389,
279,
2163,
11,
311,
5266,
264,
2115,
315,
279,
2728,
2430,
627,
10738,
198,
15124,
49325,
198,
3906,
81,
198,
82441,
368,
55609,
198,
5715,
264,
98421,
2373,
315,
279,
925,
627,
7816,
11951,
11,
1304,
279,
1176,
3752,
617,
8582,
1162,
323,
279,
2800,
4827,
198,
5756,
627,
5756,
20557,
368,
55609,
198,
5715,
264,
2373,
315,
279,
925,
14791,
369,
1162,
1752,
36595,
627,
3133,
16830,
11,
5266,
1799,
1151,
6752,
611,
8,
55609,
198,
5715,
264,
31288,
925,
315,
3160,
2430,
627,
22344,
374,
2884,
1701,
279,
5300,
5266,
3752,
320,
2309,
374,
264,
3634,
570
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-3 | Padding is done using the specified fill character (default is a space).
count(sub[, start[, end]]) → int¶
Return the number of non-overlapping occurrences of substring sub in
string S[start:end]. Optional arguments start and end are
interpreted as in slice notation.
encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
encodingThe encoding in which to encode the string.
errorsThe error handling scheme to use for encoding errors.
The default is ‘strict’ meaning that encoding errors raise a
UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and
‘xmlcharrefreplace’ as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
endswith(suffix[, start[, end]]) → bool¶
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
find(sub[, start[, end]]) → int¶
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
format(*args, **kwargs) → str¶
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces (‘{’ and ‘}’).
format_map(mapping) → str¶
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces (‘{’ and ‘}’). | [
22344,
374,
2884,
1701,
279,
5300,
5266,
3752,
320,
2309,
374,
264,
3634,
4390,
1868,
10849,
38372,
1212,
38372,
842,
30716,
11651,
528,
55609,
198,
5715,
279,
1396,
315,
2536,
29352,
91719,
57115,
315,
39549,
1207,
304,
198,
928,
328,
29563,
26874,
948,
220,
12536,
6105,
1212,
323,
842,
527,
198,
94561,
439,
304,
16363,
45297,
627,
6311,
86963,
1151,
4867,
12,
23,
518,
6103,
1151,
6765,
873,
55609,
198,
33635,
279,
925,
1701,
279,
35747,
9879,
369,
11418,
627,
17600,
791,
11418,
304,
902,
311,
16559,
279,
925,
627,
7805,
791,
1493,
11850,
13155,
311,
1005,
369,
11418,
6103,
627,
791,
1670,
374,
3451,
6765,
529,
7438,
430,
11418,
6103,
4933,
264,
198,
35020,
33635,
1480,
13,
220,
7089,
3284,
2819,
527,
3451,
13431,
20182,
3451,
8319,
529,
323,
198,
14336,
6591,
1799,
1116,
8319,
529,
439,
1664,
439,
904,
1023,
836,
9879,
449,
198,
1889,
4942,
10131,
4188,
430,
649,
3790,
36997,
33635,
14199,
627,
1438,
4291,
97566,
38372,
1212,
38372,
842,
30716,
11651,
1845,
55609,
198,
5715,
3082,
422,
328,
10548,
449,
279,
5300,
21166,
11,
3641,
6062,
627,
2409,
10309,
1212,
11,
1296,
328,
7314,
520,
430,
2361,
627,
2409,
10309,
842,
11,
3009,
27393,
328,
520,
430,
2361,
627,
27884,
649,
1101,
387,
264,
14743,
315,
9246,
311,
1456,
627,
33417,
32093,
28945,
2190,
28,
23,
8,
55609,
198,
5715,
264,
3048,
1405,
682,
5769,
5885,
527,
17626,
1701,
12908,
627,
2746,
5769,
2190,
374,
539,
2728,
11,
264,
5769,
1404,
315,
220,
23,
5885,
374,
19655,
627,
3990,
10849,
38372,
1212,
38372,
842,
30716,
11651,
528,
55609,
198,
5715,
279,
15821,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
345,
21470,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
948,
220,
12536,
198,
16774,
1212,
323,
842,
527,
33398,
439,
304,
16363,
45297,
627,
5715,
482,
16,
389,
8060,
627,
2293,
4163,
2164,
11,
3146,
9872,
8,
11651,
610,
55609,
198,
5715,
264,
24001,
2373,
315,
328,
11,
1701,
94750,
505,
2897,
323,
16901,
627,
791,
94750,
527,
11054,
555,
60291,
320,
14336,
90,
529,
323,
3451,
92,
529,
4390,
2293,
5489,
82157,
8,
11651,
610,
55609,
198,
5715,
264,
24001,
2373,
315,
328,
11,
1701,
94750,
505,
13021,
627,
791,
94750,
527,
11054,
555,
60291,
320,
14336,
90,
529,
323,
3451,
92,
529,
570
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-4 | The substitutions are identified by braces (‘{’ and ‘}’).
index(sub[, start[, end]]) → int¶
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and
there is at least one character in the string.
isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there
is at least one character in the string.
isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F.
Empty string is ASCII too.
isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and
there is at least one character in the string.
isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there
is at least one character in the string.
isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
such as “def” or “class”.
islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and | [
791,
94750,
527,
11054,
555,
60291,
320,
14336,
90,
529,
323,
3451,
92,
529,
4390,
1275,
10849,
38372,
1212,
38372,
842,
30716,
11651,
528,
55609,
198,
5715,
279,
15821,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
345,
21470,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
948,
220,
12536,
198,
16774,
1212,
323,
842,
527,
33398,
439,
304,
16363,
45297,
627,
36120,
15764,
994,
279,
39549,
374,
539,
1766,
627,
285,
94462,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
459,
8451,
12,
20173,
925,
11,
3641,
6062,
627,
32,
925,
374,
8451,
12,
20173,
422,
682,
5885,
304,
279,
925,
527,
8451,
12,
20173,
323,
198,
19041,
374,
520,
3325,
832,
3752,
304,
279,
925,
627,
285,
7288,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
459,
65695,
45938,
925,
11,
3641,
6062,
627,
32,
925,
374,
65695,
45938,
422,
682,
5885,
304,
279,
925,
527,
65695,
45938,
323,
1070,
198,
285,
520,
3325,
832,
3752,
304,
279,
925,
627,
285,
24207,
368,
55609,
198,
5715,
3082,
422,
682,
5885,
304,
279,
925,
527,
40416,
11,
3641,
6062,
627,
57550,
5885,
617,
2082,
3585,
304,
279,
2134,
549,
10,
931,
15,
35681,
10,
11194,
37,
627,
3606,
925,
374,
40416,
2288,
627,
285,
24170,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
12395,
925,
11,
3641,
6062,
627,
32,
925,
374,
264,
12395,
925,
422,
682,
5885,
304,
279,
925,
527,
12395,
323,
198,
19041,
374,
520,
3325,
832,
3752,
304,
279,
925,
627,
70929,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
16099,
925,
11,
3641,
6062,
627,
32,
925,
374,
264,
16099,
925,
422,
682,
5885,
304,
279,
925,
527,
19016,
323,
1070,
198,
285,
520,
3325,
832,
3752,
304,
279,
925,
627,
285,
16288,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
2764,
13325,
13110,
11,
3641,
6062,
627,
7368,
16570,
2124,
20454,
1161,
8,
311,
1296,
3508,
925,
274,
374,
264,
4694,
13110,
345,
21470,
439,
1054,
755,
863,
477,
1054,
1058,
863,
627,
285,
15115,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
43147,
925,
11,
3641,
6062,
627,
32,
925,
374,
43147,
422,
682,
272,
1503,
5885,
304,
279,
925,
527,
43147,
323
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-5 | A string is lowercase if all cased characters in the string are lowercase and
there is at least one cased character in the string.
isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at
least one character in the string.
isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in
repr() or if it is empty.
isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there
is at least one character in the string.
istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only
follow uncased characters and lowercase characters only cased ones.
isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and
there is at least one cased character in the string.
join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string.
The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
lower()¶
Return a copy of the string converted to lowercase.
lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed. | [
32,
925,
374,
43147,
422,
682,
272,
1503,
5885,
304,
279,
925,
527,
43147,
323,
198,
19041,
374,
520,
3325,
832,
272,
1503,
3752,
304,
279,
925,
627,
285,
20173,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
25031,
925,
11,
3641,
6062,
627,
32,
925,
374,
25031,
422,
682,
5885,
304,
279,
925,
527,
25031,
323,
1070,
374,
520,
198,
56371,
832,
3752,
304,
279,
925,
627,
285,
1374,
481,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
43095,
11,
3641,
6062,
627,
32,
925,
374,
43095,
422,
682,
315,
1202,
5885,
527,
6646,
43095,
304,
198,
31937,
368,
477,
422,
433,
374,
4384,
627,
82870,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
37472,
925,
11,
3641,
6062,
627,
32,
925,
374,
37472,
422,
682,
5885,
304,
279,
925,
527,
37472,
323,
1070,
198,
285,
520,
3325,
832,
3752,
304,
279,
925,
627,
380,
1017,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
264,
2316,
1824,
1503,
925,
11,
3641,
6062,
627,
644,
264,
2316,
1824,
1503,
925,
11,
8582,
12,
323,
2316,
39585,
5885,
1253,
1193,
198,
19070,
21482,
1503,
5885,
323,
43147,
5885,
1193,
272,
1503,
6305,
627,
285,
13886,
368,
55609,
198,
5715,
3082,
422,
279,
925,
374,
459,
40582,
925,
11,
3641,
6062,
627,
32,
925,
374,
40582,
422,
682,
272,
1503,
5885,
304,
279,
925,
527,
40582,
323,
198,
19041,
374,
520,
3325,
832,
272,
1503,
3752,
304,
279,
925,
627,
6115,
28169,
481,
11,
611,
8,
55609,
198,
79540,
32223,
904,
1396,
315,
9246,
627,
791,
925,
6832,
1749,
374,
2663,
374,
22306,
304,
1990,
1855,
2728,
925,
627,
791,
1121,
374,
6052,
439,
264,
502,
925,
627,
13617,
25,
3451,
14639,
13,
6115,
2625,
14336,
370,
20182,
3451,
65116,
20182,
3451,
5544,
529,
2526,
1492,
3451,
370,
558,
80,
26721,
529,
198,
75,
4345,
16830,
11,
5266,
1799,
1151,
6752,
611,
8,
55609,
198,
5715,
264,
2163,
12,
4345,
1908,
925,
315,
3160,
2430,
627,
22344,
374,
2884,
1701,
279,
5300,
5266,
3752,
320,
2309,
374,
264,
3634,
4390,
15115,
368,
55609,
198,
5715,
264,
3048,
315,
279,
925,
16489,
311,
43147,
627,
75,
13406,
77306,
5980,
11,
611,
8,
55609,
198,
5715,
264,
3048,
315,
279,
925,
449,
6522,
37472,
7108,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-6 | Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.
partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found,
returns a 3-tuple containing the part before the separator, the separator
itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string
and two empty strings.
removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):].
Otherwise, return a copy of the original string.
removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty,
return string[:-len(suffix)]. Otherwise, return a copy of the original
string.
replace(old, new, count=- 1, /)¶
Return a copy with all occurrences of substring old replaced by new.
countMaximum number of occurrences to replace.
-1 (the default value) means replace all occurrences. | [
5715,
264,
3048,
315,
279,
925,
449,
6522,
37472,
7108,
627,
2746,
23861,
374,
2728,
323,
539,
2290,
11,
4148,
5885,
304,
23861,
4619,
627,
2020,
52016,
17820,
598,
368,
55609,
198,
5715,
264,
14807,
2007,
41030,
369,
610,
26998,
26914,
2746,
1070,
374,
1193,
832,
5811,
11,
433,
2011,
387,
264,
11240,
13021,
36997,
198,
541,
24624,
320,
396,
68692,
8,
477,
5885,
311,
36997,
6141,
24624,
11,
9246,
477,
2290,
627,
12686,
7039,
690,
387,
1243,
16489,
311,
6141,
24624,
627,
2746,
1070,
527,
1403,
6105,
11,
814,
2011,
387,
9246,
315,
6273,
3160,
11,
323,
198,
258,
279,
13239,
11240,
11,
1855,
3752,
304,
865,
690,
387,
24784,
311,
279,
198,
19740,
520,
279,
1890,
2361,
304,
379,
13,
1442,
1070,
374,
264,
4948,
5811,
11,
433,
198,
25849,
387,
264,
925,
11,
6832,
5885,
690,
387,
24784,
311,
2290,
304,
279,
1121,
627,
42098,
10698,
79,
11,
611,
8,
55609,
198,
51078,
279,
925,
1139,
2380,
5596,
1701,
279,
2728,
25829,
627,
2028,
690,
2778,
369,
279,
25829,
304,
279,
925,
13,
220,
1442,
279,
25829,
374,
1766,
345,
4310,
264,
220,
18,
2442,
6189,
8649,
279,
961,
1603,
279,
25829,
11,
279,
25829,
198,
275,
726,
11,
323,
279,
961,
1306,
433,
627,
2746,
279,
25829,
374,
539,
1766,
11,
4780,
264,
220,
18,
2442,
6189,
8649,
279,
4113,
925,
198,
438,
1403,
4384,
9246,
627,
5514,
12113,
30018,
11,
611,
8,
55609,
198,
5715,
264,
610,
449,
279,
2728,
9436,
925,
7108,
422,
3118,
627,
2746,
279,
925,
8638,
449,
279,
9436,
925,
11,
471,
925,
25721,
30018,
1680,
27218,
81556,
11,
471,
264,
3048,
315,
279,
4113,
925,
627,
1864,
10296,
13866,
97566,
11,
611,
8,
55609,
198,
5715,
264,
610,
449,
279,
2728,
21166,
925,
7108,
422,
3118,
627,
2746,
279,
925,
10548,
449,
279,
21166,
925,
323,
430,
21166,
374,
539,
4384,
345,
693,
925,
27141,
2963,
97566,
27261,
18715,
11,
471,
264,
3048,
315,
279,
4113,
198,
928,
627,
8319,
22739,
11,
502,
11,
1797,
11065,
220,
16,
11,
611,
8,
55609,
198,
5715,
264,
3048,
449,
682,
57115,
315,
39549,
2362,
12860,
555,
502,
627,
1868,
28409,
1396,
315,
57115,
311,
8454,
627,
12,
16,
320,
1820,
1670,
907,
8,
3445,
8454,
682,
57115,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-7 | -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are
replaced.
rfind(sub[, start[, end]]) → int¶
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
rindex(sub[, start[, end]]) → int¶
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If
the separator is found, returns a 3-tuple containing the part before the
separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings
and the original string.
rsplit(sep=None, maxsplit=- 1)¶
Return a list of the substrings in the string, using sep as the separator string.
sepThe separator used to split the string.
When set to None (the default value), will split on any whitespace
character (including \n \r \t \f and spaces) and will discard
empty strings from the result.
maxsplitMaximum number of splits (starting from the left).
-1 (the default value) means no limit. | [
12,
16,
320,
1820,
1670,
907,
8,
3445,
8454,
682,
57115,
627,
2746,
279,
10309,
5811,
1797,
374,
2728,
11,
1193,
279,
1176,
1797,
57115,
527,
198,
265,
37469,
627,
81,
3990,
10849,
38372,
1212,
38372,
842,
30716,
11651,
528,
55609,
198,
5715,
279,
8592,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
345,
21470,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
948,
220,
12536,
198,
16774,
1212,
323,
842,
527,
33398,
439,
304,
16363,
45297,
627,
5715,
482,
16,
389,
8060,
627,
81,
1275,
10849,
38372,
1212,
38372,
842,
30716,
11651,
528,
55609,
198,
5715,
279,
8592,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
345,
21470,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
948,
220,
12536,
198,
16774,
1212,
323,
842,
527,
33398,
439,
304,
16363,
45297,
627,
36120,
15764,
994,
279,
39549,
374,
539,
1766,
627,
81,
4345,
16830,
11,
5266,
1799,
1151,
6752,
611,
8,
55609,
198,
5715,
264,
1314,
12,
4345,
1908,
925,
315,
3160,
2430,
627,
22344,
374,
2884,
1701,
279,
5300,
5266,
3752,
320,
2309,
374,
264,
3634,
4390,
81,
42098,
10698,
79,
11,
611,
8,
55609,
198,
51078,
279,
925,
1139,
2380,
5596,
1701,
279,
2728,
25829,
627,
2028,
690,
2778,
369,
279,
25829,
304,
279,
925,
11,
6041,
520,
279,
842,
13,
1442,
198,
1820,
25829,
374,
1766,
11,
4780,
264,
220,
18,
2442,
6189,
8649,
279,
961,
1603,
279,
198,
41220,
11,
279,
25829,
5196,
11,
323,
279,
961,
1306,
433,
627,
2746,
279,
25829,
374,
539,
1766,
11,
4780,
264,
220,
18,
2442,
6189,
8649,
1403,
4384,
9246,
198,
438,
279,
4113,
925,
627,
5544,
2344,
10698,
79,
5980,
11,
1973,
7105,
11065,
220,
16,
8,
55609,
198,
5715,
264,
1160,
315,
279,
16146,
826,
304,
279,
925,
11,
1701,
21693,
439,
279,
25829,
925,
627,
29136,
791,
25829,
1511,
311,
6859,
279,
925,
627,
4599,
743,
311,
2290,
320,
1820,
1670,
907,
705,
690,
6859,
389,
904,
37472,
198,
19740,
320,
16564,
1144,
77,
1144,
81,
1144,
83,
1144,
69,
323,
12908,
8,
323,
690,
38967,
198,
3274,
9246,
505,
279,
1121,
627,
2880,
7105,
28409,
1396,
315,
41567,
320,
40389,
505,
279,
2163,
4390,
12,
16,
320,
1820,
1670,
907,
8,
3445,
912,
4017,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-8 | -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(sep=None, maxsplit=- 1)¶
Return a list of the substrings in the string, using sep as the separator string.
sepThe separator used to split the string.
When set to None (the default value), will split on any whitespace
character (including \n \r \t \f and spaces) and will discard
empty strings from the result.
maxsplitMaximum number of splits (starting from the left).
-1 (the default value) means no limit.
Note, str.split() is mainly useful for data that has been intentionally
delimited. With natural text that includes punctuation, consider using
the regular expression module.
splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and
true.
startswith(prefix[, start[, end]]) → bool¶
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining | [
12,
16,
320,
1820,
1670,
907,
8,
3445,
912,
4017,
627,
20805,
1303,
8638,
520,
279,
842,
315,
279,
925,
323,
4375,
311,
279,
4156,
627,
71498,
77306,
5980,
11,
611,
8,
55609,
198,
5715,
264,
3048,
315,
279,
925,
449,
28848,
37472,
7108,
627,
2746,
23861,
374,
2728,
323,
539,
2290,
11,
4148,
5885,
304,
23861,
4619,
627,
7105,
10698,
79,
5980,
11,
1973,
7105,
11065,
220,
16,
8,
55609,
198,
5715,
264,
1160,
315,
279,
16146,
826,
304,
279,
925,
11,
1701,
21693,
439,
279,
25829,
925,
627,
29136,
791,
25829,
1511,
311,
6859,
279,
925,
627,
4599,
743,
311,
2290,
320,
1820,
1670,
907,
705,
690,
6859,
389,
904,
37472,
198,
19740,
320,
16564,
1144,
77,
1144,
81,
1144,
83,
1144,
69,
323,
12908,
8,
323,
690,
38967,
198,
3274,
9246,
505,
279,
1121,
627,
2880,
7105,
28409,
1396,
315,
41567,
320,
40389,
505,
279,
2163,
4390,
12,
16,
320,
1820,
1670,
907,
8,
3445,
912,
4017,
627,
9290,
11,
610,
5402,
368,
374,
14918,
5505,
369,
828,
430,
706,
1027,
37304,
198,
9783,
32611,
13,
220,
3161,
5933,
1495,
430,
5764,
62603,
11,
2980,
1701,
198,
1820,
5912,
7645,
4793,
627,
7105,
8128,
7,
13397,
1438,
5725,
8,
55609,
198,
5715,
264,
1160,
315,
279,
5238,
304,
279,
925,
11,
15061,
520,
1584,
23546,
627,
2519,
18808,
527,
539,
5343,
304,
279,
13239,
1160,
7389,
2567,
1438,
374,
2728,
323,
198,
1904,
627,
70425,
30018,
38372,
1212,
38372,
842,
30716,
11651,
1845,
55609,
198,
5715,
3082,
422,
328,
8638,
449,
279,
5300,
9436,
11,
3641,
6062,
627,
2409,
10309,
1212,
11,
1296,
328,
7314,
520,
430,
2361,
627,
2409,
10309,
842,
11,
3009,
27393,
328,
520,
430,
2361,
627,
12113,
649,
1101,
387,
264,
14743,
315,
9246,
311,
1456,
627,
13406,
77306,
5980,
11,
611,
8,
55609,
198,
5715,
264,
3048,
315,
279,
925,
449,
6522,
323,
28848,
37472,
7108,
627,
2746,
23861,
374,
2728,
323,
539,
2290,
11,
4148,
5885,
304,
23861,
4619,
627,
26825,
5756,
368,
55609,
198,
12281,
40582,
5885,
311,
43147,
323,
43147,
5885,
311,
40582,
627,
2150,
368,
55609,
198,
5715,
264,
2373,
315,
279,
925,
1405,
1855,
3492,
374,
2316,
92226,
627,
7816,
11951,
11,
4339,
1212,
449,
8582,
92226,
5885,
323,
682,
9861
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
ce773adc8274-9 | More specifically, words start with uppercased characters and all remaining
cased characters have lower case.
translate(table, /)¶
Replace each character in the string using the given translation table.
tableTranslation table, which must be a mapping of Unicode ordinals to
Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a
dictionary or list. If this operation raises LookupError, the character is
left untouched. Characters mapped to None are deleted.
upper()¶
Return a copy of the string converted to uppercase.
zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
mmr = 'mmr'¶
similarity = 'similarity'¶ | [
7816,
11951,
11,
4339,
1212,
449,
8582,
92226,
5885,
323,
682,
9861,
198,
92226,
5885,
617,
4827,
1162,
627,
14372,
16138,
11,
611,
8,
55609,
198,
23979,
1855,
3752,
304,
279,
925,
1701,
279,
2728,
14807,
2007,
627,
2048,
25416,
2007,
11,
902,
2011,
387,
264,
13021,
315,
36997,
6141,
24624,
311,
198,
35020,
6141,
24624,
11,
9246,
11,
477,
2290,
627,
791,
2007,
2011,
4305,
19128,
9199,
287,
4669,
1328,
61012,
10662,
369,
2937,
264,
198,
36771,
477,
1160,
13,
220,
1442,
420,
5784,
25930,
51411,
1480,
11,
279,
3752,
374,
198,
2414,
68622,
13,
220,
45616,
24784,
311,
2290,
527,
11309,
627,
13886,
368,
55609,
198,
5715,
264,
3048,
315,
279,
925,
16489,
311,
40582,
627,
89,
7712,
16830,
11,
611,
8,
55609,
198,
14047,
264,
25031,
925,
449,
17975,
389,
279,
2163,
11,
311,
5266,
264,
2115,
315,
279,
2728,
2430,
627,
791,
925,
374,
2646,
60856,
627,
3906,
81,
284,
364,
3906,
81,
6,
55609,
198,
15124,
49325,
284,
364,
15124,
49325,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
7be70e67891c-0 | langchain.retrievers.milvus.MilvusRetriever¶
class langchain.retrievers.milvus.MilvusRetriever(embedding_function: Embeddings, collection_name: str = 'LangChainCollection', connection_args: Optional[Dict[str, Any]] = None, consistency_level: str = 'Session', search_params: Optional[dict] = None)[source]¶
Bases: BaseRetriever
Retriever that uses the Milvus API.
Methods
__init__(embedding_function[, ...])
add_texts(texts[, metadatas])
Add text to the Milvus store
aget_relevant_documents(query, *[, callbacks])
Asynchronously get documents relevant to a query.
get_relevant_documents(query, *[, callbacks])
Retrieve documents relevant to a query.
add_texts(texts: List[str], metadatas: Optional[List[dict]] = None) → None[source]¶
Add text to the Milvus store
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.
: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 | [
5317,
8995,
1351,
9104,
3078,
749,
321,
85,
355,
1345,
321,
85,
355,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
749,
321,
85,
355,
1345,
321,
85,
355,
12289,
462,
2099,
50825,
7113,
9353,
25,
38168,
25624,
11,
4526,
1292,
25,
610,
284,
364,
27317,
19368,
6618,
518,
3717,
8550,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
29237,
8438,
25,
610,
284,
364,
5396,
518,
2778,
6887,
25,
12536,
58,
8644,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
12289,
462,
2099,
430,
5829,
279,
10357,
85,
355,
5446,
627,
18337,
198,
565,
2381,
3889,
95711,
9353,
38372,
4194,
1131,
2608,
723,
80746,
7383,
82,
38372,
4194,
4150,
329,
19907,
2608,
2261,
1495,
311,
279,
10357,
85,
355,
3637,
198,
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,
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,
10357,
85,
355,
3637,
198,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.milvus.MilvusRetriever.html |
a54a821d8be7-0 | langchain.retrievers.document_compressors.base.DocumentCompressorPipeline¶
class langchain.retrievers.document_compressors.base.DocumentCompressorPipeline(*, transformers: List[Union[BaseDocumentTransformer, BaseDocumentCompressor]])[source]¶
Bases: BaseDocumentCompressor
Document compressor that uses a pipeline of transformers.
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 transformers: List[Union[langchain.schema.BaseDocumentTransformer, langchain.retrievers.document_compressors.base.BaseDocumentCompressor]] [Required]¶
List of document filters that are chained together and run in sequence.
async acompress_documents(documents: Sequence[Document], query: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Document][source]¶
Compress retrieved documents given the query context.
compress_documents(documents: Sequence[Document], query: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Document][source]¶
Transform a list of documents.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
9105,
27352,
1110,
57320,
35756,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
9105,
27352,
1110,
57320,
35756,
4163,
11,
87970,
25,
1796,
58,
33758,
58,
4066,
7676,
47458,
11,
5464,
7676,
1110,
57320,
30716,
58,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
7676,
1110,
57320,
198,
7676,
59977,
430,
5829,
264,
15660,
315,
87970,
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,
87970,
25,
1796,
58,
33758,
58,
5317,
8995,
31992,
13316,
7676,
47458,
11,
8859,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
9105,
13316,
7676,
1110,
57320,
5163,
510,
8327,
60,
55609,
198,
861,
315,
2246,
13711,
430,
527,
68069,
3871,
323,
1629,
304,
8668,
627,
7847,
264,
39460,
77027,
19702,
2901,
25,
29971,
58,
7676,
1145,
3319,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
7676,
1483,
2484,
60,
55609,
198,
1110,
1911,
31503,
9477,
2728,
279,
3319,
2317,
627,
39460,
77027,
19702,
2901,
25,
29971,
58,
7676,
1145,
3319,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
29971,
58,
7676,
1483,
2484,
60,
55609,
198,
9140,
264,
1160,
315,
9477,
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/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html |
b834362e2d3d-0 | langchain.retrievers.zilliz.ZillizRetreiver¶
langchain.retrievers.zilliz.ZillizRetreiver(*args: Any, **kwargs: Any) → ZillizRetriever[source]¶
Deprecated ZillizRetreiver. Please use ZillizRetriever (‘i’ before ‘e’) instead.
:param *args:
:param **kwargs:
Returns
ZillizRetriever | [
5317,
8995,
1351,
9104,
3078,
4025,
484,
450,
13784,
484,
450,
12289,
265,
1553,
55609,
198,
5317,
8995,
1351,
9104,
3078,
4025,
484,
450,
13784,
484,
450,
12289,
265,
1553,
4163,
2164,
25,
5884,
11,
3146,
9872,
25,
5884,
8,
11651,
1901,
484,
450,
12289,
462,
2099,
76747,
60,
55609,
198,
52444,
1901,
484,
450,
12289,
265,
1553,
13,
5321,
1005,
1901,
484,
450,
12289,
462,
2099,
320,
14336,
72,
529,
1603,
3451,
68,
96206,
4619,
627,
68416,
353,
2164,
512,
68416,
3146,
9872,
512,
16851,
198,
57,
484,
450,
12289,
462,
2099
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetreiver.html |
3e11e771ce48-0 | langchain.retrievers.document_compressors.chain_extract.default_get_input¶
langchain.retrievers.document_compressors.chain_extract.default_get_input(query: str, doc: Document) → Dict[str, Any][source]¶
Return the compression chain input. | [
5317,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
53141,
40223,
8939,
3138,
6022,
55609,
198,
5317,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
53141,
40223,
8939,
3138,
6022,
10974,
25,
610,
11,
4733,
25,
12051,
8,
11651,
30226,
17752,
11,
5884,
1483,
2484,
60,
55609,
198,
5715,
279,
26168,
8957,
1988,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.default_get_input.html |
77b1992a8557-0 | langchain.retrievers.kendra.Highlight¶
class langchain.retrievers.kendra.Highlight(*, BeginOffset: int, EndOffset: int, TopAnswer: Optional[bool] = None, Type: Optional[str] = None, **extra_data: Any)[source]¶
Bases: 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 BeginOffset: int [Required]¶
param EndOffset: int [Required]¶
param TopAnswer: Optional[bool] = None¶
param Type: Optional[str] = None¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
71284,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
71284,
4163,
11,
19110,
6582,
25,
528,
11,
4060,
6582,
25,
528,
11,
7054,
16533,
25,
12536,
58,
2707,
60,
284,
2290,
11,
4078,
25,
12536,
17752,
60,
284,
2290,
11,
3146,
15824,
1807,
25,
5884,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
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,
19110,
6582,
25,
528,
510,
8327,
60,
55609,
198,
913,
4060,
6582,
25,
528,
510,
8327,
60,
55609,
198,
913,
7054,
16533,
25,
12536,
58,
2707,
60,
284,
2290,
55609,
198,
913,
4078,
25,
12536,
17752,
60,
284,
2290,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.Highlight.html |
3146a150b8fe-0 | langchain.retrievers.self_query.chroma.ChromaTranslator¶
class langchain.retrievers.self_query.chroma.ChromaTranslator[source]¶
Bases: Visitor
Logic for converting internal query language elements to valid filters.
Methods
__init__()
visit_comparison(comparison)
Translate a Comparison.
visit_operation(operation)
Translate an Operation.
visit_structured_query(structured_query)
Translate a StructuredQuery.
Attributes
allowed_comparators
allowed_operators
Subset of allowed logical operators.
visit_comparison(comparison: Comparison) → Dict[source]¶
Translate a Comparison.
visit_operation(operation: Operation) → Dict[source]¶
Translate an Operation.
visit_structured_query(structured_query: StructuredQuery) → Tuple[str, dict][source]¶
Translate a StructuredQuery.
allowed_comparators: Optional[Sequence[Comparator]] = None¶
allowed_operators: Optional[Sequence[Operator]] = [<Operator.AND: 'and'>, <Operator.OR: 'or'>]¶
Subset of allowed logical operators. | [
5317,
8995,
1351,
9104,
3078,
28248,
5857,
5442,
58084,
6487,
58084,
52753,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
28248,
5857,
5442,
58084,
6487,
58084,
52753,
76747,
60,
55609,
198,
33,
2315,
25,
56982,
198,
27849,
369,
34537,
5419,
3319,
4221,
5540,
311,
2764,
13711,
627,
18337,
198,
565,
2381,
33716,
28560,
91897,
14426,
36642,
340,
28573,
264,
43551,
627,
28560,
33665,
53447,
340,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
340,
28573,
264,
16531,
3149,
2929,
627,
10738,
198,
21642,
3038,
1768,
3046,
198,
21642,
26716,
3046,
198,
71684,
315,
5535,
20406,
20197,
627,
28560,
91897,
14426,
36642,
25,
43551,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
264,
43551,
627,
28560,
33665,
53447,
25,
17145,
8,
11651,
30226,
76747,
60,
55609,
198,
28573,
459,
17145,
627,
28560,
15477,
3149,
5857,
6294,
3149,
5857,
25,
16531,
3149,
2929,
8,
11651,
25645,
17752,
11,
6587,
1483,
2484,
60,
55609,
198,
28573,
264,
16531,
3149,
2929,
627,
21642,
3038,
1768,
3046,
25,
12536,
58,
14405,
58,
39758,
5163,
284,
2290,
55609,
198,
21642,
26716,
3046,
25,
12536,
58,
14405,
58,
18968,
5163,
284,
68326,
18968,
885,
8225,
25,
364,
438,
6404,
11,
366,
18968,
78997,
25,
364,
269,
6404,
60,
55609,
198,
71684,
315,
5535,
20406,
20197,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.self_query.chroma.ChromaTranslator.html |
d74189b145f8-0 | langchain.retrievers.tfidf.TFIDFRetriever¶
class langchain.retrievers.tfidf.TFIDFRetriever(*, vectorizer: Any = None, docs: List[Document], tfidf_array: Any = None, k: int = 4)[source]¶
Bases: BaseRetriever, 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 docs: List[langchain.schema.Document] [Required]¶
param k: int = 4¶
param tfidf_array: Any = None¶
param vectorizer: Any = None¶
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
classmethod from_documents(documents: Iterable[Document], *, tfidf_params: Optional[Dict[str, Any]] = None, **kwargs: Any) → TFIDFRetriever[source]¶
classmethod from_texts(texts: Iterable[str], metadatas: Optional[Iterable[dict]] = None, tfidf_params: Optional[Dict[str, Any]] = None, **kwargs: Any) → TFIDFRetriever[source]¶
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
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
1351,
9104,
3078,
739,
82054,
844,
37,
926,
10725,
94223,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
739,
82054,
844,
37,
926,
10725,
94223,
2099,
4163,
11,
4724,
3213,
25,
5884,
284,
2290,
11,
27437,
25,
1796,
58,
7676,
1145,
6543,
78104,
3943,
25,
5884,
284,
2290,
11,
597,
25,
528,
284,
220,
19,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
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,
27437,
25,
1796,
58,
5317,
8995,
31992,
27352,
60,
510,
8327,
60,
55609,
198,
913,
597,
25,
528,
284,
220,
19,
55609,
198,
913,
6543,
78104,
3943,
25,
5884,
284,
2290,
55609,
198,
913,
4724,
3213,
25,
5884,
284,
2290,
55609,
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,
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,
27853,
505,
77027,
19702,
2901,
25,
39116,
58,
7676,
1145,
12039,
6543,
78104,
6887,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
30245,
926,
10725,
94223,
2099,
76747,
60,
55609,
198,
27853,
505,
80746,
7383,
82,
25,
39116,
17752,
1145,
2322,
329,
19907,
25,
12536,
58,
51735,
58,
8644,
5163,
284,
2290,
11,
6543,
78104,
6887,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
30245,
926,
10725,
94223,
2099,
76747,
60,
55609,
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,
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/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html |
d74189b145f8-1 | Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html |
2e659c9015be-0 | langchain.retrievers.remote_retriever.RemoteLangChainRetriever¶
class langchain.retrievers.remote_retriever.RemoteLangChainRetriever(*, url: str, headers: Optional[dict] = None, input_key: str = 'message', response_key: str = 'response', page_content_key: str = 'page_content', metadata_key: str = 'metadata')[source]¶
Bases: BaseRetriever, 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 headers: Optional[dict] = None¶
param input_key: str = 'message'¶
param metadata_key: str = 'metadata'¶
param page_content_key: str = 'page_content'¶
param response_key: str = 'response'¶
param url: str [Required]¶
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 | [
5317,
8995,
1351,
9104,
3078,
35193,
1311,
9104,
424,
52534,
27317,
19368,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
35193,
1311,
9104,
424,
52534,
27317,
19368,
12289,
462,
2099,
4163,
11,
2576,
25,
610,
11,
7247,
25,
12536,
58,
8644,
60,
284,
2290,
11,
1988,
3173,
25,
610,
284,
364,
2037,
518,
2077,
3173,
25,
610,
284,
364,
2376,
518,
2199,
7647,
3173,
25,
610,
284,
364,
2964,
7647,
518,
11408,
3173,
25,
610,
284,
364,
18103,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
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,
7247,
25,
12536,
58,
8644,
60,
284,
2290,
55609,
198,
913,
1988,
3173,
25,
610,
284,
364,
2037,
6,
55609,
198,
913,
11408,
3173,
25,
610,
284,
364,
18103,
6,
55609,
198,
913,
2199,
7647,
3173,
25,
610,
284,
364,
2964,
7647,
6,
55609,
198,
913,
2077,
3173,
25,
610,
284,
364,
2376,
6,
55609,
198,
913,
2576,
25,
610,
510,
8327,
60,
55609,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.remote_retriever.RemoteLangChainRetriever.html |
f93068b7dd3c-0 | langchain.retrievers.document_compressors.chain_filter.default_get_input¶
langchain.retrievers.document_compressors.chain_filter.default_get_input(query: str, doc: Document) → Dict[str, Any][source]¶
Return the compression chain input. | [
5317,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
53141,
8901,
8939,
3138,
6022,
55609,
198,
5317,
8995,
1351,
9104,
3078,
17926,
88945,
1105,
53141,
8901,
8939,
3138,
6022,
10974,
25,
610,
11,
4733,
25,
12051,
8,
11651,
30226,
17752,
11,
5884,
1483,
2484,
60,
55609,
198,
5715,
279,
26168,
8957,
1988,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.document_compressors.chain_filter.default_get_input.html |
4cfdb0df0ceb-0 | langchain.retrievers.zep.ZepRetriever¶
class langchain.retrievers.zep.ZepRetriever(session_id: str, url: str, api_key: Optional[str] = None, top_k: Optional[int] = None)[source]¶
Bases: BaseRetriever
A Retriever implementation for the Zep long-term memory store. Search your
user’s long-term chat history with Zep.
Note: You will need to provide the user’s session_id to use this retriever.
More on Zep:
Zep provides long-term conversation storage for LLM apps. The server stores,
summarizes, embeds, indexes, and enriches conversational AI chat
histories, and exposes them via simple, low-latency APIs.
For server installation instructions, see:
https://docs.getzep.com/deployment/quickstart/
Methods
__init__(session_id, url[, api_key, top_k])
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]¶
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 | [
5317,
8995,
1351,
9104,
3078,
4025,
752,
13784,
752,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
4025,
752,
13784,
752,
12289,
462,
2099,
16663,
851,
25,
610,
11,
2576,
25,
610,
11,
6464,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
1948,
4803,
25,
12536,
19155,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
32,
10608,
462,
2099,
8292,
369,
279,
1901,
752,
1317,
9860,
5044,
3637,
13,
7694,
701,
198,
882,
753,
1317,
9860,
6369,
3925,
449,
1901,
752,
627,
9290,
25,
1472,
690,
1205,
311,
3493,
279,
1217,
753,
3882,
851,
311,
1005,
420,
10992,
424,
627,
7816,
389,
1901,
752,
512,
57,
752,
5825,
1317,
9860,
10652,
5942,
369,
445,
11237,
10721,
13,
578,
3622,
10756,
345,
1264,
5730,
4861,
11,
11840,
82,
11,
25998,
11,
323,
31518,
288,
7669,
1697,
15592,
6369,
198,
21843,
2490,
11,
323,
59381,
1124,
4669,
4382,
11,
3428,
99514,
2301,
34456,
627,
2520,
3622,
14028,
11470,
11,
1518,
512,
2485,
1129,
14452,
673,
89,
752,
916,
23365,
53899,
14,
28863,
2527,
6018,
18337,
198,
565,
2381,
3889,
6045,
851,
11,
4194,
1103,
38372,
4194,
2113,
3173,
11,
4194,
3565,
4803,
2608,
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,
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
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.zep.ZepRetriever.html |
e9f7b33c7780-0 | langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER¶
langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER(op_name: str) → Callable[source]¶
Composer for functions.
:param op_name: Name of the function.
Returns
Callable that takes a list of arguments and returns a string. | [
5317,
8995,
1351,
9104,
3078,
28248,
5857,
749,
84009,
1006,
9260,
7021,
17914,
643,
55609,
198,
5317,
8995,
1351,
9104,
3078,
28248,
5857,
749,
84009,
1006,
9260,
7021,
17914,
643,
17534,
1292,
25,
610,
8,
11651,
54223,
76747,
60,
55609,
198,
91167,
369,
5865,
627,
68416,
1200,
1292,
25,
4076,
315,
279,
734,
627,
16851,
198,
41510,
430,
5097,
264,
1160,
315,
6105,
323,
4780,
264,
925,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER.html |
58d60f5bcc0b-0 | langchain.retrievers.wikipedia.WikipediaRetriever¶
class langchain.retrievers.wikipedia.WikipediaRetriever(*, wiki_client: Any = None, top_k_results: int = 3, lang: str = 'en', load_all_available_meta: bool = False, doc_content_chars_max: int = 4000)[source]¶
Bases: BaseRetriever, WikipediaAPIWrapper
It is effectively a wrapper for WikipediaAPIWrapper.
It wraps load() to get_relevant_documents().
It uses all WikipediaAPIWrapper arguments without any change.
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 doc_content_chars_max: int = 4000¶
param lang: str = 'en'¶
param load_all_available_meta: bool = False¶
param top_k_results: int = 3¶
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
load(query: str) → List[Document]¶
Run Wikipedia search and get the article text plus the meta information.
See
Returns: a list of documents.
run(query: str) → str¶
Run Wikipedia search and get page summaries.
validator validate_environment » all fields¶ | [
5317,
8995,
1351,
9104,
3078,
34466,
1196,
15288,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
34466,
1196,
15288,
12289,
462,
2099,
4163,
11,
29709,
8342,
25,
5884,
284,
2290,
11,
1948,
4803,
13888,
25,
528,
284,
220,
18,
11,
8859,
25,
610,
284,
364,
268,
518,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
11,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
3443,
15,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
11,
27685,
7227,
11803,
198,
2181,
374,
13750,
264,
13564,
369,
27685,
7227,
11803,
627,
2181,
40809,
2865,
368,
311,
636,
1311,
8532,
77027,
26914,
2181,
5829,
682,
27685,
7227,
11803,
6105,
2085,
904,
2349,
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,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
3443,
15,
55609,
198,
913,
8859,
25,
610,
284,
364,
268,
6,
55609,
198,
913,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
55609,
198,
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609,
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,
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,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
60,
55609,
198,
6869,
27685,
2778,
323,
636,
279,
4652,
1495,
5636,
279,
8999,
2038,
627,
10031,
198,
16851,
25,
264,
1160,
315,
9477,
627,
6236,
10974,
25,
610,
8,
11651,
610,
55609,
198,
6869,
27685,
2778,
323,
636,
2199,
70022,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.wikipedia.WikipediaRetriever.html |
58d60f5bcc0b-1 | Run Wikipedia search and get page summaries.
validator validate_environment » all fields¶
Validate that the python package exists in environment.
model Config¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
6869,
27685,
2778,
323,
636,
2199,
70022,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
279,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.wikipedia.WikipediaRetriever.html |
440e90aeefcb-0 | langchain.retrievers.knn.create_index¶
langchain.retrievers.knn.create_index(contexts: List[str], embeddings: Embeddings) → ndarray[source]¶
Create an index of embeddings for a list of contexts.
Parameters
contexts – List of contexts to embed.
embeddings – Embeddings model to use.
Returns
Index of embeddings. | [
5317,
8995,
1351,
9104,
3078,
5314,
7521,
2581,
3644,
55609,
198,
5317,
8995,
1351,
9104,
3078,
5314,
7521,
2581,
3644,
5491,
82,
25,
1796,
17752,
1145,
71647,
25,
38168,
25624,
8,
11651,
67983,
76747,
60,
55609,
198,
4110,
459,
1963,
315,
71647,
369,
264,
1160,
315,
38697,
627,
9905,
198,
73027,
1389,
1796,
315,
38697,
311,
11840,
627,
12529,
25624,
1389,
38168,
25624,
1646,
311,
1005,
627,
16851,
198,
1581,
315,
71647,
13
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.knn.create_index.html |
7c53389c6f0e-0 | langchain.retrievers.kendra.AmazonKendraRetriever¶
class langchain.retrievers.kendra.AmazonKendraRetriever(index_id: str, region_name: Optional[str] = None, credentials_profile_name: Optional[str] = None, top_k: int = 3, attribute_filter: Optional[Dict] = None, client: Optional[Any] = None)[source]¶
Bases: BaseRetriever
Retriever class to query documents from Amazon Kendra Index.
Parameters
index_id – Kendra index id
region_name – The aws region e.g., us-west-2.
Fallsback to AWS_DEFAULT_REGION env variable
or region specified in ~/.aws/config.
credentials_profile_name – The name of the profile in the ~/.aws/credentials
or ~/.aws/config files, which has either access keys or role information
specified. If not specified, the default credential profile or, if on an
EC2 instance, credentials from IMDS will be used.
top_k – No of results to return
attribute_filter – Additional filtering of results based on metadata
See: https://docs.aws.amazon.com/kendra/latest/APIReference
client – boto3 client for Kendra
Example
retriever = AmazonKendraRetriever(
index_id="c0806df7-e76b-4bce-9b5c-d5582f6b1a03"
)
Methods
__init__(index_id[, region_name, ...])
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]¶ | [
5317,
8995,
1351,
9104,
3078,
5314,
61799,
885,
76,
5639,
42,
61799,
12289,
462,
2099,
55609,
198,
1058,
8859,
8995,
1351,
9104,
3078,
5314,
61799,
885,
76,
5639,
42,
61799,
12289,
462,
2099,
7343,
851,
25,
610,
11,
5654,
1292,
25,
12536,
17752,
60,
284,
2290,
11,
16792,
14108,
1292,
25,
12536,
17752,
60,
284,
2290,
11,
1948,
4803,
25,
528,
284,
220,
18,
11,
7180,
8901,
25,
12536,
58,
13755,
60,
284,
2290,
11,
3016,
25,
12536,
71401,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
12289,
462,
2099,
198,
12289,
462,
2099,
538,
311,
3319,
9477,
505,
8339,
39217,
969,
8167,
627,
9905,
198,
1275,
851,
1389,
39217,
969,
1963,
887,
198,
4030,
1292,
1389,
578,
32621,
5654,
384,
1326,
2637,
603,
38702,
12,
17,
627,
37,
5700,
1445,
311,
24124,
14131,
40279,
6233,
3977,
198,
269,
5654,
5300,
304,
41058,
8805,
15072,
627,
33453,
14108,
1292,
1389,
578,
836,
315,
279,
5643,
304,
279,
41058,
8805,
14,
33453,
198,
269,
41058,
8805,
15072,
3626,
11,
902,
706,
3060,
2680,
7039,
477,
3560,
2038,
198,
54534,
13,
1442,
539,
5300,
11,
279,
1670,
41307,
5643,
477,
11,
422,
389,
459,
198,
7650,
17,
2937,
11,
16792,
505,
6654,
6061,
690,
387,
1511,
627,
3565,
4803,
1389,
2360,
315,
3135,
311,
471,
198,
9294,
8901,
1389,
24086,
30770,
315,
3135,
3196,
389,
11408,
198,
10031,
25,
3788,
1129,
14452,
36266,
18771,
916,
14441,
61799,
34249,
73130,
9032,
198,
3045,
1389,
61879,
18,
3016,
369,
39217,
969,
198,
13617,
198,
265,
9104,
424,
284,
8339,
42,
61799,
12289,
462,
2099,
1021,
262,
1963,
851,
429,
66,
13837,
21,
3013,
22,
5773,
4767,
65,
12,
19,
65,
346,
12,
24,
65,
20,
66,
1773,
22895,
17,
69,
21,
65,
16,
64,
2839,
702,
340,
18337,
198,
565,
2381,
3889,
1275,
851,
38372,
4194,
4030,
1292,
11,
4194,
1131,
2608,
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,
60,
55609
] | https://langchain.readthedocs.io/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.