cocoindex 0.1.62__cp312-cp312-manylinux_2_28_x86_64.whl → 0.1.63__cp312-cp312-manylinux_2_28_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/_engine.cpython-312-x86_64-linux-gnu.so +0 -0
- cocoindex/cli.py +31 -11
- {cocoindex-0.1.62.dist-info → cocoindex-0.1.63.dist-info}/METADATA +2 -1
- {cocoindex-0.1.62.dist-info → cocoindex-0.1.63.dist-info}/RECORD +7 -7
- {cocoindex-0.1.62.dist-info → cocoindex-0.1.63.dist-info}/WHEEL +0 -0
- {cocoindex-0.1.62.dist-info → cocoindex-0.1.63.dist-info}/entry_points.txt +0 -0
- {cocoindex-0.1.62.dist-info → cocoindex-0.1.63.dist-info}/licenses/LICENSE +0 -0
Binary file
|
cocoindex/cli.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import atexit
|
2
|
+
import asyncio
|
2
3
|
import datetime
|
3
4
|
import importlib.util
|
4
5
|
import os
|
@@ -18,6 +19,7 @@ from rich.table import Table
|
|
18
19
|
|
19
20
|
from . import flow, lib, setting
|
20
21
|
from .setup import flow_names_with_setup
|
22
|
+
from .runtime import execution_context
|
21
23
|
|
22
24
|
# Create ServerSettings lazily upon first call, as environment variables may be loaded from files, etc.
|
23
25
|
COCOINDEX_HOST = "https://cocoindex.io"
|
@@ -267,6 +269,21 @@ def _setup_flows(
|
|
267
269
|
setup_bundle.apply(report_to_stdout=not quiet)
|
268
270
|
|
269
271
|
|
272
|
+
def _show_no_live_update_hint() -> None:
|
273
|
+
click.secho(
|
274
|
+
"NOTE: No change capture mechanism exists. See https://cocoindex.io/docs/core/flow_methods#live-update for more details.\n",
|
275
|
+
fg="yellow",
|
276
|
+
)
|
277
|
+
|
278
|
+
|
279
|
+
async def _update_all_flows_with_hint_async(
|
280
|
+
options: flow.FlowLiveUpdaterOptions,
|
281
|
+
) -> None:
|
282
|
+
await flow.update_all_flows_async(options)
|
283
|
+
if options.live_mode:
|
284
|
+
_show_no_live_update_hint()
|
285
|
+
|
286
|
+
|
270
287
|
@cli.command()
|
271
288
|
@click.argument("app_target", type=str)
|
272
289
|
@click.option(
|
@@ -398,7 +415,7 @@ def update(
|
|
398
415
|
setup: bool, # pylint: disable=redefined-outer-name
|
399
416
|
force: bool,
|
400
417
|
quiet: bool,
|
401
|
-
) ->
|
418
|
+
) -> None:
|
402
419
|
"""
|
403
420
|
Update the index to reflect the latest data from data sources.
|
404
421
|
|
@@ -410,8 +427,8 @@ def update(
|
|
410
427
|
|
411
428
|
if live:
|
412
429
|
click.secho(
|
413
|
-
"NOTE: Flow code changes will NOT be reflected
|
414
|
-
fg="
|
430
|
+
"NOTE: Flow code changes will NOT be reflected until you restart to load the new code.\n",
|
431
|
+
fg="yellow",
|
415
432
|
)
|
416
433
|
|
417
434
|
options = flow.FlowLiveUpdaterOptions(live_mode=live, print_stats=not quiet)
|
@@ -422,14 +439,15 @@ def update(
|
|
422
439
|
force=force,
|
423
440
|
quiet=quiet,
|
424
441
|
)
|
425
|
-
|
442
|
+
execution_context.run(_update_all_flows_with_hint_async(options))
|
426
443
|
else:
|
427
444
|
fl = flow.flow_by_name(flow_name)
|
428
445
|
if setup:
|
429
446
|
_setup_flows((fl,), force=force, quiet=quiet)
|
430
447
|
with flow.FlowLiveUpdater(fl, options) as updater:
|
431
448
|
updater.wait()
|
432
|
-
|
449
|
+
if options.live_mode:
|
450
|
+
_show_no_live_update_hint()
|
433
451
|
|
434
452
|
|
435
453
|
@cli.command()
|
@@ -604,8 +622,8 @@ def server(
|
|
604
622
|
)
|
605
623
|
else:
|
606
624
|
click.secho(
|
607
|
-
"NOTE: Flow code changes will NOT be reflected
|
608
|
-
fg="
|
625
|
+
"NOTE: Flow code changes will NOT be reflected until you restart to load the new code. Use --reload to enable auto-reload.\n",
|
626
|
+
fg="yellow",
|
609
627
|
)
|
610
628
|
_run_server(*args)
|
611
629
|
|
@@ -650,10 +668,6 @@ def _run_server(
|
|
650
668
|
quiet=quiet,
|
651
669
|
)
|
652
670
|
|
653
|
-
if live_update:
|
654
|
-
options = flow.FlowLiveUpdaterOptions(live_mode=True, print_stats=not quiet)
|
655
|
-
flow.update_all_flows(options)
|
656
|
-
|
657
671
|
lib.start_server(server_settings)
|
658
672
|
|
659
673
|
if COCOINDEX_HOST in cors_origins:
|
@@ -661,6 +675,12 @@ def _run_server(
|
|
661
675
|
|
662
676
|
click.secho("Press Ctrl+C to stop the server.", fg="yellow")
|
663
677
|
|
678
|
+
if live_update:
|
679
|
+
options = flow.FlowLiveUpdaterOptions(live_mode=True, print_stats=not quiet)
|
680
|
+
asyncio.run_coroutine_threadsafe(
|
681
|
+
_update_all_flows_with_hint_async(options), execution_context.event_loop
|
682
|
+
)
|
683
|
+
|
664
684
|
shutdown_event = threading.Event()
|
665
685
|
|
666
686
|
def handle_signal(signum: int, frame: FrameType | None) -> None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: cocoindex
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.63
|
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
|
@@ -162,6 +162,7 @@ It defines an index flow like this:
|
|
162
162
|
| [FastAPI Server with Docker](examples/fastapi_server_docker) | Run the semantic search server in a Dockerized FastAPI setup |
|
163
163
|
| [Product Recommendation](examples/product_recommendation) | Build real-time product recommendations with LLM and graph database|
|
164
164
|
| [Image Search with Vision API](examples/image_search) | Generates detailed captions for images using a vision model, embeds them, enables live-updating semantic search via FastAPI and served on a React frontend|
|
165
|
+
| [Paper Metadata](examples/paper_metadata) | Index papers in PDF files, and build metadata tables for each paper |
|
165
166
|
|
166
167
|
More coming and stay tuned 👀!
|
167
168
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
cocoindex-0.1.
|
2
|
-
cocoindex-0.1.
|
3
|
-
cocoindex-0.1.
|
4
|
-
cocoindex-0.1.
|
1
|
+
cocoindex-0.1.63.dist-info/METADATA,sha256=5p9o6R9LBv3kIl3GdIo-V40NqnF7DEZHgRTzKxuWFEQ,10136
|
2
|
+
cocoindex-0.1.63.dist-info/WHEEL,sha256=_CzojsfcNnIHPHWM3rF2h1_Qa3VRJKIX8HSir-fDxGE,108
|
3
|
+
cocoindex-0.1.63.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
|
4
|
+
cocoindex-0.1.63.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
5
5
|
cocoindex/__init__.py,sha256=hDjehCjxRabFCW0RTt00JxnSAJIn9HeVoK4OjFbETsk,1910
|
6
|
-
cocoindex/_engine.cpython-312-x86_64-linux-gnu.so,sha256=
|
6
|
+
cocoindex/_engine.cpython-312-x86_64-linux-gnu.so,sha256=GNFehaWGZh5_qsGPUV0t5e14LZNzNqZpuAfZC4JtThY,63213880
|
7
7
|
cocoindex/auth_registry.py,sha256=1XqO7ibjmBBd8i11XSJTvTgdz8p1ptW-ZpuSgo_5zzk,716
|
8
|
-
cocoindex/cli.py,sha256
|
8
|
+
cocoindex/cli.py,sha256=-gp639JSyQN6YjnhGqCakIzYoSSqXxQMbxbkcYGP0QY,22359
|
9
9
|
cocoindex/convert.py,sha256=FsKb2Pfbm7e1VQDOs_AsoiW9PbIUuyHQuqUlrENXmUY,11199
|
10
10
|
cocoindex/flow.py,sha256=x13SDZvFZ-MR-gGF1HPp14DMSn0vp37cfz0YFK9Pmy8,33334
|
11
11
|
cocoindex/functions.py,sha256=IBwvdPpGR-S5mk53HvHpT2GVs15MI9wQznxgOdxA0ac,3202
|
@@ -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.
|
28
|
+
cocoindex-0.1.63.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|