cocoindex 0.1.42__cp311-cp311-macosx_11_0_arm64.whl → 0.1.44__cp311-cp311-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
@@ -5,7 +5,7 @@ from . import functions, query, sources, storages, cli, utils
5
5
 
6
6
  from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
7
7
  from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
8
- from .flow import flow_def, flow_def as flow
8
+ from .flow import flow_def
9
9
  from .flow import EvaluateAndDumpOptions, GeneratedField
10
10
  from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
11
11
  from .lib import init, start_server, stop, main_fn
Binary file
cocoindex/cli.py CHANGED
@@ -251,9 +251,10 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
251
251
  """
252
252
  Drop the backend setup for flows.
253
253
 
254
- Modes of operation:\n
255
- 1. Drop ALL persisted setups: `cocoindex drop --all`\n
256
- 2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`\n
254
+ \b
255
+ Modes of operation:
256
+ 1. Drop ALL persisted setups: `cocoindex drop --all`
257
+ 2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`
257
258
  3. Drop specific named flows: `cocoindex drop <APP_TARGET> [FLOW_NAME...]`
258
259
  """
259
260
  app_ref = None
@@ -270,7 +271,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
270
271
  flow_names = list(flow_name)
271
272
  click.echo(f"Preparing to drop specified flows: {', '.join(flow_names)} (in '{app_ref}').", err=True)
272
273
  else:
273
- flow_names = [fl.name for fl in flow.flows()]
274
+ flow_names = flow.flow_names()
274
275
  if not flow_names:
275
276
  click.echo(f"No flows found defined in '{app_ref}' to drop.")
276
277
  return
@@ -338,11 +339,12 @@ def evaluate(app_flow_specifier: str, output_dir: str | None, cache: bool = True
338
339
  Instead of updating the index, it dumps what should be indexed to files.
339
340
  Mainly used for evaluation purpose.
340
341
 
342
+ \b
341
343
  APP_FLOW_SPECIFIER: Specifies the application and optionally the target flow.
342
- Can be one of the following formats:\n
343
- - path/to/your_app.py\n
344
- - an_installed.module_name\n
345
- - path/to/your_app.py:SpecificFlowName\n
344
+ Can be one of the following formats:
345
+ - path/to/your_app.py
346
+ - an_installed.module_name
347
+ - path/to/your_app.py:SpecificFlowName
346
348
  - an_installed.module_name:SpecificFlowName
347
349
 
348
350
  :SpecificFlowName can be omitted only if the application defines a single flow.
@@ -352,7 +354,7 @@ def evaluate(app_flow_specifier: str, output_dir: str | None, cache: bool = True
352
354
 
353
355
  fl = _flow_by_name(flow_ref)
354
356
  if output_dir is None:
355
- output_dir = f"eval_{setting.get_app_namespace(trailing_delimiter='_')}{flow_name}_{datetime.datetime.now().strftime('%y%m%d_%H%M%S')}"
357
+ output_dir = f"eval_{setting.get_app_namespace(trailing_delimiter='_')}{fl.name}_{datetime.datetime.now().strftime('%y%m%d_%H%M%S')}"
356
358
  options = flow.EvaluateAndDumpOptions(output_dir=output_dir, use_cache=cache)
357
359
  fl.evaluate_and_dump(options)
358
360
 
cocoindex/flow.py CHANGED
@@ -538,8 +538,8 @@ class Flow:
538
538
  Update the index defined by the flow.
539
539
  Once the function returns, the index is fresh up to the moment when the function is called.
540
540
  """
541
- updater = await FlowLiveUpdater.create_async(self, FlowLiveUpdaterOptions(live_mode=False))
542
- await updater.wait_async()
541
+ async with FlowLiveUpdater(self, FlowLiveUpdaterOptions(live_mode=False)) as updater:
542
+ await updater.wait_async()
543
543
  return updater.update_stats()
544
544
 
545
545
  def evaluate_and_dump(self, options: EvaluateAndDumpOptions):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.42
3
+ Version: 0.1.44
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
@@ -155,7 +155,7 @@ It defines an index flow like this:
155
155
  | [Embeddings to Qdrant](examples/text_embedding_qdrant) | Index documents in a Qdrant collection for semantic search |
156
156
  | [FastAPI Server with Docker](examples/fastapi_server_docker) | Run the semantic search server in a Dockerized FastAPI setup |
157
157
  | [Product Recommendation](examples/product_recommendation) | Build real-time product recommendations with LLM and graph database|
158
- | [Image Search with Vision API](examples/image_search_example) | Generates detailed captions for images using a vision model, embeds them, enables live-updating semantic search via FastAPI and served on a React frontend|
158
+ | [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|
159
159
 
160
160
  More coming and stay tuned 👀!
161
161
 
@@ -1,13 +1,13 @@
1
- cocoindex-0.1.42.dist-info/METADATA,sha256=-ukEQ2NadNRsjsH5WOnIQ4RuPN8oDBlLc2DJ4NyLilg,9826
2
- cocoindex-0.1.42.dist-info/WHEEL,sha256=p_tvkyHH2UmMBrR2Gemb1ahXJMM2SXUIsCLrWZgJvB8,104
3
- cocoindex-0.1.42.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
- cocoindex-0.1.42.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- cocoindex/__init__.py,sha256=0iO3lM8w35zhVDPsvCGBAXwUQZsCWRRqjt2wFdtJhME,834
6
- cocoindex/_engine.cpython-311-darwin.so,sha256=awTQr-_9awMzKZCokwoGlwUVMVHB_wpEK4f76hdmZRE,56886448
1
+ cocoindex-0.1.44.dist-info/METADATA,sha256=hb2dWiqrLbpqe20t5WPsq4VfEd0_Fr1swN9ImFDjT20,9818
2
+ cocoindex-0.1.44.dist-info/WHEEL,sha256=p_tvkyHH2UmMBrR2Gemb1ahXJMM2SXUIsCLrWZgJvB8,104
3
+ cocoindex-0.1.44.dist-info/entry_points.txt,sha256=_NretjYVzBdNTn7dK-zgwr7YfG2afz1u1uSE-5bZXF8,46
4
+ cocoindex-0.1.44.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ cocoindex/__init__.py,sha256=ztuMoVHbGsyhgnN_CHBnY4yQtcsHi4O-u-Q3eUFaB5Y,816
6
+ cocoindex/_engine.cpython-311-darwin.so,sha256=qMF9ijrLYaP8qU1OOQkVz5dT2Krgcjc52EF_Z0Snm2k,56886416
7
7
  cocoindex/auth_registry.py,sha256=NsALZ3SKsDG9cPdrlTlalIqUvgbgFOaFGAbWJNedtJE,692
8
- cocoindex/cli.py,sha256=1FvpeLjLHSu4EC3Ds7eeSDjBNTtAc06nsuORkNjv_NQ,16569
8
+ cocoindex/cli.py,sha256=g4QnDf5DGvdagP1g4vGP4E1JyHV63gnfS252P-j_2AY,16552
9
9
  cocoindex/convert.py,sha256=75HSBie7DokM0RJyUBqeveZRl5y_Fl8lzByoRF0yb2M,6915
10
- cocoindex/flow.py,sha256=0otFFqO8XVv-uc1Qbya9BBCK1orv7CGI52TiB5v63xk,28409
10
+ cocoindex/flow.py,sha256=xFLG5pgzOy9V10v1VFUhU1552kIcq59MUHeMwiuRdas,28407
11
11
  cocoindex/functions.py,sha256=F79dNmGE127LaU67kF5Oqtf_tIzebFQH7MkyceMX4-s,1830
12
12
  cocoindex/index.py,sha256=LssEOuZi6AqhwKtZM3QFeQpa9T-0ELi8G5DsrYKECvc,534
13
13
  cocoindex/lib.py,sha256=JiLIV5Fi-FNKMlH-6JMoe-UQsvirnFkkOLcoEQk9WkE,2903
@@ -24,4 +24,4 @@ cocoindex/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
24
24
  cocoindex/tests/test_convert.py,sha256=7jc--I3frrg7DB5MPr4JFzE7DSCznJuWyHdlDLQJ_fM,15516
25
25
  cocoindex/typing.py,sha256=RMJXdey5_vd7JbPTEdUw1DeQ4Uu4MicdiaXjzQHFNRA,9031
26
26
  cocoindex/utils.py,sha256=eClhMdjBjcXaDkah-rPUmE7Y5Ncd7S1goUe2qTETR08,456
27
- cocoindex-0.1.42.dist-info/RECORD,,
27
+ cocoindex-0.1.44.dist-info/RECORD,,