From b253518cccb82201faf01d414939ce6cfff6fe1b Mon Sep 17 00:00:00 2001 From: Jiangzhou He Date: Tue, 8 Jul 2025 19:19:36 -0700 Subject: [PATCH] chore: expose `add_flow_def()` as an API under `cocoindex` module --- docs/docs/core/flow_def.mdx | 2 +- python/cocoindex/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/core/flow_def.mdx b/docs/docs/core/flow_def.mdx index 79a27dacb..bc0001b8d 100644 --- a/docs/docs/core/flow_def.mdx +++ b/docs/docs/core/flow_def.mdx @@ -40,7 +40,7 @@ def demo_flow_def(flow_builder: cocoindex.FlowBuilder, data_scope: cocoindex.Dat ... # Add the flow definition to the flow registry. -demo_flow = cocoindex.flow.add_flow_def("DemoFlow", demo_flow_def) +demo_flow = cocoindex.add_flow_def("DemoFlow", demo_flow_def) ``` In both cases, `demo_flow` will be an object with `cocoindex.Flow` class type. diff --git a/python/cocoindex/__init__.py b/python/cocoindex/__init__.py index 36acc5cd2..97a911a87 100644 --- a/python/cocoindex/__init__.py +++ b/python/cocoindex/__init__.py @@ -11,6 +11,7 @@ from .flow import flow_def from .flow import EvaluateAndDumpOptions, GeneratedField from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions +from .flow import add_flow_def from .flow import update_all_flows_async, setup_all_flows, drop_all_flows from .lib import init, start_server, stop from .llm import LlmSpec, LlmApiType @@ -52,6 +53,7 @@ "GeneratedField", "FlowLiveUpdater", "FlowLiveUpdaterOptions", + "add_flow_def", "update_all_flows_async", "setup_all_flows", "drop_all_flows",