(KeyboardInterrupt, Exception) as e:    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:197, in BaseTool.invoke(self, input, config, **kwargs)        190 def invoke(        191     self,        192     input: Union[str, Dict],        193     config: Optional[RunnableConfig] = None,        194     **kwargs: Any,        195 ) -> Any:        196     config = config or {}    --> 197     return self.run(        198         input,        199         callbacks=config.get("callbacks"),        200         tags=config.get("tags"),        201         metadata=config.get("metadata"),        202         **kwargs,        203     )    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:356, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, **kwargs)        354 except (Exception, KeyboardInterrupt) as e:        355     run_manager.on_tool_error(e)    --> 356     raise e        357 else:        358     run_manager.on_tool_end(        359         str(observation), color=color, name=self.name, **kwargs        360     )    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:330, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, **kwargs)        325 try:        326     tool_args, tool_kwargs = self._to_args_and_kwargs(parsed_input)        327     observation = (        328         self._run(*tool_args, run_manager=run_manager, **tool_kwargs)        329         if new_arg_supported    --> 330         else self._run(*tool_args, **tool_kwargs)        331     )        332 except ToolException as e:        333     if not self.handle_tool_error:    File ~/Documents/Projects/langchain/libs/experimental/langchain_experimental/prompt_injection_identifier/hugging_face_identifier.py:43, in HuggingFaceInjectionIdentifier._run(self, query)         41 is_query_safe = self._classify_user_input(query)         42 if not is_query_safe:    ---> 43
This notebook shows how to prevent prompt injection attacks using the text classification model from HuggingFace.
This notebook shows how to prevent prompt injection attacks using the text classification model from HuggingFace. ->: (KeyboardInterrupt, Exception) as e:    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:197, in BaseTool.invoke(self, input, config, **kwargs)        190 def invoke(        191     self,        192     input: Union[str, Dict],        193     config: Optional[RunnableConfig] = None,        194     **kwargs: Any,        195 ) -> Any:        196     config = config or {}    --> 197     return self.run(        198         input,        199         callbacks=config.get("callbacks"),        200         tags=config.get("tags"),        201         metadata=config.get("metadata"),        202         **kwargs,        203     )    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:356, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, **kwargs)        354 except (Exception, KeyboardInterrupt) as e:        355     run_manager.on_tool_error(e)    --> 356     raise e        357 else:        358     run_manager.on_tool_end(        359         str(observation), color=color, name=self.name, **kwargs        360     )    File ~/Documents/Projects/langchain/libs/langchain/langchain/tools/base.py:330, in BaseTool.run(self, tool_input, verbose, start_color, color, callbacks, tags, metadata, **kwargs)        325 try:        326     tool_args, tool_kwargs = self._to_args_and_kwargs(parsed_input)        327     observation = (        328         self._run(*tool_args, run_manager=run_manager, **tool_kwargs)        329         if new_arg_supported    --> 330         else self._run(*tool_args, **tool_kwargs)        331     )        332 except ToolException as e:        333     if not self.handle_tool_error:    File ~/Documents/Projects/langchain/libs/experimental/langchain_experimental/prompt_injection_identifier/hugging_face_identifier.py:43, in HuggingFaceInjectionIdentifier._run(self, query)         41 is_query_safe = self._classify_user_input(query)         42 if not is_query_safe:    ---> 43