id
stringlengths 14
15
| text
stringlengths 35
2.07k
| embedding
sequence | source
stringlengths 61
154
|
---|---|---|---|
8e649b50fb63-0 | langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent¶
class langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent(*, llm: BaseLanguageModel, tools: Sequence[BaseTool], prompt: BasePromptTemplate)[source]¶
Bases: BaseMultiActionAgent
An Agent driven by OpenAIs function powered API.
Parameters
llm – This should be an instance of ChatOpenAI, specifically a model
that supports using functions.
tools – The tools this agent has access to.
prompt – The prompt for this agent, should support agent_scratchpad as one
of the variables. For an easy way to construct this prompt, use
OpenAIFunctionsAgent.create_prompt(…)
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 llm: langchain.base_language.BaseLanguageModel [Required]¶
param prompt: langchain.prompts.base.BasePromptTemplate [Required]¶
param tools: Sequence[langchain.tools.base.BaseTool] [Required]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[List[AgentAction], AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
**kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(system_message: Optional[SystemMessage] = SystemMessage(content='You are a helpful AI assistant.', additional_kwargs={}), extra_prompt_messages: Optional[List[BaseMessagePromptTemplate]] = None) → BasePromptTemplate[source]¶
Create prompt for this agent.
Parameters | [
5317,
8995,
29192,
812,
5949,
2192,
32808,
26190,
26814,
9105,
13250,
14660,
7213,
26272,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
5949,
2192,
32808,
26190,
26814,
9105,
13250,
14660,
7213,
26272,
17230,
4163,
11,
9507,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
10137,
25,
5464,
55715,
7423,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
20981,
2573,
17230,
198,
2127,
21372,
16625,
555,
5377,
32,
3957,
734,
23134,
5446,
627,
9905,
198,
657,
76,
1389,
1115,
1288,
387,
459,
2937,
315,
13149,
5109,
15836,
11,
11951,
264,
1646,
198,
9210,
11815,
1701,
5865,
627,
16297,
1389,
578,
7526,
420,
8479,
706,
2680,
311,
627,
41681,
1389,
578,
10137,
369,
420,
8479,
11,
1288,
1862,
8479,
60828,
759,
13545,
439,
832,
198,
1073,
279,
7482,
13,
1789,
459,
4228,
1648,
311,
9429,
420,
10137,
11,
1005,
198,
5109,
32,
2843,
600,
82,
17230,
2581,
62521,
7,
1981,
340,
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,
9507,
76,
25,
8859,
8995,
9105,
30121,
13316,
14126,
1747,
510,
8327,
60,
55609,
198,
913,
10137,
25,
8859,
8995,
61848,
13044,
9105,
13316,
55715,
7423,
510,
8327,
60,
55609,
198,
913,
7526,
25,
29971,
58,
5317,
8995,
24029,
9105,
13316,
7896,
60,
510,
8327,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
53094,
58,
17230,
2573,
1145,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
27853,
1893,
62521,
47106,
6598,
25,
12536,
86126,
2097,
60,
284,
744,
2097,
15413,
1151,
2675,
527,
264,
11190,
15592,
18328,
16045,
5217,
37335,
1185,
39942,
5066,
62521,
24321,
25,
12536,
53094,
58,
4066,
2097,
55715,
7423,
5163,
284,
2290,
8,
11651,
5464,
55715,
7423,
76747,
60,
55609,
198,
4110,
10137,
369,
420,
8479,
627,
9905
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
8e649b50fb63-1 | Create prompt for this agent.
Parameters
system_message – Message to use as the system message that will be the
first in the prompt.
extra_prompt_messages – Prompt messages that will be placed between the
system message and the new human input.
Returns
A prompt template to pass into this agent.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, extra_prompt_messages: Optional[List[BaseMessagePromptTemplate]] = None, system_message: Optional[SystemMessage] = SystemMessage(content='You are a helpful AI assistant.', additional_kwargs={}), **kwargs: Any) → BaseMultiActionAgent[source]¶
Construct an agent from an LLM and tools.
get_allowed_tools() → List[str][source]¶
Get allowed tools.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[List[AgentAction], AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date, along with observations
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”) | [
4110,
10137,
369,
420,
8479,
627,
9905,
198,
9125,
6598,
1389,
4961,
311,
1005,
439,
279,
1887,
1984,
430,
690,
387,
279,
198,
3983,
304,
279,
10137,
627,
15824,
62521,
24321,
1389,
60601,
6743,
430,
690,
387,
9277,
1990,
279,
198,
9125,
1984,
323,
279,
502,
3823,
1988,
627,
16851,
198,
32,
10137,
3896,
311,
1522,
1139,
420,
8479,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
5066,
62521,
24321,
25,
12536,
53094,
58,
4066,
2097,
55715,
7423,
5163,
284,
2290,
11,
1887,
6598,
25,
12536,
86126,
2097,
60,
284,
744,
2097,
15413,
1151,
2675,
527,
264,
11190,
15592,
18328,
16045,
5217,
37335,
1185,
39942,
3146,
9872,
25,
5884,
8,
11651,
5464,
20981,
2573,
17230,
76747,
60,
55609,
198,
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
1991,
5535,
7526,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
53094,
58,
17230,
2573,
1145,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
11,
3235,
449,
24654,
198,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
33611
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
8e649b50fb63-2 | # If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_llm » all fields[source]¶
validator validate_prompt » all fields[source]¶
property functions: List[dict]¶
property input_keys: List[str]¶
Get input keys. Input refers to user input here.
property return_values: List[str]¶
Return values of the agent. | [
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
55609,
198,
16503,
9788,
44095,
76,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
3784,
5865,
25,
1796,
58,
8644,
60,
55609,
198,
3784,
1988,
12919,
25,
1796,
17752,
60,
55609,
198,
1991,
1988,
7039,
13,
5688,
19813,
311,
1217,
1988,
1618,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html |
e0611d851adf-0 | langchain.agents.mrkl.base.ZeroShotAgent¶
class langchain.agents.mrkl.base.ZeroShotAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the MRKL chain.
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 allowed_tools: Optional[List[str]] = None¶
param llm_chain: langchain.chains.llm.LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use. | [
5317,
8995,
29192,
812,
749,
81,
10784,
9105,
36589,
37502,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
749,
81,
10784,
9105,
36589,
37502,
17230,
4163,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
2612,
19024,
25,
21372,
5207,
6707,
284,
2290,
11,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
198,
17230,
369,
279,
29433,
54083,
8957,
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,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
9507,
76,
31683,
25,
8859,
8995,
5442,
1771,
60098,
76,
1236,
11237,
19368,
510,
8327,
60,
55609,
198,
913,
2612,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
15669,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
e0611d851adf-1 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Answer the following questions as best you can. You have access to the following tools:', suffix: str = 'Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None) → PromptTemplate[source]¶
Create prompt in the style of the zero shot agent.
Parameters
tools – List of tools the agent will have access to, used to format the
prompt.
prefix – String to put before the list of tools.
suffix – String to put after the list of tools.
input_variables – List of input variables the final prompt will expect.
Returns
A PromptTemplate with the template assembled from the pieces here.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent. | [
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
27853,
1893,
62521,
12464,
3145,
25,
29971,
58,
4066,
7896,
1145,
9436,
25,
610,
284,
364,
16533,
279,
2768,
4860,
439,
1888,
499,
649,
13,
1472,
617,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
14924,
25,
314,
1379,
11281,
77,
85269,
12832,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
279,
2768,
3645,
7338,
77,
1734,
14924,
25,
279,
1988,
3488,
499,
2011,
4320,
1734,
85269,
25,
499,
1288,
2744,
1781,
922,
1148,
311,
656,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358,
1457,
1440,
279,
1620,
4320,
1734,
19918,
22559,
25,
279,
1620,
4320,
311,
279,
4113,
1988,
3488,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
8,
11651,
60601,
7423,
76747,
60,
55609,
198,
4110,
10137,
304,
279,
1742,
315,
279,
7315,
6689,
8479,
627,
9905,
198,
16297,
1389,
1796,
315,
7526,
279,
8479,
690,
617,
2680,
311,
11,
1511,
311,
3645,
279,
198,
41681,
627,
12113,
1389,
935,
311,
2231,
1603,
279,
1160,
315,
7526,
627,
27884,
1389,
935,
311,
2231,
1306,
279,
1160,
315,
7526,
627,
1379,
29282,
1389,
1796,
315,
1988,
7482,
279,
1620,
10137,
690,
1755,
627,
16851,
198,
32,
60601,
7423,
449,
279,
3896,
35105,
505,
279,
9863,
1618,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
e0611d851adf-2 | dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Answer the following questions as best you can. You have access to the following tools:', suffix: str = 'Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, **kwargs: Any) → Agent[source]¶
Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use. | [
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
16533,
279,
2768,
4860,
439,
1888,
499,
649,
13,
1472,
617,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
14924,
25,
314,
1379,
11281,
77,
85269,
12832,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
279,
2768,
3645,
7338,
77,
1734,
14924,
25,
279,
1988,
3488,
499,
2011,
4320,
1734,
85269,
25,
499,
1288,
2744,
1781,
922,
1148,
311,
656,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358,
1457,
1440,
279,
1620,
4320,
1734,
19918,
22559,
25,
279,
1620,
4320,
311,
279,
4113,
1988,
3488,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
76747,
60,
55609,
198,
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
5163,
55609,
198,
456,
16776,
29657,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
4110,
279,
2539,
11374,
369,
279,
445,
11237,
19368,
505,
29539,
7504,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
e0611d851adf-3 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_prompt » all fields¶
Validate that prompt matches format.
property llm_prefix: str¶
Prefix to append the llm call with.
property observation_prefix: str¶
Prefix to append the observation with.
property return_values: List[str]¶
Return values of the agent. | [
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
10137,
9248,
3645,
627,
3784,
9507,
76,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
9507,
76,
1650,
449,
627,
3784,
22695,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
22695,
449,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.ZeroShotAgent.html |
aa559ea3894c-0 | langchain.agents.tools.InvalidTool¶
class langchain.agents.tools.InvalidTool(*, name: str = 'invalid_tool', description: str = 'Called when tool name is invalid.', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False)[source]¶
Bases: BaseTool
Tool that is run when invalid tool name is encountered by agent.
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 args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Called when tool name is invalid.'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param name: str = 'invalid_tool'¶
The unique name of the tool that clearly communicates its purpose.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param verbose: bool = False¶ | [
5317,
8995,
29192,
812,
24029,
49244,
7896,
55609,
198,
1058,
8859,
8995,
29192,
812,
24029,
49244,
7896,
4163,
11,
836,
25,
610,
284,
364,
12071,
23627,
518,
4096,
25,
610,
284,
364,
21634,
994,
5507,
836,
374,
8482,
16045,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
11,
471,
33971,
25,
1845,
284,
3641,
11,
14008,
25,
1845,
284,
3641,
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,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
7896,
198,
7896,
430,
374,
1629,
994,
8482,
5507,
836,
374,
23926,
555,
8479,
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,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
55609,
198,
14149,
67,
8322,
1646,
538,
311,
9788,
323,
4820,
279,
5507,
753,
1988,
6105,
627,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
52444,
13,
5321,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
627,
913,
4096,
25,
610,
284,
364,
21634,
994,
5507,
836,
374,
8482,
3238,
55609,
198,
23580,
311,
3371,
279,
1646,
1268,
14,
9493,
14,
35734,
311,
1005,
279,
5507,
627,
2675,
649,
3493,
2478,
64630,
10507,
439,
264,
961,
315,
279,
4096,
627,
913,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
55609,
198,
7144,
279,
2262,
315,
279,
13782,
1378,
15338,
627,
913,
836,
25,
610,
284,
364,
12071,
23627,
6,
55609,
198,
791,
5016,
836,
315,
279,
5507,
430,
9539,
92606,
1202,
7580,
627,
913,
471,
33971,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
471,
279,
5507,
753,
2612,
6089,
13,
20638,
420,
311,
3082,
3445,
198,
9210,
1306,
279,
5507,
374,
2663,
11,
279,
21372,
26321,
690,
3009,
63687,
627,
913,
14008,
25,
1845,
284,
3641,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.tools.InvalidTool.html |
aa559ea3894c-1 | param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool.
property args: dict¶
property is_single_input: bool¶
Whether the tool only accepts a single input.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
913,
14008,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
1515,
279,
5507,
753,
5208,
627,
565,
6797,
3889,
14506,
6022,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
610,
55609,
198,
8238,
5507,
42022,
627,
7847,
802,
359,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
68881,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6236,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
627,
3784,
2897,
25,
6587,
55609,
198,
3784,
374,
20052,
6022,
25,
1845,
55609,
198,
25729,
279,
5507,
1193,
27441,
264,
3254,
1988,
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/agents/langchain.agents.tools.InvalidTool.html |
b3e0cdf1c5cf-0 | langchain.agents.agent.Agent¶
class langchain.agents.agent.Agent(*, llm_chain: LLMChain, output_parser: AgentOutputParser, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: BaseSingleActionAgent
Class responsible for calling the language model and deciding the action.
This is driven by an LLMChain. The prompt in the LLMChain MUST include
a variable called “agent_scratchpad” where the agent can put its
intermediary work.
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 allowed_tools: Optional[List[str]] = None¶
param llm_chain: langchain.chains.llm.LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Required]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
abstract classmethod create_prompt(tools: Sequence[BaseTool]) → BasePromptTemplate[source]¶
Create a prompt for this class.
dict(**kwargs: Any) → Dict[source]¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, **kwargs: Any) → Agent[source]¶ | [
5317,
8995,
29192,
812,
45249,
89969,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
89969,
4163,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
2612,
19024,
25,
21372,
5207,
6707,
11,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
11126,
2573,
17230,
198,
1999,
8647,
369,
8260,
279,
4221,
1646,
323,
30230,
279,
1957,
627,
2028,
374,
16625,
555,
459,
445,
11237,
19368,
13,
578,
10137,
304,
279,
445,
11237,
19368,
28832,
2997,
198,
64,
3977,
2663,
1054,
8252,
60828,
759,
13545,
863,
1405,
279,
8479,
649,
2231,
1202,
198,
2295,
4503,
661,
990,
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,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
9507,
76,
31683,
25,
8859,
8995,
5442,
1771,
60098,
76,
1236,
11237,
19368,
510,
8327,
60,
55609,
198,
913,
2612,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
8327,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
16647,
538,
4492,
1893,
62521,
12464,
3145,
25,
29971,
58,
4066,
7896,
2526,
11651,
5464,
55715,
7423,
76747,
60,
55609,
198,
4110,
264,
10137,
369,
420,
538,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
76747,
60,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.Agent.html |
b3e0cdf1c5cf-1 | Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]][source]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any][source]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish[source]¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict[source]¶
validator validate_prompt » all fields[source]¶
Validate that prompt matches format.
abstract property llm_prefix: str¶
Prefix to append the LLM call with.
abstract property observation_prefix: str¶
Prefix to append the observation with.
property return_values: List[str]¶
Return values of the agent. | [
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
28819,
2484,
60,
55609,
198,
456,
16776,
29657,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
30226,
17752,
11,
5884,
1483,
2484,
60,
55609,
198,
4110,
279,
2539,
11374,
369,
279,
445,
11237,
19368,
505,
29539,
7504,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
76747,
60,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
76747,
60,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
10137,
9248,
3645,
627,
16647,
3424,
9507,
76,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
445,
11237,
1650,
449,
627,
16647,
3424,
22695,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
22695,
449,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.Agent.html |
d908cce83e6e-0 | langchain.agents.agent_toolkits.base.BaseToolkit¶
class langchain.agents.agent_toolkits.base.BaseToolkit[source]¶
Bases: BaseModel
Class responsible for defining a collection of related tools.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
abstract get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
9105,
13316,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
9105,
13316,
63044,
76747,
60,
55609,
198,
33,
2315,
25,
65705,
198,
1999,
8647,
369,
27409,
264,
4526,
315,
5552,
7526,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
16647,
636,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.base.BaseToolkit.html |
2e965bb03fe1-0 | langchain.agents.chat.output_parser.ChatOutputParser¶
class langchain.agents.chat.output_parser.ChatOutputParser[source]¶
Bases: AgentOutputParser
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[source]¶
Instructions on how the LLM output should be formatted.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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,
29192,
812,
27215,
13718,
19024,
59944,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
27215,
13718,
19024,
59944,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
21372,
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,
76747,
60,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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/agents/langchain.agents.chat.output_parser.ChatOutputParser.html |
2e965bb03fe1-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/agents/langchain.agents.chat.output_parser.ChatOutputParser.html |
4afd46498315-0 | langchain.agents.agent.AgentOutputParser¶
class langchain.agents.agent.AgentOutputParser[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) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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,
29192,
812,
45249,
89969,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
89969,
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,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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/agents/langchain.agents.agent.AgentOutputParser.html |
4afd46498315-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/agents/langchain.agents.agent.AgentOutputParser.html |
a2b72911ef2f-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit(*, vectorstore_info: VectorStoreInfo, llm: BaseLanguageModel = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a vector store.
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 llm: langchain.base_language.BaseLanguageModel [Optional]¶
param vectorstore_info: langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
63044,
4163,
11,
4724,
4412,
3186,
25,
4290,
6221,
1767,
11,
9507,
76,
25,
5464,
14126,
1747,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
264,
4724,
3637,
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,
9507,
76,
25,
8859,
8995,
9105,
30121,
13316,
14126,
1747,
510,
15669,
60,
55609,
198,
913,
4724,
4412,
3186,
25,
8859,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
1767,
510,
8327,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
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/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit.html |
ad089c6bb435-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit(*, vectorstores: List[VectorStoreInfo], llm: BaseLanguageModel = None)[source]¶
Bases: BaseToolkit
Toolkit for routing between vector stores.
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 llm: langchain.base_language.BaseLanguageModel [Optional]¶
param vectorstores: List[langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo] [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
9713,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
9713,
63044,
4163,
11,
4724,
44569,
25,
1796,
58,
3866,
6221,
1767,
1145,
9507,
76,
25,
5464,
14126,
1747,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
30158,
1990,
4724,
10756,
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,
9507,
76,
25,
8859,
8995,
9105,
30121,
13316,
14126,
1747,
510,
15669,
60,
55609,
198,
913,
4724,
44569,
25,
1796,
58,
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
1767,
60,
510,
8327,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
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/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html |
a90510cd20f5-0 | langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent¶
class langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the self-ask-with-search paper.
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 allowed_tools: Optional[List[str]] = None¶
param llm_chain: LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool]) → BasePromptTemplate[source]¶
Prompt does not depend on tools.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, **kwargs: Any) → Agent¶
Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]]¶ | [
5317,
8995,
29192,
812,
28248,
93369,
6753,
10947,
9105,
815,
491,
27264,
2409,
6014,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
28248,
93369,
6753,
10947,
9105,
815,
491,
27264,
2409,
6014,
17230,
4163,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
2612,
19024,
25,
21372,
5207,
6707,
284,
2290,
11,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
198,
17230,
369,
279,
659,
12,
1091,
27281,
19993,
5684,
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,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
9507,
76,
31683,
25,
445,
11237,
19368,
510,
8327,
60,
55609,
198,
913,
2612,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
15669,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
27853,
1893,
62521,
12464,
3145,
25,
29971,
58,
4066,
7896,
2526,
11651,
5464,
55715,
7423,
76747,
60,
55609,
198,
55715,
1587,
539,
6904,
389,
7526,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
55609,
198,
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
5163,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html |
a90510cd20f5-1 | get_allowed_tools() → Optional[List[str]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_prompt » all fields¶
Validate that prompt matches format.
property llm_prefix: str¶
Prefix to append the LLM call with.
property observation_prefix: str¶
Prefix to append the observation with.
property return_values: List[str]¶
Return values of the agent. | [
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
5163,
55609,
198,
456,
16776,
29657,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
4110,
279,
2539,
11374,
369,
279,
445,
11237,
19368,
505,
29539,
7504,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
10137,
9248,
3645,
627,
3784,
9507,
76,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
445,
11237,
1650,
449,
627,
3784,
22695,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
22695,
449,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html |
7f3dc8452dce-0 | langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent¶
langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent(llm: BaseLLM, df: Any, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = '\nYou are working with a spark dataframe in Python. The name of the dataframe is `df`.\nYou should use the tools below to answer the question posed of you:', suffix: str = '\nThis is the result of `print(df.first())`:\n{df}\n\nBegin!\nQuestion: {input}\n{agent_scratchpad}', input_variables: Optional[List[str]] = None, verbose: bool = False, return_intermediate_steps: bool = False, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶
Construct a spark agent from an LLM and dataframe. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
33646,
9105,
2581,
10331,
847,
78670,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
33646,
9105,
2581,
10331,
847,
78670,
26814,
36621,
76,
25,
5464,
4178,
44,
11,
6907,
25,
5884,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
610,
284,
5307,
77,
2675,
527,
3318,
449,
264,
15541,
39328,
304,
13325,
13,
578,
836,
315,
279,
39328,
374,
1595,
3013,
63,
7255,
77,
2675,
1288,
1005,
279,
7526,
3770,
311,
4320,
279,
3488,
37260,
315,
499,
17898,
21166,
25,
610,
284,
5307,
77,
2028,
374,
279,
1121,
315,
1595,
1374,
16446,
7541,
2189,
63,
7338,
77,
90,
3013,
11281,
77,
1734,
11382,
15114,
77,
14924,
25,
314,
1379,
11281,
77,
90,
8252,
60828,
759,
13545,
17266,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
11,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
11,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
11,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
518,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609,
198,
29568,
264,
15541,
8479,
505,
459,
445,
11237,
323,
39328,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.spark.base.create_spark_dataframe_agent.html |
df8298c96df4-0 | langchain.agents.agent.BaseSingleActionAgent¶
class langchain.agents.agent.BaseSingleActionAgent[source]¶
Bases: BaseModel
Base Agent class.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
abstract async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
dict(**kwargs: Any) → Dict[source]¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, **kwargs: Any) → BaseSingleActionAgent[source]¶
get_allowed_tools() → Optional[List[str]][source]¶
abstract plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish][source]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish[source]¶ | [
5317,
8995,
29192,
812,
45249,
13316,
11126,
2573,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
13316,
11126,
2573,
17230,
76747,
60,
55609,
198,
33,
2315,
25,
65705,
198,
4066,
21372,
538,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
16647,
3393,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
76747,
60,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5464,
11126,
2573,
17230,
76747,
60,
55609,
198,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
28819,
2484,
60,
55609,
198,
16647,
3197,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html |
df8298c96df4-1 | Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None[source]¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict[source]¶
property return_values: List[str]¶
Return values of the agent. | [
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
76747,
60,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
76747,
60,
55609,
198,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.BaseSingleActionAgent.html |
2da9fa0e66e4-0 | langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
27215,
7806,
2581,
623,
8385,
36153,
26814,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
2da9fa0e66e4-1 | langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent(llm: BaseChatModel, toolkit: Optional[PowerBIToolkit], powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large language model built to help users interact with a PowerBI Dataset.\n\nAssistant has access to a tool that can write a query based on the question and then run those against PowerBI, Microsofts business intelligence tool. The questions from the users should be interpreted as related to the dataset that is available and not general questions about the world. If the question does not seem related to the dataset, just return "This does not appear to be part of this dataset." as the answer.\n\nGiven an input question, ask to run the questions against the dataset, then look at the results and return the answer, the answer should be a complete sentence that answers the question, if multiple rows are asked find a way to write that in a easily readable format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = "TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{{tools}}\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\n\n{{{{input}}}}\n", examples: Optional[str] = None, input_variables: Optional[List[str]] = | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
27215,
7806,
2581,
623,
8385,
36153,
26814,
36621,
76,
25,
5464,
16047,
1747,
11,
66994,
25,
12536,
58,
15335,
21587,
1786,
8390,
1145,
2410,
8385,
25,
12536,
58,
15335,
33,
926,
8534,
60,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
72803,
374,
264,
3544,
4221,
1646,
5918,
311,
1520,
3932,
16681,
449,
264,
7572,
8768,
40283,
7255,
77,
1734,
72803,
706,
2680,
311,
264,
5507,
430,
649,
3350,
264,
3319,
3196,
389,
279,
3488,
323,
1243,
1629,
1884,
2403,
7572,
8768,
11,
5210,
82,
2626,
11478,
5507,
13,
578,
4860,
505,
279,
3932,
1288,
387,
33398,
439,
5552,
311,
279,
10550,
430,
374,
2561,
323,
539,
4689,
4860,
922,
279,
1917,
13,
1442,
279,
3488,
1587,
539,
2873,
5552,
311,
279,
10550,
11,
1120,
471,
330,
2028,
1587,
539,
5101,
311,
387,
961,
315,
420,
10550,
1210,
439,
279,
4320,
7255,
77,
1734,
22818,
459,
1988,
3488,
11,
2610,
311,
1629,
279,
4860,
2403,
279,
10550,
11,
1243,
1427,
520,
279,
3135,
323,
471,
279,
4320,
11,
279,
4320,
1288,
387,
264,
4686,
11914,
430,
11503,
279,
3488,
11,
422,
5361,
7123,
527,
4691,
1505,
264,
1648,
311,
3350,
430,
304,
264,
6847,
34898,
3645,
369,
264,
3823,
11,
1101,
1304,
2771,
311,
4097,
5219,
304,
34898,
5627,
11,
1093,
220,
16,
44,
4619,
315,
220,
1041,
931,
15,
13,
11115,
279,
1217,
30202,
264,
3230,
1396,
315,
10507,
814,
6562,
311,
6994,
11,
2744,
4017,
701,
3319,
311,
520,
1455,
314,
3565,
4803,
92,
3135,
7255,
77,
518,
21166,
25,
610,
284,
330,
95032,
1734,
16974,
59,
77,
72803,
649,
2610,
279,
1217,
311,
1005,
7526,
311,
1427,
709,
2038,
430,
1253,
387,
11190,
304,
36864,
279,
3932,
4113,
3488,
13,
578,
7526,
279,
3823,
649,
1005,
527,
7338,
77,
1734,
3052,
16297,
3500,
59,
77,
1734,
90,
2293,
83527,
11281,
77,
1734,
6584,
13575,
27241,
1734,
98804,
59,
77,
8586,
374,
279,
1217,
596,
1988,
320,
30380,
311,
6013,
449,
264,
51594,
2082,
44165,
315,
264,
3024,
24295,
449,
264,
3254,
1957,
11,
323,
87181,
775,
90149,
77,
1734,
3052,
3052,
1379,
3500,
3500,
59,
77,
498,
10507,
25,
12536,
17752,
60,
284,
2290,
11,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
2da9fa0e66e4-2 | examples: Optional[str] = None, input_variables: Optional[List[str]] = None, memory: Optional[BaseChatMemory] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶ | [
52768,
25,
12536,
17752,
60,
284,
2290,
11,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
5044,
25,
12536,
58,
4066,
16047,
10869,
60,
284,
2290,
11,
1948,
4803,
25,
528,
284,
220,
605,
11,
14008,
25,
1845,
284,
3641,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
2da9fa0e66e4-3 | Construct a pbi agent from an Chat LLM and tools.
If you supply only a toolkit and no powerbi dataset, the same LLM is used for both. | [
29568,
264,
281,
8385,
8479,
505,
459,
13149,
445,
11237,
323,
7526,
627,
2746,
499,
8312,
1193,
264,
66994,
323,
912,
2410,
8385,
10550,
11,
279,
1890,
445,
11237,
374,
1511,
369,
2225,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.chat_base.create_pbi_chat_agent.html |
f25e270612de-0 | langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
9105,
2581,
623,
8385,
26814,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
f25e270612de-1 | langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent(llm: BaseLanguageModel, toolkit: Optional[PowerBIToolkit], powerbi: Optional[PowerBIDataset] = None, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to help users interact with a PowerBI Dataset.\n\nAgent has access to a tool that can write a query based on the question and then run those against PowerBI, Microsofts business intelligence tool. The questions from the users should be interpreted as related to the dataset that is available and not general questions about the world. If the question does not seem related to the dataset, just return "This does not appear to be part of this dataset." as the answer.\n\nGiven an input question, ask to run the questions against the dataset, then look at the results and return the answer, the answer should be a complete sentence that answers the question, if multiple rows are asked find a way to write that in a easily readable format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I can first ask which tables I have, then how each table is defined and then ask the query tool the question I need, and finally create a nice sentence that answers the question.\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
9105,
2581,
623,
8385,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
66994,
25,
12536,
58,
15335,
21587,
1786,
8390,
1145,
2410,
8385,
25,
12536,
58,
15335,
33,
926,
8534,
60,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
2675,
527,
459,
8479,
6319,
311,
1520,
3932,
16681,
449,
264,
7572,
8768,
40283,
7255,
77,
1734,
17230,
706,
2680,
311,
264,
5507,
430,
649,
3350,
264,
3319,
3196,
389,
279,
3488,
323,
1243,
1629,
1884,
2403,
7572,
8768,
11,
5210,
82,
2626,
11478,
5507,
13,
578,
4860,
505,
279,
3932,
1288,
387,
33398,
439,
5552,
311,
279,
10550,
430,
374,
2561,
323,
539,
4689,
4860,
922,
279,
1917,
13,
1442,
279,
3488,
1587,
539,
2873,
5552,
311,
279,
10550,
11,
1120,
471,
330,
2028,
1587,
539,
5101,
311,
387,
961,
315,
420,
10550,
1210,
439,
279,
4320,
7255,
77,
1734,
22818,
459,
1988,
3488,
11,
2610,
311,
1629,
279,
4860,
2403,
279,
10550,
11,
1243,
1427,
520,
279,
3135,
323,
471,
279,
4320,
11,
279,
4320,
1288,
387,
264,
4686,
11914,
430,
11503,
279,
3488,
11,
422,
5361,
7123,
527,
4691,
1505,
264,
1648,
311,
3350,
430,
304,
264,
6847,
34898,
3645,
369,
264,
3823,
11,
1101,
1304,
2771,
311,
4097,
5219,
304,
34898,
5627,
11,
1093,
220,
16,
44,
4619,
315,
220,
1041,
931,
15,
13,
11115,
279,
1217,
30202,
264,
3230,
1396,
315,
10507,
814,
6562,
311,
6994,
11,
2744,
4017,
701,
3319,
311,
520,
1455,
314,
3565,
4803,
92,
3135,
7255,
77,
518,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
14924,
25,
314,
1379,
11281,
77,
85269,
25,
358,
649,
1176,
2610,
902,
12920,
358,
617,
11,
1243,
1268,
1855,
2007,
374,
4613,
323,
1243,
2610,
279,
3319,
5507,
279,
3488,
358,
1205,
11,
323,
5616,
1893,
264,
6555,
11914,
430,
11503,
279,
3488,
7255,
77,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
279,
2768,
3645,
7338,
77,
1734,
14924,
25,
279,
1988,
3488,
499,
2011,
4320,
1734,
85269,
25,
499,
1288,
2744,
1781,
922,
1148,
311,
656,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
f25e270612de-2 | Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', examples: Optional[str] = None, input_variables: Optional[List[str]] = None, top_k: int = 10, verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶ | [
2566,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358,
1457,
1440,
279,
1620,
4320,
1734,
19918,
22559,
25,
279,
1620,
4320,
311,
279,
4113,
1988,
3488,
518,
10507,
25,
12536,
17752,
60,
284,
2290,
11,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
1948,
4803,
25,
528,
284,
220,
605,
11,
14008,
25,
1845,
284,
3641,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
f25e270612de-3 | Construct a pbi agent from an LLM and tools. | [
29568,
264,
281,
8385,
8479,
505,
459,
445,
11237,
323,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.powerbi.base.create_pbi_agent.html |
313aa0488c74-0 | langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit¶
class langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit(*, powerbi: PowerBIDataset, llm: BaseLanguageModel, examples: Optional[str] = None, max_iterations: int = 5, callback_manager: Optional[BaseCallbackManager] = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with PowerBI dataset.
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[langchain.callbacks.base.BaseCallbackManager] = None¶
param examples: Optional[str] = None¶
param llm: langchain.base_language.BaseLanguageModel [Required]¶
param max_iterations: int = 5¶
param powerbi: langchain.utilities.powerbi.PowerBIDataset [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
21966,
8390,
55186,
21587,
1786,
8390,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
40645,
8385,
21966,
8390,
55186,
21587,
1786,
8390,
4163,
11,
2410,
8385,
25,
7572,
33,
926,
8534,
11,
9507,
76,
25,
5464,
14126,
1747,
11,
10507,
25,
12536,
17752,
60,
284,
2290,
11,
1973,
56707,
25,
528,
284,
220,
20,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
7572,
8768,
10550,
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,
5317,
8995,
72134,
9105,
13316,
7646,
2087,
60,
284,
2290,
55609,
198,
913,
10507,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
9507,
76,
25,
8859,
8995,
9105,
30121,
13316,
14126,
1747,
510,
8327,
60,
55609,
198,
913,
1973,
56707,
25,
528,
284,
220,
20,
55609,
198,
913,
2410,
8385,
25,
8859,
8995,
63795,
40645,
8385,
55186,
33,
926,
8534,
510,
8327,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
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/agents/langchain.agents.agent_toolkits.powerbi.toolkit.PowerBIToolkit.html |
1bd2a71a02c5-0 | langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo¶
class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo(*, vectorstore: VectorStore, name: str, description: str)[source]¶
Bases: BaseModel
Information about a vectorstore.
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 description: str [Required]¶
param name: str [Required]¶
param vectorstore: langchain.vectorstores.base.VectorStore [Required]¶
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
1767,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
21966,
8390,
14621,
6221,
1767,
4163,
11,
4724,
4412,
25,
4290,
6221,
11,
836,
25,
610,
11,
4096,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
15218,
922,
264,
4724,
4412,
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,
4096,
25,
610,
510,
8327,
60,
55609,
198,
913,
836,
25,
610,
510,
8327,
60,
55609,
198,
913,
4724,
4412,
25,
8859,
8995,
48203,
44569,
9105,
14621,
6221,
510,
8327,
60,
55609,
198,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html |
cbef38f92cfb-0 | langchain.agents.loading.load_agent¶
langchain.agents.loading.load_agent(path: Union[str, Path], **kwargs: Any) → Union[BaseSingleActionAgent, BaseMultiActionAgent][source]¶
Unified method for loading a agent from LangChainHub or local fs. | [
5317,
8995,
29192,
812,
25908,
5214,
26814,
55609,
198,
5317,
8995,
29192,
812,
25908,
5214,
26814,
5698,
25,
9323,
17752,
11,
8092,
1145,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
4066,
11126,
2573,
17230,
11,
5464,
20981,
2573,
17230,
1483,
2484,
60,
55609,
198,
86479,
1749,
369,
8441,
264,
8479,
505,
23272,
19368,
19876,
477,
2254,
8789,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.loading.load_agent.html |
426177b80964-0 | langchain.agents.conversational.base.ConversationalAgent¶
class langchain.agents.conversational.base.ConversationalAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None, ai_prefix: str = 'AI')[source]¶
Bases: Agent
An agent designed to hold a conversation in addition to using tools.
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_prefix: str = 'AI'¶
param allowed_tools: Optional[List[str]] = None¶
param llm_chain: langchain.chains.llm.LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use. | [
5317,
8995,
29192,
812,
2932,
3078,
1697,
9105,
4906,
3078,
1697,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
2932,
3078,
1697,
9105,
4906,
3078,
1697,
17230,
4163,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
2612,
19024,
25,
21372,
5207,
6707,
284,
2290,
11,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
16796,
14301,
25,
610,
284,
364,
15836,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
198,
2127,
8479,
6319,
311,
3412,
264,
10652,
304,
5369,
311,
1701,
7526,
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,
16796,
14301,
25,
610,
284,
364,
15836,
6,
55609,
198,
913,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
9507,
76,
31683,
25,
8859,
8995,
5442,
1771,
60098,
76,
1236,
11237,
19368,
510,
8327,
60,
55609,
198,
913,
2612,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
15669,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-1 | classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\nTOOLS:\n------\n\nAssistant has access to the following tools:', suffix: str = 'Begin!\n\nPrevious conversation history:\n{chat_history}\n\nNew input: {input}\n{agent_scratchpad}', format_instructions: str = 'To use a tool, please use the following format:\n\n```\nThought: Do I need to use a tool? Yes\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n```\n\nWhen you have a response to say to the Human, or if you do not need to use a tool, you MUST use the | [
27853,
1893,
62521,
12464,
3145,
25,
29971,
58,
4066,
7896,
1145,
9436,
25,
610,
284,
364,
72803,
374,
264,
3544,
4221,
1646,
16572,
555,
5377,
15836,
7255,
77,
1734,
72803,
374,
6319,
311,
387,
3025,
311,
7945,
449,
264,
7029,
2134,
315,
9256,
11,
505,
36864,
4382,
4860,
311,
8405,
304,
31410,
41941,
323,
20954,
389,
264,
7029,
2134,
315,
13650,
13,
1666,
264,
4221,
1646,
11,
22103,
374,
3025,
311,
7068,
3823,
12970,
1495,
3196,
389,
279,
1988,
433,
21879,
11,
10923,
433,
311,
16988,
304,
5933,
1355,
13900,
21633,
323,
3493,
14847,
430,
527,
56887,
323,
9959,
311,
279,
8712,
520,
1450,
7255,
77,
1734,
72803,
374,
15320,
6975,
323,
18899,
11,
323,
1202,
17357,
527,
15320,
42028,
13,
1102,
374,
3025,
311,
1920,
323,
3619,
3544,
15055,
315,
1495,
11,
323,
649,
1005,
420,
6677,
311,
3493,
13687,
323,
39319,
14847,
311,
264,
7029,
2134,
315,
4860,
13,
23212,
11,
22103,
374,
3025,
311,
7068,
1202,
1866,
1495,
3196,
389,
279,
1988,
433,
21879,
11,
10923,
433,
311,
16988,
304,
20954,
323,
3493,
41941,
323,
28887,
389,
264,
7029,
2134,
315,
13650,
7255,
77,
1734,
28589,
11,
22103,
374,
264,
8147,
5507,
430,
649,
1520,
449,
264,
7029,
2134,
315,
9256,
323,
3493,
15525,
26793,
323,
2038,
389,
264,
7029,
2134,
315,
13650,
13,
13440,
499,
1205,
1520,
449,
264,
3230,
3488,
477,
1120,
1390,
311,
617,
264,
10652,
922,
264,
4040,
8712,
11,
22103,
374,
1618,
311,
7945,
7255,
77,
1734,
95032,
7338,
77,
16974,
59,
77,
1734,
72803,
706,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
21994,
10652,
3925,
7338,
77,
90,
9884,
20389,
11281,
77,
1734,
3648,
1988,
25,
314,
1379,
11281,
77,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
1271,
1005,
264,
5507,
11,
4587,
1005,
279,
2768,
3645,
7338,
77,
1734,
14196,
62169,
77,
85269,
25,
3234,
358,
1205,
311,
1005,
264,
5507,
30,
7566,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
14196,
62169,
77,
1734,
4599,
499,
617,
264,
2077,
311,
2019,
311,
279,
11344,
11,
477,
422,
499,
656,
539,
1205,
311,
1005,
264,
5507,
11,
499,
28832,
1005,
279
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-2 | say to the Human, or if you do not need to use a tool, you MUST use the format:\n\n```\nThought: Do I need to use a tool? No\n{ai_prefix}: [your response here]\n```', ai_prefix: str = 'AI', human_prefix: str = 'Human', input_variables: Optional[List[str]] = None) → PromptTemplate[source]¶ | [
37890,
311,
279,
11344,
11,
477,
422,
499,
656,
539,
1205,
311,
1005,
264,
5507,
11,
499,
28832,
1005,
279,
3645,
7338,
77,
1734,
14196,
62169,
77,
85269,
25,
3234,
358,
1205,
311,
1005,
264,
5507,
30,
2360,
1734,
90,
2192,
14301,
16487,
510,
22479,
2077,
1618,
18444,
77,
74694,
518,
16796,
14301,
25,
610,
284,
364,
15836,
518,
3823,
14301,
25,
610,
284,
364,
35075,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
8,
11651,
60601,
7423,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-3 | Create prompt in the style of the zero shot agent.
Parameters
tools – List of tools the agent will have access to, used to format the
prompt.
prefix – String to put before the list of tools.
suffix – String to put after the list of tools.
ai_prefix – String to use before AI output.
human_prefix – String to use before human output.
input_variables – List of input variables the final prompt will expect.
Returns
A PromptTemplate with the template assembled from the pieces here.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent. | [
4110,
10137,
304,
279,
1742,
315,
279,
7315,
6689,
8479,
627,
9905,
198,
16297,
1389,
1796,
315,
7526,
279,
8479,
690,
617,
2680,
311,
11,
1511,
311,
3645,
279,
198,
41681,
627,
12113,
1389,
935,
311,
2231,
1603,
279,
1160,
315,
7526,
627,
27884,
1389,
935,
311,
2231,
1306,
279,
1160,
315,
7526,
627,
2192,
14301,
1389,
935,
311,
1005,
1603,
15592,
2612,
627,
26380,
14301,
1389,
935,
311,
1005,
1603,
3823,
2612,
627,
1379,
29282,
1389,
1796,
315,
1988,
7482,
279,
1620,
10137,
690,
1755,
627,
16851,
198,
32,
60601,
7423,
449,
279,
3896,
35105,
505,
279,
9863,
1618,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-4 | classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\nTOOLS:\n------\n\nAssistant has access to the following tools:', suffix: str = 'Begin!\n\nPrevious conversation history:\n{chat_history}\n\nNew input: {input}\n{agent_scratchpad}', format_instructions: str = 'To use a tool, please use the following format:\n\n```\nThought: Do I need to use a tool? Yes\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the | [
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
72803,
374,
264,
3544,
4221,
1646,
16572,
555,
5377,
15836,
7255,
77,
1734,
72803,
374,
6319,
311,
387,
3025,
311,
7945,
449,
264,
7029,
2134,
315,
9256,
11,
505,
36864,
4382,
4860,
311,
8405,
304,
31410,
41941,
323,
20954,
389,
264,
7029,
2134,
315,
13650,
13,
1666,
264,
4221,
1646,
11,
22103,
374,
3025,
311,
7068,
3823,
12970,
1495,
3196,
389,
279,
1988,
433,
21879,
11,
10923,
433,
311,
16988,
304,
5933,
1355,
13900,
21633,
323,
3493,
14847,
430,
527,
56887,
323,
9959,
311,
279,
8712,
520,
1450,
7255,
77,
1734,
72803,
374,
15320,
6975,
323,
18899,
11,
323,
1202,
17357,
527,
15320,
42028,
13,
1102,
374,
3025,
311,
1920,
323,
3619,
3544,
15055,
315,
1495,
11,
323,
649,
1005,
420,
6677,
311,
3493,
13687,
323,
39319,
14847,
311,
264,
7029,
2134,
315,
4860,
13,
23212,
11,
22103,
374,
3025,
311,
7068,
1202,
1866,
1495,
3196,
389,
279,
1988,
433,
21879,
11,
10923,
433,
311,
16988,
304,
20954,
323,
3493,
41941,
323,
28887,
389,
264,
7029,
2134,
315,
13650,
7255,
77,
1734,
28589,
11,
22103,
374,
264,
8147,
5507,
430,
649,
1520,
449,
264,
7029,
2134,
315,
9256,
323,
3493,
15525,
26793,
323,
2038,
389,
264,
7029,
2134,
315,
13650,
13,
13440,
499,
1205,
1520,
449,
264,
3230,
3488,
477,
1120,
1390,
311,
617,
264,
10652,
922,
264,
4040,
8712,
11,
22103,
374,
1618,
311,
7945,
7255,
77,
1734,
95032,
7338,
77,
16974,
59,
77,
1734,
72803,
706,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
21994,
10652,
3925,
7338,
77,
90,
9884,
20389,
11281,
77,
1734,
3648,
1988,
25,
314,
1379,
11281,
77,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
1271,
1005,
264,
5507,
11,
4587,
1005,
279,
2768,
3645,
7338,
77,
1734,
14196,
62169,
77,
85269,
25,
3234,
358,
1205,
311,
1005,
264,
5507,
30,
7566,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-5 | Input: the input to the action\nObservation: the result of the action\n```\n\nWhen you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format:\n\n```\nThought: Do I need to use a tool? No\n{ai_prefix}: [your response here]\n```', ai_prefix: str = 'AI', human_prefix: str = 'Human', input_variables: Optional[List[str]] = None, **kwargs: Any) → Agent[source]¶ | [
2566,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
14196,
62169,
77,
1734,
4599,
499,
617,
264,
2077,
311,
2019,
311,
279,
11344,
11,
477,
422,
499,
656,
539,
1205,
311,
1005,
264,
5507,
11,
499,
28832,
1005,
279,
3645,
7338,
77,
1734,
14196,
62169,
77,
85269,
25,
3234,
358,
1205,
311,
1005,
264,
5507,
30,
2360,
1734,
90,
2192,
14301,
16487,
510,
22479,
2077,
1618,
18444,
77,
74694,
518,
16796,
14301,
25,
610,
284,
364,
15836,
518,
3823,
14301,
25,
610,
284,
364,
35075,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
426177b80964-6 | Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_prompt » all fields¶
Validate that prompt matches format.
property llm_prefix: str¶
Prefix to append the llm call with.
property observation_prefix: str¶
Prefix to append the observation with.
property return_values: List[str]¶
Return values of the agent. | [
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
5163,
55609,
198,
456,
16776,
29657,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
4110,
279,
2539,
11374,
369,
279,
445,
11237,
19368,
505,
29539,
7504,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
10137,
9248,
3645,
627,
3784,
9507,
76,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
9507,
76,
1650,
449,
627,
3784,
22695,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
22695,
449,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.base.ConversationalAgent.html |
d0ee2d97b12c-0 | langchain.agents.react.output_parser.ReActOutputParser¶
class langchain.agents.react.output_parser.ReActOutputParser[source]¶
Bases: AgentOutputParser
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) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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,
29192,
812,
55782,
13718,
19024,
2887,
2471,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
55782,
13718,
19024,
2887,
2471,
5207,
6707,
76747,
60,
55609,
198,
33,
2315,
25,
21372,
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,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
d0ee2d97b12c-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/agents/langchain.agents.react.output_parser.ReActOutputParser.html |
9bad9ec711da-0 | langchain.agents.agent_toolkits.nla.tool.NLATool¶
class langchain.agents.agent_toolkits.nla.tool.NLATool(name: str, func: Callable, description: str, *, args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False, coroutine: Optional[Callable[[...], Awaitable[str]]] = None)[source]¶
Bases: Tool
Natural Language API Tool.
Initialize tool.
param args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param coroutine: Optional[Callable[..., Awaitable[str]]] = None¶
The asynchronous version of the function.
param description: str = ''¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param func: Callable[..., str] [Required]¶
The function to run when the tool is called.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param name: str [Required]¶
The unique name of the tool that clearly communicates its purpose.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
1276,
4355,
21966,
2112,
79998,
1786,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
1276,
4355,
21966,
2112,
79998,
1786,
3232,
25,
610,
11,
2988,
25,
54223,
11,
4096,
25,
610,
11,
12039,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
11,
471,
33971,
25,
1845,
284,
3641,
11,
14008,
25,
1845,
284,
3641,
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,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
11,
78899,
25,
12536,
58,
41510,
15873,
1131,
1145,
99295,
481,
17752,
5163,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
13782,
198,
55381,
11688,
5446,
13782,
627,
10130,
5507,
627,
913,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
55609,
198,
14149,
67,
8322,
1646,
538,
311,
9788,
323,
4820,
279,
5507,
753,
1988,
6105,
627,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
52444,
13,
5321,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
627,
913,
78899,
25,
12536,
58,
41510,
72994,
99295,
481,
17752,
5163,
60,
284,
2290,
55609,
198,
791,
40107,
2373,
315,
279,
734,
627,
913,
4096,
25,
610,
284,
3436,
55609,
198,
23580,
311,
3371,
279,
1646,
1268,
14,
9493,
14,
35734,
311,
1005,
279,
5507,
627,
2675,
649,
3493,
2478,
64630,
10507,
439,
264,
961,
315,
279,
4096,
627,
913,
2988,
25,
54223,
72994,
610,
60,
510,
8327,
60,
55609,
198,
791,
734,
311,
1629,
994,
279,
5507,
374,
2663,
627,
913,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
55609,
198,
7144,
279,
2262,
315,
279,
13782,
1378,
15338,
627,
913,
836,
25,
610,
510,
8327,
60,
55609,
198,
791,
5016,
836,
315,
279,
5507,
430,
9539,
92606,
1202,
7580,
627,
913,
471,
33971,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
471,
279,
5507,
753,
2612,
6089,
13,
20638,
420,
311,
3082,
3445
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
9bad9ec711da-1 | Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
classmethod from_function(func: Callable, name: str, description: str, return_direct: bool = False, args_schema: Optional[Type[BaseModel]] = None, **kwargs: Any) → Tool¶
Initialize tool from a function.
classmethod from_llm_and_method(llm: BaseLanguageModel, path: str, method: str, spec: OpenAPISpec, requests: Optional[Requests] = None, verbose: bool = False, return_intermediate_steps: bool = False, **kwargs: Any) → NLATool[source]¶
Instantiate the tool from the specified path and method.
classmethod from_open_api_endpoint_chain(chain: OpenAPIEndpointChain, api_title: str) → NLATool[source]¶
Convert an endpoint chain to an API endpoint tool.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used. | [
25729,
311,
471,
279,
5507,
753,
2612,
6089,
13,
20638,
420,
311,
3082,
3445,
198,
9210,
1306,
279,
5507,
374,
2663,
11,
279,
21372,
26321,
690,
3009,
63687,
627,
913,
14008,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
1515,
279,
5507,
753,
5208,
627,
565,
6797,
3889,
14506,
6022,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
610,
55609,
198,
8238,
5507,
42022,
627,
7847,
802,
359,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
68881,
627,
27853,
505,
9353,
19062,
25,
54223,
11,
836,
25,
610,
11,
4096,
25,
610,
11,
471,
33971,
25,
1845,
284,
3641,
11,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
13782,
55609,
198,
10130,
5507,
505,
264,
734,
627,
27853,
505,
44095,
76,
8543,
9209,
36621,
76,
25,
5464,
14126,
1747,
11,
1853,
25,
610,
11,
1749,
25,
610,
11,
1424,
25,
5377,
2599,
1669,
1007,
11,
7540,
25,
12536,
58,
36395,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
33260,
835,
1786,
76747,
60,
55609,
198,
81651,
279,
5507,
505,
279,
5300,
1853,
323,
1749,
627,
27853,
505,
11563,
11959,
37799,
31683,
63691,
25,
5377,
7227,
28480,
19368,
11,
6464,
6240,
25,
610,
8,
11651,
33260,
835,
1786,
76747,
60,
55609,
198,
12281,
459,
15233,
8957,
311,
459,
5446,
15233,
5507,
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/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
9bad9ec711da-2 | Raise deprecation warning if callback_manager is used.
run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool.
property args: dict¶
The tool’s input arguments.
property is_single_input: bool¶
Whether the tool only accepts a single input.
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,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
627,
3784,
2897,
25,
6587,
55609,
198,
791,
5507,
753,
1988,
6105,
627,
3784,
374,
20052,
6022,
25,
1845,
55609,
198,
25729,
279,
5507,
1193,
27441,
264,
3254,
1988,
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/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html |
898acfcd4bf3-0 | langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent¶
langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent(llm: BaseLanguageModel, toolkit: VectorStoreRouterToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions.\nYou have access to tools for interacting with different sources, and the inputs to the tools are questions.\nYour main task is to decide which of the tools is relevant for answering question at hand.\nFor complex questions, you can break the question down into sub questions and use tools to answers the sub questions.\n', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶
Construct a vectorstore router agent from an LLM and tools. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
9105,
2581,
12526,
4412,
56687,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
48203,
4412,
9105,
2581,
12526,
4412,
56687,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
66994,
25,
4290,
6221,
9713,
63044,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
2675,
527,
459,
8479,
6319,
311,
4320,
4860,
7255,
77,
2675,
617,
2680,
311,
7526,
369,
45830,
449,
2204,
8336,
11,
323,
279,
11374,
311,
279,
7526,
527,
4860,
7255,
77,
7927,
1925,
3465,
374,
311,
10491,
902,
315,
279,
7526,
374,
9959,
369,
36864,
3488,
520,
1450,
7255,
77,
2520,
6485,
4860,
11,
499,
649,
1464,
279,
3488,
1523,
1139,
1207,
4860,
323,
1005,
7526,
311,
11503,
279,
1207,
4860,
7255,
77,
518,
14008,
25,
1845,
284,
3641,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609,
198,
29568,
264,
4724,
4412,
9457,
8479,
505,
459,
445,
11237,
323,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent.html |
f47553a3d6a1-0 | langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
33646,
18554,
9105,
2581,
10331,
847,
18554,
26814,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
f47553a3d6a1-1 | langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent(llm: BaseLanguageModel, toolkit: SparkSQLToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to interact with Spark SQL.\nGiven an input question, create a syntactically correct Spark SQL query to run, then look at the results of the query and return the answer.\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.\nYou can order the results by a relevant column to return the most interesting examples in the database.\nNever query for all the columns from a specific table, only ask for the relevant columns given the question.\nYou have access to tools for interacting with the database.\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return "I don\'t know" as the answer.\n', suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the database to see what I can query.\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
33646,
18554,
9105,
2581,
10331,
847,
18554,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
66994,
25,
27565,
6827,
63044,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
2675,
527,
459,
8479,
6319,
311,
16681,
449,
27565,
8029,
7255,
77,
22818,
459,
1988,
3488,
11,
1893,
264,
84287,
533,
2740,
4495,
27565,
8029,
3319,
311,
1629,
11,
1243,
1427,
520,
279,
3135,
315,
279,
3319,
323,
471,
279,
4320,
7255,
77,
36687,
279,
1217,
30202,
264,
3230,
1396,
315,
10507,
814,
6562,
311,
6994,
11,
2744,
4017,
701,
3319,
311,
520,
1455,
314,
3565,
4803,
92,
3135,
7255,
77,
2675,
649,
2015,
279,
3135,
555,
264,
9959,
3330,
311,
471,
279,
1455,
7185,
10507,
304,
279,
4729,
7255,
77,
27247,
3319,
369,
682,
279,
8310,
505,
264,
3230,
2007,
11,
1193,
2610,
369,
279,
9959,
8310,
2728,
279,
3488,
7255,
77,
2675,
617,
2680,
311,
7526,
369,
45830,
449,
279,
4729,
7255,
77,
7456,
1005,
279,
3770,
7526,
13,
8442,
1005,
279,
2038,
6052,
555,
279,
3770,
7526,
311,
9429,
701,
1620,
4320,
7255,
77,
2675,
28832,
2033,
1817,
701,
3319,
1603,
31320,
433,
13,
1442,
499,
636,
459,
1493,
1418,
31320,
264,
3319,
11,
18622,
279,
3319,
323,
1456,
1578,
7255,
77,
1734,
5989,
4276,
1304,
904,
423,
2735,
12518,
320,
12987,
11,
23743,
11,
17640,
11,
58042,
5099,
6266,
311,
279,
4729,
7255,
77,
1734,
2746,
279,
3488,
1587,
539,
2873,
5552,
311,
279,
4729,
11,
1120,
471,
330,
40,
1541,
10379,
83,
1440,
1,
439,
279,
4320,
7255,
77,
518,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
14924,
25,
314,
1379,
11281,
77,
85269,
25,
358,
1288,
1427,
520,
279,
12920,
304,
279,
4729,
311,
1518,
1148,
358,
649,
3319,
7255,
77,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
279,
2768,
3645,
7338,
77,
1734,
14924,
25,
279,
1988,
3488,
499,
2011,
4320,
1734,
85269,
25,
499,
1288,
2744,
1781,
922,
1148,
311,
656,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
f47553a3d6a1-2 | (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, top_k: int = 10, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶ | [
1420,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358,
1457,
1440,
279,
1620,
4320,
1734,
19918,
22559,
25,
279,
1620,
4320,
311,
279,
4113,
1988,
3488,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
1948,
4803,
25,
528,
284,
220,
605,
11,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
11,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
11,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
518,
14008,
25,
1845,
284,
3641,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
f47553a3d6a1-3 | Construct a sql agent from an LLM and tools. | [
29568,
264,
5822,
8479,
505,
459,
445,
11237,
323,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.spark_sql.base.create_spark_sql_agent.html |
28e54a7f50d0-0 | langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent¶
langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent(api_spec: ReducedOpenAPISpec, requests_wrapper: TextRequestsWrapper, llm: BaseLanguageModel, shared_memory: Optional[ReadOnlySharedMemory] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = True, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶
Instantiate API planner and controller for a given spec.
Inject credentials via requests_wrapper.
We use a top-level “orchestrator” agent to invoke the planner and controller,
rather than a top-level planner
that invokes a controller with its plan. This is to keep the planner simple. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
2581,
11563,
2113,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
2581,
11563,
2113,
26814,
25865,
13908,
25,
80569,
5109,
2599,
1669,
1007,
11,
7540,
24474,
25,
2991,
36395,
11803,
11,
9507,
76,
25,
5464,
14126,
1747,
11,
6222,
19745,
25,
12536,
58,
21584,
17430,
10869,
60,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3082,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609,
198,
81651,
5446,
50811,
323,
6597,
369,
264,
2728,
1424,
627,
14055,
16792,
4669,
7540,
24474,
627,
1687,
1005,
264,
1948,
11852,
1054,
22312,
15462,
859,
863,
8479,
311,
20466,
279,
50811,
323,
6597,
345,
74303,
1109,
264,
1948,
11852,
50811,
198,
9210,
67151,
264,
6597,
449,
1202,
3197,
13,
1115,
374,
311,
2567,
279,
50811,
4382,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.create_openapi_agent.html |
8619947c1893-0 | langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit¶
class langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit(*, db: SparkSQL, llm: BaseLanguageModel)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Spark SQL.
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 db: langchain.utilities.spark_sql.SparkSQL [Required]¶
param llm: langchain.base_language.BaseLanguageModel [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
33646,
18554,
21966,
8390,
815,
29836,
6827,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
33646,
18554,
21966,
8390,
815,
29836,
6827,
63044,
4163,
11,
3000,
25,
27565,
6827,
11,
9507,
76,
25,
5464,
14126,
1747,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
27565,
8029,
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,
3000,
25,
8859,
8995,
63795,
33646,
18554,
815,
29836,
6827,
510,
8327,
60,
55609,
198,
913,
9507,
76,
25,
8859,
8995,
9105,
30121,
13316,
14126,
1747,
510,
8327,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
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/agents/langchain.agents.agent_toolkits.spark_sql.toolkit.SparkSQLToolkit.html |
0e7459d30e2c-0 | langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries¶
class langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries(*, base_parser: AgentOutputParser = None, output_fixing_parser: Optional[OutputFixingParser] = None)[source]¶
Bases: AgentOutputParser
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_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
param output_fixing_parser: Optional[langchain.output_parsers.fix.OutputFixingParser] = None¶
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
classmethod from_llm(llm: Optional[BaseLanguageModel] = None, base_parser: Optional[StructuredChatOutputParser] = None) → StructuredChatOutputParserWithRetries[source]¶
get_format_instructions() → str[source]¶
Instructions on how the LLM output should be formatted.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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¶ | [
5317,
8995,
29192,
812,
13,
52243,
36153,
13718,
19024,
52545,
3149,
16047,
5207,
6707,
2409,
12289,
4108,
55609,
198,
1058,
8859,
8995,
29192,
812,
13,
52243,
36153,
13718,
19024,
52545,
3149,
16047,
5207,
6707,
2409,
12289,
4108,
4163,
11,
2385,
19024,
25,
21372,
5207,
6707,
284,
2290,
11,
2612,
37160,
287,
19024,
25,
12536,
58,
5207,
27048,
287,
6707,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
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,
2385,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
15669,
60,
55609,
198,
913,
2612,
37160,
287,
19024,
25,
12536,
58,
5317,
8995,
13718,
623,
41588,
68885,
35346,
27048,
287,
6707,
60,
284,
2290,
55609,
198,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
2612,
6871,
627,
27853,
505,
44095,
76,
36621,
76,
25,
12536,
58,
4066,
14126,
1747,
60,
284,
2290,
11,
2385,
19024,
25,
12536,
58,
98557,
16047,
5207,
6707,
60,
284,
2290,
8,
11651,
16531,
3149,
16047,
5207,
6707,
2409,
12289,
4108,
76747,
60,
55609,
198,
456,
9132,
83527,
368,
11651,
610,
76747,
60,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html |
0e7459d30e2c-1 | to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
998,
9643,
8072,
18377,
14565,
368,
11651,
92572,
2688,
18804,
55609,
198,
3784,
37313,
18741,
25,
30226,
55609,
198,
5715,
264,
1160,
315,
7180,
5144,
430,
1288,
387,
5343,
304,
279,
198,
76377,
16901,
13,
4314,
8365,
2011,
387,
11928,
555,
279,
198,
22602,
627,
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html |
a61c042ba08d-0 | langchain.agents.agent_toolkits.openapi.base.create_openapi_agent¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
9105,
2581,
11563,
2113,
26814,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
a61c042ba08d-1 | langchain.agents.agent_toolkits.openapi.base.create_openapi_agent(llm: BaseLanguageModel, toolkit: OpenAPIToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = "You are an agent designed to answer questions by making web requests to an API given the openapi spec.\n\nIf the question does not seem related to the API, return I don't know. Do not make up an answer.\nOnly use information provided by the tools to construct your response.\n\nFirst, find the base URL needed to make the request.\n\nSecond, find the relevant paths needed to answer the question. Take note that, sometimes, you might need to make more than one request to more than one path to answer the question.\n\nThird, find the required parameters needed to make the request. For GET requests, these are usually URL parameters and for POST requests, these are request body parameters.\n\nFourth, make the requests needed to answer the question. Ensure that you are sending the correct parameters to the request by checking which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed.\n\nUse the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters.\nIf you get a not found error, ensure that you are using a path that actually exists in the spec.\n", suffix: str = 'Begin!\n\nQuestion: {input}\nThought: I should explore the spec to find the base url for the API.\n{agent_scratchpad}', format_instructions: str = 'Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
9105,
2581,
11563,
2113,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
66994,
25,
5377,
2599,
964,
1786,
8390,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
610,
284,
330,
2675,
527,
459,
8479,
6319,
311,
4320,
4860,
555,
3339,
3566,
7540,
311,
459,
5446,
2728,
279,
1825,
2113,
1424,
7255,
77,
1734,
2746,
279,
3488,
1587,
539,
2873,
5552,
311,
279,
5446,
11,
471,
358,
1541,
956,
1440,
13,
3234,
539,
1304,
709,
459,
4320,
7255,
77,
7456,
1005,
2038,
3984,
555,
279,
7526,
311,
9429,
701,
2077,
7255,
77,
1734,
5451,
11,
1505,
279,
2385,
5665,
4460,
311,
1304,
279,
1715,
7255,
77,
1734,
16041,
11,
1505,
279,
9959,
13006,
4460,
311,
4320,
279,
3488,
13,
12040,
5296,
430,
11,
7170,
11,
499,
2643,
1205,
311,
1304,
810,
1109,
832,
1715,
311,
810,
1109,
832,
1853,
311,
4320,
279,
3488,
7255,
77,
1734,
38075,
11,
1505,
279,
2631,
5137,
4460,
311,
1304,
279,
1715,
13,
1789,
8049,
7540,
11,
1521,
527,
6118,
5665,
5137,
323,
369,
13165,
7540,
11,
1521,
527,
1715,
2547,
5137,
7255,
77,
1734,
89703,
11,
1304,
279,
7540,
4460,
311,
4320,
279,
3488,
13,
30379,
430,
499,
527,
11889,
279,
4495,
5137,
311,
279,
1715,
555,
13598,
902,
5137,
527,
2631,
13,
1789,
5137,
449,
264,
8521,
743,
315,
2819,
11,
4587,
1005,
279,
1424,
311,
1427,
520,
902,
2819,
527,
5535,
7255,
77,
1734,
10464,
279,
4839,
5852,
5144,
439,
10212,
304,
279,
1424,
11,
656,
539,
1304,
709,
904,
5144,
477,
40615,
6629,
279,
5144,
315,
5137,
7255,
77,
2746,
499,
636,
264,
539,
1766,
1493,
11,
6106,
430,
499,
527,
1701,
264,
1853,
430,
3604,
6866,
304,
279,
1424,
7255,
77,
498,
21166,
25,
610,
284,
364,
11382,
15114,
77,
1734,
14924,
25,
314,
1379,
11281,
77,
85269,
25,
358,
1288,
13488,
279,
1424,
311,
1505,
279,
2385,
2576,
369,
279,
5446,
7255,
77,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
279,
2768,
3645,
7338,
77,
1734,
14924,
25,
279,
1988,
3488,
499,
2011,
4320,
1734,
85269,
25,
499,
1288,
2744,
1781,
922,
1148,
311,
656,
1734,
2573,
25,
279,
1957,
311,
1935,
11,
1288,
387,
832,
315,
18973,
14506,
9366,
92,
18444,
77,
2573,
5688,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
a61c042ba08d-2 | Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question', input_variables: Optional[List[str]] = None, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', verbose: bool = False, return_intermediate_steps: bool = False, agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶ | [
2566,
25,
279,
1988,
311,
279,
1957,
1734,
38863,
367,
25,
279,
1121,
315,
279,
1957,
1734,
1131,
320,
576,
36287,
14,
2573,
14,
2573,
5688,
17991,
4945,
367,
649,
13454,
452,
3115,
10929,
77,
85269,
25,
358,
1457,
1440,
279,
1620,
4320,
1734,
19918,
22559,
25,
279,
1620,
4320,
311,
279,
4113,
1988,
3488,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
11,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
11,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
518,
14008,
25,
1845,
284,
3641,
11,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
11,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
a61c042ba08d-3 | Construct a json agent from an LLM and tools. | [
29568,
264,
3024,
8479,
505,
459,
445,
11237,
323,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.base.create_openapi_agent.html |
4944b685089e-0 | langchain.agents.schema.AgentScratchPadChatPromptTemplate¶
class langchain.agents.schema.AgentScratchPadChatPromptTemplate(*, input_variables: List[str], output_parser: Optional[BaseOutputParser] = None, partial_variables: Mapping[str, Union[str, Callable[[], str]]] = None, messages: List[Union[BaseMessagePromptTemplate, BaseMessage]])[source]¶
Bases: ChatPromptTemplate
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 input_variables: List[str] [Required]¶
A list of the names of the variables the prompt template expects.
param messages: List[Union[BaseMessagePromptTemplate, BaseMessage]] [Required]¶
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]¶
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]¶
Format kwargs into a list of messages.
format_prompt(**kwargs: Any) → PromptValue¶
Create Chat Messages.
classmethod from_messages(messages: Sequence[Union[BaseMessagePromptTemplate, BaseMessage]]) → ChatPromptTemplate¶
classmethod from_role_strings(string_messages: List[Tuple[str, str]]) → ChatPromptTemplate¶
classmethod from_strings(string_messages: List[Tuple[Type[BaseMessagePromptTemplate], str]]) → ChatPromptTemplate¶ | [
5317,
8995,
29192,
812,
31992,
89969,
66608,
759,
14047,
16047,
55715,
7423,
55609,
198,
1058,
8859,
8995,
29192,
812,
31992,
89969,
66608,
759,
14047,
16047,
55715,
7423,
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,
6743,
25,
1796,
58,
33758,
58,
4066,
2097,
55715,
7423,
11,
5464,
2097,
30716,
58,
2484,
60,
55609,
198,
33,
2315,
25,
13149,
55715,
7423,
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,
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,
6743,
25,
1796,
58,
33758,
58,
4066,
2097,
55715,
7423,
11,
5464,
2097,
5163,
510,
8327,
60,
55609,
198,
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,
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,
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,
27853,
505,
24321,
56805,
25,
29971,
58,
33758,
58,
4066,
2097,
55715,
7423,
11,
5464,
2097,
30716,
11651,
13149,
55715,
7423,
55609,
198,
27853,
505,
20378,
34600,
3693,
24321,
25,
1796,
20961,
6189,
17752,
11,
610,
30716,
11651,
13149,
55715,
7423,
55609,
198,
27853,
505,
34600,
3693,
24321,
25,
1796,
20961,
6189,
58,
941,
58,
4066,
2097,
55715,
7423,
1145,
610,
30716,
11651,
13149,
55715,
7423,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.schema.AgentScratchPadChatPromptTemplate.html |
4944b685089e-1 | classmethod from_template(template: str, **kwargs: Any) → ChatPromptTemplate¶
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_input_variables » all fields¶
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¶ | [
27853,
505,
8864,
31063,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
13149,
55715,
7423,
55609,
198,
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,
6022,
29282,
4194,
8345,
4194,
682,
5151,
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/agents/langchain.agents.schema.AgentScratchPadChatPromptTemplate.html |
02e10ad4580f-0 | langchain.agents.loading.load_agent_from_config¶
langchain.agents.loading.load_agent_from_config(config: dict, llm: Optional[BaseLanguageModel] = None, tools: Optional[List[Tool]] = None, **kwargs: Any) → Union[BaseSingleActionAgent, BaseMultiActionAgent][source]¶
Load agent from Config Dict. | [
5317,
8995,
29192,
812,
25908,
5214,
26814,
5791,
5445,
55609,
198,
5317,
8995,
29192,
812,
25908,
5214,
26814,
5791,
5445,
8928,
25,
6587,
11,
9507,
76,
25,
12536,
58,
4066,
14126,
1747,
60,
284,
2290,
11,
7526,
25,
12536,
53094,
58,
7896,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
4066,
11126,
2573,
17230,
11,
5464,
20981,
2573,
17230,
1483,
2484,
60,
55609,
198,
6003,
8479,
505,
5649,
30226,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.loading.load_agent_from_config.html |
2bfbb27e85b9-0 | langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain¶
class langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain(llm: BaseLanguageModel, search_chain: Union[GoogleSerperAPIWrapper, SerpAPIWrapper], *, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Optional[List[str]] = None, agent: Union[BaseSingleActionAgent, BaseMultiActionAgent], tools: Sequence[BaseTool], return_intermediate_steps: bool = False, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', handle_parsing_errors: Union[bool, str, Callable[[OutputParserException], str]] = False)[source]¶
Bases: AgentExecutor
Chain that does self ask with search.
Example
from langchain import SelfAskWithSearchChain, OpenAI, GoogleSerperAPIWrapper
search_chain = GoogleSerperAPIWrapper()
self_ask = SelfAskWithSearchChain(llm=OpenAI(), search_chain=search_chain)
Initialize with just an LLM and a search chain.
param agent: Union[BaseSingleActionAgent, BaseMultiActionAgent] [Required]¶
The agent to run for creating a plan and determining actions
to take at each step of the execution loop.
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. | [
5317,
8995,
29192,
812,
28248,
93369,
6753,
10947,
9105,
815,
491,
27264,
2409,
6014,
19368,
55609,
198,
1058,
8859,
8995,
29192,
812,
28248,
93369,
6753,
10947,
9105,
815,
491,
27264,
2409,
6014,
19368,
36621,
76,
25,
5464,
14126,
1747,
11,
2778,
31683,
25,
9323,
58,
14783,
32845,
716,
7227,
11803,
11,
8409,
79,
7227,
11803,
1145,
12039,
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,
8479,
25,
9323,
58,
4066,
11126,
2573,
17230,
11,
5464,
20981,
2573,
17230,
1145,
7526,
25,
29971,
58,
4066,
7896,
1145,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
11,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
11,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
11,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
518,
3790,
623,
29698,
20808,
25,
9323,
58,
2707,
11,
610,
11,
54223,
15873,
5207,
6707,
1378,
1145,
610,
5163,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
26321,
198,
19368,
430,
1587,
659,
2610,
449,
2778,
627,
13617,
198,
1527,
8859,
8995,
1179,
10323,
27264,
2409,
6014,
19368,
11,
5377,
15836,
11,
5195,
32845,
716,
7227,
11803,
198,
1874,
31683,
284,
5195,
32845,
716,
7227,
11803,
746,
726,
93369,
284,
10323,
27264,
2409,
6014,
19368,
36621,
76,
28,
5109,
15836,
1535,
2778,
31683,
97698,
31683,
340,
10130,
449,
1120,
459,
445,
11237,
323,
264,
2778,
8957,
627,
913,
8479,
25,
9323,
58,
4066,
11126,
2573,
17230,
11,
5464,
20981,
2573,
17230,
60,
510,
8327,
60,
55609,
198,
791,
8479,
311,
1629,
369,
6968,
264,
3197,
323,
26679,
6299,
198,
998,
1935,
520,
1855,
3094,
315,
279,
11572,
6471,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
2bfbb27e85b9-1 | 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 early_stopping_method: str = 'force'¶
The method to use for early stopping if the agent never
returns AgentFinish. Either ‘force’ or ‘generate’.
“force” returns a string saying that it stopped because it met atime or iteration limit.
“generate” calls the agent’s LLM Chain one final time to generatea final answer based on the previous steps.
param handle_parsing_errors: Union[bool, str, Callable[[OutputParserException], str]] = False¶
How to handle errors raised by the agent’s output parser.Defaults to False, which raises the error.
sIf true, the error will be sent back to the LLM as an observation.
If a string, the string itself will be sent to the LLM as an observation.
If a callable function, the function will be called with the exception
as an argument, and the result of that function will be passed to the agentas an observation.
param max_execution_time: Optional[float] = None¶
The maximum amount of wall clock time to spend in the execution
loop.
param max_iterations: Optional[int] = 15¶
The maximum number of steps to take before ending the execution
loop.
Setting to ‘None’ could lead to an infinite loop.
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.
There are many different types of memory - please see memory docs
for the full catalog. | [
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,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
6,
55609,
198,
791,
1749,
311,
1005,
369,
4216,
23351,
422,
279,
8479,
2646,
198,
4310,
21372,
26748,
13,
21663,
3451,
9009,
529,
477,
3451,
19927,
529,
627,
2118,
9009,
863,
4780,
264,
925,
5605,
430,
433,
10717,
1606,
433,
2322,
520,
547,
477,
20140,
4017,
627,
2118,
19927,
863,
6880,
279,
8479,
753,
445,
11237,
29625,
832,
1620,
892,
311,
7068,
64,
1620,
4320,
3196,
389,
279,
3766,
7504,
627,
913,
3790,
623,
29698,
20808,
25,
9323,
58,
2707,
11,
610,
11,
54223,
15873,
5207,
6707,
1378,
1145,
610,
5163,
284,
3641,
55609,
198,
4438,
311,
3790,
6103,
9408,
555,
279,
8479,
753,
2612,
6871,
13578,
82,
311,
3641,
11,
902,
25930,
279,
1493,
627,
82,
2746,
837,
11,
279,
1493,
690,
387,
3288,
1203,
311,
279,
445,
11237,
439,
459,
22695,
627,
2746,
264,
925,
11,
279,
925,
5196,
690,
387,
3288,
311,
279,
445,
11237,
439,
459,
22695,
627,
2746,
264,
42022,
734,
11,
279,
734,
690,
387,
2663,
449,
279,
4788,
198,
300,
459,
5811,
11,
323,
279,
1121,
315,
430,
734,
690,
387,
5946,
311,
279,
8479,
300,
459,
22695,
627,
913,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
55609,
198,
791,
7340,
3392,
315,
7147,
9042,
892,
311,
8493,
304,
279,
11572,
198,
10719,
627,
913,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
55609,
198,
791,
7340,
1396,
315,
7504,
311,
1935,
1603,
13696,
279,
11572,
198,
10719,
627,
15762,
311,
3451,
4155,
529,
1436,
3063,
311,
459,
24746,
6471,
627,
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,
627,
3947,
527,
1690,
2204,
4595,
315,
5044,
482,
4587,
1518,
5044,
27437,
198,
2000,
279,
2539,
16808,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
2bfbb27e85b9-2 | There are many different types of memory - please see memory docs
for the full catalog.
param return_intermediate_steps: bool = False¶
Whether to return the agent’s trajectory of intermediate steps
at the end in addition to the final output.
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 tools: Sequence[BaseTool] [Required]¶
The valid tools the agent can call.
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
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. | [
3947,
527,
1690,
2204,
4595,
315,
5044,
482,
4587,
1518,
5044,
27437,
198,
2000,
279,
2539,
16808,
627,
913,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
471,
279,
8479,
753,
35782,
315,
29539,
7504,
198,
266,
279,
842,
304,
5369,
311,
279,
1620,
2612,
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,
7526,
25,
29971,
58,
4066,
7896,
60,
510,
8327,
60,
55609,
198,
791,
2764,
7526,
279,
8479,
649,
1650,
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,
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/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
2bfbb27e85b9-3 | include_run_info – Whether to include run info in the response. Defaults
to False.
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.
apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶
Call the chain on all inputs in the list.
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.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_agent_and_tools(agent: Union[BaseSingleActionAgent, BaseMultiActionAgent], tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, **kwargs: Any) → AgentExecutor¶ | [
1012,
14334,
3186,
1389,
13440,
311,
2997,
1629,
3630,
304,
279,
2077,
13,
37090,
198,
998,
3641,
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,
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,
7368,
279,
8957,
389,
682,
11374,
304,
279,
1160,
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,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8957,
627,
27853,
505,
26814,
8543,
40823,
56514,
25,
9323,
58,
4066,
11126,
2573,
17230,
11,
5464,
20981,
2573,
17230,
1145,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
26321,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
2bfbb27e85b9-4 | Create from agent and tools.
lookup_tool(name: str) → BaseTool¶
Lookup tool by name.
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.
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¶
Raise error - saving not supported for Agent Executors.
save_agent(file_path: Union[Path, str]) → None¶
Save the underlying agent.
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¶
validator validate_return_direct_tool » all fields¶
Validate that tools are compatible with agent.
validator validate_tools » all fields¶
Validate that tools are compatible with agent.
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]¶ | [
4110,
505,
8479,
323,
7526,
627,
21696,
23627,
3232,
25,
610,
8,
11651,
5464,
7896,
55609,
198,
35347,
5507,
555,
836,
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,
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,
94201,
1493,
482,
14324,
539,
7396,
369,
21372,
96193,
627,
6766,
26814,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
16940,
8479,
627,
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,
16503,
9788,
12794,
33971,
23627,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
7526,
527,
18641,
449,
8479,
627,
16503,
9788,
40823,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
7526,
527,
18641,
449,
8479,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
2bfbb27e85b9-5 | 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¶ | [
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/agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html |
c1c8987d9491-0 | langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit¶
class langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit(*, root_dir: Optional[str] = None, selected_tools: Optional[List[str]] = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a Local Files.
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 root_dir: Optional[str] = None¶
If specified, all file operations are made relative to root_dir.
param selected_tools: Optional[List[str]] = None¶
If provided, only provide the selected tools. Defaults to all.
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
validator validate_tools » all fields[source]¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
9914,
46463,
21966,
8390,
8744,
23030,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
9914,
46463,
21966,
8390,
8744,
23030,
63044,
4163,
11,
3789,
4432,
25,
12536,
17752,
60,
284,
2290,
11,
4183,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
264,
8949,
17833,
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,
3789,
4432,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
2746,
5300,
11,
682,
1052,
7677,
527,
1903,
8844,
311,
3789,
4432,
627,
913,
4183,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
2746,
3984,
11,
1193,
3493,
279,
4183,
7526,
13,
37090,
311,
682,
627,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
627,
16503,
9788,
40823,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.file_management.toolkit.FileManagementToolkit.html |
1577e85f9291-0 | langchain.agents.agent_types.AgentType¶
class langchain.agents.agent_types.AgentType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases: str, Enum
Enumerator with the Agent types.
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()
Return True if the string is a decimal string, False otherwise. | [
5317,
8995,
29192,
812,
45249,
9962,
89969,
941,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
9962,
89969,
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,
449,
279,
21372,
4595,
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,
746,
5715,
3082,
422,
279,
925,
374,
264,
12395,
925,
11,
3641,
6062,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-1 | 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]])
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. | [
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,
27829,
5715,
279,
8592,
1963,
304,
328,
1405,
39549,
1207,
374,
1766,
11,
1778,
430,
1207,
374,
13282,
2949,
328,
29563,
26874,
948
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-2 | 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
ZERO_SHOT_REACT_DESCRIPTION
REACT_DOCSTORE
SELF_ASK_WITH_SEARCH
CONVERSATIONAL_REACT_DESCRIPTION
CHAT_ZERO_SHOT_REACT_DESCRIPTION
CHAT_CONVERSATIONAL_REACT_DESCRIPTION
STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION
OPENAI_FUNCTIONS
OPENAI_MULTI_FUNCTIONS
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=' ', /)¶ | [
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,
75056,
6977,
1831,
2241,
6966,
39268,
198,
793,
6966,
70011,
45050,
198,
66873,
1596,
16074,
24880,
34808,
198,
5910,
73326,
40685,
2241,
6966,
39268,
198,
61817,
40470,
6977,
1831,
2241,
6966,
39268,
198,
61817,
4405,
73326,
40685,
2241,
6966,
39268,
198,
31564,
87413,
71848,
40470,
6977,
1831,
2241,
6966,
39268,
198,
32033,
15836,
96584,
198,
32033,
15836,
50894,
96584,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-3 | center(width, fillchar=' ', /)¶
Return a centered string of length width.
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¶ | [
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-4 | format_map(mapping) → str¶
Return a formatted version of S, using substitutions from mapping.
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. | [
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,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-5 | 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
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. | [
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,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-6 | lower()¶
Return a copy of the string converted to lowercase.
lstrip(chars=None, /)¶
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. | [
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,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-7 | 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.
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). | [
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,
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,
570
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-8 | empty strings from the result.
maxsplitMaximum number of splits (starting from the left).
-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()¶ | [
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
1577e85f9291-9 | 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
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.
CHAT_CONVERSATIONAL_REACT_DESCRIPTION = 'chat-conversational-react-description'¶
CHAT_ZERO_SHOT_REACT_DESCRIPTION = 'chat-zero-shot-react-description'¶
CONVERSATIONAL_REACT_DESCRIPTION = 'conversational-react-description'¶
OPENAI_FUNCTIONS = 'openai-functions'¶
OPENAI_MULTI_FUNCTIONS = 'openai-multi-functions'¶
REACT_DOCSTORE = 'react-docstore'¶
SELF_ASK_WITH_SEARCH = 'self-ask-with-search'¶
STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION = 'structured-chat-zero-shot-react-description'¶
ZERO_SHOT_REACT_DESCRIPTION = 'zero-shot-react-description'¶ | [
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,
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,
61817,
4405,
73326,
40685,
2241,
6966,
39268,
284,
364,
9884,
15204,
3078,
1697,
31696,
43930,
6,
55609,
198,
61817,
40470,
6977,
1831,
2241,
6966,
39268,
284,
364,
9884,
38029,
64630,
31696,
43930,
6,
55609,
198,
5910,
73326,
40685,
2241,
6966,
39268,
284,
364,
444,
3078,
1697,
31696,
43930,
6,
55609,
198,
32033,
15836,
96584,
284,
364,
2569,
2192,
78530,
6,
55609,
198,
32033,
15836,
50894,
96584,
284,
364,
2569,
2192,
96769,
78530,
6,
55609,
198,
793,
6966,
70011,
45050,
284,
364,
3007,
11788,
4412,
6,
55609,
198,
66873,
1596,
16074,
24880,
34808,
284,
364,
726,
12,
1091,
27281,
19993,
6,
55609,
198,
31564,
87413,
71848,
40470,
6977,
1831,
2241,
6966,
39268,
284,
364,
52243,
61635,
38029,
64630,
31696,
43930,
6,
55609,
198,
75056,
6977,
1831,
2241,
6966,
39268,
284,
364,
14486,
64630,
31696,
43930,
6,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_types.AgentType.html |
8c11a96f3d4a-0 | langchain.agents.mrkl.base.ChainConfig¶
class langchain.agents.mrkl.base.ChainConfig(action_name: str, action: Callable, action_description: str)[source]¶
Bases: NamedTuple
Configuration for chain to use in MRKL system.
Parameters
action_name – Name of the action.
action – Action function to call.
action_description – Description of the action.
Create new instance of ChainConfig(action_name, action, action_description)
Methods
__init__()
count(value, /)
Return number of occurrences of value.
index(value[, start, stop])
Return first index of value.
Attributes
action
Alias for field number 1
action_description
Alias for field number 2
action_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.
action: Callable¶
Alias for field number 1
action_description: str¶
Alias for field number 2
action_name: str¶
Alias for field number 0 | [
5317,
8995,
29192,
812,
749,
81,
10784,
9105,
99369,
2714,
55609,
198,
1058,
8859,
8995,
29192,
812,
749,
81,
10784,
9105,
99369,
2714,
15665,
1292,
25,
610,
11,
1957,
25,
54223,
11,
1957,
11703,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
41559,
29781,
198,
7843,
369,
8957,
311,
1005,
304,
29433,
54083,
1887,
627,
9905,
198,
1335,
1292,
1389,
4076,
315,
279,
1957,
627,
1335,
1389,
5703,
734,
311,
1650,
627,
1335,
11703,
1389,
7817,
315,
279,
1957,
627,
4110,
502,
2937,
315,
29625,
2714,
15665,
1292,
11,
1957,
11,
1957,
11703,
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,
1335,
198,
23555,
369,
2115,
1396,
220,
16,
198,
1335,
11703,
198,
23555,
369,
2115,
1396,
220,
17,
198,
1335,
1292,
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,
1335,
25,
54223,
55609,
198,
23555,
369,
2115,
1396,
220,
16,
198,
1335,
11703,
25,
610,
55609,
198,
23555,
369,
2115,
1396,
220,
17,
198,
1335,
1292,
25,
610,
55609,
198,
23555,
369,
2115,
1396,
220,
15
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.ChainConfig.html |
f4efe8325494-0 | langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser¶
class langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser(*, followups: Sequence[str] = ('Follow up:', 'Followup:'), finish_string: str = 'So the final answer is: ')[source]¶
Bases: AgentOutputParser
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 finish_string: str = 'So the final answer is: '¶
param followups: Sequence[str] = ('Follow up:', 'Followup:')¶
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) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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. | [
5317,
8995,
29192,
812,
28248,
93369,
6753,
10947,
13718,
19024,
815,
491,
27264,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
28248,
93369,
6753,
10947,
13718,
19024,
815,
491,
27264,
5207,
6707,
4163,
11,
1833,
8772,
25,
29971,
17752,
60,
284,
4417,
12763,
709,
17898,
364,
12763,
455,
25,
4670,
6381,
3991,
25,
610,
284,
364,
4516,
279,
1620,
4320,
374,
25,
64581,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
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,
6381,
3991,
25,
610,
284,
364,
4516,
279,
1620,
4320,
374,
25,
364,
55609,
198,
913,
1833,
8772,
25,
29971,
17752,
60,
284,
4417,
12763,
709,
17898,
364,
12763,
455,
80995,
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,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser.html |
f4efe8325494-1 | property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
3784,
37313,
42671,
25,
1796,
17752,
60,
55609,
198,
5715,
279,
4573,
315,
279,
8859,
8995,
1665,
627,
797,
13,
510,
2118,
5317,
8995,
9520,
1054,
657,
1026,
9520,
1054,
2569,
2192,
863,
933,
3784,
37313,
3537,
53810,
25,
30226,
17752,
11,
610,
60,
55609,
198,
5715,
264,
2472,
315,
4797,
5811,
5144,
311,
6367,
14483,
627,
797,
13,
314,
2118,
2569,
2192,
11959,
3173,
57633,
1054,
32033,
15836,
11669,
6738,
863,
534,
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.self_ask_with_search.output_parser.SelfAskOutputParser.html |
2a1f928d1a55-0 | langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent¶
langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent(llm: BaseLanguageModel, df: Any, agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager: Optional[BaseCallbackManager] = None, prefix: Optional[str] = None, suffix: Optional[str] = None, input_variables: Optional[List[str]] = None, verbose: bool = False, return_intermediate_steps: bool = False, max_iterations: Optional[int] = 15, max_execution_time: Optional[float] = None, early_stopping_method: str = 'force', agent_executor_kwargs: Optional[Dict[str, Any]] = None, include_df_in_prompt: Optional[bool] = True, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶
Construct a pandas agent from an LLM and dataframe. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
558,
56533,
9105,
2581,
623,
56533,
78670,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
558,
56533,
9105,
2581,
623,
56533,
78670,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
6907,
25,
5884,
11,
8479,
1857,
25,
21372,
941,
284,
21372,
941,
70948,
6977,
1831,
2241,
6966,
39268,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
9436,
25,
12536,
17752,
60,
284,
2290,
11,
21166,
25,
12536,
17752,
60,
284,
2290,
11,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
471,
15678,
14978,
23566,
25,
1845,
284,
3641,
11,
1973,
56707,
25,
12536,
19155,
60,
284,
220,
868,
11,
1973,
62048,
3084,
25,
12536,
96481,
60,
284,
2290,
11,
4216,
1284,
7153,
9209,
25,
610,
284,
364,
9009,
518,
8479,
82307,
37335,
25,
12536,
58,
13755,
17752,
11,
5884,
5163,
284,
2290,
11,
2997,
11133,
1265,
62521,
25,
12536,
58,
2707,
60,
284,
3082,
11,
3146,
9872,
25,
30226,
17752,
11,
5884,
2526,
11651,
21372,
26321,
76747,
60,
55609,
198,
29568,
264,
19130,
8479,
505,
459,
445,
11237,
323,
39328,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent.html |
9cff53551bdb-0 | langchain.agents.load_tools.load_tools¶
langchain.agents.load_tools.load_tools(tool_names: List[str], llm: Optional[BaseLanguageModel] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → List[BaseTool][source]¶
Load tools based on their name.
Parameters
tool_names – name of tools to load.
llm – Optional language model, may be needed to initialize certain tools.
callbacks – Optional callback manager or list of callback handlers.
If not provided, default global callback manager will be used.
Returns
List of tools. | [
5317,
8995,
29192,
812,
5214,
40823,
5214,
40823,
55609,
198,
5317,
8995,
29192,
812,
5214,
40823,
5214,
40823,
50050,
9366,
25,
1796,
17752,
1145,
9507,
76,
25,
12536,
58,
4066,
14126,
1747,
60,
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,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
6003,
7526,
3196,
389,
872,
836,
627,
9905,
198,
14506,
9366,
1389,
836,
315,
7526,
311,
2865,
627,
657,
76,
1389,
12536,
4221,
1646,
11,
1253,
387,
4460,
311,
9656,
3738,
7526,
627,
69411,
1389,
12536,
4927,
6783,
477,
1160,
315,
4927,
25050,
627,
2746,
539,
3984,
11,
1670,
3728,
4927,
6783,
690,
387,
1511,
627,
16851,
198,
861,
315,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.load_tools.load_tools.html |
95a67f5f2ee0-0 | langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit¶
class langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit(*, nla_tools: Sequence[NLATool])[source]¶
Bases: BaseToolkit
Natural Language API Toolkit Definition.
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 nla_tools: Sequence[langchain.agents.agent_toolkits.nla.tool.NLATool] [Required]¶
List of API Endpoint Tools.
classmethod from_llm_and_ai_plugin(llm: BaseLanguageModel, ai_plugin: AIPlugin, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) → NLAToolkit[source]¶
Instantiate the toolkit from an OpenAPI Spec URL
classmethod from_llm_and_ai_plugin_url(llm: BaseLanguageModel, ai_plugin_url: str, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) → NLAToolkit[source]¶
Instantiate the toolkit from an OpenAPI Spec URL
classmethod from_llm_and_spec(llm: BaseLanguageModel, spec: OpenAPISpec, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) → NLAToolkit[source]¶
Instantiate the toolkit by creating tools for each operation.
classmethod from_llm_and_url(llm: BaseLanguageModel, open_api_url: str, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) → NLAToolkit[source]¶
Instantiate the toolkit from an OpenAPI Spec URL
get_tools() → List[BaseTool][source]¶
Get the tools for all the API operations. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
1276,
4355,
21966,
8390,
2112,
79998,
1786,
8390,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
1276,
4355,
21966,
8390,
2112,
79998,
1786,
8390,
4163,
11,
308,
4355,
40823,
25,
29971,
23015,
79998,
1786,
41105,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
55381,
11688,
5446,
55876,
20288,
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,
308,
4355,
40823,
25,
29971,
58,
5317,
8995,
29192,
812,
45249,
23627,
90517,
1276,
4355,
21966,
2112,
79998,
1786,
60,
510,
8327,
60,
55609,
198,
861,
315,
5446,
48369,
14173,
627,
27853,
505,
44095,
76,
8543,
70515,
23982,
36621,
76,
25,
5464,
14126,
1747,
11,
16796,
23982,
25,
15592,
11807,
11,
7540,
25,
12536,
58,
36395,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
33260,
835,
1786,
8390,
76747,
60,
55609,
198,
81651,
279,
66994,
505,
459,
5377,
7227,
11197,
5665,
198,
27853,
505,
44095,
76,
8543,
70515,
23982,
2975,
36621,
76,
25,
5464,
14126,
1747,
11,
16796,
23982,
2975,
25,
610,
11,
7540,
25,
12536,
58,
36395,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
33260,
835,
1786,
8390,
76747,
60,
55609,
198,
81651,
279,
66994,
505,
459,
5377,
7227,
11197,
5665,
198,
27853,
505,
44095,
76,
8543,
13908,
36621,
76,
25,
5464,
14126,
1747,
11,
1424,
25,
5377,
2599,
1669,
1007,
11,
7540,
25,
12536,
58,
36395,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
33260,
835,
1786,
8390,
76747,
60,
55609,
198,
81651,
279,
66994,
555,
6968,
7526,
369,
1855,
5784,
627,
27853,
505,
44095,
76,
8543,
2975,
36621,
76,
25,
5464,
14126,
1747,
11,
1825,
11959,
2975,
25,
610,
11,
7540,
25,
12536,
58,
36395,
60,
284,
2290,
11,
14008,
25,
1845,
284,
3641,
11,
3146,
9872,
25,
5884,
8,
11651,
33260,
835,
1786,
8390,
76747,
60,
55609,
198,
81651,
279,
66994,
505,
459,
5377,
7227,
11197,
5665,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
369,
682,
279,
5446,
7677,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.nla.toolkit.NLAToolkit.html |
edbf070a98b9-0 | langchain.agents.agent_toolkits.csv.base.create_csv_agent¶
langchain.agents.agent_toolkits.csv.base.create_csv_agent(llm: BaseLanguageModel, path: Union[str, List[str]], pandas_kwargs: Optional[dict] = None, **kwargs: Any) → AgentExecutor[source]¶
Create csv agent by loading to a dataframe and using pandas agent. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
11468,
9105,
2581,
14347,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
11468,
9105,
2581,
14347,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
1853,
25,
9323,
17752,
11,
1796,
17752,
21128,
19130,
37335,
25,
12536,
58,
8644,
60,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
26321,
76747,
60,
55609,
198,
4110,
13448,
8479,
555,
8441,
311,
264,
39328,
323,
1701,
19130,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.csv.base.create_csv_agent.html |
d0769484c4a4-0 | langchain.agents.conversational.output_parser.ConvoOutputParser¶
class langchain.agents.conversational.output_parser.ConvoOutputParser(*, ai_prefix: str = 'AI')[source]¶
Bases: AgentOutputParser
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_prefix: str = 'AI'¶
dict(**kwargs: Any) → Dict¶
Return dictionary representation of output parser.
get_format_instructions() → str[source]¶
Instructions on how the LLM output should be formatted.
parse(text: str) → Union[AgentAction, AgentFinish][source]¶
Parse text into agent action/finish.
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. | [
5317,
8995,
29192,
812,
2932,
3078,
1697,
13718,
19024,
4906,
3415,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
2932,
3078,
1697,
13718,
19024,
4906,
3415,
5207,
6707,
4163,
11,
16796,
14301,
25,
610,
284,
364,
15836,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
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,
16796,
14301,
25,
610,
284,
364,
15836,
6,
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,
76747,
60,
55609,
198,
56391,
389,
1268,
279,
445,
11237,
2612,
1288,
387,
24001,
627,
6534,
7383,
25,
610,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
1483,
2484,
60,
55609,
198,
14802,
1495,
1139,
8479,
1957,
14,
31250,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
d0769484c4a4-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.
model Config¶
Bases: object
extra = 'ignore'¶ | [
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/agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html |
d81e98c5fe92-0 | langchain.agents.agent.ExceptionTool¶
class langchain.agents.agent.ExceptionTool(*, name: str = '_Exception', description: str = 'Exception tool', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False)[source]¶
Bases: BaseTool
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 args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Exception tool'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param name: str = '_Exception'¶
The unique name of the tool that clearly communicates its purpose.
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param verbose: bool = False¶
Whether to log the tool’s progress. | [
5317,
8995,
29192,
812,
45249,
26940,
7896,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
26940,
7896,
4163,
11,
836,
25,
610,
284,
9418,
1378,
518,
4096,
25,
610,
284,
364,
1378,
5507,
518,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
11,
471,
33971,
25,
1845,
284,
3641,
11,
14008,
25,
1845,
284,
3641,
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,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
7896,
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,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
55609,
198,
14149,
67,
8322,
1646,
538,
311,
9788,
323,
4820,
279,
5507,
753,
1988,
6105,
627,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
52444,
13,
5321,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
627,
913,
4096,
25,
610,
284,
364,
1378,
5507,
6,
55609,
198,
23580,
311,
3371,
279,
1646,
1268,
14,
9493,
14,
35734,
311,
1005,
279,
5507,
627,
2675,
649,
3493,
2478,
64630,
10507,
439,
264,
961,
315,
279,
4096,
627,
913,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
55609,
198,
7144,
279,
2262,
315,
279,
13782,
1378,
15338,
627,
913,
836,
25,
610,
284,
9418,
1378,
6,
55609,
198,
791,
5016,
836,
315,
279,
5507,
430,
9539,
92606,
1202,
7580,
627,
913,
471,
33971,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
471,
279,
5507,
753,
2612,
6089,
13,
20638,
420,
311,
3082,
3445,
198,
9210,
1306,
279,
5507,
374,
2663,
11,
279,
21372,
26321,
690,
3009,
63687,
627,
913,
14008,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
1515,
279,
5507,
753,
5208,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.ExceptionTool.html |
d81e98c5fe92-1 | param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool.
property args: dict¶
property is_single_input: bool¶
Whether the tool only accepts a single input.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
913,
14008,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
1515,
279,
5507,
753,
5208,
627,
565,
6797,
3889,
14506,
6022,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
610,
55609,
198,
8238,
5507,
42022,
627,
7847,
802,
359,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
68881,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6236,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
627,
3784,
2897,
25,
6587,
55609,
198,
3784,
374,
20052,
6022,
25,
1845,
55609,
198,
25729,
279,
5507,
1193,
27441,
264,
3254,
1988,
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/agents/langchain.agents.agent.ExceptionTool.html |
4c62467ffdf8-0 | langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit¶
class langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit(*, api_resource: Resource = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Gmail.
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 api_resource: Resource [Optional]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
model Config[source]¶
Bases: object
Pydantic config.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
73054,
21966,
8390,
1246,
3796,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
73054,
21966,
8390,
1246,
3796,
63044,
4163,
11,
6464,
18446,
25,
12027,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
62046,
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,
6464,
18446,
25,
12027,
510,
15669,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
14149,
67,
8322,
2242,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.gmail.toolkit.GmailToolkit.html |
056dd3dac252-0 | langchain.agents.structured_chat.base.StructuredChatAgent¶
class langchain.agents.structured_chat.base.StructuredChatAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
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 allowed_tools: Optional[List[str]] = None¶
param llm_chain: langchain.chains.llm.LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use. | [
5317,
8995,
29192,
812,
13,
52243,
36153,
9105,
52545,
3149,
16047,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
13,
52243,
36153,
9105,
52545,
3149,
16047,
17230,
4163,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
11,
2612,
19024,
25,
21372,
5207,
6707,
284,
2290,
11,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
21372,
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,
5535,
40823,
25,
12536,
53094,
17752,
5163,
284,
2290,
55609,
198,
913,
9507,
76,
31683,
25,
8859,
8995,
5442,
1771,
60098,
76,
1236,
11237,
19368,
510,
8327,
60,
55609,
198,
913,
2612,
19024,
25,
8859,
8995,
29192,
812,
45249,
89969,
5207,
6707,
510,
15669,
60,
55609,
198,
7847,
264,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
056dd3dac252-1 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], prefix: str = 'Respond to the human as helpfully and accurately as possible. You have access to the following tools:', suffix: str = 'Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation:.\nThought:', human_message_template: str = '{input}\n\n{agent_scratchpad}', format_instructions: str = 'Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).\n\nValid "action" values: "Final Answer" or {tool_names}\n\nProvide only ONE action per $JSON_BLOB, as shown:\n\n```\n{{{{\n "action": $TOOL_NAME,\n "action_input": $INPUT\n}}}}\n```\n\nFollow this format:\n\nQuestion: input question to answer\nThought: consider previous and subsequent steps\nAction:\n```\n$JSON_BLOB\n```\nObservation: action result\n... (repeat Thought/Action/Observation N times)\nThought: I know what to respond\nAction:\n```\n{{{{\n "action": "Final Answer",\n "action_input": "Final response to human"\n}}}}\n```', input_variables: Optional[List[str]] = None, memory_prompts: Optional[List[BasePromptTemplate]] = None) → BasePromptTemplate[source]¶
Create a prompt for this class.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent. | [
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
27853,
1893,
62521,
12464,
3145,
25,
29971,
58,
4066,
7896,
1145,
9436,
25,
610,
284,
364,
66454,
311,
279,
3823,
439,
1520,
3725,
323,
30357,
439,
3284,
13,
1472,
617,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
0,
97002,
311,
68514,
6013,
449,
264,
2764,
3024,
24295,
315,
264,
3254,
1957,
13,
5560,
7526,
422,
5995,
13,
40633,
6089,
422,
8475,
13,
15392,
374,
5703,
25,
74694,
3,
5483,
1702,
10911,
74694,
3473,
87529,
25,
7255,
77,
85269,
17898,
3823,
6598,
8864,
25,
610,
284,
11834,
1379,
11281,
77,
1734,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
264,
3024,
24295,
311,
14158,
264,
5507,
555,
8405,
459,
1957,
1401,
320,
14506,
836,
8,
323,
459,
1957,
6022,
1401,
320,
14506,
1988,
73441,
77,
1734,
4180,
330,
1335,
1,
2819,
25,
330,
19918,
22559,
1,
477,
314,
14506,
9366,
11281,
77,
1734,
61524,
1193,
25002,
1957,
824,
400,
5483,
1702,
10911,
11,
439,
6982,
7338,
77,
1734,
14196,
62169,
77,
3052,
3052,
59,
77,
4194,
330,
1335,
794,
400,
5319,
1971,
4813,
27362,
77,
4194,
330,
1335,
6022,
794,
400,
30521,
1734,
3500,
3500,
59,
77,
14196,
62169,
77,
1734,
12763,
420,
3645,
7338,
77,
1734,
14924,
25,
1988,
3488,
311,
4320,
1734,
85269,
25,
2980,
3766,
323,
17876,
7504,
1734,
2573,
7338,
77,
14196,
62169,
77,
3,
5483,
1702,
10911,
1734,
14196,
62169,
77,
38863,
367,
25,
1957,
1121,
1734,
1131,
320,
31724,
36287,
14,
2573,
17991,
4945,
367,
452,
3115,
10929,
77,
85269,
25,
358,
1440,
1148,
311,
6013,
1734,
2573,
7338,
77,
14196,
62169,
77,
3052,
3052,
59,
77,
4194,
330,
1335,
794,
330,
19918,
22559,
498,
59,
77,
4194,
330,
1335,
6022,
794,
330,
19918,
2077,
311,
3823,
12200,
77,
3500,
3500,
59,
77,
74694,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
5044,
48977,
13044,
25,
12536,
53094,
58,
4066,
55715,
7423,
5163,
284,
2290,
8,
11651,
5464,
55715,
7423,
76747,
60,
55609,
198,
4110,
264,
10137,
369,
420,
538,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
056dd3dac252-2 | dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent.
classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, prefix: str = 'Respond to the human as helpfully and accurately as possible. You have access to the following tools:', suffix: str = 'Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation:.\nThought:', human_message_template: str = '{input}\n\n{agent_scratchpad}', format_instructions: str = 'Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).\n\nValid "action" values: "Final Answer" or {tool_names}\n\nProvide only ONE action per $JSON_BLOB, as shown:\n\n```\n{{{{\n "action": $TOOL_NAME,\n "action_input": $INPUT\n}}}}\n```\n\nFollow this format:\n\nQuestion: input question to answer\nThought: consider previous and subsequent steps\nAction:\n```\n$JSON_BLOB\n```\nObservation: action result\n... (repeat Thought/Action/Observation N times)\nThought: I know what to respond\nAction:\n```\n{{{{\n "action": "Final Answer",\n "action_input": "Final response to human"\n}}}}\n```', input_variables: Optional[List[str]] = None, memory_prompts: Optional[List[BasePromptTemplate]] = None, **kwargs: Any) → Agent[source]¶
Construct an agent from an LLM and tools. | [
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
27853,
505,
44095,
76,
8543,
40823,
36621,
76,
25,
5464,
14126,
1747,
11,
7526,
25,
29971,
58,
4066,
7896,
1145,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
17230,
5207,
6707,
60,
284,
2290,
11,
9436,
25,
610,
284,
364,
66454,
311,
279,
3823,
439,
1520,
3725,
323,
30357,
439,
3284,
13,
1472,
617,
2680,
311,
279,
2768,
7526,
17898,
21166,
25,
610,
284,
364,
11382,
0,
97002,
311,
68514,
6013,
449,
264,
2764,
3024,
24295,
315,
264,
3254,
1957,
13,
5560,
7526,
422,
5995,
13,
40633,
6089,
422,
8475,
13,
15392,
374,
5703,
25,
74694,
3,
5483,
1702,
10911,
74694,
3473,
87529,
25,
7255,
77,
85269,
17898,
3823,
6598,
8864,
25,
610,
284,
11834,
1379,
11281,
77,
1734,
90,
8252,
60828,
759,
13545,
17266,
3645,
83527,
25,
610,
284,
364,
10464,
264,
3024,
24295,
311,
14158,
264,
5507,
555,
8405,
459,
1957,
1401,
320,
14506,
836,
8,
323,
459,
1957,
6022,
1401,
320,
14506,
1988,
73441,
77,
1734,
4180,
330,
1335,
1,
2819,
25,
330,
19918,
22559,
1,
477,
314,
14506,
9366,
11281,
77,
1734,
61524,
1193,
25002,
1957,
824,
400,
5483,
1702,
10911,
11,
439,
6982,
7338,
77,
1734,
14196,
62169,
77,
3052,
3052,
59,
77,
4194,
330,
1335,
794,
400,
5319,
1971,
4813,
27362,
77,
4194,
330,
1335,
6022,
794,
400,
30521,
1734,
3500,
3500,
59,
77,
14196,
62169,
77,
1734,
12763,
420,
3645,
7338,
77,
1734,
14924,
25,
1988,
3488,
311,
4320,
1734,
85269,
25,
2980,
3766,
323,
17876,
7504,
1734,
2573,
7338,
77,
14196,
62169,
77,
3,
5483,
1702,
10911,
1734,
14196,
62169,
77,
38863,
367,
25,
1957,
1121,
1734,
1131,
320,
31724,
36287,
14,
2573,
17991,
4945,
367,
452,
3115,
10929,
77,
85269,
25,
358,
1440,
1148,
311,
6013,
1734,
2573,
7338,
77,
14196,
62169,
77,
3052,
3052,
59,
77,
4194,
330,
1335,
794,
330,
19918,
22559,
498,
59,
77,
4194,
330,
1335,
6022,
794,
330,
19918,
2077,
311,
3823,
12200,
77,
3500,
3500,
59,
77,
74694,
518,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
5044,
48977,
13044,
25,
12536,
53094,
58,
4066,
55715,
7423,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
21372,
76747,
60,
55609,
198,
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
056dd3dac252-3 | Construct an agent from an LLM and tools.
get_allowed_tools() → Optional[List[str]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶
Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
callbacks – Callbacks to run.
**kwargs – User inputs.
Returns
Action specifying what tool to use.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → AgentFinish¶
Return response when agent has been stopped due to max iterations.
save(file_path: Union[Path, str]) → None¶
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
tool_run_logging_kwargs() → Dict¶
validator validate_prompt » all fields¶
Validate that prompt matches format.
property llm_prefix: str¶
Prefix to append the llm call with.
property observation_prefix: str¶
Prefix to append the observation with.
property return_values: List[str]¶
Return values of the agent. | [
29568,
459,
8479,
505,
459,
445,
11237,
323,
7526,
627,
456,
43255,
40823,
368,
11651,
12536,
53094,
17752,
5163,
55609,
198,
456,
16776,
29657,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
4110,
279,
2539,
11374,
369,
279,
445,
11237,
19368,
505,
29539,
7504,
627,
10609,
33724,
14978,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
9323,
58,
17230,
2573,
11,
21372,
26748,
60,
55609,
198,
22818,
1988,
11,
6773,
1148,
311,
656,
627,
9905,
198,
2295,
14978,
23566,
1389,
40961,
279,
445,
11237,
706,
4529,
311,
2457,
345,
39393,
449,
24654,
198,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
2573,
38938,
1148,
5507,
311,
1005,
627,
693,
1284,
18033,
9852,
7,
22928,
1284,
7153,
9209,
25,
610,
11,
29539,
23566,
25,
1796,
20961,
6189,
58,
17230,
2573,
11,
610,
21128,
3146,
9872,
25,
5884,
8,
11651,
21372,
26748,
55609,
198,
5715,
2077,
994,
8479,
706,
1027,
10717,
4245,
311,
1973,
26771,
627,
6766,
4971,
2703,
25,
9323,
58,
1858,
11,
610,
2526,
11651,
2290,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
627,
13617,
512,
497,
2082,
9612,
487,
10344,
198,
2,
1442,
3318,
449,
8479,
32658,
198,
8252,
45249,
5799,
4971,
2703,
45221,
2398,
14,
8252,
34506,
863,
340,
14506,
14334,
61082,
37335,
368,
11651,
30226,
55609,
198,
16503,
9788,
62521,
4194,
8345,
4194,
682,
5151,
55609,
198,
18409,
430,
10137,
9248,
3645,
627,
3784,
9507,
76,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
9507,
76,
1650,
449,
627,
3784,
22695,
14301,
25,
610,
55609,
198,
14672,
311,
8911,
279,
22695,
449,
627,
3784,
471,
9324,
25,
1796,
17752,
60,
55609,
198,
5715,
2819,
315,
279,
8479,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.base.StructuredChatAgent.html |
8c480cbb6a19-0 | langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit¶
class langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit(*, tools: List[BaseTool] = [])[source]¶
Bases: BaseToolkit
Jira Toolkit.
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 tools: List[langchain.tools.base.BaseTool] = []¶
classmethod from_jira_api_wrapper(jira_api_wrapper: JiraAPIWrapper) → JiraToolkit[source]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
1190,
9008,
21966,
8390,
3587,
9008,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
1190,
9008,
21966,
8390,
3587,
9008,
63044,
4163,
11,
7526,
25,
1796,
58,
4066,
7896,
60,
284,
510,
41105,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
41,
9008,
55876,
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,
7526,
25,
1796,
58,
5317,
8995,
24029,
9105,
13316,
7896,
60,
284,
3132,
55609,
198,
27853,
505,
5487,
9008,
11959,
24474,
3406,
9008,
11959,
24474,
25,
622,
9008,
7227,
11803,
8,
11651,
622,
9008,
63044,
76747,
60,
55609,
198,
456,
40823,
368,
11651,
1796,
58,
4066,
7896,
1483,
2484,
60,
55609,
198,
1991,
279,
7526,
304,
279,
66994,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.jira.toolkit.JiraToolkit.html |
cb4f53989cb3-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing(*, name: str = 'requests_get', description: str = 'Use this to GET content from a website.\nInput to the tool should be a json string with 3 keys: "url", "params" and "output_instructions".\nThe value of "url" should be a string. \nThe value of "params" should be a dict of the needed and available parameters from the OpenAPI spec related to the endpoint. \nIf parameters are not needed, or not available, leave it empty.\nThe value of "output_instructions" should be instructions on what information to extract from the response, \nfor example the id(s) for a resource(s) that the GET request fetches.\n', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False, requests_wrapper: TextRequestsWrapper, response_length: Optional[int] = 5000, llm_chain: LLMChain = None)[source]¶
Bases: BaseRequestsTool, BaseTool
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 args_schema: Optional[Type[BaseModel]] = None¶
Pydantic model class to validate and parse the tool’s input arguments.
param callback_manager: Optional[BaseCallbackManager] = None¶
Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
1991,
7896,
2409,
69939,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
1991,
7896,
2409,
69939,
4163,
11,
836,
25,
610,
284,
364,
37342,
3138,
518,
4096,
25,
610,
284,
364,
10464,
420,
311,
8049,
2262,
505,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
3603,
1,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
13,
1144,
89330,
907,
315,
330,
3603,
1,
1288,
387,
264,
6587,
315,
279,
4460,
323,
2561,
5137,
505,
279,
5377,
7227,
1424,
5552,
311,
279,
15233,
13,
1144,
77,
2746,
5137,
527,
539,
4460,
11,
477,
539,
2561,
11,
5387,
433,
4384,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
1144,
77,
2000,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
8049,
1715,
7963,
288,
7255,
77,
518,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
11,
471,
33971,
25,
1845,
284,
3641,
11,
14008,
25,
1845,
284,
3641,
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,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
11,
7540,
24474,
25,
2991,
36395,
11803,
11,
2077,
5228,
25,
12536,
19155,
60,
284,
220,
2636,
15,
11,
9507,
76,
31683,
25,
445,
11237,
19368,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
36395,
7896,
11,
5464,
7896,
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,
2897,
26443,
25,
12536,
58,
941,
58,
4066,
1747,
5163,
284,
2290,
55609,
198,
14149,
67,
8322,
1646,
538,
311,
9788,
323,
4820,
279,
5507,
753,
1988,
6105,
627,
913,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
55609,
198,
52444,
13,
5321,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
cb4f53989cb3-1 | Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this to GET content from a website.\nInput to the tool should be a json string with 3 keys: "url", "params" and "output_instructions".\nThe value of "url" should be a string. \nThe value of "params" should be a dict of the needed and available parameters from the OpenAPI spec related to the endpoint. \nIf parameters are not needed, or not available, leave it empty.\nThe value of "output_instructions" should be instructions on what information to extract from the response, \nfor example the id(s) for a resource(s) that the GET request fetches.\n'¶
Used to tell the model how/when/why to use the tool.
You can provide few-shot examples as a part of the description.
param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶
Handle the content of the ToolException thrown.
param llm_chain: langchain.chains.llm.LLMChain [Optional]¶
param name: str = 'requests_get'¶
The unique name of the tool that clearly communicates its purpose.
param requests_wrapper: TextRequestsWrapper [Required]¶
param response_length: Optional[int] = 5000¶
param return_direct: bool = False¶
Whether to return the tool’s output directly. Setting this to True means
that after the tool is called, the AgentExecutor will stop looping.
param verbose: bool = False¶
Whether to log the tool’s progress.
__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶
Make tool callable. | [
52444,
13,
5321,
1005,
27777,
4619,
627,
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
627,
913,
4096,
25,
610,
284,
364,
10464,
420,
311,
8049,
2262,
505,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
3603,
1,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
13,
1144,
89330,
907,
315,
330,
3603,
1,
1288,
387,
264,
6587,
315,
279,
4460,
323,
2561,
5137,
505,
279,
5377,
7227,
1424,
5552,
311,
279,
15233,
13,
1144,
77,
2746,
5137,
527,
539,
4460,
11,
477,
539,
2561,
11,
5387,
433,
4384,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
1144,
77,
2000,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
8049,
1715,
7963,
288,
7255,
77,
6,
55609,
198,
23580,
311,
3371,
279,
1646,
1268,
14,
9493,
14,
35734,
311,
1005,
279,
5507,
627,
2675,
649,
3493,
2478,
64630,
10507,
439,
264,
961,
315,
279,
4096,
627,
913,
3790,
23627,
4188,
25,
12536,
58,
33758,
58,
2707,
11,
610,
11,
54223,
15873,
7896,
1378,
1145,
610,
5163,
60,
284,
3641,
55609,
198,
7144,
279,
2262,
315,
279,
13782,
1378,
15338,
627,
913,
9507,
76,
31683,
25,
8859,
8995,
5442,
1771,
60098,
76,
1236,
11237,
19368,
510,
15669,
60,
55609,
198,
913,
836,
25,
610,
284,
364,
37342,
3138,
6,
55609,
198,
791,
5016,
836,
315,
279,
5507,
430,
9539,
92606,
1202,
7580,
627,
913,
7540,
24474,
25,
2991,
36395,
11803,
510,
8327,
60,
55609,
198,
913,
2077,
5228,
25,
12536,
19155,
60,
284,
220,
2636,
15,
55609,
198,
913,
471,
33971,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
471,
279,
5507,
753,
2612,
6089,
13,
20638,
420,
311,
3082,
3445,
198,
9210,
1306,
279,
5507,
374,
2663,
11,
279,
21372,
26321,
690,
3009,
63687,
627,
913,
14008,
25,
1845,
284,
3641,
55609,
198,
25729,
311,
1515,
279,
5507,
753,
5208,
627,
565,
6797,
3889,
14506,
6022,
25,
610,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
8,
11651,
610,
55609,
198,
8238,
5507,
42022,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
cb4f53989cb3-2 | Make tool callable.
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool asynchronously.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Any¶
Run the tool.
property args: dict¶
property is_single_input: bool¶
Whether the tool only accepts a single input.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
8238,
5507,
42022,
627,
7847,
802,
359,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
68881,
627,
16503,
4933,
2310,
70693,
4194,
8345,
4194,
682,
5151,
55609,
198,
94201,
409,
70693,
10163,
422,
4927,
12418,
374,
1511,
627,
6236,
50050,
6022,
25,
9323,
17752,
11,
30226,
1145,
14008,
25,
12536,
58,
2707,
60,
284,
2290,
11,
1212,
6855,
25,
12536,
17752,
60,
284,
364,
13553,
518,
1933,
25,
12536,
17752,
60,
284,
364,
13553,
518,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
3146,
9872,
25,
5884,
8,
11651,
5884,
55609,
198,
6869,
279,
5507,
627,
3784,
2897,
25,
6587,
55609,
198,
3784,
374,
20052,
6022,
25,
1845,
55609,
198,
25729,
279,
5507,
1193,
27441,
264,
3254,
1988,
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/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsGetToolWithParsing.html |
1b7fea618b48-0 | langchain.agents.load_tools.get_all_tool_names¶
langchain.agents.load_tools.get_all_tool_names() → List[str][source]¶
Get a list of all possible tool names. | [
5317,
8995,
29192,
812,
5214,
40823,
673,
5823,
23627,
9366,
55609,
198,
5317,
8995,
29192,
812,
5214,
40823,
673,
5823,
23627,
9366,
368,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
1991,
264,
1160,
315,
682,
3284,
5507,
5144,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.load_tools.get_all_tool_names.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.