@@ -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.
5858A * source spec* needs to be provided for any import operation, to describe the source and parameters related to the source.
5959Import 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")
6666def 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
7676We ' ll describe different data objects in next few sections.
7777Note 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
9696def 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