cocoindex 0.1.40__cp312-cp312-macosx_11_0_arm64.whl → 0.1.41__cp312-cp312-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cocoindex/__init__.py CHANGED
@@ -2,14 +2,15 @@
2
2
  Cocoindex is a framework for building and running indexing pipelines.
3
3
  """
4
4
  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
6
9
  from .flow import EvaluateAndDumpOptions, GeneratedField
7
10
  from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
11
+ from .lib import init, start_server, stop, main_fn
8
12
  from .llm import LlmSpec, LlmApiType
9
13
  from .index import VectorSimilarityMetric, VectorIndexDef, IndexOptions
10
- from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
11
- from .lib import *
12
14
  from .setting import DatabaseConnectionSpec, Settings, ServerSettings
13
15
  from .setting import get_app_namespace
14
- from ._engine import OpArgSchema
15
16
  from .typing import Float32, Float64, LocalDateTime, OffsetDateTime, Range, Vector, Json
Binary file
cocoindex/flow.py CHANGED
@@ -718,9 +718,11 @@ class TransformFlow(Generic[T]):
718
718
  for (param_name, param), param_type in zip(sig.parameters.items(), self._flow_arg_types):
719
719
  if param.kind not in (inspect.Parameter.POSITIONAL_OR_KEYWORD,
720
720
  inspect.Parameter.KEYWORD_ONLY):
721
- raise ValueError(f"Parameter {param_name} is not a parameter can be passed by name")
722
- engine_ds = flow_builder_state.engine_flow_builder.add_direct_input(
723
- param_name, encode_enriched_type(param_type))
721
+ raise ValueError(f"Parameter `{param_name}` is not a parameter can be passed by name")
722
+ encoded_type = encode_enriched_type(param_type)
723
+ if encoded_type is None:
724
+ raise ValueError(f"Parameter `{param_name}` has no type annotation")
725
+ engine_ds = flow_builder_state.engine_flow_builder.add_direct_input(param_name, encoded_type)
724
726
  kwargs[param_name] = DataSlice(_DataSliceState(flow_builder_state, engine_ds))
725
727
 
726
728
  output = self._flow_fn(**kwargs)
@@ -780,8 +782,13 @@ def transform_flow() -> Callable[[Callable[..., DataSlice[T]]], TransformFlow[T]
780
782
  for (param_name, param) in sig.parameters.items():
781
783
  if param.kind not in (inspect.Parameter.POSITIONAL_OR_KEYWORD,
782
784
  inspect.Parameter.KEYWORD_ONLY):
783
- raise ValueError(f"Parameter {param_name} is not a parameter can be passed by name")
784
- arg_types.append(_get_data_slice_annotation_type(param.annotation))
785
+ raise ValueError(f"Parameter `{param_name}` is not a parameter can be passed by name")
786
+ value_type_annotation = _get_data_slice_annotation_type(param.annotation)
787
+ if value_type_annotation is None:
788
+ raise ValueError(
789
+ f"Parameter `{param_name}` for {fn} has no value type annotation. "
790
+ "Please use `cocoindex.DataSlice[T]` where T is the type of the value.")
791
+ arg_types.append(value_type_annotation)
785
792
 
786
793
  _transform_flow = TransformFlow(fn, arg_types)
787
794
  functools.update_wrapper(_transform_flow, fn)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.40
3
+ Version: 0.1.41
4
4
  Requires-Dist: sentence-transformers>=3.3.1
5
5
  Requires-Dist: click>=8.1.8
6
6
  Requires-Dist: rich>=14.0.0
@@ -1,12 +1,12 @@
1
- cocoindex-0.1.40.dist-info/METADATA,sha256=k_dUmyVymd4d0TmoRNrOnQAf8r9bOgLzqQU5MWTFZe8,9790
2
- cocoindex-0.1.40.dist-info/WHEEL,sha256=ryp1uXCltaq3TPfjxhSWoam4EHMC40-Yabw-yvEW9gU,104
3
- cocoindex-0.1.40.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
- cocoindex/__init__.py,sha256=NIOdQAQ2nMgLgMdfGsWj4YnmC6sFWDUE1-33hkS63T4,799
5
- cocoindex/_engine.cpython-312-darwin.so,sha256=mNqKea-6DSAFilDeRAPZ7bD3gQ3jzMO6IAc0LUFL53E,56853120
1
+ cocoindex-0.1.41.dist-info/METADATA,sha256=_wnwGo7A-7PLOp6HuG18kFtC-ld4QEP4RtKwVEWdpQ4,9790
2
+ cocoindex-0.1.41.dist-info/WHEEL,sha256=ryp1uXCltaq3TPfjxhSWoam4EHMC40-Yabw-yvEW9gU,104
3
+ cocoindex-0.1.41.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
+ cocoindex/__init__.py,sha256=0iO3lM8w35zhVDPsvCGBAXwUQZsCWRRqjt2wFdtJhME,834
5
+ cocoindex/_engine.cpython-312-darwin.so,sha256=TgrpClutvTXWvlJ4Mr3VU0ifRutOlh6yOrsSjZrPlj4,56853136
6
6
  cocoindex/auth_registry.py,sha256=NsALZ3SKsDG9cPdrlTlalIqUvgbgFOaFGAbWJNedtJE,692
7
7
  cocoindex/cli.py,sha256=Ac3ybnQW-HGVGJeUwIOHd1qhjs0KC5wCsemWuyouEfU,8999
8
8
  cocoindex/convert.py,sha256=75HSBie7DokM0RJyUBqeveZRl5y_Fl8lzByoRF0yb2M,6915
9
- cocoindex/flow.py,sha256=QRbbYwHCpOvjAah33gbuVLgu1ML_ea0HReHHOFDTHxQ,27888
9
+ cocoindex/flow.py,sha256=FJGuw71q8EPd37DUbveiMV-LTpqRG2ckQ7jM5bVMJcw,28356
10
10
  cocoindex/functions.py,sha256=F79dNmGE127LaU67kF5Oqtf_tIzebFQH7MkyceMX4-s,1830
11
11
  cocoindex/index.py,sha256=LssEOuZi6AqhwKtZM3QFeQpa9T-0ELi8G5DsrYKECvc,534
12
12
  cocoindex/lib.py,sha256=OqTMuOHicdyX9PRA7fmTzznK8HZMrzxpUDbqxAEF--Q,2383
@@ -23,4 +23,4 @@ cocoindex/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
23
  cocoindex/tests/test_convert.py,sha256=7jc--I3frrg7DB5MPr4JFzE7DSCznJuWyHdlDLQJ_fM,15516
24
24
  cocoindex/typing.py,sha256=369ABRtnpbaVSQVIBc2ZDutXW8jUmncvNJd9CHEWT3Q,8962
25
25
  cocoindex/utils.py,sha256=eClhMdjBjcXaDkah-rPUmE7Y5Ncd7S1goUe2qTETR08,456
26
- cocoindex-0.1.40.dist-info/RECORD,,
26
+ cocoindex-0.1.41.dist-info/RECORD,,