Skip to content

Commit cb66382

Browse files
authored
chore: rexport flow_def as flow and cleanup a few example usages (#516)
1 parent cf3634c commit cb66382

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

examples/image_search_example/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def image_object_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope:
9494
# --- CocoIndex initialization on startup ---
9595
@app.on_event("startup")
9696
def startup_event():
97-
settings = cocoindex.setting.Settings.from_env()
97+
settings = cocoindex.Settings.from_env()
9898
cocoindex.init(settings)
9999
app.state.query_handler = cocoindex.query.SimpleSemanticsQueryHandler(
100100
name="ImageObjectSearch",

examples/product_recommendation/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ProductTaxonomyInfo:
6161
complementary_taxonomies: list[ProductTaxonomy]
6262

6363
@cocoindex.op.function(behavior_version=2)
64-
def extract_product_info(product: cocoindex.typing.Json, filename: str) -> ProductInfo:
64+
def extract_product_info(product: cocoindex.Json, filename: str) -> ProductInfo:
6565
# Print markdown for LLM to extract the taxonomy and complimentary taxonomy
6666
return ProductInfo(
6767
id=f"{filename.removesuffix('.json')}",

python/cocoindex/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
Cocoindex is a framework for building and running indexing pipelines.
33
"""
44
from . import functions, query, sources, storages, cli, utils
5-
from .flow import FlowBuilder, DataScope, DataSlice, Flow, flow_def, transform_flow
5+
6+
from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
7+
from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
8+
from .flow import flow_def, flow_def as flow
69
from .flow import EvaluateAndDumpOptions, GeneratedField
710
from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
11+
from .lib import init, start_server, stop, main_fn
812
from .llm import LlmSpec, LlmApiType
913
from .index import VectorSimilarityMetric, VectorIndexDef, IndexOptions
10-
from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
11-
from .lib import *
1214
from .setting import DatabaseConnectionSpec, Settings, ServerSettings
1315
from .setting import get_app_namespace
14-
from ._engine import OpArgSchema
1516
from .typing import Float32, Float64, LocalDateTime, OffsetDateTime, Range, Vector, Json

0 commit comments

Comments
 (0)