Skip to content

Commit 52dfd7a

Browse files
committed
Update documentation
1 parent 047bf21 commit 52dfd7a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/source/user_guide_pipeline.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ their own by following these steps:
2222

2323
1. Create a subclass of the Pydantic `neo4j_graphrag.experimental.pipeline.DataModel` to represent the data being returned by the component
2424
2. Create a subclass of `neo4j_graphrag.experimental.pipeline.Component`
25-
3. Create a `run_with_context` method in this new class and specify the required inputs and output model using the just created `DataModel`
25+
3. Create a `run` method in this new class and specify the required inputs and output model using the just created `DataModel`
2626
4. Implement the run method: it's an `async` method, allowing tasks to be parallelized and awaited within this method.
2727

2828
An example is given below, where a `ComponentAdd` is created to add two numbers together and return
@@ -31,13 +31,12 @@ the resulting sum:
3131
.. code:: python
3232
3333
from neo4j_graphrag.experimental.pipeline import Component, DataModel
34-
from neo4j_graphrag.experimental.pipeline.types.context import RunContext
3534
3635
class IntResultModel(DataModel):
3736
result: int
3837
3938
class ComponentAdd(Component):
40-
async def run_with_context(self, context_: RunContext, number1: int, number2: int = 1) -> IntResultModel:
39+
async def run(self, number1: int, number2: int = 1) -> IntResultModel:
4140
return IntResultModel(result = number1 + number2)
4241
4342
Read more about :ref:`components-section` in the API Documentation.

0 commit comments

Comments
 (0)