Skip to content

Commit 640fc21

Browse files
authored
chore: expose add_flow_def() as an API under cocoindex module (#719)
1 parent 7eb00ba commit 640fc21

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/docs/core/flow_def.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def demo_flow_def(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.Dat
4040
...
4141

4242
# Add the flow definition to the flow registry.
43-
demo_flow = cocoindex.flow.add_flow_def("DemoFlow", demo_flow_def)
43+
demo_flow = cocoindex.add_flow_def("DemoFlow", demo_flow_def)
4444
```
4545

4646
In both cases, `demo_flow` will be an object with `cocoindex.Flow` class type.

python/cocoindex/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .flow import flow_def
1212
from .flow import EvaluateAndDumpOptions, GeneratedField
1313
from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions
14+
from .flow import add_flow_def
1415
from .flow import update_all_flows_async, setup_all_flows, drop_all_flows
1516
from .lib import init, start_server, stop
1617
from .llm import LlmSpec, LlmApiType
@@ -52,6 +53,7 @@
5253
"GeneratedField",
5354
"FlowLiveUpdater",
5455
"FlowLiveUpdaterOptions",
56+
"add_flow_def",
5557
"update_all_flows_async",
5658
"setup_all_flows",
5759
"drop_all_flows",

0 commit comments

Comments
 (0)