Skip to content

Commit

Permalink
Add instance argument to code samples in docstrings for component.py (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
evanderiel committed Apr 30, 2024
1 parent 8cb3cec commit 5de5619
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions haystack/core/component/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def set_input_types(self, instance, **types):
class MyComponent:
def __init__(self, value: int):
component.set_input_types(value_1=str, value_2=str)
component.set_input_types(self, value_1=str, value_2=str)
...
@component.output_types(output_1=int, output_2=str)
Expand All @@ -309,7 +309,7 @@ def run(self, **kwargs):
class MyComponent:
def __init__(self, value: int):
component.set_input_types(value_1=str, value_2=str)
component.set_input_types(self, value_1=str, value_2=str)
...
@component.output_types(output_1=int, output_2=str)
Expand Down Expand Up @@ -337,7 +337,7 @@ def set_output_types(self, instance, **types):
class MyComponent:
def __init__(self, value: int):
component.set_output_types(output_1=int, output_2=str)
component.set_output_types(self, output_1=int, output_2=str)
...
# no decorators here
Expand Down

0 comments on commit 5de5619

Please sign in to comment.