Skip to content

Commit c986116

Browse files
authored
Typo fix for doc: s/from_source/add_source/ (#254)
1 parent 869c525 commit c986116

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/docs/core/flow_def.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The `FlowBuilder` object is the starting point to construct a flow.
5454

5555
### Import From Source
5656

57-
`FlowBuilder` provides a `from_source()` method to import data from external sources.
57+
`FlowBuilder` provides a `add_source()` method to import data from external sources.
5858
A *source spec* needs to be provided for any import operation, to describe the source and parameters related to the source.
5959
Import must happen at the top level, and the field created by import must be in the top-level struct.
6060

@@ -64,14 +64,14 @@ Import must happen at the top level, and the field created by import must be in
6464
```python
6565
@cocoindex.flow_def(name="DemoFlow")
6666
def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
67-
data_scope["documents"] = flow_builder.from_source(DemoSourceSpec(...))
67+
data_scope["documents"] = flow_builder.add_source(DemoSourceSpec(...))
6868
......
6969
```
7070

7171
</TabItem>
7272
</Tabs>
7373

74-
`from_source()` returns a `DataSlice`. Once external data sources are imported, you can further transform them using methods exposed by these data objects, as discussed in the following sections.
74+
`add_source()` returns a `DataSlice`. Once external data sources are imported, you can further transform them using methods exposed by these data objects, as discussed in the following sections.
7575

7676
We'll describe different data objects in next few sections.
7777
Note that the actual value of data is not available at the time when we define the flow: it's only available at runtime.
@@ -96,7 +96,7 @@ Getting and setting a field of a data scope is done by the `[]` operator with a
9696
def demo_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.DataScope):
9797
9898
# Add "documents" to the top-level data scope.
99-
data_scope["documents"] = flow_builder.from_source(DemoSourceSpec(...))
99+
data_scope["documents"] = flow_builder.add_source(DemoSourceSpec(...))
100100
101101
# Each row of "documents" is a child scope.
102102
with data_scope["documents"].row() as document:

0 commit comments

Comments
 (0)