cocoindex 0.1.60__cp311-cp311-macosx_10_12_x86_64.whl → 0.1.62__cp311-cp311-macosx_10_12_x86_64.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
@@ -12,7 +12,7 @@ from .flow import flow_def
12
12
  from .flow import EvaluateAndDumpOptions, GeneratedField
13
13
  from .flow import FlowLiveUpdater, FlowLiveUpdaterOptions
14
14
  from .flow import update_all_flows_async, setup_all_flows, drop_all_flows
15
- from .lib import init, start_server, stop, main_fn
15
+ from .lib import init, start_server, stop
16
16
  from .llm import LlmSpec, LlmApiType
17
17
  from .index import VectorSimilarityMetric, VectorIndexDef, IndexOptions
18
18
  from .setting import DatabaseConnectionSpec, Settings, ServerSettings
@@ -59,7 +59,6 @@ __all__ = [
59
59
  "init",
60
60
  "start_server",
61
61
  "stop",
62
- "main_fn",
63
62
  # LLM
64
63
  "LlmSpec",
65
64
  "LlmApiType",
Binary file
cocoindex/cli.py CHANGED
@@ -408,6 +408,12 @@ def update(
408
408
  app_ref, flow_name = _parse_app_flow_specifier(app_flow_specifier)
409
409
  _load_user_app(app_ref)
410
410
 
411
+ if live:
412
+ click.secho(
413
+ "NOTE: Flow code changes will NOT be reflected in the server until you restart it.",
414
+ fg="red",
415
+ )
416
+
411
417
  options = flow.FlowLiveUpdaterOptions(live_mode=live, print_stats=not quiet)
412
418
  if flow_name is None:
413
419
  if setup:
@@ -597,6 +603,10 @@ def server(
597
603
  ),
598
604
  )
599
605
  else:
606
+ click.secho(
607
+ "NOTE: Flow code changes will NOT be reflected in the server until you restart it. Use --reload to enable auto-reload.",
608
+ fg="red",
609
+ )
600
610
  _run_server(*args)
601
611
 
602
612
 
@@ -633,9 +643,6 @@ def _run_server(
633
643
  if address is not None:
634
644
  server_settings.address = address
635
645
 
636
- if COCOINDEX_HOST in cors_origins:
637
- click.echo(f"Open CocoInsight at: {COCOINDEX_HOST}/cocoinsight")
638
-
639
646
  if run_setup:
640
647
  _setup_flows(
641
648
  flow.flows().values(),
@@ -649,6 +656,9 @@ def _run_server(
649
656
 
650
657
  lib.start_server(server_settings)
651
658
 
659
+ if COCOINDEX_HOST in cors_origins:
660
+ click.echo(f"Open CocoInsight at: {COCOINDEX_HOST}/cocoinsight")
661
+
652
662
  click.secho("Press Ctrl+C to stop the server.", fg="yellow")
653
663
 
654
664
  shutdown_event = threading.Event()
cocoindex/flow.py CHANGED
@@ -416,6 +416,11 @@ class _SourceRefreshOptions:
416
416
  refresh_interval: datetime.timedelta | None = None
417
417
 
418
418
 
419
+ @dataclass
420
+ class _ExecutionOptions:
421
+ max_inflight_count: int | None = None
422
+
423
+
419
424
  class FlowBuilder:
420
425
  """
421
426
  A flow builder is used to build a flow.
@@ -439,6 +444,7 @@ class FlowBuilder:
439
444
  *,
440
445
  name: str | None = None,
441
446
  refresh_interval: datetime.timedelta | None = None,
447
+ max_inflight_count: int | None = None,
442
448
  ) -> DataSlice[T]:
443
449
  """
444
450
  Import a source to the flow.
@@ -454,9 +460,12 @@ class FlowBuilder:
454
460
  self._state.field_name_builder.build_name(
455
461
  name, prefix=_to_snake_case(_spec_kind(spec)) + "_"
456
462
  ),
457
- dump_engine_object(
463
+ refresh_options=dump_engine_object(
458
464
  _SourceRefreshOptions(refresh_interval=refresh_interval)
459
465
  ),
466
+ execution_options=dump_engine_object(
467
+ _ExecutionOptions(max_inflight_count=max_inflight_count)
468
+ ),
460
469
  ),
461
470
  name,
462
471
  )
cocoindex/lib.py CHANGED
@@ -30,46 +30,3 @@ def start_server(settings: setting.ServerSettings) -> None:
30
30
  def stop() -> None:
31
31
  """Stop the cocoindex library."""
32
32
  _engine.stop()
33
-
34
-
35
- def main_fn(
36
- settings: Any | None = None,
37
- cocoindex_cmd: str | None = None,
38
- ) -> Callable[[Callable[..., Any]], Callable[..., Any]]:
39
- """
40
- DEPRECATED: The @cocoindex.main_fn() decorator is obsolete and has no effect.
41
- It will be removed in a future version, which will cause an AttributeError.
42
-
43
- Please remove this decorator from your code and use the standalone 'cocoindex' CLI.
44
- See the updated CLI usage examples in the warning message.
45
- """
46
- warnings.warn(
47
- "\n\n"
48
- "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
49
- "CRITICAL DEPRECATION NOTICE from CocoIndex:\n"
50
- "The @cocoindex.main_fn() decorator in your script is DEPRECATED and IGNORED.\n"
51
- "It provides NO functionality and will be REMOVED entirely in a future version.\n"
52
- "If not removed, your script will FAIL with an AttributeError in the future.\n\n"
53
- "ACTION REQUIRED: Please REMOVE @cocoindex.main_fn() from your Python script.\n\n"
54
- "To use CocoIndex, invoke the standalone 'cocoindex' CLI."
55
- " Examples of new CLI usage:\n\n"
56
- " To list flows from 'main.py' (previously 'python main.py cocoindex ls'):\n"
57
- " cocoindex ls main.py\n\n"
58
- " To list all persisted flows (previously 'python main.py cocoindex ls --all'):\n"
59
- " cocoindex ls\n\n"
60
- " To show 'MyFlow' defined in 'main.py' (previously 'python main.py cocoindex show MyFlow'):\n"
61
- " cocoindex show main.py:MyFlow\n\n"
62
- " To update all flows in 'my_package.flows_module':\n"
63
- " cocoindex update my_package.flows_module\n\n"
64
- " To update 'SpecificFlow' in 'my_package.flows_module':\n"
65
- " cocoindex update my_package.flows_module:SpecificFlow\n\n"
66
- "See cocoindex <command> --help for more details.\n"
67
- "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n",
68
- DeprecationWarning,
69
- stacklevel=2,
70
- )
71
-
72
- def _main_wrapper(fn: Callable[..., Any]) -> Callable[..., Any]:
73
- return fn
74
-
75
- return _main_wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.60
3
+ Version: 0.1.62
4
4
  Requires-Dist: click>=8.1.8
5
5
  Requires-Dist: rich>=14.0.0
6
6
  Requires-Dist: python-dotenv>=1.1.0
@@ -1,16 +1,16 @@
1
- cocoindex-0.1.60.dist-info/METADATA,sha256=TLP5AmkWol7oAVwBcHJfzpQNbilcmrczI6MJX_oVBD0,10020
2
- cocoindex-0.1.60.dist-info/WHEEL,sha256=T-mIu33LRyznTeW5iI9hbhGd5CtQNSRT-9igbaKmYE0,106
3
- cocoindex-0.1.60.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.1.60.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- cocoindex/__init__.py,sha256=dSSqO5g2EPoPM3Yo7meIpIh8hWPDArsXFG8kXaQrCwk,1934
6
- cocoindex/_engine.cpython-311-darwin.so,sha256=v7e7hC_SY3MZfEP2IIbo8AHqtIvGUa9V5hnuXNLDmFg,60208948
1
+ cocoindex-0.1.62.dist-info/METADATA,sha256=zLkmmjLMos6lgZF4pDNIJzlhx4WCr3lhwWHBrBWtEzA,10020
2
+ cocoindex-0.1.62.dist-info/WHEEL,sha256=T-mIu33LRyznTeW5iI9hbhGd5CtQNSRT-9igbaKmYE0,106
3
+ cocoindex-0.1.62.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.1.62.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ cocoindex/__init__.py,sha256=hDjehCjxRabFCW0RTt00JxnSAJIn9HeVoK4OjFbETsk,1910
6
+ cocoindex/_engine.cpython-311-darwin.so,sha256=y9-Ge7IZauApIOjDbxd2VFWKp0fHc0jrD_UVbUJkRdQ,60226108
7
7
  cocoindex/auth_registry.py,sha256=1XqO7ibjmBBd8i11XSJTvTgdz8p1ptW-ZpuSgo_5zzk,716
8
- cocoindex/cli.py,sha256=8bDL-Qmd9NYtn1DsDfvUMk45xfAqNf9YTyM7H9KRuNU,21345
8
+ cocoindex/cli.py,sha256=YpAn6awBlPHtTvDcHQk3xXS1PDlF4HDs5ak6t2da_WE,21695
9
9
  cocoindex/convert.py,sha256=FsKb2Pfbm7e1VQDOs_AsoiW9PbIUuyHQuqUlrENXmUY,11199
10
- cocoindex/flow.py,sha256=UQviW2O6nzCKt3jf7N1xAXULvK7YRCZDAj5hy5VLkjM,33041
10
+ cocoindex/flow.py,sha256=x13SDZvFZ-MR-gGF1HPp14DMSn0vp37cfz0YFK9Pmy8,33334
11
11
  cocoindex/functions.py,sha256=IBwvdPpGR-S5mk53HvHpT2GVs15MI9wQznxgOdxA0ac,3202
12
12
  cocoindex/index.py,sha256=j93B9jEvvLXHtpzKWL88SY6wCGEoPgpsQhEGHlyYGFg,540
13
- cocoindex/lib.py,sha256=BeRUn3RqE_wSsVtsgCzbFFKe1LXgRyRmMOcmwWBuEXo,2940
13
+ cocoindex/lib.py,sha256=f--9dAYd84CZosbDZqNW0oGbBLsY3dXiUTR1VrfQ_QY,817
14
14
  cocoindex/llm.py,sha256=0ri8ZRg9_Zf2gyC5xuQ1Kq6kdZUO8r-A5WLnxit5S_4,448
15
15
  cocoindex/op.py,sha256=r_Usx7Jqh49Cck3tsYLx2vLRNUZArkQP_g7bIID6LPU,11809
16
16
  cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,4 +25,4 @@ cocoindex/tests/test_optional_database.py,sha256=snAmkNa6wtOSaxoZE1HgjvL5v_ylitt
25
25
  cocoindex/tests/test_typing.py,sha256=t6UCYShcfonTfjBlGRWPiFGMZ8DGFfABXo6idekPoJE,14757
26
26
  cocoindex/typing.py,sha256=s_Hk4Npi8pxJUM2h_7Km0VFrojA8wJU9VDtRqVSL6C0,12622
27
27
  cocoindex/utils.py,sha256=hUhX-XV6XGCtJSEIpBOuDv6VvqImwPlgBxztBTw7u0U,598
28
- cocoindex-0.1.60.dist-info/RECORD,,
28
+ cocoindex-0.1.62.dist-info/RECORD,,