OpenAPIToolkit#

class langchain_community.agent_toolkits.openapi.toolkit.OpenAPIToolkit[source]#

Bases: BaseToolkit

Toolkit for interacting with an OpenAPI API.

Security Note: This toolkit contains tools that can read and modify

the state of a service; e.g., by creating, deleting, or updating, reading underlying data.

For example, this toolkit can be used to delete data exposed via an OpenAPI compliant API.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param allow_dangerous_requests: bool = False#

Allow dangerous requests. See documentation for details.

param json_agent: Any [Required]#

The JSON agent.

param requests_wrapper: TextRequestsWrapper [Required]#

The requests wrapper.

classmethod from_llm(llm: BaseLanguageModel, json_spec: JsonSpec, requests_wrapper: TextRequestsWrapper, allow_dangerous_requests: bool = False, **kwargs: Any) OpenAPIToolkit[source]#

Create json agent from llm, then initialize.

Parameters:
Return type:

OpenAPIToolkit

get_tools() List[BaseTool][source]#

Get the tools in the toolkit.

Return type:

List[BaseTool]

Examples using OpenAPIToolkit