langchain_community.agent_toolkits.nla.toolkit
.NLAToolkitΒΆ
- class langchain_community.agent_toolkits.nla.toolkit.NLAToolkit[source]ΒΆ
Bases:
BaseToolkit
Natural Language API Toolkit.
- Security Note: This toolkit creates tools that enable making calls
to an Open API compliant API.
The tools created by this toolkit may be able to make GET, POST, PATCH, PUT, DELETE requests to any of the exposed endpoints on the API.
Control access to who can use this toolkit.
See https://python.langchain.com/docs/security for more information.
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.
- classmethod from_llm_and_ai_plugin(llm: BaseLanguageModel, ai_plugin: AIPlugin, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) NLAToolkit [source]ΒΆ
Instantiate the toolkit from an OpenAPI Spec URL
- Parameters
llm (BaseLanguageModel) β
ai_plugin (AIPlugin) β
requests (Optional[Requests]) β
verbose (bool) β
kwargs (Any) β
- Return type
- classmethod from_llm_and_ai_plugin_url(llm: BaseLanguageModel, ai_plugin_url: str, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) NLAToolkit [source]ΒΆ
Instantiate the toolkit from an OpenAPI Spec URL
- Parameters
llm (BaseLanguageModel) β
ai_plugin_url (str) β
requests (Optional[Requests]) β
verbose (bool) β
kwargs (Any) β
- Return type
- classmethod from_llm_and_spec(llm: BaseLanguageModel, spec: OpenAPISpec, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) NLAToolkit [source]ΒΆ
Instantiate the toolkit by creating tools for each operation.
- Parameters
llm (BaseLanguageModel) β The language model to use.
spec (OpenAPISpec) β The OpenAPI spec.
requests (Optional[Requests]) β Optional requests object. Default is None.
verbose (bool) β Whether to print verbose output. Default is False.
kwargs (Any) β Additional arguments.
- Returns
The toolkit.
- Return type
- classmethod from_llm_and_url(llm: BaseLanguageModel, open_api_url: str, requests: Optional[Requests] = None, verbose: bool = False, **kwargs: Any) NLAToolkit [source]ΒΆ
Instantiate the toolkit from an OpenAPI Spec URL.
- Parameters
llm (BaseLanguageModel) β The language model to use.
open_api_url (str) β The URL of the OpenAPI spec.
requests (Optional[Requests]) β Optional requests object. Default is None.
verbose (bool) β Whether to print verbose output. Default is False.
kwargs (Any) β Additional arguments.
- Returns
The toolkit.
- Return type