class_docstr: See module's docstring.
  
  Args:
      class_: the class that Canals should use as a component.
      serializable: whether to check, at init time, if the component can be saved with
      `save_pipelines()`.
  
  Returns:
      A class that can be recognized as a component.
  
  Raises:
      ComponentError: if the class provided has no `run()` method or otherwise doesn't respect the component contract.
class_docstr_tok: ["See","module","'s","docstring",".","Args",":","class_",":","the","class","that","Canals","should","use","as","a","component",".","serializable",":","whether","to","check",",","at","init","time",",","if","the","component","can","be","saved","with","`","save_pipelines","(",")","`",".","Returns",":","A","class","that","can","be","recognized","as","a","component",".","Raises",":","ComponentError",":","if","the","class","provided","has","no","`","run","(",")","`","method","or","otherwise","does","n't","respect","the","component","contract","."]
docstr: Method that specifies the output types when the 'run' method is not decorated
  with 'component.output_types'.
  
  Use as:
  
  ```python
  @component
  class MyComponent:
  
      def __init__(self, value: int):
          component.set_output_types(output_1=int, output_2=str)
          ...
  
      # no decorators here
      def run(self, value: int):
          return {"output_1": 1, "output_2": "2"}
  ```
docstr_tok: ["Method","that","specifies","the","output","types","when","the","'run","'","method","is","not","decorated","with","'component.output_types","'",".","Use","as",":","``","`","python","@","component","class","MyComponent",":","def","__init__","(","self",",","value",":","int",")",":","component.set_output_types","(","output_1=int",",","output_2=str",")","...","#","no","decorators","here","def","run","(","self",",","value",":","int",")",":","return","{","``","output_1","''",":","1",",","``","output_2","''",":","``","2","''","}","``","`"]
code: def set_output_types(self, instance, **types):
      """
      Method that specifies the output types when the 'run' method is not decorated
      with 'component.output_types'.
  
      Use as:
  
      ```python
      @component
      class MyComponent:
  
          def __init__(self, value: int):
              component.set_output_types(output_1=int, output_2=str)
              ...
  
          # no decorators here
          def run(self, value: int):
              return {"output_1": 1, "output_2": "2"}
      ```
      """
      instance.__canals_output__ = {
          name: OutputSocket(name=name, type=type_)
          for name, type_ in types.items()
      }
  
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 4 for calling the _Component obj's underlying member method code with example usage: obj.set_output_types(instance) without return types