id
stringlengths 14
15
| text
stringlengths 35
2.07k
| embedding
sequence | source
stringlengths 61
154
|
---|---|---|---|
9bc375ac23d6-0 | langchain.agents.react.base.ReActChain¶
class langchain.agents.react.base.ReActChain(llm: BaseLanguageModel, docstore: Docstore, *, 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 implements the ReAct paper.
Example
from langchain import ReActChain, OpenAI
react = ReAct(llm=OpenAI())
Initialize with the LLM and a docstore.
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.
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 | [
5317,
8995,
29192,
812,
55782,
9105,
2887,
2471,
19368,
55609,
198,
1058,
8859,
8995,
29192,
812,
55782,
9105,
2887,
2471,
19368,
36621,
76,
25,
5464,
14126,
1747,
11,
4733,
4412,
25,
22452,
4412,
11,
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,
5280,
279,
1050,
2471,
5684,
627,
13617,
198,
1527,
8859,
8995,
1179,
1050,
2471,
19368,
11,
5377,
15836,
198,
3007,
284,
1050,
2471,
36621,
76,
28,
5109,
15836,
2455,
10130,
449,
279,
445,
11237,
323,
264,
4733,
4412,
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.react.base.ReActChain.html |
9bc375ac23d6-1 | 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.
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 | [
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.react.base.ReActChain.html |
9bc375ac23d6-2 | 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.
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 | [
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.react.base.ReActChain.html |
9bc375ac23d6-3 | 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¶
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. | [
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,
198,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.react.base.ReActChain.html |
9bc375ac23d6-4 | 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]¶
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¶ | [
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,
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.react.base.ReActChain.html |
75efc7a9da87-0 | langchain.agents.mrkl.output_parser.MRKLOutputParser¶
class langchain.agents.mrkl.output_parser.MRKLOutputParser[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¶ | [
5317,
8995,
29192,
812,
749,
81,
10784,
13718,
19024,
1345,
78120,
1623,
332,
631,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
749,
81,
10784,
13718,
19024,
1345,
78120,
1623,
332,
631,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html |
75efc7a9da87-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html |
706014b309b0-0 | langchain.agents.agent_toolkits.office365.toolkit.O365Toolkit¶
class langchain.agents.agent_toolkits.office365.toolkit.O365Toolkit(*, account: Account = None)[source]¶
Bases: BaseToolkit
Toolkit for interacting with Office365.
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 account: Account [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,
100193,
12676,
21966,
8390,
8548,
12676,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
100193,
12676,
21966,
8390,
8548,
12676,
63044,
4163,
11,
2759,
25,
8785,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
8410,
12676,
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,
2759,
25,
8785,
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.office365.toolkit.O365Toolkit.html |
38faff5b6c60-0 | langchain.agents.structured_chat.output_parser.StructuredChatOutputParser¶
class langchain.agents.structured_chat.output_parser.StructuredChatOutputParser[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¶ | [
5317,
8995,
29192,
812,
13,
52243,
36153,
13718,
19024,
52545,
3149,
16047,
5207,
6707,
55609,
198,
1058,
8859,
8995,
29192,
812,
13,
52243,
36153,
13718,
19024,
52545,
3149,
16047,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParser.html |
38faff5b6c60-1 | property lc_serializable: bool¶
Return whether or not the class is serializable.
model Config¶
Bases: object
extra = 'ignore'¶ | [
3784,
37313,
26684,
8499,
25,
1845,
55609,
198,
5715,
3508,
477,
539,
279,
538,
374,
6275,
8499,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParser.html |
2df55740ef52-0 | langchain.agents.agent.BaseMultiActionAgent¶
class langchain.agents.agent.BaseMultiActionAgent[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[List[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
Actions specifying what tool to use.
dict(**kwargs: Any) → Dict[source]¶
Return dictionary representation of agent.
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[List[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
Actions 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[source]¶
Save the agent.
Parameters
file_path – Path to file to save the agent to. | [
5317,
8995,
29192,
812,
45249,
13316,
20981,
2573,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
13316,
20981,
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,
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,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
13245,
38938,
1148,
5507,
311,
1005,
627,
8644,
22551,
9872,
25,
5884,
8,
11651,
30226,
76747,
60,
55609,
198,
5715,
11240,
13340,
315,
8479,
627,
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,
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,
69411,
1389,
23499,
82,
311,
1629,
627,
334,
9872,
1389,
2724,
11374,
627,
16851,
198,
13245,
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,
76747,
60,
55609,
198,
8960,
279,
8479,
627,
9905,
198,
1213,
2703,
1389,
8092,
311,
1052,
311,
3665,
279,
8479,
311,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent.BaseMultiActionAgent.html |
2df55740ef52-1 | 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. | [
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.BaseMultiActionAgent.html |
a7ac4119ab7e-0 | langchain.agents.react.base.ReActDocstoreAgent¶
class langchain.agents.react.base.ReActDocstoreAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None)[source]¶
Bases: Agent
Agent for the ReAct 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: 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]¶
Return default prompt.
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]]¶
get_full_inputs(intermediate_steps: List[Tuple[AgentAction, str]], **kwargs: Any) → Dict[str, Any]¶ | [
5317,
8995,
29192,
812,
55782,
9105,
2887,
2471,
9743,
4412,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
55782,
9105,
2887,
2471,
9743,
4412,
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,
1050,
2471,
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,
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,
5715,
1670,
10137,
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,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.react.base.ReActDocstoreAgent.html |
a7ac4119ab7e-1 | 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. | [
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.react.base.ReActDocstoreAgent.html |
5f03478cb6a2-0 | langchain.agents.conversational_chat.base.ConversationalChatAgent¶
class langchain.agents.conversational_chat.base.ConversationalChatAgent(*, llm_chain: LLMChain, output_parser: AgentOutputParser = None, allowed_tools: Optional[List[str]] = None, template_tool_response: str = "TOOL RESPONSE: \n---------------------\n{observation}\n\nUSER'S INPUT\n--------------------\n\nOkay, so what is the response to my last comment? If using information obtained from the tools you must mention it explicitly without mentioning the tool names - I have forgotten all TOOL RESPONSES! Remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else.")[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 allowed_tools: Optional[List[str]] = None¶
param llm_chain: langchain.chains.llm.LLMChain [Required]¶
param output_parser: langchain.agents.agent.AgentOutputParser [Optional]¶
param template_tool_response: str = "TOOL RESPONSE: \n---------------------\n{observation}\n\nUSER'S INPUT\n--------------------\n\nOkay, so what is the response to my last comment? If using information obtained from the tools you must mention it explicitly without mentioning the tool names - I have forgotten all TOOL RESPONSES! Remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else."¶
async aplan(intermediate_steps: List[Tuple[AgentAction, str]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[AgentAction, AgentFinish]¶ | [
5317,
8995,
29192,
812,
2932,
3078,
1697,
36153,
9105,
4906,
3078,
1697,
16047,
17230,
55609,
198,
1058,
8859,
8995,
29192,
812,
2932,
3078,
1697,
36153,
9105,
4906,
3078,
1697,
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,
11,
3896,
23627,
9852,
25,
610,
284,
330,
5319,
1971,
77273,
25,
1144,
77,
776,
15431,
59,
77,
90,
79060,
11281,
77,
1734,
6584,
13575,
27241,
1734,
98804,
59,
77,
1734,
33413,
11,
779,
1148,
374,
279,
2077,
311,
856,
1566,
4068,
30,
1442,
1701,
2038,
12457,
505,
279,
7526,
499,
2011,
6420,
433,
21650,
2085,
45391,
279,
5507,
5144,
482,
358,
617,
25565,
682,
93913,
77273,
50,
0,
20474,
311,
6013,
449,
264,
51594,
2082,
44165,
315,
264,
3024,
24295,
449,
264,
3254,
1957,
11,
323,
87181,
775,
13,
17573,
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,
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,
913,
3896,
23627,
9852,
25,
610,
284,
330,
5319,
1971,
77273,
25,
1144,
77,
776,
15431,
59,
77,
90,
79060,
11281,
77,
1734,
6584,
13575,
27241,
1734,
98804,
59,
77,
1734,
33413,
11,
779,
1148,
374,
279,
2077,
311,
856,
1566,
4068,
30,
1442,
1701,
2038,
12457,
505,
279,
7526,
499,
2011,
6420,
433,
21650,
2085,
45391,
279,
5507,
5144,
482,
358,
617,
25565,
682,
93913,
77273,
50,
0,
20474,
311,
6013,
449,
264,
51594,
2082,
44165,
315,
264,
3024,
24295,
449,
264,
3254,
1957,
11,
323,
87181,
775,
1210,
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
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
5f03478cb6a2-1 | 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. | [
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_chat.base.ConversationalChatAgent.html |
5f03478cb6a2-2 | **kwargs – User inputs.
Returns
Action specifying what tool to use.
classmethod create_prompt(tools: Sequence[BaseTool], system_message: 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 system 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.', human_message: 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}}}}", input_variables: Optional[List[str]] = None, output_parser: Optional[BaseOutputParser] = None) → BasePromptTemplate[source]¶
Create a prompt for this class. | [
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,
1887,
6598,
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,
1887,
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,
16045,
3823,
6598,
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,
498,
1988,
29282,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
2612,
19024,
25,
12536,
58,
4066,
5207,
6707,
60,
284,
2290,
8,
11651,
5464,
55715,
7423,
76747,
60,
55609,
198,
4110,
264,
10137,
369,
420,
538,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html |
5f03478cb6a2-3 | Create a prompt for this class.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of agent. | [
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.conversational_chat.base.ConversationalChatAgent.html |
5f03478cb6a2-4 | classmethod from_llm_and_tools(llm: BaseLanguageModel, tools: Sequence[BaseTool], callback_manager: Optional[BaseCallbackManager] = None, output_parser: Optional[AgentOutputParser] = None, system_message: 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 system 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.', human_message: 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}}}}", input_variables: Optional[List[str]] = None, **kwargs: Any) → Agent[source]¶ | [
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,
1887,
6598,
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,
1887,
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,
16045,
3823,
6598,
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,
498,
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_chat.base.ConversationalChatAgent.html |
5f03478cb6a2-5 | 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_chat.base.ConversationalChatAgent.html |
a7dffda63ed1-0 | langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit¶
class langchain.agents.agent_toolkits.sql.toolkit.SQLDatabaseToolkit(*, db: SQLDatabase, llm: BaseLanguageModel)[source]¶
Bases: BaseToolkit
Toolkit for interacting with SQL databases.
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.sql_database.SQLDatabase [Required]¶
param llm: langchain.base_language.BaseLanguageModel [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit.
property dialect: str¶
Return string representation of dialect to use.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
10251,
21966,
8390,
26151,
6116,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
10251,
21966,
8390,
26151,
6116,
63044,
4163,
11,
3000,
25,
8029,
6116,
11,
9507,
76,
25,
5464,
14126,
1747,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
8029,
32906,
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,
10251,
28441,
26151,
6116,
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,
3784,
43379,
25,
610,
55609,
198,
5715,
925,
13340,
315,
43379,
311,
1005,
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.sql.toolkit.SQLDatabaseToolkit.html |
27cfedb102f6-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing(*, name: str = 'requests_post', description: str = 'Use this when you want to POST to a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "data" should be a dictionary of key-value pairs you want to POST to the url.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the POST request creates.\nAlways use double quotes for strings in the json string.', 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¶
Callbacks to be called during tool execution. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
4226,
7896,
2409,
69939,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
4226,
7896,
2409,
69939,
4163,
11,
836,
25,
610,
284,
364,
37342,
6467,
518,
4096,
25,
610,
284,
364,
10464,
420,
994,
499,
1390,
311,
13165,
311,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
695,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
695,
1,
1288,
387,
264,
11240,
315,
1401,
19625,
13840,
499,
1390,
311,
13165,
311,
279,
2576,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
13165,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
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,
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,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsPostToolWithParsing.html |
27cfedb102f6-1 | param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this when you want to POST to a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "data" should be a dictionary of key-value pairs you want to POST to the url.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the POST request creates.\nAlways use double quotes for strings in the json string.'¶
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_post'¶
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. | [
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,
994,
499,
1390,
311,
13165,
311,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
695,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
695,
1,
1288,
387,
264,
11240,
315,
1401,
19625,
13840,
499,
1390,
311,
13165,
311,
279,
2576,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
13165,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
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,
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,
6467,
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.RequestsPostToolWithParsing.html |
27cfedb102f6-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.RequestsPostToolWithParsing.html |
f3a12aaff443-0 | langchain.agents.agent_toolkits.python.base.create_python_agent¶
langchain.agents.agent_toolkits.python.base.create_python_agent(llm: BaseLanguageModel, tool: PythonREPLTool, agent_type: AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = False, prefix: str = 'You are an agent designed to write and execute python code to answer questions.\nYou have access to a python REPL, which you can use to execute python code.\nIf you get an error, debug your code and try again.\nOnly use the output of your code to answer the question. \nYou might know the answer without running any code, but you should still run the code to get the answer.\nIf it does not seem like you can write code to answer the question, just return "I don\'t know" as the answer.\n', agent_executor_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Dict[str, Any]) → AgentExecutor[source]¶
Construct a python agent from an LLM and tool. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
44293,
9105,
2581,
56969,
26814,
55609,
198,
5317,
8995,
29192,
812,
45249,
23627,
90517,
44293,
9105,
2581,
56969,
26814,
36621,
76,
25,
5464,
14126,
1747,
11,
5507,
25,
13325,
793,
2989,
7896,
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,
14008,
25,
1845,
284,
3641,
11,
9436,
25,
610,
284,
364,
2675,
527,
459,
8479,
6319,
311,
3350,
323,
9203,
10344,
2082,
311,
4320,
4860,
7255,
77,
2675,
617,
2680,
311,
264,
10344,
93680,
11,
902,
499,
649,
1005,
311,
9203,
10344,
2082,
7255,
77,
2746,
499,
636,
459,
1493,
11,
7542,
701,
2082,
323,
1456,
1578,
7255,
77,
7456,
1005,
279,
2612,
315,
701,
2082,
311,
4320,
279,
3488,
13,
1144,
77,
2675,
2643,
1440,
279,
4320,
2085,
4401,
904,
2082,
11,
719,
499,
1288,
2103,
1629,
279,
2082,
311,
636,
279,
4320,
7255,
77,
2746,
433,
1587,
539,
2873,
1093,
499,
649,
3350,
2082,
311,
4320,
279,
3488,
11,
1120,
471,
330,
40,
1541,
10379,
83,
1440,
1,
439,
279,
4320,
7255,
77,
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,
10344,
8479,
505,
459,
445,
11237,
323,
5507,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.python.base.create_python_agent.html |
2cb749a30fa7-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing(*, name: str = 'requests_delete', description: str = 'ONLY USE THIS TOOL WHEN THE USER HAS SPECIFICALLY REQUESTED TO DELETE CONTENT FROM A WEBSITE.\nInput to the tool should be a json string with 2 keys: "url", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the DELETE request creates.\nAlways use double quotes for strings in the json string.\nONLY USE THIS TOOL IF THE USER HAS SPECIFICALLY REQUESTED TO DELETE SOMETHING.', 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¶
Callbacks to be called during tool execution. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
6571,
7896,
2409,
69939,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
6571,
7896,
2409,
69939,
4163,
11,
836,
25,
610,
284,
364,
37342,
11607,
518,
4096,
25,
610,
284,
364,
32192,
9645,
10245,
93913,
34733,
3247,
14194,
36848,
48204,
34735,
29555,
34516,
1507,
5257,
17640,
36868,
4393,
362,
20255,
77946,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
17,
7039,
25,
330,
1103,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
17640,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
7255,
77,
32192,
9645,
10245,
93913,
11812,
3247,
14194,
36848,
48204,
34735,
29555,
34516,
1507,
5257,
17640,
74390,
7780,
1753,
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,
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,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.agent_toolkits.openapi.planner.RequestsDeleteToolWithParsing.html |
2cb749a30fa7-1 | param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'ONLY USE THIS TOOL WHEN THE USER HAS SPECIFICALLY REQUESTED TO DELETE CONTENT FROM A WEBSITE.\nInput to the tool should be a json string with 2 keys: "url", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the DELETE request creates.\nAlways use double quotes for strings in the json string.\nONLY USE THIS TOOL IF THE USER HAS SPECIFICALLY REQUESTED TO DELETE SOMETHING.'¶
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_delete'¶
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. | [
913,
27777,
25,
23499,
82,
284,
2290,
55609,
198,
45561,
311,
387,
2663,
2391,
5507,
11572,
627,
913,
4096,
25,
610,
284,
364,
32192,
9645,
10245,
93913,
34733,
3247,
14194,
36848,
48204,
34735,
29555,
34516,
1507,
5257,
17640,
36868,
4393,
362,
20255,
77946,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
17,
7039,
25,
330,
1103,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
17640,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
7255,
77,
32192,
9645,
10245,
93913,
11812,
3247,
14194,
36848,
48204,
34735,
29555,
34516,
1507,
5257,
17640,
74390,
7780,
1753,
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,
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,
11607,
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.RequestsDeleteToolWithParsing.html |
2cb749a30fa7-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.RequestsDeleteToolWithParsing.html |
b4a26f0d7645-0 | langchain.agents.agent_toolkits.json.toolkit.JsonToolkit¶
class langchain.agents.agent_toolkits.json.toolkit.JsonToolkit(*, spec: JsonSpec)[source]¶
Bases: BaseToolkit
Toolkit for interacting with a JSON spec.
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 spec: langchain.tools.json.tool.JsonSpec [Required]¶
get_tools() → List[BaseTool][source]¶
Get the tools in the toolkit. | [
5317,
8995,
29192,
812,
45249,
23627,
90517,
4421,
21966,
8390,
13874,
63044,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
4421,
21966,
8390,
13874,
63044,
4163,
11,
1424,
25,
8472,
8491,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
63044,
198,
63044,
369,
45830,
449,
264,
4823,
1424,
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,
1424,
25,
8859,
8995,
24029,
4421,
21966,
13874,
8491,
510,
8327,
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.json.toolkit.JsonToolkit.html |
891c5fd0822c-0 | langchain.agents.mrkl.base.MRKLChain¶
class langchain.agents.mrkl.base.MRKLChain(*, 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 implements the MRKL system.
Example
from langchain import OpenAI, MRKLChain
from langchain.chains.mrkl.base import ChainConfig
llm = OpenAI(temperature=0)
prompt = PromptTemplate(...)
chains = [...]
mrkl = MRKLChain.from_chains(llm=llm, prompt=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 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, | [
5317,
8995,
29192,
812,
749,
81,
10784,
9105,
1345,
49,
54083,
19368,
55609,
198,
1058,
8859,
8995,
29192,
812,
749,
81,
10784,
9105,
1345,
49,
54083,
19368,
4163,
11,
5044,
25,
12536,
58,
4066,
10869,
60,
284,
2290,
11,
27777,
25,
12536,
58,
33758,
53094,
58,
4066,
7646,
3126,
1145,
5464,
7646,
2087,
5163,
284,
2290,
11,
4927,
12418,
25,
12536,
58,
4066,
7646,
2087,
60,
284,
2290,
11,
14008,
25,
1845,
284,
2290,
11,
9681,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
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,
5280,
279,
29433,
54083,
1887,
627,
13617,
198,
1527,
8859,
8995,
1179,
5377,
15836,
11,
29433,
54083,
19368,
198,
1527,
8859,
8995,
5442,
1771,
749,
81,
10784,
9105,
1179,
29625,
2714,
198,
657,
76,
284,
5377,
15836,
7,
35658,
28,
15,
340,
41681,
284,
60601,
7423,
73893,
59458,
284,
16702,
933,
21620,
10784,
284,
29433,
54083,
19368,
6521,
4231,
1771,
36621,
76,
28,
657,
76,
11,
10137,
17841,
15091,
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,
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,
11
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
891c5fd0822c-1 | Callback handlers are called throughout the lifecycle of a call to a chain,
starting with on_chain_start, ending with on_chain_end or on_chain_error.
Each custom chain can optionally call additional callback methods, see Callback docs
for full details.
param 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. | [
7646,
25050,
527,
2663,
6957,
279,
48608,
315,
264,
1650,
311,
264,
8957,
345,
40389,
449,
389,
31683,
5011,
11,
13696,
449,
389,
31683,
6345,
477,
389,
31683,
4188,
627,
4959,
2587,
8957,
649,
46624,
1650,
5217,
4927,
5528,
11,
1518,
23499,
27437,
198,
2000,
2539,
3649,
627,
913,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
891c5fd0822c-2 | them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full catalog.
param 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. | [
49818,
3235,
304,
279,
8957,
13,
2468,
279,
842,
11,
433,
27024,
904,
6052,
7482,
627,
3947,
527,
1690,
2204,
4595,
315,
5044,
482,
4587,
1518,
5044,
27437,
198,
2000,
279,
2539,
16808,
627,
913,
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.mrkl.base.MRKLChain.html |
891c5fd0822c-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.mrkl.base.MRKLChain.html |
891c5fd0822c-4 | Create from agent and tools.
classmethod from_chains(llm: BaseLanguageModel, chains: List[ChainConfig], **kwargs: Any) → AgentExecutor[source]¶
User friendly way to initialize the MRKL chain.
This is intended to be an easy way to get up and running with the
MRKL chain.
Parameters
llm – The LLM to use as the agent LLM.
chains – The chains the MRKL system has access to.
**kwargs – parameters to be passed to initialization.
Returns
An initialized MRKL chain.
Example
from langchain import LLMMathChain, OpenAI, SerpAPIWrapper, MRKLChain
from langchain.chains.mrkl.base import ChainConfig
llm = OpenAI(temperature=0)
search = SerpAPIWrapper()
llm_math_chain = LLMMathChain(llm=llm)
chains = [
ChainConfig(
action_name = "Search",
action=search.search,
action_description="useful for searching"
),
ChainConfig(
action_name="Calculator",
action=llm_math_chain.run,
action_description="useful for doing math"
)
]
mrkl = MRKLChain.from_chains(llm, chains)
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. | [
4110,
505,
8479,
323,
7526,
627,
27853,
505,
4231,
1771,
36621,
76,
25,
5464,
14126,
1747,
11,
27271,
25,
1796,
58,
19368,
2714,
1145,
3146,
9872,
25,
5884,
8,
11651,
21372,
26321,
76747,
60,
55609,
198,
1502,
11919,
1648,
311,
9656,
279,
29433,
54083,
8957,
627,
2028,
374,
10825,
311,
387,
459,
4228,
1648,
311,
636,
709,
323,
4401,
449,
279,
198,
18953,
54083,
8957,
627,
9905,
198,
657,
76,
1389,
578,
445,
11237,
311,
1005,
439,
279,
8479,
445,
11237,
627,
59458,
1389,
578,
27271,
279,
29433,
54083,
1887,
706,
2680,
311,
627,
334,
9872,
1389,
5137,
311,
387,
5946,
311,
17923,
627,
16851,
198,
2127,
17719,
29433,
54083,
8957,
627,
13617,
198,
1527,
8859,
8995,
1179,
20072,
8195,
589,
19368,
11,
5377,
15836,
11,
8409,
79,
7227,
11803,
11,
29433,
54083,
19368,
198,
1527,
8859,
8995,
5442,
1771,
749,
81,
10784,
9105,
1179,
29625,
2714,
198,
657,
76,
284,
5377,
15836,
7,
35658,
28,
15,
340,
1874,
284,
8409,
79,
7227,
11803,
746,
657,
76,
66661,
31683,
284,
20072,
8195,
589,
19368,
36621,
76,
28,
657,
76,
340,
59458,
284,
2330,
262,
29625,
2714,
1021,
286,
1957,
1292,
284,
330,
6014,
761,
286,
1957,
97698,
9472,
345,
286,
1957,
11703,
429,
817,
1285,
369,
15389,
702,
262,
2907,
262,
29625,
2714,
1021,
286,
1957,
1292,
429,
56843,
761,
286,
1957,
28,
657,
76,
66661,
31683,
7789,
345,
286,
1957,
11703,
429,
817,
1285,
369,
3815,
7033,
702,
262,
1763,
933,
21620,
10784,
284,
29433,
54083,
19368,
6521,
4231,
1771,
36621,
76,
11,
27271,
340,
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,
13
] | https://langchain.readthedocs.io/en/latest/agents/langchain.agents.mrkl.base.MRKLChain.html |
891c5fd0822c-5 | Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
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]¶
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¶ | [
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,
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.mrkl.base.MRKLChain.html |
a7ed6418a739-0 | langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing¶
class langchain.agents.agent_toolkits.openapi.planner.RequestsPatchToolWithParsing(*, name: str = 'requests_patch', description: str = 'Use this when you want to PATCH content on a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "data" should be a dictionary of key-value pairs of the body params available in the OpenAPI spec you want to PATCH the content with at the url.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the PATCH request creates.\nAlways use double quotes for strings in the json string.', 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,
44722,
7896,
2409,
69939,
55609,
198,
1058,
8859,
8995,
29192,
812,
45249,
23627,
90517,
59920,
8022,
4992,
9856,
82,
44722,
7896,
2409,
69939,
4163,
11,
836,
25,
610,
284,
364,
37342,
40743,
518,
4096,
25,
610,
284,
364,
10464,
420,
994,
499,
1390,
311,
60445,
2262,
389,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
695,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
695,
1,
1288,
387,
264,
11240,
315,
1401,
19625,
13840,
315,
279,
2547,
3712,
2561,
304,
279,
5377,
7227,
1424,
499,
1390,
311,
60445,
279,
2262,
449,
520,
279,
2576,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
60445,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
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,
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.RequestsPatchToolWithParsing.html |
a7ed6418a739-1 | Deprecated. Please use callbacks instead.
param callbacks: Callbacks = None¶
Callbacks to be called during tool execution.
param description: str = 'Use this when you want to PATCH content on a website.\nInput to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".\nThe value of "url" should be a string.\nThe value of "data" should be a dictionary of key-value pairs of the body params available in the OpenAPI spec you want to PATCH the content with at the url.\nThe value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the PATCH request creates.\nAlways use double quotes for strings in the json string.'¶
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_patch'¶
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,
994,
499,
1390,
311,
60445,
2262,
389,
264,
3997,
7255,
77,
2566,
311,
279,
5507,
1288,
387,
264,
3024,
925,
449,
220,
18,
7039,
25,
330,
1103,
498,
330,
695,
498,
323,
330,
3081,
83527,
3343,
59,
89330,
907,
315,
330,
1103,
1,
1288,
387,
264,
925,
7255,
89330,
907,
315,
330,
695,
1,
1288,
387,
264,
11240,
315,
1401,
19625,
13840,
315,
279,
2547,
3712,
2561,
304,
279,
5377,
7227,
1424,
499,
1390,
311,
60445,
279,
2262,
449,
520,
279,
2576,
7255,
89330,
907,
315,
330,
3081,
83527,
1,
1288,
387,
11470,
389,
1148,
2038,
311,
8819,
505,
279,
2077,
11,
369,
3187,
279,
887,
1161,
8,
369,
264,
5211,
1161,
8,
430,
279,
60445,
1715,
11705,
7255,
77,
38195,
1005,
2033,
17637,
369,
9246,
304,
279,
3024,
925,
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,
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,
40743,
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.RequestsPatchToolWithParsing.html |
a7ed6418a739-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.RequestsPatchToolWithParsing.html |
79148421a80a-0 | langchain.server.main¶
langchain.server.main() → None[source]¶
Run the langchain server locally. | [
5317,
8995,
12926,
9056,
55609,
198,
5317,
8995,
12926,
9056,
368,
11651,
2290,
76747,
60,
55609,
198,
6869,
279,
8859,
8995,
3622,
24392,
13
] | https://langchain.readthedocs.io/en/latest/server/langchain.server.main.html |
1cd33a070715-0 | langchain.utils.stringify_value¶
langchain.utils.stringify_value(val: Any) → str[source]¶
Stringify a value.
Parameters
val – The value to stringify.
Returns
The stringified value.
Return type
str | [
5317,
8995,
8576,
10258,
3220,
55609,
198,
5317,
8995,
8576,
10258,
3220,
9276,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
707,
1463,
264,
907,
627,
9905,
198,
838,
1389,
578,
907,
311,
84266,
627,
16851,
198,
791,
925,
1908,
907,
627,
5715,
955,
198,
496
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.stringify_value.html |
f293efb93458-0 | langchain.utils.get_from_env¶
langchain.utils.get_from_env(key: str, env_key: str, default: Optional[str] = None) → str[source]¶
Get a value from a dictionary or an environment variable. | [
5317,
8995,
8576,
673,
5791,
16258,
55609,
198,
5317,
8995,
8576,
673,
5791,
16258,
4962,
25,
610,
11,
6233,
3173,
25,
610,
11,
1670,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
264,
907,
505,
264,
11240,
477,
459,
4676,
3977,
13
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.get_from_env.html |
36220f56223a-0 | langchain.utils.guard_import¶
langchain.utils.guard_import(module_name: str, *, pip_name: Optional[str] = None, package: Optional[str] = None) → Any[source]¶
Dynamically imports a module and raises a helpful exception if the module is not
installed. | [
5317,
8995,
8576,
74629,
18941,
55609,
198,
5317,
8995,
8576,
74629,
18941,
19669,
1292,
25,
610,
11,
12039,
24547,
1292,
25,
12536,
17752,
60,
284,
2290,
11,
6462,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
5884,
76747,
60,
55609,
198,
35,
11694,
2740,
15557,
264,
4793,
323,
25930,
264,
11190,
4788,
422,
279,
4793,
374,
539,
198,
50673,
13
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.guard_import.html |
bf0d404f79f8-0 | langchain.utils.get_from_dict_or_env¶
langchain.utils.get_from_dict_or_env(data: Dict[str, Any], key: str, env_key: str, default: Optional[str] = None) → str[source]¶
Get a value from a dictionary or an environment variable. | [
5317,
8995,
8576,
673,
5791,
5356,
8908,
16258,
55609,
198,
5317,
8995,
8576,
673,
5791,
5356,
8908,
16258,
2657,
25,
30226,
17752,
11,
5884,
1145,
1401,
25,
610,
11,
6233,
3173,
25,
610,
11,
1670,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
264,
907,
505,
264,
11240,
477,
459,
4676,
3977,
13
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.get_from_dict_or_env.html |
03056f6998cf-0 | langchain.utils.mock_now¶
langchain.utils.mock_now(dt_value)[source]¶
Context manager for mocking out datetime.now() in unit tests.
Example:
with mock_now(datetime.datetime(2011, 2, 3, 10, 11)):
assert datetime.datetime.now() == datetime.datetime(2011, 2, 3, 10, 11) | [
5317,
8995,
8576,
15418,
21480,
55609,
198,
5317,
8995,
8576,
15418,
21480,
25726,
3220,
6758,
2484,
60,
55609,
198,
2014,
6783,
369,
67583,
704,
9050,
10930,
368,
304,
5089,
7177,
627,
13617,
512,
4291,
8018,
21480,
46344,
20296,
7,
679,
16,
11,
220,
17,
11,
220,
18,
11,
220,
605,
11,
220,
806,
10162,
2256,
9050,
20296,
10930,
368,
624,
9050,
20296,
7,
679,
16,
11,
220,
17,
11,
220,
18,
11,
220,
605,
11,
220,
806,
8
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.mock_now.html |
f48a5d40d3fa-0 | langchain.utils.xor_args¶
langchain.utils.xor_args(*arg_groups: Tuple[str, ...]) → Callable[source]¶
Validate specified keyword args are mutually exclusive. | [
5317,
8995,
8576,
2036,
269,
8550,
55609,
198,
5317,
8995,
8576,
2036,
269,
8550,
4163,
867,
21833,
25,
25645,
17752,
11,
2564,
2526,
11651,
54223,
76747,
60,
55609,
198,
18409,
5300,
16570,
2897,
527,
53579,
14079,
13
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.xor_args.html |
b6bef6877ea9-0 | langchain.utils.stringify_dict¶
langchain.utils.stringify_dict(data: dict) → str[source]¶
Stringify a dictionary.
Parameters
data – The dictionary to stringify.
Returns
The stringified dictionary.
Return type
str | [
5317,
8995,
8576,
10258,
5356,
55609,
198,
5317,
8995,
8576,
10258,
5356,
2657,
25,
6587,
8,
11651,
610,
76747,
60,
55609,
198,
707,
1463,
264,
11240,
627,
9905,
198,
695,
1389,
578,
11240,
311,
84266,
627,
16851,
198,
791,
925,
1908,
11240,
627,
5715,
955,
198,
496
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.stringify_dict.html |
6906dfe06a5c-0 | langchain.utils.comma_list¶
langchain.utils.comma_list(items: List[Any]) → str[source]¶ | [
5317,
8995,
8576,
916,
1764,
2062,
55609,
198,
5317,
8995,
8576,
916,
1764,
2062,
25331,
25,
1796,
71401,
2526,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.comma_list.html |
434b0f430031-0 | langchain.utils.raise_for_status_with_text¶
langchain.utils.raise_for_status_with_text(response: Response) → None[source]¶
Raise an error with the response text. | [
5317,
8995,
8576,
68934,
5595,
4878,
6753,
4424,
55609,
198,
5317,
8995,
8576,
68934,
5595,
4878,
6753,
4424,
5802,
25,
6075,
8,
11651,
2290,
76747,
60,
55609,
198,
94201,
459,
1493,
449,
279,
2077,
1495,
13
] | https://langchain.readthedocs.io/en/latest/utils/langchain.utils.raise_for_status_with_text.html |
986673052630-0 | langchain.requests.Requests¶
class langchain.requests.Requests(*, headers: Optional[Dict[str, str]] = None, aiosession: Optional[ClientSession] = None)[source]¶
Bases: BaseModel
Wrapper around requests to handle auth and async.
The main purpose of this wrapper is to handle authentication (by saving
headers) and enable easy async methods on the same base object.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param aiosession: Optional[aiohttp.client.ClientSession] = None¶
param headers: Optional[Dict[str, str]] = None¶
adelete(url: str, **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶
DELETE the URL and return the text asynchronously.
aget(url: str, **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶
GET the URL and return the text asynchronously.
apatch(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶
PATCH the URL and return the text asynchronously.
apost(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶
POST to the URL and return the text asynchronously.
aput(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶
PUT the URL and return the text asynchronously.
delete(url: str, **kwargs: Any) → Response[source]¶
DELETE the URL and return the text.
get(url: str, **kwargs: Any) → Response[source]¶
GET the URL and return the text. | [
5317,
8995,
68771,
9856,
82,
55609,
198,
1058,
8859,
8995,
68771,
9856,
82,
4163,
11,
7247,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
11,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
7540,
311,
3790,
4259,
323,
3393,
627,
791,
1925,
7580,
315,
420,
13564,
374,
311,
3790,
17066,
320,
1729,
14324,
198,
7869,
8,
323,
7431,
4228,
3393,
5528,
389,
279,
1890,
2385,
1665,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
6718,
11978,
5396,
60,
284,
2290,
55609,
198,
913,
7247,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
55609,
198,
1037,
1649,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
22149,
12846,
58,
3032,
2647,
11,
2290,
1483,
2484,
60,
55609,
198,
14762,
279,
5665,
323,
471,
279,
1495,
68881,
627,
85163,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
22149,
12846,
58,
3032,
2647,
11,
2290,
1483,
2484,
60,
55609,
198,
3891,
279,
5665,
323,
471,
279,
1495,
68881,
627,
391,
759,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
22149,
12846,
58,
3032,
2647,
11,
2290,
1483,
2484,
60,
55609,
198,
32265,
279,
5665,
323,
471,
279,
1495,
68881,
627,
391,
537,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
22149,
12846,
58,
3032,
2647,
11,
2290,
1483,
2484,
60,
55609,
198,
3019,
311,
279,
5665,
323,
471,
279,
1495,
68881,
627,
391,
332,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
22149,
12846,
58,
3032,
2647,
11,
2290,
1483,
2484,
60,
55609,
198,
6353,
279,
5665,
323,
471,
279,
1495,
68881,
627,
4644,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
6075,
76747,
60,
55609,
198,
14762,
279,
5665,
323,
471,
279,
1495,
627,
456,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
6075,
76747,
60,
55609,
198,
3891,
279,
5665,
323,
471,
279,
1495,
13
] | https://langchain.readthedocs.io/en/latest/requests/langchain.requests.Requests.html |
986673052630-1 | GET the URL and return the text.
patch(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶
PATCH the URL and return the text.
post(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶
POST to the URL and return the text.
put(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶
PUT the URL and return the text.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
3891,
279,
5665,
323,
471,
279,
1495,
627,
3482,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
6075,
76747,
60,
55609,
198,
32265,
279,
5665,
323,
471,
279,
1495,
627,
2252,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
6075,
76747,
60,
55609,
198,
3019,
311,
279,
5665,
323,
471,
279,
1495,
627,
631,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
6075,
76747,
60,
55609,
198,
6353,
279,
5665,
323,
471,
279,
1495,
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,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/requests/langchain.requests.Requests.html |
00dd0e3cd988-0 | langchain.requests.TextRequestsWrapper¶
class langchain.requests.TextRequestsWrapper(*, headers: Optional[Dict[str, str]] = None, aiosession: Optional[ClientSession] = None)[source]¶
Bases: BaseModel
Lightweight wrapper around requests library.
The main purpose of this wrapper is to always return a text output.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param aiosession: Optional[aiohttp.client.ClientSession] = None¶
param headers: Optional[Dict[str, str]] = None¶
async adelete(url: str, **kwargs: Any) → str[source]¶
DELETE the URL and return the text asynchronously.
async aget(url: str, **kwargs: Any) → str[source]¶
GET the URL and return the text asynchronously.
async apatch(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
PATCH the URL and return the text asynchronously.
async apost(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
POST to the URL and return the text asynchronously.
async aput(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
PUT the URL and return the text asynchronously.
delete(url: str, **kwargs: Any) → str[source]¶
DELETE the URL and return the text.
get(url: str, **kwargs: Any) → str[source]¶
GET the URL and return the text.
patch(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
PATCH the URL and return the text. | [
5317,
8995,
68771,
2021,
36395,
11803,
55609,
198,
1058,
8859,
8995,
68771,
2021,
36395,
11803,
4163,
11,
7247,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
11,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
14235,
4870,
13564,
2212,
7540,
6875,
627,
791,
1925,
7580,
315,
420,
13564,
374,
311,
2744,
471,
264,
1495,
2612,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
6718,
11978,
5396,
60,
284,
2290,
55609,
198,
913,
7247,
25,
12536,
58,
13755,
17752,
11,
610,
5163,
284,
2290,
55609,
198,
7847,
264,
4644,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
14762,
279,
5665,
323,
471,
279,
1495,
68881,
627,
7847,
264,
456,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
3891,
279,
5665,
323,
471,
279,
1495,
68881,
627,
7847,
1469,
759,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
32265,
279,
5665,
323,
471,
279,
1495,
68881,
627,
7847,
39571,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
3019,
311,
279,
5665,
323,
471,
279,
1495,
68881,
627,
7847,
264,
631,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6353,
279,
5665,
323,
471,
279,
1495,
68881,
627,
4644,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
14762,
279,
5665,
323,
471,
279,
1495,
627,
456,
6659,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
3891,
279,
5665,
323,
471,
279,
1495,
627,
3482,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
32265,
279,
5665,
323,
471,
279,
1495,
13
] | https://langchain.readthedocs.io/en/latest/requests/langchain.requests.TextRequestsWrapper.html |
00dd0e3cd988-1 | PATCH the URL and return the text.
post(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
POST to the URL and return the text.
put(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶
PUT the URL and return the text.
property requests: langchain.requests.Requests¶
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
32265,
279,
5665,
323,
471,
279,
1495,
627,
2252,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
3019,
311,
279,
5665,
323,
471,
279,
1495,
627,
631,
6659,
25,
610,
11,
828,
25,
30226,
17752,
11,
5884,
1145,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6353,
279,
5665,
323,
471,
279,
1495,
627,
3784,
7540,
25,
8859,
8995,
68771,
9856,
82,
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,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/requests/langchain.requests.TextRequestsWrapper.html |
df292d25568e-0 | langchain.env.get_runtime_environment¶
langchain.env.get_runtime_environment() → dict[source]¶
Get information about the environment. | [
5317,
8995,
9449,
673,
34332,
52874,
55609,
198,
5317,
8995,
9449,
673,
34332,
52874,
368,
11651,
6587,
76747,
60,
55609,
198,
1991,
2038,
922,
279,
4676,
13
] | https://langchain.readthedocs.io/en/latest/env/langchain.env.get_runtime_environment.html |
37ff5a1093df-0 | langchain.utilities.zapier.ZapierNLAWrapper¶
class langchain.utilities.zapier.ZapierNLAWrapper(*, zapier_nla_api_key: str, zapier_nla_oauth_access_token: str, zapier_nla_api_base: str = 'https://nla.zapier.com/api/v1/')[source]¶
Bases: BaseModel
Wrapper for Zapier NLA.
Full docs here: https://nla.zapier.com/start/
This wrapper supports both API Key and OAuth Credential auth methods. API Key
is the fastest way to get started using this wrapper.
Call this wrapper with either zapier_nla_api_key or
zapier_nla_oauth_access_token arguments, or set the ZAPIER_NLA_API_KEY
environment variable. If both arguments are set, the Access Token will take
precedence.
For use-cases where LangChain + Zapier NLA is powering a user-facing application,
and LangChain needs access to the end-user’s connected accounts on Zapier.com,
you’ll need to use OAuth. Review the full docs above to learn how to create
your own provider and generate credentials.
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 zapier_nla_api_base: str = 'https://nla.zapier.com/api/v1/'¶
param zapier_nla_api_key: str [Required]¶
param zapier_nla_oauth_access_token: str [Required]¶
async alist() → List[Dict][source]¶
Returns a list of all exposed (enabled) actions associated with
current user (associated with the set api_key). Change your exposed
actions here: https://nla.zapier.com/demo/start/ | [
5317,
8995,
63795,
4025,
391,
1291,
13784,
391,
1291,
45,
18326,
11803,
55609,
198,
1058,
8859,
8995,
63795,
4025,
391,
1291,
13784,
391,
1291,
45,
18326,
11803,
4163,
11,
34078,
1291,
1107,
4355,
11959,
3173,
25,
610,
11,
34078,
1291,
1107,
4355,
92293,
13049,
6594,
25,
610,
11,
34078,
1291,
1107,
4355,
11959,
7806,
25,
610,
284,
364,
2485,
1129,
77,
4355,
4025,
391,
1291,
916,
10729,
5574,
16,
14,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
369,
70331,
1291,
452,
18326,
627,
9619,
27437,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
71076,
6018,
2028,
13564,
11815,
2225,
5446,
5422,
323,
39416,
94479,
4259,
5528,
13,
5446,
5422,
198,
285,
279,
26731,
1648,
311,
636,
3940,
1701,
420,
13564,
627,
7368,
420,
13564,
449,
3060,
34078,
1291,
1107,
4355,
11959,
3173,
477,
198,
93471,
1291,
1107,
4355,
92293,
13049,
6594,
6105,
11,
477,
743,
279,
1901,
7227,
643,
1635,
18326,
11669,
6738,
198,
24175,
3977,
13,
1442,
2225,
6105,
527,
743,
11,
279,
9742,
9857,
690,
1935,
198,
27244,
768,
627,
2520,
1005,
1824,
2315,
1405,
23272,
19368,
489,
70331,
1291,
452,
18326,
374,
91000,
264,
1217,
64406,
3851,
345,
438,
23272,
19368,
3966,
2680,
311,
279,
842,
8865,
753,
8599,
9815,
389,
70331,
1291,
916,
345,
9514,
4805,
1205,
311,
1005,
39416,
13,
10506,
279,
2539,
27437,
3485,
311,
4048,
1268,
311,
1893,
198,
22479,
1866,
9287,
323,
7068,
16792,
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,
34078,
1291,
1107,
4355,
11959,
7806,
25,
610,
284,
364,
2485,
1129,
77,
4355,
4025,
391,
1291,
916,
10729,
5574,
16,
11576,
55609,
198,
913,
34078,
1291,
1107,
4355,
11959,
3173,
25,
610,
510,
8327,
60,
55609,
198,
913,
34078,
1291,
1107,
4355,
92293,
13049,
6594,
25,
610,
510,
8327,
60,
55609,
198,
7847,
96795,
368,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
16851,
264,
1160,
315,
682,
15246,
320,
16247,
8,
6299,
5938,
449,
198,
3311,
1217,
320,
50187,
449,
279,
743,
6464,
3173,
570,
10604,
701,
15246,
198,
4109,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
14
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html |
37ff5a1093df-1 | actions here: https://nla.zapier.com/demo/start/
The return list can be empty if no actions exposed. Else will contain
a list of action objects:
[{“id”: str,
“description”: str,
“params”: Dict[str, str]
}]
params will always contain an instructions key, the only required
param. All others optional and if provided will override any AI guesses
(see “understanding the AI guessing flow” here:
https://nla.zapier.com/api/v1/docs)
async alist_as_str() → str[source]¶
Same as list, but returns a stringified version of the JSON for
insertting back into an LLM.
async apreview(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶
Same as run, but instead of actually executing the action, will
instead return a preview of params that have been guessed by the AI in
case you need to explicitly review before executing.
async apreview_as_str(*args, **kwargs) → str[source]¶
Same as preview, but returns a stringified version of the JSON for
insertting back into an LLM.
async arun(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶
Executes an action that is identified by action_id, must be exposed
(enabled) by the current user (associated with the set api_key). Change
your exposed actions here: https://nla.zapier.com/demo/start/
The return JSON is guaranteed to be less than ~500 words (350
tokens) making it safe to inject into the prompt of another LLM
call.
async arun_as_str(*args, **kwargs) → str[source]¶
Same as run, but returns a stringified version of the JSON for | [
4109,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
6018,
791,
471,
1160,
649,
387,
4384,
422,
912,
6299,
15246,
13,
19334,
690,
6782,
198,
64,
1160,
315,
1957,
6302,
512,
53208,
2118,
307,
57633,
610,
345,
2118,
4789,
57633,
610,
345,
2118,
3603,
57633,
30226,
17752,
11,
610,
933,
58420,
3603,
690,
2744,
6782,
459,
11470,
1401,
11,
279,
1193,
2631,
198,
913,
13,
2052,
3885,
10309,
323,
422,
3984,
690,
2882,
904,
15592,
61637,
198,
7,
4151,
1054,
8154,
10276,
279,
15592,
47576,
6530,
863,
1618,
512,
2485,
1129,
77,
4355,
4025,
391,
1291,
916,
10729,
5574,
16,
27057,
340,
7847,
96795,
12162,
2966,
368,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
1160,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
7847,
1469,
19981,
15665,
851,
25,
610,
11,
11470,
25,
610,
11,
3712,
25,
12536,
58,
13755,
60,
284,
2290,
8,
11651,
30226,
76747,
60,
55609,
198,
19749,
439,
1629,
11,
719,
4619,
315,
3604,
31320,
279,
1957,
11,
690,
198,
65937,
471,
264,
17562,
315,
3712,
430,
617,
1027,
43410,
555,
279,
15592,
304,
198,
5756,
499,
1205,
311,
21650,
3477,
1603,
31320,
627,
7847,
1469,
19981,
12162,
2966,
4163,
2164,
11,
3146,
9872,
8,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
17562,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
7847,
802,
359,
15665,
851,
25,
610,
11,
11470,
25,
610,
11,
3712,
25,
12536,
58,
13755,
60,
284,
2290,
8,
11651,
30226,
76747,
60,
55609,
198,
10427,
2142,
459,
1957,
430,
374,
11054,
555,
1957,
851,
11,
2011,
387,
15246,
198,
88854,
8,
555,
279,
1510,
1217,
320,
50187,
449,
279,
743,
6464,
3173,
570,
10604,
198,
22479,
15246,
6299,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
6018,
791,
471,
4823,
374,
19883,
311,
387,
2753,
1109,
4056,
2636,
4339,
320,
8652,
198,
31666,
8,
3339,
433,
6220,
311,
15921,
1139,
279,
10137,
315,
2500,
445,
11237,
198,
6797,
627,
7847,
802,
359,
12162,
2966,
4163,
2164,
11,
3146,
9872,
8,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
1629,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html |
37ff5a1093df-2 | Same as run, but returns a stringified version of the JSON for
insertting back into an LLM.
list() → List[Dict][source]¶
Returns a list of all exposed (enabled) actions associated with
current user (associated with the set api_key). Change your exposed
actions here: https://nla.zapier.com/demo/start/
The return list can be empty if no actions exposed. Else will contain
a list of action objects:
[{“id”: str,
“description”: str,
“params”: Dict[str, str]
}]
params will always contain an instructions key, the only required
param. All others optional and if provided will override any AI guesses
(see “understanding the AI guessing flow” here:
https://nla.zapier.com/docs/using-the-api#ai-guessing)
list_as_str() → str[source]¶
Same as list, but returns a stringified version of the JSON for
insertting back into an LLM.
preview(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶
Same as run, but instead of actually executing the action, will
instead return a preview of params that have been guessed by the AI in
case you need to explicitly review before executing.
preview_as_str(*args, **kwargs) → str[source]¶
Same as preview, but returns a stringified version of the JSON for
insertting back into an LLM.
run(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶
Executes an action that is identified by action_id, must be exposed
(enabled) by the current user (associated with the set api_key). Change
your exposed actions here: https://nla.zapier.com/demo/start/ | [
19749,
439,
1629,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
1638,
368,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
16851,
264,
1160,
315,
682,
15246,
320,
16247,
8,
6299,
5938,
449,
198,
3311,
1217,
320,
50187,
449,
279,
743,
6464,
3173,
570,
10604,
701,
15246,
198,
4109,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
6018,
791,
471,
1160,
649,
387,
4384,
422,
912,
6299,
15246,
13,
19334,
690,
6782,
198,
64,
1160,
315,
1957,
6302,
512,
53208,
2118,
307,
57633,
610,
345,
2118,
4789,
57633,
610,
345,
2118,
3603,
57633,
30226,
17752,
11,
610,
933,
58420,
3603,
690,
2744,
6782,
459,
11470,
1401,
11,
279,
1193,
2631,
198,
913,
13,
2052,
3885,
10309,
323,
422,
3984,
690,
2882,
904,
15592,
61637,
198,
7,
4151,
1054,
8154,
10276,
279,
15592,
47576,
6530,
863,
1618,
512,
2485,
1129,
77,
4355,
4025,
391,
1291,
916,
27057,
14,
985,
10826,
24851,
2,
2192,
2427,
34401,
287,
340,
1638,
12162,
2966,
368,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
1160,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
28270,
15665,
851,
25,
610,
11,
11470,
25,
610,
11,
3712,
25,
12536,
58,
13755,
60,
284,
2290,
8,
11651,
30226,
76747,
60,
55609,
198,
19749,
439,
1629,
11,
719,
4619,
315,
3604,
31320,
279,
1957,
11,
690,
198,
65937,
471,
264,
17562,
315,
3712,
430,
617,
1027,
43410,
555,
279,
15592,
304,
198,
5756,
499,
1205,
311,
21650,
3477,
1603,
31320,
627,
28270,
12162,
2966,
4163,
2164,
11,
3146,
9872,
8,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
17562,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
6236,
15665,
851,
25,
610,
11,
11470,
25,
610,
11,
3712,
25,
12536,
58,
13755,
60,
284,
2290,
8,
11651,
30226,
76747,
60,
55609,
198,
10427,
2142,
459,
1957,
430,
374,
11054,
555,
1957,
851,
11,
2011,
387,
15246,
198,
88854,
8,
555,
279,
1510,
1217,
320,
50187,
449,
279,
743,
6464,
3173,
570,
10604,
198,
22479,
15246,
6299,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
14
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html |
37ff5a1093df-3 | your exposed actions here: https://nla.zapier.com/demo/start/
The return JSON is guaranteed to be less than ~500 words (350
tokens) making it safe to inject into the prompt of another LLM
call.
run_as_str(*args, **kwargs) → str[source]¶
Same as run, but returns a stringified version of the JSON for
insertting back into an LLM.
validator validate_environment » all fields[source]¶
Validate that api key exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
22479,
15246,
6299,
1618,
25,
3788,
1129,
77,
4355,
4025,
391,
1291,
916,
56260,
71076,
6018,
791,
471,
4823,
374,
19883,
311,
387,
2753,
1109,
4056,
2636,
4339,
320,
8652,
198,
31666,
8,
3339,
433,
6220,
311,
15921,
1139,
279,
10137,
315,
2500,
445,
11237,
198,
6797,
627,
6236,
12162,
2966,
4163,
2164,
11,
3146,
9872,
8,
11651,
610,
76747,
60,
55609,
198,
19749,
439,
1629,
11,
719,
4780,
264,
925,
1908,
2373,
315,
279,
4823,
369,
198,
4302,
1303,
1203,
1139,
459,
445,
11237,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html |
4c4033aa3a93-0 | langchain.utilities.vertexai.raise_vertex_import_error¶
langchain.utilities.vertexai.raise_vertex_import_error() → None[source]¶
Raise ImportError related to Vertex SDK being not available.
Raises
ImportError – an ImportError that mentions a required version of the SDK. | [
5317,
8995,
63795,
48375,
2192,
68934,
27709,
18941,
4188,
55609,
198,
5317,
8995,
63795,
48375,
2192,
68934,
27709,
18941,
4188,
368,
11651,
2290,
76747,
60,
55609,
198,
94201,
55165,
5552,
311,
24103,
27721,
1694,
539,
2561,
627,
36120,
198,
11772,
1480,
1389,
459,
55165,
430,
34945,
264,
2631,
2373,
315,
279,
27721,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.vertexai.raise_vertex_import_error.html |
7e79a77434aa-0 | langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper¶
class langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper(*, k: int = 10, region: Optional[str] = 'wt-wt', safesearch: str = 'moderate', time: Optional[str] = 'y', max_results: int = 5)[source]¶
Bases: BaseModel
Wrapper for DuckDuckGo Search API.
Free and does not require any setup
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param k: int = 10¶
param max_results: int = 5¶
param region: Optional[str] = 'wt-wt'¶
param safesearch: str = 'moderate'¶
param time: Optional[str] = 'y'¶
get_snippets(query: str) → List[str][source]¶
Run query through DuckDuckGo and return concatenated results.
results(query: str, num_results: int) → List[Dict[str, str]][source]¶
Run query through DuckDuckGo and return metadata.
Parameters
query – The query to search for.
num_results – The number of results to return.
Returns
snippet - The description of the result.
title - The title of the result.
link - The link to the result.
Return type
A list of dictionaries with the following keys
run(query: str) → str[source]¶
validator validate_environment » all fields[source]¶
Validate that python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
5317,
8995,
63795,
962,
1983,
74070,
3427,
10947,
920,
1983,
35,
1983,
11087,
6014,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
962,
1983,
74070,
3427,
10947,
920,
1983,
35,
1983,
11087,
6014,
7227,
11803,
4163,
11,
597,
25,
528,
284,
220,
605,
11,
5654,
25,
12536,
17752,
60,
284,
364,
9490,
2695,
83,
518,
5653,
288,
2974,
25,
610,
284,
364,
2658,
59768,
518,
892,
25,
12536,
17752,
60,
284,
364,
88,
518,
1973,
13888,
25,
528,
284,
220,
20,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
369,
46870,
35,
1983,
11087,
7694,
5446,
627,
11180,
323,
1587,
539,
1397,
904,
6642,
198,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
597,
25,
528,
284,
220,
605,
55609,
198,
913,
1973,
13888,
25,
528,
284,
220,
20,
55609,
198,
913,
5654,
25,
12536,
17752,
60,
284,
364,
9490,
2695,
83,
6,
55609,
198,
913,
5653,
288,
2974,
25,
610,
284,
364,
2658,
59768,
6,
55609,
198,
913,
892,
25,
12536,
17752,
60,
284,
364,
88,
6,
55609,
198,
456,
29122,
43970,
10974,
25,
610,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
6869,
3319,
1555,
46870,
35,
1983,
11087,
323,
471,
98634,
3135,
627,
8234,
10974,
25,
610,
11,
1661,
13888,
25,
528,
8,
11651,
1796,
58,
13755,
17752,
11,
610,
28819,
2484,
60,
55609,
198,
6869,
3319,
1555,
46870,
35,
1983,
11087,
323,
471,
11408,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
2470,
13888,
1389,
578,
1396,
315,
3135,
311,
471,
627,
16851,
198,
58715,
482,
578,
4096,
315,
279,
1121,
627,
2150,
482,
578,
2316,
315,
279,
1121,
627,
2125,
482,
578,
2723,
311,
279,
1121,
627,
5715,
955,
198,
32,
1160,
315,
58614,
449,
279,
2768,
7039,
198,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper.html |
ed701bd1e53d-0 | langchain.utilities.python.PythonREPL¶
class langchain.utilities.python.PythonREPL(*, _globals: Optional[Dict] = None, _locals: Optional[Dict] = None)[source]¶
Bases: BaseModel
Simulates a standalone Python REPL.
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 globals: Optional[Dict] [Optional] (alias '_globals')¶
param locals: Optional[Dict] [Optional] (alias '_locals')¶
run(command: str) → str[source]¶
Run command with own globals/locals and returns anything printed. | [
5317,
8995,
63795,
44293,
1087,
27993,
793,
2989,
55609,
198,
1058,
8859,
8995,
63795,
44293,
1087,
27993,
793,
2989,
4163,
11,
721,
54267,
25,
12536,
58,
13755,
60,
284,
2290,
11,
721,
65230,
25,
12536,
58,
13755,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
14354,
24031,
264,
44488,
13325,
93680,
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,
38885,
25,
12536,
58,
13755,
60,
510,
15669,
60,
320,
15305,
9418,
54267,
873,
55609,
198,
913,
25958,
25,
12536,
58,
13755,
60,
510,
15669,
60,
320,
15305,
9418,
65230,
873,
55609,
198,
6236,
15494,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3290,
449,
1866,
38885,
14,
65230,
323,
4780,
4205,
17124,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.python.PythonREPL.html |
1890f69314e0-0 | langchain.utilities.wikipedia.WikipediaAPIWrapper¶
class langchain.utilities.wikipedia.WikipediaAPIWrapper(*, wiki_client: Any = None, top_k_results: int = 3, lang: str = 'en', load_all_available_meta: bool = False, doc_content_chars_max: int = 4000)[source]¶
Bases: BaseModel
Wrapper around WikipediaAPI.
To use, you should have the wikipedia python package installed.
This wrapper will use the Wikipedia API to conduct searches and
fetch page summaries. By default, it will return the page summaries
of the top-k results.
It limits the Document content by doc_content_chars_max.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param doc_content_chars_max: int = 4000¶
param lang: str = 'en'¶
param load_all_available_meta: bool = False¶
param top_k_results: int = 3¶
load(query: str) → List[Document][source]¶
Run Wikipedia search and get the article text plus the meta information.
See
Returns: a list of documents.
run(query: str) → str[source]¶
Run Wikipedia search and get page summaries.
validator validate_environment » all fields[source]¶
Validate that the python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
5317,
8995,
63795,
34466,
1196,
15288,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
34466,
1196,
15288,
7227,
11803,
4163,
11,
29709,
8342,
25,
5884,
284,
2290,
11,
1948,
4803,
13888,
25,
528,
284,
220,
18,
11,
8859,
25,
610,
284,
364,
268,
518,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
11,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
3443,
15,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
27685,
7227,
627,
1271,
1005,
11,
499,
1288,
617,
279,
59318,
10344,
6462,
10487,
627,
2028,
13564,
690,
1005,
279,
27685,
5446,
311,
6929,
27573,
323,
198,
9838,
2199,
70022,
13,
3296,
1670,
11,
433,
690,
471,
279,
2199,
70022,
198,
1073,
279,
1948,
12934,
3135,
627,
2181,
13693,
279,
12051,
2262,
555,
4733,
7647,
38518,
6479,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
4733,
7647,
38518,
6479,
25,
528,
284,
220,
3443,
15,
55609,
198,
913,
8859,
25,
610,
284,
364,
268,
6,
55609,
198,
913,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
55609,
198,
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609,
198,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
6869,
27685,
2778,
323,
636,
279,
4652,
1495,
5636,
279,
8999,
2038,
627,
10031,
198,
16851,
25,
264,
1160,
315,
9477,
627,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
27685,
2778,
323,
636,
2199,
70022,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
279,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.wikipedia.WikipediaAPIWrapper.html |
27c7c12b303f-0 | langchain.utilities.google_places_api.GooglePlacesAPIWrapper¶
class langchain.utilities.google_places_api.GooglePlacesAPIWrapper(*, gplaces_api_key: Optional[str] = None, google_map_client: Any = None, top_k_results: Optional[int] = None)[source]¶
Bases: BaseModel
Wrapper around Google Places API.
To use, you should have the googlemaps python package installed,an API key for the google maps platform,
and the enviroment variable ‘’GPLACES_API_KEY’’
set with your API key , or pass ‘gplaces_api_key’
as a named parameter to the constructor.
By default, this will return the all the results on the input query.You can use the top_k_results argument to limit the number of results.
Example
from langchain import GooglePlacesAPIWrapper
gplaceapi = GooglePlacesAPIWrapper()
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 gplaces_api_key: Optional[str] = None¶
param top_k_results: Optional[int] = None¶
fetch_place_details(place_id: str) → Optional[str][source]¶
format_place_details(place_details: Dict[str, Any]) → Optional[str][source]¶
run(query: str) → str[source]¶
Run Places search and get k number of places that exists that match.
validator validate_environment » all fields[source]¶
Validate that api key is in your environment variable.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
5317,
8995,
63795,
5831,
58546,
11959,
61493,
59925,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
5831,
58546,
11959,
61493,
59925,
7227,
11803,
4163,
11,
342,
27170,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
11819,
5489,
8342,
25,
5884,
284,
2290,
11,
1948,
4803,
13888,
25,
12536,
19155,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
5195,
45836,
5446,
627,
1271,
1005,
11,
499,
1288,
617,
279,
11819,
18106,
10344,
6462,
10487,
11,
276,
5446,
1401,
369,
279,
11819,
14370,
5452,
345,
438,
279,
50364,
442,
306,
3977,
3451,
529,
37934,
53181,
11669,
6738,
529,
529,
198,
751,
449,
701,
5446,
1401,
1174,
477,
1522,
3451,
70,
27170,
11959,
3173,
529,
198,
300,
264,
7086,
5852,
311,
279,
4797,
627,
1383,
1670,
11,
420,
690,
471,
279,
682,
279,
3135,
389,
279,
1988,
3319,
39537,
649,
1005,
279,
1948,
4803,
13888,
5811,
311,
4017,
279,
1396,
315,
3135,
627,
13617,
198,
1527,
8859,
8995,
1179,
5195,
59925,
7227,
11803,
198,
70,
2050,
2113,
284,
5195,
59925,
7227,
11803,
746,
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,
342,
27170,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
1948,
4803,
13888,
25,
12536,
19155,
60,
284,
2290,
55609,
198,
9838,
35648,
13563,
65689,
851,
25,
610,
8,
11651,
12536,
17752,
1483,
2484,
60,
55609,
198,
2293,
35648,
13563,
65689,
13563,
25,
30226,
17752,
11,
5884,
2526,
11651,
12536,
17752,
1483,
2484,
60,
55609,
198,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
45836,
2778,
323,
636,
597,
1396,
315,
7634,
430,
6866,
430,
2489,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
374,
304,
701,
4676,
3977,
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,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.google_places_api.GooglePlacesAPIWrapper.html |
8b0393f087a6-0 | langchain.utilities.google_serper.GoogleSerperAPIWrapper¶
class langchain.utilities.google_serper.GoogleSerperAPIWrapper(*, k: int = 10, gl: str = 'us', hl: str = 'en', type: Literal['news', 'search', 'places', 'images'] = 'search', tbs: Optional[str] = None, serper_api_key: Optional[str] = None, aiosession: Optional[ClientSession] = None, result_key_for_type: dict = {'images': 'images', 'news': 'news', 'places': 'places', 'search': 'organic'})[source]¶
Bases: BaseModel
Wrapper around the Serper.dev Google Search API.
You can create a free API key at https://serper.dev.
To use, you should have the environment variable SERPER_API_KEY
set with your API key, or pass serper_api_key as a named parameter
to the constructor.
Example
from langchain import GoogleSerperAPIWrapper
google_serper = GoogleSerperAPIWrapper()
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param aiosession: Optional[aiohttp.client.ClientSession] = None¶
param gl: str = 'us'¶
param hl: str = 'en'¶
param k: int = 10¶
param serper_api_key: Optional[str] = None¶
param tbs: Optional[str] = None¶
param type: Literal['news', 'search', 'places', 'images'] = 'search'¶
async aresults(query: str, **kwargs: Any) → Dict[source]¶
Run query through GoogleSearch.
async arun(query: str, **kwargs: Any) → str[source]¶ | [
5317,
8995,
63795,
5831,
76961,
716,
61493,
32845,
716,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
5831,
76961,
716,
61493,
32845,
716,
7227,
11803,
4163,
11,
597,
25,
528,
284,
220,
605,
11,
2840,
25,
610,
284,
364,
355,
518,
50686,
25,
610,
284,
364,
268,
518,
955,
25,
50774,
681,
10189,
518,
364,
1874,
518,
364,
27170,
518,
364,
3726,
663,
284,
364,
1874,
518,
259,
1302,
25,
12536,
17752,
60,
284,
2290,
11,
1446,
716,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
11,
1121,
3173,
5595,
1857,
25,
6587,
284,
5473,
3726,
1232,
364,
3726,
518,
364,
10189,
1232,
364,
10189,
518,
364,
27170,
1232,
364,
27170,
518,
364,
1874,
1232,
364,
61694,
66360,
58,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
279,
8409,
716,
22247,
5195,
7694,
5446,
627,
2675,
649,
1893,
264,
1949,
5446,
1401,
520,
3788,
1129,
805,
716,
22247,
627,
1271,
1005,
11,
499,
1288,
617,
279,
4676,
3977,
14311,
9851,
11669,
6738,
198,
751,
449,
701,
5446,
1401,
11,
477,
1522,
1446,
716,
11959,
3173,
439,
264,
7086,
5852,
198,
998,
279,
4797,
627,
13617,
198,
1527,
8859,
8995,
1179,
5195,
32845,
716,
7227,
11803,
198,
17943,
76961,
716,
284,
5195,
32845,
716,
7227,
11803,
746,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
6718,
11978,
5396,
60,
284,
2290,
55609,
198,
913,
2840,
25,
610,
284,
364,
355,
6,
55609,
198,
913,
50686,
25,
610,
284,
364,
268,
6,
55609,
198,
913,
597,
25,
528,
284,
220,
605,
55609,
198,
913,
1446,
716,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
259,
1302,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
955,
25,
50774,
681,
10189,
518,
364,
1874,
518,
364,
27170,
518,
364,
3726,
663,
284,
364,
1874,
6,
55609,
198,
7847,
264,
8234,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
30226,
76747,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
627,
7847,
802,
359,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.google_serper.GoogleSerperAPIWrapper.html |
8b0393f087a6-1 | async arun(query: str, **kwargs: Any) → str[source]¶
Run query through GoogleSearch and parse result async.
results(query: str, **kwargs: Any) → Dict[source]¶
Run query through GoogleSearch.
run(query: str, **kwargs: Any) → str[source]¶
Run query through GoogleSearch and parse result.
validator validate_environment » all fields[source]¶
Validate that api key exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
7847,
802,
359,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
323,
4820,
1121,
3393,
627,
8234,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
30226,
76747,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
627,
6236,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
323,
4820,
1121,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.google_serper.GoogleSerperAPIWrapper.html |
e8eb11d16fa4-0 | langchain.utilities.arxiv.ArxivAPIWrapper¶
class langchain.utilities.arxiv.ArxivAPIWrapper(*, arxiv_search: Any = None, arxiv_exceptions: Any = None, top_k_results: int = 3, load_max_docs: int = 100, load_all_available_meta: bool = False, doc_content_chars_max: Optional[int] = 4000, ARXIV_MAX_QUERY_LENGTH: int = 300)[source]¶
Bases: BaseModel
Wrapper around ArxivAPI.
To use, you should have the arxiv python package installed.
https://lukasschwab.me/arxiv.py/index.html
This wrapper will use the Arxiv API to conduct searches and
fetch document summaries. By default, it will return the document summaries
of the top-k results.
It limits the Document content by doc_content_chars_max.
Set doc_content_chars_max=None if you don’t want to limit the content size.
Parameters
top_k_results – number of the top-scored document used for the arxiv tool
ARXIV_MAX_QUERY_LENGTH – the cut limit on the query used for the arxiv tool.
load_max_docs – a limit to the number of loaded documents
load_all_available_meta –
if True: the metadata of the loaded Documents gets all available meta info(see https://lukasschwab.me/arxiv.py/index.html#Result),
if False: the metadata gets only the most informative fields.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param arxiv_exceptions: Any = None¶
param doc_content_chars_max: Optional[int] = 4000¶
param load_all_available_meta: bool = False¶
param load_max_docs: int = 100¶
param top_k_results: int = 3¶ | [
5317,
8995,
63795,
17126,
89833,
885,
12940,
344,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
17126,
89833,
885,
12940,
344,
7227,
11803,
4163,
11,
802,
89833,
10947,
25,
5884,
284,
2290,
11,
802,
89833,
81136,
25,
5884,
284,
2290,
11,
1948,
4803,
13888,
25,
528,
284,
220,
18,
11,
2865,
6479,
50792,
25,
528,
284,
220,
1041,
11,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
11,
4733,
7647,
38518,
6479,
25,
12536,
19155,
60,
284,
220,
3443,
15,
11,
6395,
55,
3166,
6949,
32685,
15373,
25,
528,
284,
220,
3101,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
1676,
89833,
7227,
627,
1271,
1005,
11,
499,
1288,
617,
279,
802,
89833,
10344,
6462,
10487,
627,
2485,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
198,
2028,
13564,
690,
1005,
279,
1676,
89833,
5446,
311,
6929,
27573,
323,
198,
9838,
2246,
70022,
13,
3296,
1670,
11,
433,
690,
471,
279,
2246,
70022,
198,
1073,
279,
1948,
12934,
3135,
627,
2181,
13693,
279,
12051,
2262,
555,
4733,
7647,
38518,
6479,
627,
1681,
4733,
7647,
38518,
6479,
5980,
422,
499,
1541,
1431,
1390,
311,
4017,
279,
2262,
1404,
627,
9905,
198,
3565,
4803,
13888,
1389,
1396,
315,
279,
1948,
76274,
67,
2246,
1511,
369,
279,
802,
89833,
5507,
198,
946,
55,
3166,
6949,
32685,
15373,
1389,
279,
4018,
4017,
389,
279,
3319,
1511,
369,
279,
802,
89833,
5507,
627,
1096,
6479,
50792,
1389,
264,
4017,
311,
279,
1396,
315,
6799,
9477,
198,
1096,
5823,
28060,
13686,
1389,
720,
333,
3082,
25,
279,
11408,
315,
279,
6799,
45890,
5334,
682,
2561,
8999,
3630,
7,
4151,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
2122,
1350,
333,
3641,
25,
279,
11408,
5334,
1193,
279,
1455,
39319,
5151,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
802,
89833,
81136,
25,
5884,
284,
2290,
55609,
198,
913,
4733,
7647,
38518,
6479,
25,
12536,
19155,
60,
284,
220,
3443,
15,
55609,
198,
913,
2865,
5823,
28060,
13686,
25,
1845,
284,
3641,
55609,
198,
913,
2865,
6479,
50792,
25,
528,
284,
220,
1041,
55609,
198,
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html |
e8eb11d16fa4-1 | param top_k_results: int = 3¶
load(query: str) → List[Document][source]¶
Run Arxiv search and get the article texts plus the article meta information.
See https://lukasschwab.me/arxiv.py/index.html#Search
Returns: a list of documents with the document.page_content in text format
run(query: str) → str[source]¶
Run Arxiv search and get the article meta information.
See https://lukasschwab.me/arxiv.py/index.html#Search
See https://lukasschwab.me/arxiv.py/index.html#Result
It uses only the most informative fields of article meta information.
validator validate_environment » all fields[source]¶
Validate that the python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
913,
1948,
4803,
13888,
25,
528,
284,
220,
18,
55609,
198,
1096,
10974,
25,
610,
8,
11651,
1796,
58,
7676,
1483,
2484,
60,
55609,
198,
6869,
1676,
89833,
2778,
323,
636,
279,
4652,
22755,
5636,
279,
4652,
8999,
2038,
627,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
6014,
198,
16851,
25,
264,
1160,
315,
9477,
449,
279,
2246,
10678,
7647,
304,
1495,
3645,
198,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
1676,
89833,
2778,
323,
636,
279,
4652,
8999,
2038,
627,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
6014,
198,
10031,
3788,
1129,
75,
3178,
395,
66945,
370,
17777,
96520,
89833,
7345,
9199,
2628,
2,
2122,
198,
2181,
5829,
1193,
279,
1455,
39319,
5151,
315,
4652,
8999,
2038,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
279,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html |
eae813ffab5c-0 | langchain.utilities.bing_search.BingSearchAPIWrapper¶
class langchain.utilities.bing_search.BingSearchAPIWrapper(*, bing_subscription_key: str, bing_search_url: str, k: int = 10)[source]¶
Bases: BaseModel
Wrapper for Bing Search API.
In order to set this up, follow instructions at:
https://levelup.gitconnected.com/api-tutorial-how-to-use-bing-web-search-api-in-python-4165d5592a7e
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 bing_search_url: str [Required]¶
param bing_subscription_key: str [Required]¶
param k: int = 10¶
results(query: str, num_results: int) → List[Dict][source]¶
Run query through BingSearch and return metadata.
Parameters
query – The query to search for.
num_results – The number of results to return.
Returns
snippet - The description of the result.
title - The title of the result.
link - The link to the result.
Return type
A list of dictionaries with the following keys
run(query: str) → str[source]¶
Run query through BingSearch and parse result.
validator validate_environment » all fields[source]¶
Validate that api key and endpoint exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
5317,
8995,
63795,
960,
287,
10947,
1823,
287,
6014,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
960,
287,
10947,
1823,
287,
6014,
7227,
11803,
4163,
11,
293,
287,
60938,
3173,
25,
610,
11,
293,
287,
10947,
2975,
25,
610,
11,
597,
25,
528,
284,
220,
605,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
369,
54587,
7694,
5446,
627,
644,
2015,
311,
743,
420,
709,
11,
1833,
11470,
520,
512,
2485,
1129,
3374,
455,
33899,
15647,
916,
10729,
2442,
14212,
58523,
4791,
25700,
1481,
287,
30531,
19993,
24851,
3502,
73029,
12,
17763,
20,
67,
22424,
17,
64,
22,
68,
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,
293,
287,
10947,
2975,
25,
610,
510,
8327,
60,
55609,
198,
913,
293,
287,
60938,
3173,
25,
610,
510,
8327,
60,
55609,
198,
913,
597,
25,
528,
284,
220,
605,
55609,
198,
8234,
10974,
25,
610,
11,
1661,
13888,
25,
528,
8,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
6869,
3319,
1555,
54587,
6014,
323,
471,
11408,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
2470,
13888,
1389,
578,
1396,
315,
3135,
311,
471,
627,
16851,
198,
58715,
482,
578,
4096,
315,
279,
1121,
627,
2150,
482,
578,
2316,
315,
279,
1121,
627,
2125,
482,
578,
2723,
311,
279,
1121,
627,
5715,
955,
198,
32,
1160,
315,
58614,
449,
279,
2768,
7039,
198,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
54587,
6014,
323,
4820,
1121,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
15233,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.bing_search.BingSearchAPIWrapper.html |
4a1d6c455f43-0 | langchain.utilities.powerbi.fix_table_name¶
langchain.utilities.powerbi.fix_table_name(table: str) → str[source]¶
Add single quotes around table names that contain spaces. | [
5317,
8995,
63795,
40645,
8385,
68885,
5350,
1292,
55609,
198,
5317,
8995,
63795,
40645,
8385,
68885,
5350,
1292,
16138,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
2261,
3254,
17637,
2212,
2007,
5144,
430,
6782,
12908,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.powerbi.fix_table_name.html |
2b79ff384587-0 | langchain.utilities.bibtex.BibtexparserWrapper¶
class langchain.utilities.bibtex.BibtexparserWrapper[source]¶
Bases: BaseModel
Wrapper around bibtexparser.
To use, you should have the bibtexparser python package installed.
https://bibtexparser.readthedocs.io/en/master/
This wrapper will use bibtexparser to load a collection of references from
a bibtex file and fetch document summaries.
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.
get_metadata(entry: Mapping[str, Any], load_extra: bool = False) → Dict[str, Any][source]¶
Get metadata for the given entry.
load_bibtex_entries(path: str) → List[Dict[str, Any]][source]¶
Load bibtex entries from the bibtex file at the given path.
validator validate_environment » all fields[source]¶
Validate that the python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
5317,
8995,
63795,
960,
20938,
327,
1823,
20938,
327,
9854,
11803,
55609,
198,
1058,
8859,
8995,
63795,
960,
20938,
327,
1823,
20938,
327,
9854,
11803,
76747,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
293,
20938,
327,
9854,
627,
1271,
1005,
11,
499,
1288,
617,
279,
293,
20938,
327,
9854,
10344,
6462,
10487,
627,
2485,
1129,
65,
20938,
327,
9854,
4217,
79371,
14460,
4340,
13920,
24184,
6018,
2028,
13564,
690,
1005,
293,
20938,
327,
9854,
311,
2865,
264,
4526,
315,
15407,
505,
198,
64,
293,
20938,
327,
1052,
323,
7963,
2246,
70022,
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,
456,
23012,
18739,
25,
39546,
17752,
11,
5884,
1145,
2865,
32958,
25,
1845,
284,
3641,
8,
11651,
30226,
17752,
11,
5884,
1483,
2484,
60,
55609,
198,
1991,
11408,
369,
279,
2728,
4441,
627,
1096,
890,
20938,
327,
27184,
5698,
25,
610,
8,
11651,
1796,
58,
13755,
17752,
11,
5884,
28819,
2484,
60,
55609,
198,
6003,
293,
20938,
327,
10925,
505,
279,
293,
20938,
327,
1052,
520,
279,
2728,
1853,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
279,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html |
971e25d5e1d8-0 | langchain.utilities.scenexplain.SceneXplainAPIWrapper¶
class langchain.utilities.scenexplain.SceneXplainAPIWrapper(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, scenex_api_key: str, scenex_api_url: str = 'https://us-central1-causal-diffusion.cloudfunctions.net/describe')[source]¶
Bases: BaseSettings, BaseModel
Wrapper for SceneXplain API.
In order to set this up, you need API key for the SceneXplain API.
You can obtain a key by following the steps below.
- Sign up for a free account at https://scenex.jina.ai/.
- Navigate to the API Access page (https://scenex.jina.ai/api)
and create a new API key.
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 scenex_api_key: str [Required]¶
param scenex_api_url: str = 'https://us-central1-causal-diffusion.cloudfunctions.net/describe'¶
run(image: str) → str[source]¶
Run SceneXplain image explainer.
validator validate_environment » all fields[source]¶
Validate that api key exists in environment.
model Config¶
Bases: BaseConfig
getter_dict¶
alias of GetterDict | [
5317,
8995,
63795,
7840,
268,
95444,
37127,
55,
21435,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
7840,
268,
95444,
37127,
55,
21435,
7227,
11803,
2551,
3239,
2517,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
11,
1796,
58,
33758,
17752,
11,
8092,
13246,
21128,
25645,
58,
33758,
17752,
11,
8092,
13246,
1145,
2564,
5163,
60,
284,
3942,
1735,
1665,
20150,
721,
3239,
2517,
38713,
25,
12536,
17752,
60,
284,
2290,
11,
721,
3239,
67379,
18519,
18170,
25,
12536,
17752,
60,
284,
2290,
11,
721,
325,
53810,
4432,
25,
12536,
58,
33758,
17752,
11,
8092,
13246,
5163,
284,
2290,
11,
12039,
7681,
327,
11959,
3173,
25,
610,
11,
7681,
327,
11959,
2975,
25,
610,
284,
364,
2485,
1129,
355,
85181,
16,
51877,
36514,
1773,
3168,
7713,
17365,
22124,
5181,
3529,
288,
3191,
13588,
2484,
60,
55609,
198,
33,
2315,
25,
5464,
6214,
11,
65705,
198,
11803,
369,
17952,
55,
21435,
5446,
627,
644,
2015,
311,
743,
420,
709,
11,
499,
1205,
5446,
1401,
369,
279,
17952,
55,
21435,
5446,
627,
2675,
649,
6994,
264,
1401,
555,
2768,
279,
7504,
3770,
627,
12,
7220,
709,
369,
264,
1949,
2759,
520,
3788,
1129,
2445,
268,
327,
1190,
2259,
41483,
76969,
12,
82839,
311,
279,
5446,
9742,
2199,
320,
2485,
1129,
2445,
268,
327,
1190,
2259,
41483,
10729,
340,
438,
1893,
264,
502,
5446,
1401,
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,
7681,
327,
11959,
3173,
25,
610,
510,
8327,
60,
55609,
198,
913,
7681,
327,
11959,
2975,
25,
610,
284,
364,
2485,
1129,
355,
85181,
16,
51877,
36514,
1773,
3168,
7713,
17365,
22124,
5181,
3529,
288,
3191,
6,
55609,
198,
6236,
10281,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
17952,
55,
21435,
2217,
3327,
1780,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
6866,
304,
4676,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
5464,
2714,
198,
53991,
5356,
55609,
198,
15305,
315,
57230,
13755
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html |
971e25d5e1d8-1 | model Config¶
Bases: BaseConfig
getter_dict¶
alias of GetterDict
classmethod customise_sources(init_settings: Callable[[BaseSettings], Dict[str, Any]], env_settings: Callable[[BaseSettings], Dict[str, Any]], file_secret_settings: Callable[[BaseSettings], Dict[str, Any]]) → Tuple[Callable[[BaseSettings], Dict[str, Any]], ...]¶
classmethod get_field_info(name: unicode) → Dict[str, Any]¶
Get properties of FieldInfo from the fields property of the config class.
json_dumps(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)¶
Serialize obj to a JSON formatted str.
If skipkeys is true then dict keys that are not basic types
(str, int, float, bool, None) will be skipped
instead of raising a TypeError.
If ensure_ascii is false, then the return value can contain non-ASCII
characters if they appear in strings contained in obj. Otherwise, all
such characters are escaped in JSON strings.
If check_circular is false, then the circular reference check
for container types will be skipped and a circular reference will
result in an RecursionError (or worse).
If allow_nan is false, then it will be a ValueError to
serialize out of range float values (nan, inf, -inf) in
strict compliance of the JSON specification, instead of using the
JavaScript equivalents (NaN, Infinity, -Infinity).
If indent is a non-negative integer, then JSON array elements and
object members will be pretty-printed with that indent level. An indent
level of 0 will only insert newlines. None is the most compact
representation.
If specified, separators should be an (item_separator, key_separator) | [
2590,
5649,
55609,
198,
33,
2315,
25,
5464,
2714,
198,
53991,
5356,
55609,
198,
15305,
315,
57230,
13755,
198,
27853,
2587,
1082,
53996,
39350,
11090,
25,
54223,
15873,
4066,
6214,
1145,
30226,
17752,
11,
5884,
21128,
6233,
11090,
25,
54223,
15873,
4066,
6214,
1145,
30226,
17752,
11,
5884,
21128,
1052,
22729,
11090,
25,
54223,
15873,
4066,
6214,
1145,
30226,
17752,
11,
5884,
30716,
11651,
25645,
58,
41510,
15873,
4066,
6214,
1145,
30226,
17752,
11,
5884,
21128,
2564,
60,
55609,
198,
27853,
636,
5121,
3186,
3232,
25,
27169,
8,
11651,
30226,
17752,
11,
5884,
60,
55609,
198,
1991,
6012,
315,
8771,
1767,
505,
279,
5151,
3424,
315,
279,
2242,
538,
627,
2285,
821,
12055,
4163,
11,
10936,
10786,
5725,
11,
6106,
51338,
3702,
11,
1817,
669,
22190,
3702,
11,
2187,
75036,
3702,
11,
13082,
5980,
11,
17962,
5980,
11,
83602,
5980,
11,
1670,
5980,
11,
3460,
12919,
5725,
11,
3146,
29700,
8,
55609,
198,
16055,
2909,
311,
264,
4823,
24001,
610,
627,
2746,
10936,
10786,
374,
837,
1243,
6587,
7039,
430,
527,
539,
6913,
4595,
198,
4293,
11,
528,
11,
2273,
11,
1845,
11,
2290,
8,
690,
387,
36257,
198,
65937,
315,
19054,
264,
26082,
627,
2746,
6106,
51338,
374,
905,
11,
1243,
279,
471,
907,
649,
6782,
2536,
12,
57550,
198,
48585,
422,
814,
5101,
304,
9246,
13282,
304,
2909,
13,
18715,
11,
682,
198,
21470,
5885,
527,
28883,
304,
4823,
9246,
627,
2746,
1817,
669,
22190,
374,
905,
11,
1243,
279,
28029,
5905,
1817,
198,
2000,
5593,
4595,
690,
387,
36257,
323,
264,
28029,
5905,
690,
198,
1407,
304,
459,
4158,
35380,
1480,
320,
269,
11201,
4390,
2746,
2187,
75036,
374,
905,
11,
1243,
433,
690,
387,
264,
15764,
311,
198,
25140,
704,
315,
2134,
2273,
2819,
320,
19285,
11,
4225,
11,
482,
13885,
8,
304,
198,
6765,
8907,
315,
279,
4823,
26185,
11,
4619,
315,
1701,
279,
198,
30575,
86106,
320,
23678,
11,
40989,
11,
482,
46190,
4390,
2746,
17962,
374,
264,
2536,
62035,
7698,
11,
1243,
4823,
1358,
5540,
323,
198,
1735,
3697,
690,
387,
5128,
43245,
291,
449,
430,
17962,
2237,
13,
1556,
17962,
198,
3374,
315,
220,
15,
690,
1193,
5774,
502,
8128,
13,
2290,
374,
279,
1455,
17251,
198,
84216,
627,
2746,
5300,
11,
83602,
1288,
387,
459,
320,
1224,
59304,
11,
1401,
59304,
8
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html |
971e25d5e1d8-2 | representation.
If specified, separators should be an (item_separator, key_separator)
tuple. The default is (', ', ': ') if indent is None and
(',', ': ') otherwise. To get the most compact JSON representation,
you should specify (',', ':') to eliminate whitespace.
default(obj) is a function that should return a serializable version
of obj or raise TypeError. The default simply raises TypeError.
If sort_keys is true (default: False), then the output of
dictionaries will be sorted by key.
To use a custom JSONEncoder subclass (e.g. one that overrides the
.default() method to serialize additional types), specify it with
the cls kwarg; otherwise JSONEncoder is used.
json_loads(*, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)¶
Deserialize s (a str, bytes or bytearray instance
containing a JSON document) to a Python object.
object_hook is an optional function that will be called with the
result of any object literal decode (a dict). The return value of
object_hook will be used instead of the dict. This feature
can be used to implement custom decoders (e.g. JSON-RPC class hinting).
object_pairs_hook is an optional function that will be called with the
result of any object literal decoded with an ordered list of pairs. The
return value of object_pairs_hook will be used instead of the dict.
This feature can be used to implement custom decoders. If object_hook
is also defined, the object_pairs_hook takes priority.
parse_float, if specified, will be called with the string
of every JSON float to be decoded. By default this is equivalent to
float(num_str). This can be used to use another datatype or parser
for JSON floats (e.g. decimal.Decimal). | [
84216,
627,
2746,
5300,
11,
83602,
1288,
387,
459,
320,
1224,
59304,
11,
1401,
59304,
340,
25609,
13,
220,
578,
1670,
374,
320,
518,
6752,
13906,
17081,
422,
17962,
374,
2290,
323,
198,
35421,
13906,
17081,
6062,
13,
220,
2057,
636,
279,
1455,
17251,
4823,
13340,
345,
9514,
1288,
14158,
320,
518,
518,
13906,
873,
311,
22472,
37472,
627,
2309,
6922,
8,
374,
264,
734,
430,
1288,
471,
264,
6275,
8499,
2373,
198,
1073,
2909,
477,
4933,
26082,
13,
578,
1670,
5042,
25930,
26082,
627,
2746,
3460,
12919,
374,
837,
320,
2309,
25,
3641,
705,
1243,
279,
2612,
315,
198,
67,
45292,
690,
387,
10839,
555,
1401,
627,
1271,
1005,
264,
2587,
4823,
20516,
38290,
320,
68,
1326,
13,
832,
430,
36555,
279,
198,
8939,
368,
1749,
311,
25217,
5217,
4595,
705,
14158,
433,
449,
198,
1820,
13082,
30625,
867,
26,
6062,
4823,
20516,
374,
1511,
627,
2285,
12693,
82,
4163,
11,
13082,
5980,
11,
1665,
33105,
5980,
11,
4820,
18047,
5980,
11,
4820,
4132,
5980,
11,
4820,
36067,
5980,
11,
1665,
37530,
33105,
5980,
11,
3146,
29700,
8,
55609,
198,
65565,
274,
320,
64,
610,
11,
5943,
477,
96703,
2937,
198,
778,
2101,
264,
4823,
2246,
8,
311,
264,
13325,
1665,
627,
1735,
33105,
374,
459,
10309,
734,
430,
690,
387,
2663,
449,
279,
198,
1407,
315,
904,
1665,
24016,
17322,
320,
64,
6587,
570,
578,
471,
907,
315,
198,
1735,
33105,
690,
387,
1511,
4619,
315,
279,
6587,
13,
1115,
4668,
198,
4919,
387,
1511,
311,
4305,
2587,
1654,
53598,
320,
68,
1326,
13,
4823,
11151,
4977,
538,
13310,
287,
4390,
1735,
37530,
33105,
374,
459,
10309,
734,
430,
690,
387,
2663,
449,
279,
198,
1407,
315,
904,
1665,
24016,
30313,
449,
459,
11713,
1160,
315,
13840,
13,
220,
578,
198,
693,
907,
315,
1665,
37530,
33105,
690,
387,
1511,
4619,
315,
279,
6587,
627,
2028,
4668,
649,
387,
1511,
311,
4305,
2587,
1654,
53598,
13,
220,
1442,
1665,
33105,
198,
285,
1101,
4613,
11,
279,
1665,
37530,
33105,
5097,
10844,
627,
6534,
18047,
11,
422,
5300,
11,
690,
387,
2663,
449,
279,
925,
198,
1073,
1475,
4823,
2273,
311,
387,
30313,
13,
3296,
1670,
420,
374,
13890,
311,
198,
3733,
8228,
2966,
570,
1115,
649,
387,
1511,
311,
1005,
2500,
47734,
477,
6871,
198,
2000,
4823,
49002,
320,
68,
1326,
13,
12395,
41775,
570
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html |
971e25d5e1d8-3 | for JSON floats (e.g. decimal.Decimal).
parse_int, if specified, will be called with the string
of every JSON int to be decoded. By default this is equivalent to
int(num_str). This can be used to use another datatype or parser
for JSON integers (e.g. float).
parse_constant, if specified, will be called with one of the
following strings: -Infinity, Infinity, NaN.
This can be used to raise an exception if invalid JSON numbers
are encountered.
To use a custom JSONDecoder subclass, specify it with the cls
kwarg; otherwise JSONDecoder is used.
classmethod parse_env_var(field_name: unicode, raw_val: unicode) → Any¶
classmethod prepare_field(field: ModelField) → None¶
Optional hook to check or modify fields during model creation.
alias_generator = None¶
allow_inf_nan = True¶
allow_mutation = True¶
allow_population_by_field_name = False¶
anystr_lower = False¶
anystr_strip_whitespace = False¶
anystr_upper = False¶
arbitrary_types_allowed = True¶
case_sensitive = False¶
copy_on_model_validation = 'shallow'¶
env_file = None¶
env_file_encoding = None¶
env_nested_delimiter = None¶
env_prefix = ''¶
error_msg_templates = {}¶
extra = 'forbid'¶
fields = {}¶
frozen = False¶
json_encoders = {}¶
keep_untouched = ()¶
max_anystr_length = None¶
min_anystr_length = 0¶
orm_mode = False¶
post_init_call = 'before_validation'¶
schema_extra = {}¶
secrets_dir = None¶
smart_union = False¶
title = None¶
underscore_attrs_are_private = False¶
use_enum_values = False¶
validate_all = True¶
validate_assignment = False¶ | [
2000,
4823,
49002,
320,
68,
1326,
13,
12395,
41775,
4390,
6534,
4132,
11,
422,
5300,
11,
690,
387,
2663,
449,
279,
925,
198,
1073,
1475,
4823,
528,
311,
387,
30313,
13,
3296,
1670,
420,
374,
13890,
311,
198,
396,
8228,
2966,
570,
1115,
649,
387,
1511,
311,
1005,
2500,
47734,
477,
6871,
198,
2000,
4823,
26864,
320,
68,
1326,
13,
2273,
4390,
6534,
36067,
11,
422,
5300,
11,
690,
387,
2663,
449,
832,
315,
279,
198,
44018,
9246,
25,
482,
46190,
11,
40989,
11,
33278,
627,
2028,
649,
387,
1511,
311,
4933,
459,
4788,
422,
8482,
4823,
5219,
198,
548,
23926,
627,
1271,
1005,
264,
2587,
4823,
21394,
38290,
11,
14158,
433,
449,
279,
13082,
198,
29700,
867,
26,
6062,
4823,
21394,
374,
1511,
627,
27853,
4820,
16258,
4715,
15944,
1292,
25,
27169,
11,
7257,
6320,
25,
27169,
8,
11651,
5884,
55609,
198,
27853,
10772,
5121,
15944,
25,
5008,
1915,
8,
11651,
2290,
55609,
198,
15669,
9903,
311,
1817,
477,
5719,
5151,
2391,
1646,
9886,
627,
15305,
26898,
284,
2290,
55609,
198,
7331,
27143,
75036,
284,
3082,
55609,
198,
7331,
722,
23539,
284,
3082,
55609,
198,
7331,
75672,
3795,
5121,
1292,
284,
3641,
55609,
198,
3852,
496,
31525,
284,
3641,
55609,
198,
3852,
496,
67230,
87275,
284,
3641,
55609,
198,
3852,
496,
35545,
284,
3641,
55609,
198,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
5756,
66424,
284,
3641,
55609,
198,
8728,
4570,
5156,
19980,
284,
364,
939,
7331,
6,
55609,
198,
3239,
2517,
284,
2290,
55609,
198,
3239,
2517,
38713,
284,
2290,
55609,
198,
3239,
67379,
18519,
18170,
284,
2290,
55609,
198,
3239,
14301,
284,
3436,
55609,
198,
850,
6619,
50626,
284,
4792,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609,
198,
9184,
284,
4792,
55609,
198,
69,
43340,
284,
3641,
55609,
198,
2285,
14100,
53598,
284,
4792,
55609,
198,
13397,
62,
3935,
34170,
284,
1754,
55609,
198,
2880,
38348,
496,
5228,
284,
2290,
55609,
198,
1083,
38348,
496,
5228,
284,
220,
15,
55609,
198,
494,
7450,
284,
3641,
55609,
198,
2252,
6265,
13735,
284,
364,
15145,
19980,
6,
55609,
198,
17801,
32958,
284,
4792,
55609,
198,
325,
53810,
4432,
284,
2290,
55609,
198,
40903,
52721,
284,
3641,
55609,
198,
2150,
284,
2290,
55609,
198,
55033,
40678,
57955,
27345,
284,
3641,
55609,
198,
817,
32154,
9324,
284,
3641,
55609,
198,
7212,
5823,
284,
3082,
55609,
198,
7212,
52991,
284,
3641,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html |
971e25d5e1d8-4 | use_enum_values = False¶
validate_all = True¶
validate_assignment = False¶ | [
817,
32154,
9324,
284,
3641,
55609,
198,
7212,
5823,
284,
3082,
55609,
198,
7212,
52991,
284,
3641,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html |
f79178678bd0-0 | langchain.utilities.loading.try_load_from_hub¶
langchain.utilities.loading.try_load_from_hub(path: Union[str, Path], loader: Callable[[str], T], valid_prefix: str, valid_suffixes: Set[str], **kwargs: Any) → Optional[T][source]¶
Load configuration from hub. Returns None if path is not a hub path. | [
5317,
8995,
63795,
25908,
49879,
12693,
5791,
95096,
55609,
198,
5317,
8995,
63795,
25908,
49879,
12693,
5791,
95096,
5698,
25,
9323,
17752,
11,
8092,
1145,
16432,
25,
54223,
15873,
496,
1145,
350,
1145,
2764,
14301,
25,
610,
11,
2764,
38251,
288,
25,
2638,
17752,
1145,
3146,
9872,
25,
5884,
8,
11651,
12536,
20961,
1483,
2484,
60,
55609,
198,
6003,
6683,
505,
19240,
13,
220,
5295,
2290,
422,
1853,
374,
539,
264,
19240,
1853,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.loading.try_load_from_hub.html |
179e2b740f9c-0 | langchain.utilities.serpapi.SerpAPIWrapper¶
class langchain.utilities.serpapi.SerpAPIWrapper(*, search_engine: Any = None, params: dict = {'engine': 'google', 'gl': 'us', 'google_domain': 'google.com', 'hl': 'en'}, serpapi_api_key: Optional[str] = None, aiosession: Optional[ClientSession] = None)[source]¶
Bases: BaseModel
Wrapper around SerpAPI.
To use, you should have the google-search-results python package installed,
and the environment variable SERPAPI_API_KEY set with your API key, or pass
serpapi_api_key as a named parameter to the constructor.
Example
from langchain.utilities import SerpAPIWrapper
serpapi = SerpAPIWrapper()
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param aiosession: Optional[aiohttp.client.ClientSession] = None¶
param params: dict = {'engine': 'google', 'gl': 'us', 'google_domain': 'google.com', 'hl': 'en'}¶
param serpapi_api_key: Optional[str] = None¶
async aresults(query: str) → dict[source]¶
Use aiohttp to run query through SerpAPI and return the results async.
async arun(query: str, **kwargs: Any) → str[source]¶
Run query through SerpAPI and parse result async.
get_params(query: str) → Dict[str, str][source]¶
Get parameters for SerpAPI.
results(query: str) → dict[source]¶
Run query through SerpAPI and return the raw result.
run(query: str, **kwargs: Any) → str[source]¶ | [
5317,
8995,
63795,
516,
23457,
2113,
815,
23457,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
516,
23457,
2113,
815,
23457,
7227,
11803,
4163,
11,
2778,
25860,
25,
5884,
284,
2290,
11,
3712,
25,
6587,
284,
5473,
8680,
1232,
364,
17943,
518,
364,
6200,
1232,
364,
355,
518,
364,
17943,
20715,
1232,
364,
17943,
916,
518,
364,
18442,
1232,
364,
268,
25762,
1446,
79,
2113,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
2212,
8409,
79,
7227,
627,
1271,
1005,
11,
499,
1288,
617,
279,
11819,
19993,
65870,
10344,
6462,
10487,
345,
438,
279,
4676,
3977,
14311,
47,
7227,
11669,
6738,
743,
449,
701,
5446,
1401,
11,
477,
1522,
198,
805,
79,
2113,
11959,
3173,
439,
264,
7086,
5852,
311,
279,
4797,
627,
13617,
198,
1527,
8859,
8995,
63795,
1179,
8409,
79,
7227,
11803,
198,
805,
79,
2113,
284,
8409,
79,
7227,
11803,
746,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
6718,
11978,
5396,
60,
284,
2290,
55609,
198,
913,
3712,
25,
6587,
284,
5473,
8680,
1232,
364,
17943,
518,
364,
6200,
1232,
364,
355,
518,
364,
17943,
20715,
1232,
364,
17943,
916,
518,
364,
18442,
1232,
364,
268,
8439,
55609,
198,
913,
1446,
79,
2113,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
7847,
264,
8234,
10974,
25,
610,
8,
11651,
6587,
76747,
60,
55609,
198,
10464,
85043,
1277,
311,
1629,
3319,
1555,
8409,
79,
7227,
323,
471,
279,
3135,
3393,
627,
7847,
802,
359,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
8409,
79,
7227,
323,
4820,
1121,
3393,
627,
456,
6887,
10974,
25,
610,
8,
11651,
30226,
17752,
11,
610,
1483,
2484,
60,
55609,
198,
1991,
5137,
369,
8409,
79,
7227,
627,
8234,
10974,
25,
610,
8,
11651,
6587,
76747,
60,
55609,
198,
6869,
3319,
1555,
8409,
79,
7227,
323,
471,
279,
7257,
1121,
627,
6236,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.serpapi.SerpAPIWrapper.html |
179e2b740f9c-1 | run(query: str, **kwargs: Any) → str[source]¶
Run query through SerpAPI and parse result.
validator validate_environment » all fields[source]¶
Validate that api key and python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | [
6236,
10974,
25,
610,
11,
3146,
9872,
25,
5884,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
8409,
79,
7227,
323,
4820,
1121,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
277,
88951,
9962,
43255,
284,
3082,
55609,
198,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.serpapi.SerpAPIWrapper.html |
6524c3fefdea-0 | langchain.utilities.searx_search.SearxResults¶
class langchain.utilities.searx_search.SearxResults(data: str)[source]¶
Bases: dict
Dict like wrapper around search api results.
Take a raw result from Searx and make it into a dict like object.
Methods
__init__(data)
Take a raw result from Searx and make it into a dict like object.
clear()
copy()
fromkeys([value])
Create a new dictionary with keys from iterable and values set to value.
get(key[, default])
Return the value for key if key is in the dictionary, else default.
items()
keys()
pop(k[,d])
If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem()
Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])
Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()
Attributes
answers
Helper accessor on the json result.
results
Silence mypy for accessing this field.
clear() → None. Remove all items from D.¶
copy() → a shallow copy of D¶
fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
get(key, default=None, /)¶ | [
5317,
8995,
63795,
4624,
277,
87,
10947,
815,
686,
87,
10001,
55609,
198,
1058,
8859,
8995,
63795,
4624,
277,
87,
10947,
815,
686,
87,
10001,
2657,
25,
610,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
6587,
198,
13755,
1093,
13564,
2212,
2778,
6464,
3135,
627,
18293,
264,
7257,
1121,
505,
328,
686,
87,
323,
1304,
433,
1139,
264,
6587,
1093,
1665,
627,
18337,
198,
565,
2381,
3889,
695,
340,
18293,
264,
7257,
1121,
505,
328,
686,
87,
323,
1304,
433,
1139,
264,
6587,
1093,
1665,
627,
7574,
746,
8728,
746,
1527,
10786,
2625,
970,
2608,
4110,
264,
502,
11240,
449,
7039,
505,
51934,
323,
2819,
743,
311,
907,
627,
456,
4962,
38372,
4194,
2309,
2608,
5715,
279,
907,
369,
1401,
422,
1401,
374,
304,
279,
11240,
11,
775,
1670,
627,
3699,
746,
10786,
746,
8539,
6097,
38372,
67,
2608,
2746,
279,
1401,
374,
539,
1766,
11,
471,
279,
1670,
422,
2728,
26,
6062,
11,
4933,
264,
39194,
627,
8539,
1224,
746,
13319,
323,
471,
264,
320,
798,
11,
907,
8,
6857,
439,
264,
220,
17,
2442,
6189,
627,
751,
2309,
4962,
38372,
4194,
2309,
2608,
14099,
1401,
449,
264,
907,
315,
1670,
422,
1401,
374,
539,
304,
279,
11240,
627,
2443,
2625,
36,
11,
4194,
79441,
37,
340,
2746,
469,
374,
3118,
323,
706,
264,
662,
10786,
368,
1749,
11,
1243,
1587,
25,
220,
369,
597,
304,
469,
25,
423,
6874,
60,
284,
469,
6874,
60,
1442,
469,
374,
3118,
323,
37856,
264,
662,
10786,
368,
1749,
11,
1243,
1587,
25,
220,
369,
597,
11,
348,
304,
469,
25,
423,
6874,
60,
284,
348,
763,
3060,
1162,
11,
420,
374,
8272,
555,
25,
369,
597,
304,
435,
25,
220,
423,
6874,
60,
284,
435,
6874,
933,
3745,
746,
10738,
198,
25739,
198,
5628,
45484,
389,
279,
3024,
1121,
627,
8234,
198,
28671,
768,
856,
3368,
369,
32888,
420,
2115,
627,
7574,
368,
11651,
2290,
13,
4194,
11016,
682,
3673,
505,
423,
13,
55609,
198,
8728,
368,
11651,
264,
26682,
3048,
315,
423,
55609,
198,
1527,
10786,
3764,
5980,
11,
611,
8,
55609,
198,
4110,
264,
502,
11240,
449,
7039,
505,
51934,
323,
2819,
743,
311,
907,
627,
456,
4962,
11,
1670,
5980,
11,
611,
8,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html |
6524c3fefdea-1 | get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
items() → a set-like object providing a view on D's items¶
keys() → a set-like object providing a view on D's keys¶
pop(k[, d]) → v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise,
raise a KeyError.
popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order.
Raises KeyError if the dict is empty.
setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
update([E, ]**F) → None. Update D from dict/iterable E and F.¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]
If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
values() → an object providing a view on D's values¶
property answers: Any¶
Helper accessor on the json result. | [
456,
4962,
11,
1670,
5980,
11,
611,
8,
55609,
198,
5715,
279,
907,
369,
1401,
422,
1401,
374,
304,
279,
11240,
11,
775,
1670,
627,
3699,
368,
11651,
264,
743,
12970,
1665,
8405,
264,
1684,
389,
423,
596,
3673,
55609,
198,
10786,
368,
11651,
264,
743,
12970,
1665,
8405,
264,
1684,
389,
423,
596,
7039,
55609,
198,
8539,
6097,
38372,
294,
2526,
11651,
348,
11,
4148,
5300,
1401,
323,
471,
279,
12435,
907,
13,
55609,
198,
2746,
279,
1401,
374,
539,
1766,
11,
471,
279,
1670,
422,
2728,
26,
6062,
345,
19223,
264,
39194,
627,
8539,
1224,
368,
55609,
198,
13319,
323,
471,
264,
320,
798,
11,
907,
8,
6857,
439,
264,
220,
17,
2442,
6189,
627,
55328,
527,
6052,
304,
445,
27088,
320,
4354,
3502,
11,
1176,
9994,
8,
2015,
627,
36120,
39194,
422,
279,
6587,
374,
4384,
627,
751,
2309,
4962,
11,
1670,
5980,
11,
611,
8,
55609,
198,
14099,
1401,
449,
264,
907,
315,
1670,
422,
1401,
374,
539,
304,
279,
11240,
627,
5715,
279,
907,
369,
1401,
422,
1401,
374,
304,
279,
11240,
11,
775,
1670,
627,
2443,
2625,
36,
11,
2331,
334,
37,
8,
11651,
2290,
13,
4194,
5666,
423,
505,
6587,
14,
2058,
481,
469,
323,
435,
13,
55609,
198,
2746,
469,
374,
3118,
323,
706,
264,
662,
10786,
368,
1749,
11,
1243,
1587,
25,
220,
369,
597,
304,
469,
25,
423,
6874,
60,
284,
469,
6874,
933,
2746,
469,
374,
3118,
323,
37856,
264,
662,
10786,
368,
1749,
11,
1243,
1587,
25,
220,
369,
597,
11,
348,
304,
469,
25,
423,
6874,
60,
284,
348,
198,
644,
3060,
1162,
11,
420,
374,
8272,
555,
25,
369,
597,
304,
435,
25,
220,
423,
6874,
60,
284,
435,
6874,
933,
3745,
368,
11651,
459,
1665,
8405,
264,
1684,
389,
423,
596,
2819,
55609,
198,
3784,
11503,
25,
5884,
55609,
198,
5628,
45484,
389,
279,
3024,
1121,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html |
de464ed3ce0f-0 | langchain.utilities.openapi.OpenAPISpec¶
class langchain.utilities.openapi.OpenAPISpec(*, openapi: str = '3.1.0', info: Info, jsonSchemaDialect: Optional[str] = None, servers: List[Server] = [Server(url='/', description=None, variables=None)], paths: Optional[Dict[str, PathItem]] = None, webhooks: Optional[Dict[str, Union[PathItem, Reference]]] = None, components: Optional[Components] = None, security: Optional[List[Dict[str, List[str]]]] = None, tags: Optional[List[Tag]] = None, externalDocs: Optional[ExternalDocumentation] = None)[source]¶
Bases: OpenAPI
OpenAPI Model that removes misformatted parts of the spec.
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 components: Optional[openapi_schema_pydantic.v3.v3_1_0.components.Components] = None¶
An element to hold various schemas for the document.
param externalDocs: Optional[openapi_schema_pydantic.v3.v3_1_0.external_documentation.ExternalDocumentation] = None¶
Additional external documentation.
param info: openapi_schema_pydantic.v3.v3_1_0.info.Info [Required]¶
REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.
param jsonSchemaDialect: Optional[str] = None¶
The default value for the $schema keyword within [Schema Objects](#schemaObject)
contained within this OAS document. This MUST be in the form of a URI.
param openapi: str = '3.1.0'¶
REQUIRED. This string MUST be the [version number](#versions) | [
5317,
8995,
63795,
59920,
13250,
2599,
1669,
1007,
55609,
198,
1058,
8859,
8995,
63795,
59920,
13250,
2599,
1669,
1007,
4163,
11,
1825,
2113,
25,
610,
284,
364,
18,
13,
16,
13,
15,
518,
3630,
25,
13374,
11,
3024,
8802,
35,
56156,
25,
12536,
17752,
60,
284,
2290,
11,
16692,
25,
1796,
58,
5592,
60,
284,
510,
5592,
6659,
1151,
14688,
4096,
5980,
11,
7482,
5980,
26090,
13006,
25,
12536,
58,
13755,
17752,
11,
8092,
1256,
5163,
284,
2290,
11,
3566,
39660,
25,
12536,
58,
13755,
17752,
11,
9323,
58,
1858,
1256,
11,
17650,
5163,
60,
284,
2290,
11,
6956,
25,
12536,
58,
10660,
60,
284,
2290,
11,
4868,
25,
12536,
53094,
58,
13755,
17752,
11,
1796,
17752,
5163,
5163,
284,
2290,
11,
9681,
25,
12536,
53094,
58,
5786,
5163,
284,
2290,
11,
9434,
64207,
25,
12536,
58,
27002,
65434,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
5377,
7227,
198,
5109,
7227,
5008,
430,
29260,
5906,
50978,
5596,
315,
279,
1424,
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,
6956,
25,
12536,
58,
2569,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
20641,
60888,
60,
284,
2290,
55609,
198,
2127,
2449,
311,
3412,
5370,
62900,
369,
279,
2246,
627,
913,
9434,
64207,
25,
12536,
58,
2569,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
65327,
27326,
367,
5231,
15702,
65434,
60,
284,
2290,
55609,
198,
30119,
9434,
9904,
627,
913,
3630,
25,
1825,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
5506,
20736,
510,
8327,
60,
55609,
198,
90915,
13,
37717,
11408,
922,
279,
5446,
13,
578,
11408,
40330,
387,
1511,
555,
5507,
287,
439,
2631,
627,
913,
3024,
8802,
35,
56156,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
791,
1670,
907,
369,
279,
400,
17801,
16570,
2949,
510,
8802,
25083,
9725,
2,
17801,
1211,
340,
53615,
2949,
420,
507,
1950,
2246,
13,
1115,
28832,
387,
304,
279,
1376,
315,
264,
16403,
627,
913,
1825,
2113,
25,
610,
284,
364,
18,
13,
16,
13,
15,
6,
55609,
198,
90915,
13,
1115,
925,
28832,
387,
279,
510,
4464,
1396,
9725,
2,
29390,
8
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html |
de464ed3ce0f-1 | REQUIRED. This string MUST be the [version number](#versions)
of the OpenAPI Specification that the OpenAPI document uses.
The openapi field SHOULD be used by tooling to interpret the OpenAPI document.
This is not related to the API [info.version](#infoVersion) string.
param paths: Optional[Dict[str, openapi_schema_pydantic.v3.v3_1_0.path_item.PathItem]] = None¶
The available paths and operations for the API.
param security: Optional[List[Dict[str, List[str]]]] = None¶
A declaration of which security mechanisms can be used across the API.
The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement ({}) can be included in the array.
param servers: List[openapi_schema_pydantic.v3.v3_1_0.server.Server] = [Server(url='/', description=None, variables=None)]¶
An array of Server Objects, which provide connectivity information to a target server.
If the servers property is not provided, or is an empty array,
the default value would be a [Server Object](#serverObject) with a [url](#serverUrl) value of /.
param tags: Optional[List[openapi_schema_pydantic.v3.v3_1_0.tag.Tag]] = None¶
A list of tags used by the document with additional metadata.
The order of the tags can be used to reflect on their order by the parsing tools.
Not all tags that are used by the [Operation Object](#operationObject) must be declared.
The tags that are not declared MAY be organized randomly or based on the tools’ logic.
Each tag name in the list MUST be unique. | [
90915,
13,
1115,
925,
28832,
387,
279,
510,
4464,
1396,
9725,
2,
29390,
340,
1073,
279,
5377,
7227,
52377,
430,
279,
5377,
7227,
2246,
5829,
627,
791,
1825,
2113,
2115,
61975,
387,
1511,
555,
5507,
287,
311,
14532,
279,
5377,
7227,
2246,
627,
2028,
374,
539,
5552,
311,
279,
5446,
510,
2801,
20049,
9725,
2,
2801,
5755,
8,
925,
627,
913,
13006,
25,
12536,
58,
13755,
17752,
11,
1825,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
3960,
5752,
17932,
1256,
5163,
284,
2290,
55609,
198,
791,
2561,
13006,
323,
7677,
369,
279,
5446,
627,
913,
4868,
25,
12536,
53094,
58,
13755,
17752,
11,
1796,
17752,
5163,
5163,
284,
2290,
55609,
198,
32,
18489,
315,
902,
4868,
24717,
649,
387,
1511,
4028,
279,
5446,
627,
791,
1160,
315,
2819,
5764,
10778,
4868,
16686,
6302,
430,
649,
387,
1511,
627,
7456,
832,
315,
279,
4868,
16686,
6302,
1205,
311,
387,
20097,
311,
37926,
264,
1715,
627,
44259,
7677,
649,
2882,
420,
7419,
627,
1271,
1304,
4868,
10309,
11,
459,
4384,
4868,
16686,
9657,
5525,
649,
387,
5343,
304,
279,
1358,
627,
913,
16692,
25,
1796,
58,
2569,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
12926,
23858,
60,
284,
510,
5592,
6659,
1151,
14688,
4096,
5980,
11,
7482,
5980,
7400,
55609,
198,
2127,
1358,
315,
8588,
25083,
11,
902,
3493,
31357,
2038,
311,
264,
2218,
3622,
627,
2746,
279,
16692,
3424,
374,
539,
3984,
11,
477,
374,
459,
4384,
1358,
345,
1820,
1670,
907,
1053,
387,
264,
510,
5592,
3075,
9725,
2,
4120,
1211,
8,
449,
264,
510,
1103,
9725,
2,
4120,
2934,
8,
907,
315,
611,
627,
913,
9681,
25,
12536,
53094,
58,
2569,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
12681,
24602,
5163,
284,
2290,
55609,
198,
32,
1160,
315,
9681,
1511,
555,
279,
2246,
449,
5217,
11408,
627,
791,
2015,
315,
279,
9681,
649,
387,
1511,
311,
8881,
389,
872,
2015,
555,
279,
23115,
7526,
627,
2688,
682,
9681,
430,
527,
1511,
555,
279,
510,
8598,
3075,
9725,
2,
9446,
1211,
8,
2011,
387,
14610,
627,
791,
9681,
430,
527,
539,
14610,
40330,
387,
17057,
27716,
477,
3196,
389,
279,
7526,
529,
12496,
627,
4959,
4877,
836,
304,
279,
1160,
28832,
387,
5016,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html |
de464ed3ce0f-2 | Each tag name in the list MUST be unique.
param webhooks: Optional[Dict[str, Union[openapi_schema_pydantic.v3.v3_1_0.path_item.PathItem, openapi_schema_pydantic.v3.v3_1_0.reference.Reference]]] = None¶
The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement.
Closely related to the callbacks feature, this section describes requests initiated other than by an API call,
for example by an out of band registration.
The key name is a unique string to refer to each webhook,
while the (optionally referenced) Path Item Object describes a request
that may be initiated by the API provider and the expected responses.
An [example](../examples/v3.1/webhook-example.yaml) is available.
classmethod from_file(path: Union[str, Path]) → OpenAPISpec[source]¶
Get an OpenAPI spec from a file path.
classmethod from_spec_dict(spec_dict: dict) → OpenAPISpec[source]¶
Get an OpenAPI spec from a dict.
classmethod from_text(text: str) → OpenAPISpec[source]¶
Get an OpenAPI spec from a text.
classmethod from_url(url: str) → OpenAPISpec[source]¶
Get an OpenAPI spec from a URL.
static get_cleaned_operation_id(operation: Operation, path: str, method: str) → str[source]¶
Get a cleaned operation id from an operation id.
get_methods_for_path(path: str) → List[str][source]¶
Return a list of valid methods for the specified path.
get_operation(path: str, method: str) → Operation[source]¶
Get the operation object for a given path and HTTP method.
get_parameters_for_operation(operation: Operation) → List[Parameter][source]¶ | [
4959,
4877,
836,
304,
279,
1160,
28832,
387,
5016,
627,
913,
3566,
39660,
25,
12536,
58,
13755,
17752,
11,
9323,
58,
2569,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
3960,
5752,
17932,
1256,
11,
1825,
2113,
26443,
623,
41221,
8322,
3211,
18,
3211,
18,
62,
16,
62,
15,
51613,
59516,
5163,
60,
284,
2290,
55609,
198,
791,
19957,
3566,
39660,
430,
40330,
387,
4036,
439,
961,
315,
420,
5446,
323,
430,
279,
5446,
11761,
40330,
5268,
311,
4305,
627,
34,
2353,
989,
5552,
311,
279,
27777,
4668,
11,
420,
3857,
16964,
7540,
33230,
1023,
1109,
555,
459,
5446,
1650,
345,
2000,
3187,
555,
459,
704,
315,
7200,
12506,
627,
791,
1401,
836,
374,
264,
5016,
925,
311,
8464,
311,
1855,
76368,
345,
3556,
279,
320,
2091,
750,
25819,
8,
8092,
5858,
3075,
16964,
264,
1715,
198,
9210,
1253,
387,
33230,
555,
279,
5446,
9287,
323,
279,
3685,
14847,
627,
2127,
510,
8858,
9725,
1266,
52768,
5574,
18,
13,
16,
22561,
21543,
44530,
34506,
8,
374,
2561,
627,
27853,
505,
2517,
5698,
25,
9323,
17752,
11,
8092,
2526,
11651,
5377,
2599,
1669,
1007,
76747,
60,
55609,
198,
1991,
459,
5377,
7227,
1424,
505,
264,
1052,
1853,
627,
27853,
505,
13908,
5356,
39309,
5356,
25,
6587,
8,
11651,
5377,
2599,
1669,
1007,
76747,
60,
55609,
198,
1991,
459,
5377,
7227,
1424,
505,
264,
6587,
627,
27853,
505,
4424,
7383,
25,
610,
8,
11651,
5377,
2599,
1669,
1007,
76747,
60,
55609,
198,
1991,
459,
5377,
7227,
1424,
505,
264,
1495,
627,
27853,
505,
2975,
6659,
25,
610,
8,
11651,
5377,
2599,
1669,
1007,
76747,
60,
55609,
198,
1991,
459,
5377,
7227,
1424,
505,
264,
5665,
627,
2020,
636,
20144,
291,
33665,
851,
53447,
25,
17145,
11,
1853,
25,
610,
11,
1749,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
264,
28822,
5784,
887,
505,
459,
5784,
887,
627,
456,
37184,
5595,
2703,
5698,
25,
610,
8,
11651,
1796,
17752,
1483,
2484,
60,
55609,
198,
5715,
264,
1160,
315,
2764,
5528,
369,
279,
5300,
1853,
627,
456,
33665,
5698,
25,
610,
11,
1749,
25,
610,
8,
11651,
17145,
76747,
60,
55609,
198,
1991,
279,
5784,
1665,
369,
264,
2728,
1853,
323,
10339,
1749,
627,
456,
18764,
5595,
33665,
53447,
25,
17145,
8,
11651,
1796,
58,
5078,
1483,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html |
de464ed3ce0f-3 | get_parameters_for_operation(operation: Operation) → List[Parameter][source]¶
Get the components for a given operation.
get_parameters_for_path(path: str) → List[Parameter][source]¶
get_referenced_schema(ref: Reference) → Schema[source]¶
Get a schema (or nested reference) or err.
get_request_body_for_operation(operation: Operation) → Optional[RequestBody][source]¶
Get the request body for a given operation.
get_schema(schema: Union[Reference, Schema]) → Schema[source]¶
classmethod parse_obj(obj: dict) → OpenAPISpec[source]¶
property base_url: str¶
Get the base url.
model Config¶
Bases: object
extra = 'ignore'¶ | [
456,
18764,
5595,
33665,
53447,
25,
17145,
8,
11651,
1796,
58,
5078,
1483,
2484,
60,
55609,
198,
1991,
279,
6956,
369,
264,
2728,
5784,
627,
456,
18764,
5595,
2703,
5698,
25,
610,
8,
11651,
1796,
58,
5078,
1483,
2484,
60,
55609,
198,
456,
74486,
5886,
26443,
13624,
25,
17650,
8,
11651,
12824,
76747,
60,
55609,
198,
1991,
264,
11036,
320,
269,
24997,
5905,
8,
477,
1886,
627,
456,
8052,
14446,
5595,
33665,
53447,
25,
17145,
8,
11651,
12536,
58,
34434,
1483,
2484,
60,
55609,
198,
1991,
279,
1715,
2547,
369,
264,
2728,
5784,
627,
456,
26443,
43835,
25,
9323,
58,
9032,
11,
12824,
2526,
11651,
12824,
76747,
60,
55609,
198,
27853,
4820,
7478,
6922,
25,
6587,
8,
11651,
5377,
2599,
1669,
1007,
76747,
60,
55609,
198,
3784,
2385,
2975,
25,
610,
55609,
198,
1991,
279,
2385,
2576,
627,
2590,
5649,
55609,
198,
33,
2315,
25,
1665,
198,
15824,
284,
364,
13431,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html |
4c7a57150a4a-0 | langchain.utilities.vertexai.init_vertexai¶
langchain.utilities.vertexai.init_vertexai(project: Optional[str] = None, location: Optional[str] = None, credentials: Optional[Credentials] = None) → None[source]¶
Init vertexai.
Parameters
project – The default GCP project to use when making Vertex API calls.
location – The default location to use when making API calls.
credentials – The default custom
credentials to use when making API calls. If not provided credentials
will be ascertained from the environment.
Raises
ImportError – If importing vertexai SDK did not succeed. | [
5317,
8995,
63795,
48375,
2192,
8435,
27709,
2192,
55609,
198,
5317,
8995,
63795,
48375,
2192,
8435,
27709,
2192,
21855,
25,
12536,
17752,
60,
284,
2290,
11,
3813,
25,
12536,
17752,
60,
284,
2290,
11,
16792,
25,
12536,
58,
28123,
60,
284,
2290,
8,
11651,
2290,
76747,
60,
55609,
198,
3888,
12202,
2192,
627,
9905,
198,
5094,
1389,
578,
1670,
480,
7269,
2447,
311,
1005,
994,
3339,
24103,
5446,
6880,
627,
2588,
1389,
578,
1670,
3813,
311,
1005,
994,
3339,
5446,
6880,
627,
33453,
1389,
578,
1670,
2587,
198,
33453,
311,
1005,
994,
3339,
5446,
6880,
13,
1442,
539,
3984,
16792,
198,
14724,
387,
439,
12525,
2692,
505,
279,
4676,
627,
36120,
198,
11772,
1480,
1389,
1442,
50995,
12202,
2192,
27721,
1550,
539,
12265,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.vertexai.init_vertexai.html |
ee5cf53b09df-0 | langchain.utilities.jira.JiraAPIWrapper¶ | [
5317,
8995,
63795,
1190,
9008,
3587,
9008,
7227,
11803,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-1 | class langchain.utilities.jira.JiraAPIWrapper(*, jira: Any = None, confluence: Any = None, jira_username: Optional[str] = None, jira_api_token: Optional[str] = None, jira_instance_url: Optional[str] = None, operations: List[Dict] = [{'mode': 'jql', 'name': 'JQL Query', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira jql API, useful when you need to search for Jira issues.\n The input to this tool is a JQL query string, and will be passed into atlassian-python-api\'s Jira `jql` function,\n For example, to find all the issues in project "Test" assigned to the me, you would pass in the following string:\n project = Test AND assignee = currentUser()\n or to find issues with summaries that contain the word "test", you would pass in the following string:\n summary ~ \'test\'\n '}, {'mode': 'get_projects', 'name': 'Get Projects', 'description': "\n This tool is a wrapper around atlassian-python-api's Jira project API, \n useful when you need to fetch all the projects the user has access to, find out how many projects there are, or as an intermediary step that involv searching by projects. \n there is no input to this tool.\n "}, {'mode': 'create_issue', 'name': 'Create Issue', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira issue_create API, useful when you need to create a Jira issue. \n The input to this tool is a dictionary specifying the fields of the Jira issue, and will be passed into atlassian-python-api\'s Jira `issue_create` | [
1058,
8859,
8995,
63795,
1190,
9008,
3587,
9008,
7227,
11803,
4163,
11,
503,
9008,
25,
5884,
284,
2290,
11,
390,
41116,
25,
5884,
284,
2290,
11,
503,
9008,
22316,
25,
12536,
17752,
60,
284,
2290,
11,
503,
9008,
11959,
6594,
25,
12536,
17752,
60,
284,
2290,
11,
503,
9008,
12169,
2975,
25,
12536,
17752,
60,
284,
2290,
11,
7677,
25,
1796,
58,
13755,
60,
284,
62208,
8684,
1232,
364,
73,
1498,
518,
364,
609,
1232,
364,
41,
3672,
11615,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
503,
1498,
5446,
11,
5505,
994,
499,
1205,
311,
2778,
369,
622,
9008,
4819,
7255,
77,
46493,
578,
1988,
311,
420,
5507,
374,
264,
622,
3672,
3319,
925,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
1595,
73,
1498,
63,
734,
27362,
77,
46493,
1789,
3187,
11,
311,
1505,
682,
279,
4819,
304,
2447,
330,
2323,
1,
12893,
311,
279,
757,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
2447,
284,
3475,
3651,
9993,
2176,
284,
32543,
63820,
77,
46493,
477,
311,
1505,
4819,
449,
70022,
430,
6782,
279,
3492,
330,
1985,
498,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
12399,
4056,
28251,
1985,
10379,
59,
77,
46493,
364,
2186,
5473,
8684,
1232,
364,
456,
59874,
518,
364,
609,
1232,
364,
1991,
32323,
518,
364,
4789,
1232,
2990,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
596,
622,
9008,
2447,
5446,
11,
1144,
77,
46493,
5505,
994,
499,
1205,
311,
7963,
682,
279,
7224,
279,
1217,
706,
2680,
311,
11,
1505,
704,
1268,
1690,
7224,
1070,
527,
11,
477,
439,
459,
95170,
3094,
430,
4457,
85,
15389,
555,
7224,
13,
1144,
77,
46493,
1070,
374,
912,
1988,
311,
420,
5507,
7255,
77,
46493,
330,
2186,
5473,
8684,
1232,
364,
3261,
54440,
518,
364,
609,
1232,
364,
4110,
26292,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
4360,
8827,
5446,
11,
5505,
994,
499,
1205,
311,
1893,
264,
622,
9008,
4360,
13,
1144,
77,
46493,
578,
1988,
311,
420,
5507,
374,
264,
11240,
38938,
279,
5151,
315,
279,
622,
9008,
4360,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
1595,
11407,
8827,
63
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-2 | issue, and will be passed into atlassian-python-api\'s Jira `issue_create` function.\n For example, to create a low priority task called "test issue" with description "test description", you would pass in the following dictionary: \n {{"summary": "test issue", "description": "test description", "issuetype": {{"name": "Task"}}, "priority": {{"name": "Low"}}}}\n '}, {'mode': 'other', 'name': 'Catch all Jira API call', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira API.\n There are other dedicated tools for fetching all projects, and creating and searching for issues, \n use this tool if you need to perform any other actions allowed by the atlassian-python-api Jira API.\n The input to this tool is line of python code that calls a function from atlassian-python-api\'s Jira API\n For example, to update the summary field of an issue, you would pass in the following string:\n self.jira.update_issue_field(key, {{"summary": "New summary"}})\n or to find out how many projects are in the Jira instance, you would pass in the following string:\n self.jira.projects()\n For more information on the Jira API, refer to https://atlassian-python-api.readthedocs.io/jira.html\n '}, {'mode': 'create_page', 'name': 'Create confluence page', 'description': 'This tool is a wrapper around atlassian-python-api\'s Confluence \natlassian-python-api API, useful when you need to create a Confluence page. The input to this tool is a dictionary \nspecifying the fields of the Confluence page, and will be passed into atlassian-python-api\'s Confluence `create_page` | [
11407,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
1595,
11407,
8827,
63,
734,
7255,
77,
46493,
1789,
3187,
11,
311,
1893,
264,
3428,
10844,
3465,
2663,
330,
1985,
4360,
1,
449,
4096,
330,
1985,
4096,
498,
499,
1053,
1522,
304,
279,
2768,
11240,
25,
1144,
77,
46493,
314,
5018,
1743,
794,
330,
1985,
4360,
498,
330,
4789,
794,
330,
1985,
4096,
498,
330,
1056,
99440,
794,
314,
5018,
609,
794,
330,
6396,
9388,
2186,
330,
24498,
794,
314,
5018,
609,
794,
330,
25162,
32075,
3500,
59,
77,
46493,
364,
2186,
5473,
8684,
1232,
364,
1605,
518,
364,
609,
1232,
364,
58860,
682,
622,
9008,
5446,
1650,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
5446,
7255,
77,
46493,
2684,
527,
1023,
12514,
7526,
369,
45334,
682,
7224,
11,
323,
6968,
323,
15389,
369,
4819,
11,
1144,
77,
46493,
1005,
420,
5507,
422,
499,
1205,
311,
2804,
904,
1023,
6299,
5535,
555,
279,
520,
90697,
73029,
24851,
622,
9008,
5446,
7255,
77,
46493,
578,
1988,
311,
420,
5507,
374,
1584,
315,
10344,
2082,
430,
6880,
264,
734,
505,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
5446,
1734,
46493,
1789,
3187,
11,
311,
2713,
279,
12399,
2115,
315,
459,
4360,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
659,
1190,
9008,
5430,
54440,
5121,
4962,
11,
314,
5018,
1743,
794,
330,
3648,
12399,
32075,
10929,
77,
46493,
477,
311,
1505,
704,
1268,
1690,
7224,
527,
304,
279,
622,
9008,
2937,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
659,
1190,
9008,
60456,
63820,
77,
46493,
1789,
810,
2038,
389,
279,
622,
9008,
5446,
11,
8464,
311,
3788,
1129,
266,
90697,
73029,
24851,
4217,
79371,
14460,
4340,
4537,
9008,
2628,
1734,
46493,
364,
2186,
5473,
8684,
1232,
364,
3261,
6257,
518,
364,
609,
1232,
364,
4110,
390,
41116,
2199,
518,
364,
4789,
1232,
364,
2028,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
1221,
41116,
1144,
34397,
90697,
73029,
24851,
5446,
11,
5505,
994,
499,
1205,
311,
1893,
264,
1221,
41116,
2199,
13,
578,
1988,
311,
420,
5507,
374,
264,
11240,
1144,
4511,
1007,
7922,
279,
5151,
315,
279,
1221,
41116,
2199,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
1221,
41116,
1595,
3261,
6257,
63
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-3 | page, and will be passed into atlassian-python-api\'s Confluence `create_page` \nfunction. For example, to create a page in the DEMO space titled "This is the title" with body "This is the body. You can use \n<strong>HTML tags</strong>!", you would pass in the following dictionary: {{"space": "DEMO", "title":"This is the \ntitle","body":"This is the body. You can use <strong>HTML tags</strong>!"}} '}])[source]¶ | [
2964,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
1221,
41116,
1595,
3261,
6257,
63,
1144,
77,
1723,
13,
1789,
3187,
11,
311,
1893,
264,
2199,
304,
279,
51914,
46,
3634,
25891,
330,
2028,
374,
279,
2316,
1,
449,
2547,
330,
2028,
374,
279,
2547,
13,
1472,
649,
1005,
1144,
77,
49747,
29,
5959,
9681,
524,
4620,
29,
19318,
499,
1053,
1522,
304,
279,
2768,
11240,
25,
314,
5018,
8920,
794,
330,
1170,
10754,
498,
330,
2150,
3332,
2028,
374,
279,
1144,
406,
1017,
2247,
2664,
3332,
2028,
374,
279,
2547,
13,
1472,
649,
1005,
366,
4620,
29,
5959,
9681,
524,
4620,
29,
9135,
3500,
41174,
41105,
2484,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-4 | Bases: BaseModel
Wrapper for Jira API.
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 confluence: Any = None¶
param jira_api_token: Optional[str] = None¶
param jira_instance_url: Optional[str] = None¶
param jira_username: Optional[str] = None¶ | [
33,
2315,
25,
65705,
198,
11803,
369,
622,
9008,
5446,
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,
390,
41116,
25,
5884,
284,
2290,
55609,
198,
913,
503,
9008,
11959,
6594,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
503,
9008,
12169,
2975,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
503,
9008,
22316,
25,
12536,
17752,
60,
284,
2290,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-5 | param operations: List[Dict] = [{'mode': 'jql', 'name': 'JQL Query', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira jql API, useful when you need to search for Jira issues.\n The input to this tool is a JQL query string, and will be passed into atlassian-python-api\'s Jira `jql` function,\n For example, to find all the issues in project "Test" assigned to the me, you would pass in the following string:\n project = Test AND assignee = currentUser()\n or to find issues with summaries that contain the word "test", you would pass in the following string:\n summary ~ \'test\'\n '}, {'mode': 'get_projects', 'name': 'Get Projects', 'description': "\n This tool is a wrapper around atlassian-python-api's Jira project API, \n useful when you need to fetch all the projects the user has access to, find out how many projects there are, or as an intermediary step that involv searching by projects. \n there is no input to this tool.\n "}, {'mode': 'create_issue', 'name': 'Create Issue', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira issue_create API, useful when you need to create a Jira issue. \n The input to this tool is a dictionary specifying the fields of the Jira issue, and will be passed into atlassian-python-api\'s Jira `issue_create` function.\n For example, to create a low priority task called "test issue" with description "test description", you would pass in the following dictionary: \n {{"summary": "test issue", "description": "test description", "issuetype": {{"name": | [
913,
7677,
25,
1796,
58,
13755,
60,
284,
62208,
8684,
1232,
364,
73,
1498,
518,
364,
609,
1232,
364,
41,
3672,
11615,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
503,
1498,
5446,
11,
5505,
994,
499,
1205,
311,
2778,
369,
622,
9008,
4819,
7255,
77,
46493,
578,
1988,
311,
420,
5507,
374,
264,
622,
3672,
3319,
925,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
1595,
73,
1498,
63,
734,
27362,
77,
46493,
1789,
3187,
11,
311,
1505,
682,
279,
4819,
304,
2447,
330,
2323,
1,
12893,
311,
279,
757,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
2447,
284,
3475,
3651,
9993,
2176,
284,
32543,
63820,
77,
46493,
477,
311,
1505,
4819,
449,
70022,
430,
6782,
279,
3492,
330,
1985,
498,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
12399,
4056,
28251,
1985,
10379,
59,
77,
46493,
364,
2186,
5473,
8684,
1232,
364,
456,
59874,
518,
364,
609,
1232,
364,
1991,
32323,
518,
364,
4789,
1232,
2990,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
596,
622,
9008,
2447,
5446,
11,
1144,
77,
46493,
5505,
994,
499,
1205,
311,
7963,
682,
279,
7224,
279,
1217,
706,
2680,
311,
11,
1505,
704,
1268,
1690,
7224,
1070,
527,
11,
477,
439,
459,
95170,
3094,
430,
4457,
85,
15389,
555,
7224,
13,
1144,
77,
46493,
1070,
374,
912,
1988,
311,
420,
5507,
7255,
77,
46493,
330,
2186,
5473,
8684,
1232,
364,
3261,
54440,
518,
364,
609,
1232,
364,
4110,
26292,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
4360,
8827,
5446,
11,
5505,
994,
499,
1205,
311,
1893,
264,
622,
9008,
4360,
13,
1144,
77,
46493,
578,
1988,
311,
420,
5507,
374,
264,
11240,
38938,
279,
5151,
315,
279,
622,
9008,
4360,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
1595,
11407,
8827,
63,
734,
7255,
77,
46493,
1789,
3187,
11,
311,
1893,
264,
3428,
10844,
3465,
2663,
330,
1985,
4360,
1,
449,
4096,
330,
1985,
4096,
498,
499,
1053,
1522,
304,
279,
2768,
11240,
25,
1144,
77,
46493,
314,
5018,
1743,
794,
330,
1985,
4360,
498,
330,
4789,
794,
330,
1985,
4096,
498,
330,
1056,
99440,
794,
314,
5018,
609,
794
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-6 | "test issue", "description": "test description", "issuetype": {{"name": "Task"}}, "priority": {{"name": "Low"}}}}\n '}, {'mode': 'other', 'name': 'Catch all Jira API call', 'description': '\n This tool is a wrapper around atlassian-python-api\'s Jira API.\n There are other dedicated tools for fetching all projects, and creating and searching for issues, \n use this tool if you need to perform any other actions allowed by the atlassian-python-api Jira API.\n The input to this tool is line of python code that calls a function from atlassian-python-api\'s Jira API\n For example, to update the summary field of an issue, you would pass in the following string:\n self.jira.update_issue_field(key, {{"summary": "New summary"}})\n or to find out how many projects are in the Jira instance, you would pass in the following string:\n self.jira.projects()\n For more information on the Jira API, refer to https://atlassian-python-api.readthedocs.io/jira.html\n '}, {'mode': 'create_page', 'name': 'Create confluence page', 'description': 'This tool is a wrapper around atlassian-python-api\'s Confluence \natlassian-python-api API, useful when you need to create a Confluence page. The input to this tool is a dictionary \nspecifying the fields of the Confluence page, and will be passed into atlassian-python-api\'s Confluence `create_page` \nfunction. For example, to create a page in the DEMO space titled "This is the title" with body "This is the body. You can use \n<strong>HTML tags</strong>!", you would pass in the following dictionary: {{"space": "DEMO", | [
1,
1985,
4360,
498,
330,
4789,
794,
330,
1985,
4096,
498,
330,
1056,
99440,
794,
314,
5018,
609,
794,
330,
6396,
9388,
2186,
330,
24498,
794,
314,
5018,
609,
794,
330,
25162,
32075,
3500,
59,
77,
46493,
364,
2186,
5473,
8684,
1232,
364,
1605,
518,
364,
609,
1232,
364,
58860,
682,
622,
9008,
5446,
1650,
518,
364,
4789,
1232,
5307,
77,
46493,
1115,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
5446,
7255,
77,
46493,
2684,
527,
1023,
12514,
7526,
369,
45334,
682,
7224,
11,
323,
6968,
323,
15389,
369,
4819,
11,
1144,
77,
46493,
1005,
420,
5507,
422,
499,
1205,
311,
2804,
904,
1023,
6299,
5535,
555,
279,
520,
90697,
73029,
24851,
622,
9008,
5446,
7255,
77,
46493,
578,
1988,
311,
420,
5507,
374,
1584,
315,
10344,
2082,
430,
6880,
264,
734,
505,
520,
90697,
73029,
24851,
10379,
82,
622,
9008,
5446,
1734,
46493,
1789,
3187,
11,
311,
2713,
279,
12399,
2115,
315,
459,
4360,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
659,
1190,
9008,
5430,
54440,
5121,
4962,
11,
314,
5018,
1743,
794,
330,
3648,
12399,
32075,
10929,
77,
46493,
477,
311,
1505,
704,
1268,
1690,
7224,
527,
304,
279,
622,
9008,
2937,
11,
499,
1053,
1522,
304,
279,
2768,
925,
7338,
77,
46493,
659,
1190,
9008,
60456,
63820,
77,
46493,
1789,
810,
2038,
389,
279,
622,
9008,
5446,
11,
8464,
311,
3788,
1129,
266,
90697,
73029,
24851,
4217,
79371,
14460,
4340,
4537,
9008,
2628,
1734,
46493,
364,
2186,
5473,
8684,
1232,
364,
3261,
6257,
518,
364,
609,
1232,
364,
4110,
390,
41116,
2199,
518,
364,
4789,
1232,
364,
2028,
5507,
374,
264,
13564,
2212,
520,
90697,
73029,
24851,
10379,
82,
1221,
41116,
1144,
34397,
90697,
73029,
24851,
5446,
11,
5505,
994,
499,
1205,
311,
1893,
264,
1221,
41116,
2199,
13,
578,
1988,
311,
420,
5507,
374,
264,
11240,
1144,
4511,
1007,
7922,
279,
5151,
315,
279,
1221,
41116,
2199,
11,
323,
690,
387,
5946,
1139,
520,
90697,
73029,
24851,
10379,
82,
1221,
41116,
1595,
3261,
6257,
63,
1144,
77,
1723,
13,
1789,
3187,
11,
311,
1893,
264,
2199,
304,
279,
51914,
46,
3634,
25891,
330,
2028,
374,
279,
2316,
1,
449,
2547,
330,
2028,
374,
279,
2547,
13,
1472,
649,
1005,
1144,
77,
49747,
29,
5959,
9681,
524,
4620,
29,
19318,
499,
1053,
1522,
304,
279,
2768,
11240,
25,
314,
5018,
8920,
794,
330,
1170,
10754,
498
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-7 | you would pass in the following dictionary: {{"space": "DEMO", "title":"This is the \ntitle","body":"This is the body. You can use <strong>HTML tags</strong>!"}} '}]¶ | [
9514,
1053,
1522,
304,
279,
2768,
11240,
25,
314,
5018,
8920,
794,
330,
1170,
10754,
498,
330,
2150,
3332,
2028,
374,
279,
1144,
406,
1017,
2247,
2664,
3332,
2028,
374,
279,
2547,
13,
1472,
649,
1005,
366,
4620,
29,
5959,
9681,
524,
4620,
29,
9135,
3500,
364,
26516,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
ee5cf53b09df-8 | issue_create(query: str) → str[source]¶
list() → List[Dict][source]¶
other(query: str) → str[source]¶
page_create(query: str) → str[source]¶
parse_issues(issues: Dict) → List[dict][source]¶
parse_projects(projects: List[dict]) → List[dict][source]¶
project() → str[source]¶
run(mode: str, query: str) → str[source]¶
search(query: str) → str[source]¶
validator validate_environment » all fields[source]¶
Validate that api key and python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
11407,
8827,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
1638,
368,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
1605,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
2964,
8827,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6534,
91332,
7,
18934,
25,
30226,
8,
11651,
1796,
58,
8644,
1483,
2484,
60,
55609,
198,
6534,
59874,
7,
17602,
25,
1796,
58,
8644,
2526,
11651,
1796,
58,
8644,
1483,
2484,
60,
55609,
198,
5094,
368,
11651,
610,
76747,
60,
55609,
198,
6236,
32456,
25,
610,
11,
3319,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
1874,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html |
83dcf8843366-0 | langchain.utilities.powerbi.json_to_md¶
langchain.utilities.powerbi.json_to_md(json_contents: List[Dict[str, Union[str, int, float]]], table_name: Optional[str] = None) → str[source]¶
Converts a JSON object to a markdown table. | [
5317,
8995,
63795,
40645,
8385,
4421,
2401,
34094,
55609,
198,
5317,
8995,
63795,
40645,
8385,
4421,
2401,
34094,
9488,
17096,
25,
1796,
58,
13755,
17752,
11,
9323,
17752,
11,
528,
11,
2273,
5163,
1145,
2007,
1292,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
610,
76747,
60,
55609,
198,
12281,
82,
264,
4823,
1665,
311,
264,
51594,
2007,
13
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.powerbi.json_to_md.html |
5e5496832fff-0 | langchain.utilities.google_search.GoogleSearchAPIWrapper¶
class langchain.utilities.google_search.GoogleSearchAPIWrapper(*, search_engine: Any = None, google_api_key: Optional[str] = None, google_cse_id: Optional[str] = None, k: int = 10, siterestrict: bool = False)[source]¶
Bases: BaseModel
Wrapper for Google Search API.
Adapted from: Instructions adapted from https://stackoverflow.com/questions/
37083058/
programmatically-searching-google-in-python-using-custom-search
TODO: DOCS for using it
1. Install google-api-python-client
- If you don’t already have a Google account, sign up.
- If you have never created a Google APIs Console project,
read the Managing Projects page and create a project in the Google API Console.
- Install the library using pip install google-api-python-client
The current version of the library is 2.70.0 at this time
2. To create an API key:
- Navigate to the APIs & Services→Credentials panel in Cloud Console.
- Select Create credentials, then select API key from the drop-down menu.
- The API key created dialog box displays your newly created key.
- You now have an API_KEY
3. Setup Custom Search Engine so you can search the entire web
- Create a custom search engine in this link.
- In Sites to search, add any valid URL (i.e. www.stackoverflow.com).
- That’s all you have to fill up, the rest doesn’t matter.
In the left-side menu, click Edit search engine → {your search engine name}
→ Setup Set Search the entire web to ON. Remove the URL you added from
the list of Sites to search.
- Under Search engine ID you’ll find the search-engine-ID.
4. Enable the Custom Search API | [
5317,
8995,
63795,
5831,
10947,
61493,
6014,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
5831,
10947,
61493,
6014,
7227,
11803,
4163,
11,
2778,
25860,
25,
5884,
284,
2290,
11,
11819,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
11,
11819,
669,
325,
851,
25,
12536,
17752,
60,
284,
2290,
11,
597,
25,
528,
284,
220,
605,
11,
274,
2058,
15462,
858,
25,
1845,
284,
3641,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
369,
5195,
7694,
5446,
627,
2654,
2756,
291,
505,
25,
39397,
30464,
505,
3788,
1129,
43135,
916,
44419,
6018,
14648,
21221,
2970,
6018,
15252,
76,
7167,
19993,
287,
63745,
3502,
73029,
93875,
37998,
19993,
198,
15074,
25,
9503,
6546,
369,
1701,
433,
198,
16,
13,
19796,
11819,
24851,
73029,
31111,
198,
12,
1442,
499,
1541,
1431,
2736,
617,
264,
5195,
2759,
11,
1879,
709,
627,
12,
1442,
499,
617,
2646,
3549,
264,
5195,
34456,
5390,
2447,
345,
888,
279,
49407,
32323,
2199,
323,
1893,
264,
2447,
304,
279,
5195,
5446,
5390,
627,
12,
19796,
279,
6875,
1701,
24547,
4685,
11819,
24851,
73029,
31111,
198,
791,
1510,
2373,
315,
279,
6875,
374,
220,
17,
13,
2031,
13,
15,
520,
420,
892,
198,
17,
13,
2057,
1893,
459,
5446,
1401,
512,
12,
82839,
311,
279,
34456,
612,
8471,
52118,
28123,
7090,
304,
15161,
5390,
627,
12,
8593,
4324,
16792,
11,
1243,
3373,
5446,
1401,
505,
279,
6068,
15220,
5130,
627,
12,
578,
5446,
1401,
3549,
7402,
3830,
19207,
701,
13945,
3549,
1401,
627,
12,
1472,
1457,
617,
459,
5446,
6738,
198,
18,
13,
19139,
8572,
7694,
8364,
779,
499,
649,
2778,
279,
4553,
3566,
198,
12,
4324,
264,
2587,
2778,
4817,
304,
420,
2723,
627,
12,
763,
33038,
311,
2778,
11,
923,
904,
2764,
5665,
320,
72,
1770,
13,
8604,
23228,
21490,
916,
4390,
12,
3011,
753,
682,
499,
617,
311,
5266,
709,
11,
279,
2800,
3250,
1431,
5030,
627,
644,
279,
2163,
25034,
5130,
11,
4299,
8505,
2778,
4817,
11651,
314,
22479,
2778,
4817,
836,
534,
52118,
19139,
2638,
7694,
279,
4553,
3566,
311,
6328,
13,
11016,
279,
5665,
499,
3779,
505,
198,
1820,
1160,
315,
33038,
311,
2778,
627,
12,
9636,
7694,
4817,
3110,
499,
4805,
1505,
279,
2778,
50725,
54465,
627,
19,
13,
19078,
279,
8572,
7694,
5446
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html |
5e5496832fff-1 | 4. Enable the Custom Search API
- Navigate to the APIs & Services→Dashboard panel in Cloud Console.
- Click Enable APIs and Services.
- Search for Custom Search API and click on it.
- Click Enable.
URL for it: https://console.cloud.google.com/apis/library/customsearch.googleapis
.com
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 google_api_key: Optional[str] = None¶
param google_cse_id: Optional[str] = None¶
param k: int = 10¶
param siterestrict: bool = False¶
results(query: str, num_results: int) → List[Dict][source]¶
Run query through GoogleSearch and return metadata.
Parameters
query – The query to search for.
num_results – The number of results to return.
Returns
snippet - The description of the result.
title - The title of the result.
link - The link to the result.
Return type
A list of dictionaries with the following keys
run(query: str) → str[source]¶
Run query through GoogleSearch and parse result.
validator validate_environment » all fields[source]¶
Validate that api key and python package exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
19,
13,
19078,
279,
8572,
7694,
5446,
198,
12,
82839,
311,
279,
34456,
612,
8471,
52118,
28045,
7090,
304,
15161,
5390,
627,
12,
9369,
19078,
34456,
323,
8471,
627,
12,
7694,
369,
8572,
7694,
5446,
323,
4299,
389,
433,
627,
12,
9369,
19078,
627,
3222,
369,
433,
25,
3788,
1129,
5467,
17365,
5831,
916,
67252,
46546,
35765,
1874,
20341,
198,
916,
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,
11819,
11959,
3173,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
11819,
669,
325,
851,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
597,
25,
528,
284,
220,
605,
55609,
198,
913,
274,
2058,
15462,
858,
25,
1845,
284,
3641,
55609,
198,
8234,
10974,
25,
610,
11,
1661,
13888,
25,
528,
8,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
323,
471,
11408,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
2470,
13888,
1389,
578,
1396,
315,
3135,
311,
471,
627,
16851,
198,
58715,
482,
578,
4096,
315,
279,
1121,
627,
2150,
482,
578,
2316,
315,
279,
1121,
627,
2125,
482,
578,
2723,
311,
279,
1121,
627,
5715,
955,
198,
32,
1160,
315,
58614,
449,
279,
2768,
7039,
198,
6236,
10974,
25,
610,
8,
11651,
610,
76747,
60,
55609,
198,
6869,
3319,
1555,
5195,
6014,
323,
4820,
1121,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
10344,
6462,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html |
18cc38998d3f-0 | langchain.utilities.powerbi.PowerBIDataset¶
class langchain.utilities.powerbi.PowerBIDataset(*, dataset_id: str, table_names: List[str], group_id: Optional[str] = None, credential: Optional[TokenCredential] = None, token: Optional[str] = None, impersonated_user_name: Optional[str] = None, sample_rows_in_table_info: ConstrainedIntValue = 1, schemas: Dict[str, str] = None, aiosession: Optional[ClientSession] = None)[source]¶
Bases: BaseModel
Create PowerBI engine from dataset ID and credential or token.
Use either the credential or a supplied token to authenticate.
If both are supplied the credential is used to generate a token.
The impersonated_user_name is the UPN of a user to be impersonated.
If the model is not RLS enabled, this will be ignored.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param aiosession: Optional[aiohttp.ClientSession] = None¶
param credential: Optional[TokenCredential] = None¶
param dataset_id: str [Required]¶
param group_id: Optional[str] = None¶
param impersonated_user_name: Optional[str] = None¶
param sample_rows_in_table_info: int = 1¶
Constraints
exclusiveMinimum = 0
maximum = 10
param schemas: Dict[str, str] [Optional]¶
param table_names: List[str] [Required]¶
param token: Optional[str] = None¶
async aget_table_info(table_names: Optional[Union[List[str], str]] = None) → str[source]¶
Get information about specified tables.
async arun(command: str) → Any[source]¶ | [
5317,
8995,
63795,
40645,
8385,
55186,
33,
926,
8534,
55609,
198,
1058,
8859,
8995,
63795,
40645,
8385,
55186,
33,
926,
8534,
4163,
11,
10550,
851,
25,
610,
11,
2007,
9366,
25,
1796,
17752,
1145,
1912,
851,
25,
12536,
17752,
60,
284,
2290,
11,
41307,
25,
12536,
58,
3404,
49365,
60,
284,
2290,
11,
4037,
25,
12536,
17752,
60,
284,
2290,
11,
60849,
660,
3398,
1292,
25,
12536,
17752,
60,
284,
2290,
11,
6205,
11189,
1265,
5350,
3186,
25,
1221,
58827,
1090,
1150,
284,
220,
16,
11,
62900,
25,
30226,
17752,
11,
610,
60,
284,
2290,
11,
264,
3614,
1362,
25,
12536,
58,
3032,
5396,
60,
284,
2290,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
4110,
7572,
8768,
4817,
505,
10550,
3110,
323,
41307,
477,
4037,
627,
10464,
3060,
279,
41307,
477,
264,
17665,
4037,
311,
34289,
627,
2746,
2225,
527,
17665,
279,
41307,
374,
1511,
311,
7068,
264,
4037,
627,
791,
60849,
660,
3398,
1292,
374,
279,
12250,
45,
315,
264,
1217,
311,
387,
60849,
660,
627,
2746,
279,
1646,
374,
539,
432,
7416,
9147,
11,
420,
690,
387,
12305,
627,
4110,
264,
502,
1646,
555,
23115,
323,
69772,
1988,
828,
505,
16570,
6105,
627,
36120,
54129,
422,
279,
1988,
828,
4250,
387,
16051,
311,
1376,
264,
2764,
1646,
627,
913,
264,
3614,
1362,
25,
12536,
15848,
822,
1277,
11978,
5396,
60,
284,
2290,
55609,
198,
913,
41307,
25,
12536,
58,
3404,
49365,
60,
284,
2290,
55609,
198,
913,
10550,
851,
25,
610,
510,
8327,
60,
55609,
198,
913,
1912,
851,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
60849,
660,
3398,
1292,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
913,
6205,
11189,
1265,
5350,
3186,
25,
528,
284,
220,
16,
55609,
198,
13221,
198,
90222,
29795,
284,
220,
15,
198,
40287,
284,
220,
605,
198,
913,
62900,
25,
30226,
17752,
11,
610,
60,
510,
15669,
60,
55609,
198,
913,
2007,
9366,
25,
1796,
17752,
60,
510,
8327,
60,
55609,
198,
913,
4037,
25,
12536,
17752,
60,
284,
2290,
55609,
198,
7847,
264,
456,
5350,
3186,
16138,
9366,
25,
12536,
58,
33758,
53094,
17752,
1145,
610,
5163,
284,
2290,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
2038,
922,
5300,
12920,
627,
7847,
802,
359,
15494,
25,
610,
8,
11651,
5884,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.powerbi.PowerBIDataset.html |
18cc38998d3f-1 | Get information about specified tables.
async arun(command: str) → Any[source]¶
Execute a DAX command and return the result asynchronously.
validator fix_table_names » table_names[source]¶
Fix the table names.
get_schemas() → str[source]¶
Get the available schema’s.
get_table_info(table_names: Optional[Union[List[str], str]] = None) → str[source]¶
Get information about specified tables.
get_table_names() → Iterable[str][source]¶
Get names of tables available.
run(command: str) → Any[source]¶
Execute a DAX command and return a json representing the results.
validator token_or_credential_present » all fields[source]¶
Validate that at least one of token and credentials is present.
property headers: Dict[str, str]¶
Get the token.
property request_url: str¶
Get the request url.
property table_info: str¶
Information about all tables in the database.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | [
1991,
2038,
922,
5300,
12920,
627,
7847,
802,
359,
15494,
25,
610,
8,
11651,
5884,
76747,
60,
55609,
198,
17617,
264,
423,
3027,
3290,
323,
471,
279,
1121,
68881,
627,
16503,
5155,
5350,
9366,
4194,
8345,
4194,
2007,
9366,
76747,
60,
55609,
198,
27048,
279,
2007,
5144,
627,
456,
646,
32226,
368,
11651,
610,
76747,
60,
55609,
198,
1991,
279,
2561,
11036,
753,
627,
456,
5350,
3186,
16138,
9366,
25,
12536,
58,
33758,
53094,
17752,
1145,
610,
5163,
284,
2290,
8,
11651,
610,
76747,
60,
55609,
198,
1991,
2038,
922,
5300,
12920,
627,
456,
5350,
9366,
368,
11651,
39116,
17752,
1483,
2484,
60,
55609,
198,
1991,
5144,
315,
12920,
2561,
627,
6236,
15494,
25,
610,
8,
11651,
5884,
76747,
60,
55609,
198,
17617,
264,
423,
3027,
3290,
323,
471,
264,
3024,
14393,
279,
3135,
627,
16503,
4037,
8908,
669,
31420,
38076,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
520,
3325,
832,
315,
4037,
323,
16792,
374,
3118,
627,
3784,
7247,
25,
30226,
17752,
11,
610,
60,
55609,
198,
1991,
279,
4037,
627,
3784,
1715,
2975,
25,
610,
55609,
198,
1991,
279,
1715,
2576,
627,
3784,
2007,
3186,
25,
610,
55609,
198,
15218,
922,
682,
12920,
304,
279,
4729,
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/utilities/langchain.utilities.powerbi.PowerBIDataset.html |
d2ab3f372dc5-0 | langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper¶
class langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper(*, metaphor_api_key: str, k: int = 10)[source]¶
Bases: BaseModel
Wrapper for Metaphor Search API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param k: int = 10¶
param metaphor_api_key: str [Required]¶
results(query: str, num_results: int, include_domains: Optional[List[str]] = None, exclude_domains: Optional[List[str]] = None, start_crawl_date: Optional[str] = None, end_crawl_date: Optional[str] = None, start_published_date: Optional[str] = None, end_published_date: Optional[str] = None) → List[Dict][source]¶
Run query through Metaphor Search and return metadata.
Parameters
query – The query to search for.
num_results – The number of results to return.
Returns
title - The title of the
url - The url
author - Author of the content, if applicable. Otherwise, None.
published_date - Estimated date published
in YYYY-MM-DD format. Otherwise, None.
Return type
A list of dictionaries with the following keys
async results_async(query: str, num_results: int, include_domains: Optional[List[str]] = None, exclude_domains: Optional[List[str]] = None, start_crawl_date: Optional[str] = None, end_crawl_date: Optional[str] = None, start_published_date: Optional[str] = None, end_published_date: Optional[str] = None) → List[Dict][source]¶
Get results from the Metaphor Search API asynchronously.
validator validate_environment » all fields[source]¶ | [
5317,
8995,
63795,
41748,
1366,
269,
10947,
1345,
295,
1366,
269,
6014,
7227,
11803,
55609,
198,
1058,
8859,
8995,
63795,
41748,
1366,
269,
10947,
1345,
295,
1366,
269,
6014,
7227,
11803,
4163,
11,
46450,
11959,
3173,
25,
610,
11,
597,
25,
528,
284,
220,
605,
6758,
2484,
60,
55609,
198,
33,
2315,
25,
65705,
198,
11803,
369,
6344,
1366,
269,
7694,
5446,
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,
597,
25,
528,
284,
220,
605,
55609,
198,
913,
46450,
11959,
3173,
25,
610,
510,
8327,
60,
55609,
198,
8234,
10974,
25,
610,
11,
1661,
13888,
25,
528,
11,
2997,
71299,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
22429,
71299,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
1212,
669,
34783,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
842,
669,
34783,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
1212,
70624,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
842,
70624,
4257,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
6869,
3319,
1555,
6344,
1366,
269,
7694,
323,
471,
11408,
627,
9905,
198,
1663,
1389,
578,
3319,
311,
2778,
369,
627,
2470,
13888,
1389,
578,
1396,
315,
3135,
311,
471,
627,
16851,
198,
2150,
482,
578,
2316,
315,
279,
198,
1103,
482,
578,
2576,
198,
3170,
482,
7030,
315,
279,
2262,
11,
422,
8581,
13,
18715,
11,
2290,
627,
33966,
4257,
482,
83086,
2457,
4756,
198,
258,
61691,
19013,
41275,
3645,
13,
18715,
11,
2290,
627,
5715,
955,
198,
32,
1160,
315,
58614,
449,
279,
2768,
7039,
198,
7847,
3135,
29446,
10974,
25,
610,
11,
1661,
13888,
25,
528,
11,
2997,
71299,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
22429,
71299,
25,
12536,
53094,
17752,
5163,
284,
2290,
11,
1212,
669,
34783,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
842,
669,
34783,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
1212,
70624,
4257,
25,
12536,
17752,
60,
284,
2290,
11,
842,
70624,
4257,
25,
12536,
17752,
60,
284,
2290,
8,
11651,
1796,
58,
13755,
1483,
2484,
60,
55609,
198,
1991,
3135,
505,
279,
6344,
1366,
269,
7694,
5446,
68881,
627,
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper.html |
d2ab3f372dc5-1 | validator validate_environment » all fields[source]¶
Validate that api key and endpoint exists in environment.
model Config[source]¶
Bases: object
Configuration for this pydantic object.
extra = 'forbid'¶ | [
16503,
9788,
52874,
4194,
8345,
4194,
682,
5151,
76747,
60,
55609,
198,
18409,
430,
6464,
1401,
323,
15233,
6866,
304,
4676,
627,
2590,
5649,
76747,
60,
55609,
198,
33,
2315,
25,
1665,
198,
7843,
369,
420,
4611,
67,
8322,
1665,
627,
15824,
284,
364,
2000,
21301,
6,
55609
] | https://langchain.readthedocs.io/en/latest/utilities/langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.