class_docstr: Note this is only used by type checking tools.
  
  In order to implement the `Component` protocol, custom components need to
  have a `run` method. The signature of the method and its return value
  won't be checked, i.e. classes with the following methods:
  
      def run(self, param: str) -> Dict[str, Any]:
          ...
  
  and
  
      def run(self, **kwargs):
          ...
  
  will be both considered as respecting the protocol. This makes the type
  checking much weaker, but we have other places where we ensure code is
  dealing with actual Components.
  
  The protocol is runtime checkable so it'll be possible to assert:
  
      isinstance(MyComponent, Component)
class_docstr_tok: ["Note","this","is","only","used","by","type","checking","tools",".","In","order","to","implement","the","`","Component","`","protocol",",","custom","components","need","to","have","a","`","run","`","method",".","The","signature","of","the","method","and","its","return","value","wo","n't","be","checked",",","i.e",".","classes","with","the","following","methods",":","def","run","(","self",",","param",":","str",")","-",">","Dict","[","str",",","Any","]",":","...","and","def","run","(","self",",","*","*","kwargs",")",":","...","will","be","both","considered","as","respecting","the","protocol",".","This","makes","the","type","checking","much","weaker",",","but","we","have","other","places","where","we","ensure","code","is","dealing","with","actual","Components",".","The","protocol","is","runtime","checkable","so","it","'ll","be","possible","to","assert",":","isinstance","(","MyComponent",",","Component",")"]
code: def run(
      self, *args: Any, **kwargs: Any
  ):  # pylint: disable=missing-function-docstring
      ...
  
imports: import logging
  import inspect
  from typing import Protocol, runtime_checkable, Any
  from types import new_class
  from copy import deepcopy
  from haystack.core.component.sockets import InputSocket, OutputSocket, _empty
  from haystack.core.errors import ComponentError
label_desc: Use image node_id 1 for calling the Component obj's underlying member method code with example usage: obj.run() without return types