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, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = 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

A tool that sends a DELETE request and parses the response.

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

param args_schema: Optional[Type[BaseModel]] = None¶

Pydantic model class to validate and parse the tool’s input arguments.

param callback_manager: Optional[BaseCallbackManager] = None¶

Deprecated. Please use callbacks instead.

param callbacks: Callbacks = None¶

Callbacks to be called during tool execution.

param description: str = '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.'¶

The description of the tool.

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]¶

The LLM chain used to parse the response.

param metadata: Optional[Dict[str, Any]] = None¶

Optional metadata associated with the tool. Defaults to None This metadata will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case.

param name: str = 'requests_delete'¶

The name of the tool.

param requests_wrapper: TextRequestsWrapper [Required]¶
param response_length: Optional[int] = 5000¶

The maximum length of the response.

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 tags: Optional[List[str]] = None¶

Optional list of tags associated with the tool. Defaults to None These tags will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case.

param verbose: bool = False¶

Whether to log the tool’s progress.

__call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) str¶

Make tool callable.

async ainvoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) Any¶
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, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) Any¶

Run the tool asynchronously.

invoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) Any¶
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, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = 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'¶