color_mapping,       1042         inputs,       1043         intermediate_steps,       1044         run_manager=run_manager,       1045     )       1046     if isinstance(next_step_output, AgentFinish):       1047         return self._return(       1048             next_step_output, intermediate_steps, run_manager=run_manager       1049         )    File ~/Documents/Projects/langchain/libs/langchain/langchain/agents/agent.py:894, in AgentExecutor._take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)        892         tool_run_kwargs["llm_prefix"] = ""        893     # We then call the tool on the tool input to get an observation    --> 894     observation = tool.run(        895         agent_action.tool_input,        896         verbose=self.verbose,        897         color=color,        898         callbacks=run_manager.get_child() if run_manager else None,        899         **tool_run_kwargs,        900     )        901 else:        902     tool_run_kwargs = self.agent.tool_run_logging_kwargs()    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,
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. ->: color_mapping,       1042         inputs,       1043         intermediate_steps,       1044         run_manager=run_manager,       1045     )       1046     if isinstance(next_step_output, AgentFinish):       1047         return self._return(       1048             next_step_output, intermediate_steps, run_manager=run_manager       1049         )    File ~/Documents/Projects/langchain/libs/langchain/langchain/agents/agent.py:894, in AgentExecutor._take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)        892         tool_run_kwargs["llm_prefix"] = ""        893     # We then call the tool on the tool input to get an observation    --> 894     observation = tool.run(        895         agent_action.tool_input,        896         verbose=self.verbose,        897         color=color,        898         callbacks=run_manager.get_child() if run_manager else None,        899         **tool_run_kwargs,        900     )        901 else:        902     tool_run_kwargs = self.agent.tool_run_logging_kwargs()    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,