cocoindex 0.1.30__cp311-cp311-macosx_10_12_x86_64.whl → 0.1.32__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.
Binary file
cocoindex/cli.py CHANGED
@@ -1,7 +1,9 @@
1
+ import asyncio
1
2
  import click
2
3
  import datetime
3
4
 
4
5
  from rich.console import Console
6
+ from rich.table import Table
5
7
 
6
8
  from . import flow, lib, setting
7
9
  from .setup import sync_setup, drop_setup, flow_names_with_setup, apply_setup_changes
@@ -56,11 +58,26 @@ def ls(show_all: bool):
56
58
  @click.option("--color/--no-color", default=True)
57
59
  def show(flow_name: str | None, color: bool):
58
60
  """
59
- Show the flow spec in a readable format with colored output.
61
+ Show the flow spec in a readable format with colored output,
62
+ including the schema.
60
63
  """
61
- fl = _flow_by_name(flow_name)
64
+ flow = _flow_by_name(flow_name)
62
65
  console = Console(no_color=not color)
63
- console.print(fl._render_text())
66
+ console.print(flow._render_text())
67
+
68
+ table = Table(
69
+ title=f"Schema for Flow: {flow.name}",
70
+ show_header=True,
71
+ header_style="bold magenta"
72
+ )
73
+ table.add_column("Field", style="cyan")
74
+ table.add_column("Type", style="green")
75
+ table.add_column("Attributes", style="yellow")
76
+
77
+ for field_name, field_type, attr_str in flow._render_schema():
78
+ table.add_row(field_name, field_type, attr_str)
79
+
80
+ console.print(table)
64
81
 
65
82
  @cli.command()
66
83
  def setup():
cocoindex/flow.py CHANGED
@@ -503,6 +503,9 @@ class Flow:
503
503
  return self._format_flow(flow_dict)
504
504
  except json.JSONDecodeError:
505
505
  return Text(flow_spec_str)
506
+
507
+ def _render_schema(self) -> list[tuple[str, str, str]]:
508
+ return self._lazy_engine_flow().get_schema()
506
509
 
507
510
  def __str__(self):
508
511
  return str(self._render_text())
cocoindex/setting.py CHANGED
@@ -47,7 +47,7 @@ class ServerSettings:
47
47
  """Settings for the cocoindex server."""
48
48
 
49
49
  # The address to bind the server to.
50
- address: str = "127.0.0.1:8080"
50
+ address: str = "127.0.0.1:49344"
51
51
 
52
52
  # The origins of the clients (e.g. CocoInsight UI) to allow CORS from.
53
53
  cors_origins: list[str] | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex
3
- Version: 0.1.30
3
+ Version: 0.1.32
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,6 +1,6 @@
1
- cocoindex-0.1.30.dist-info/METADATA,sha256=DgYe-2f-9L1PE3WP9x8f0om8fr3-Zct3bi5vkGbD-q0,8107
2
- cocoindex-0.1.30.dist-info/WHEEL,sha256=jgSIe9rFDK6RQayLUaWuarrVdZcfGY6qifRq6bxJ5gg,106
3
- cocoindex-0.1.30.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1
+ cocoindex-0.1.32.dist-info/METADATA,sha256=xqTNEyXV9wQlABo-P6xNvUWvgDZW56UiGmyM-Am7o-4,8107
2
+ cocoindex-0.1.32.dist-info/WHEEL,sha256=jgSIe9rFDK6RQayLUaWuarrVdZcfGY6qifRq6bxJ5gg,106
3
+ cocoindex-0.1.32.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
4
  cocoindex/functions.py,sha256=F79dNmGE127LaU67kF5Oqtf_tIzebFQH7MkyceMX4-s,1830
5
5
  cocoindex/query.py,sha256=8_3Lb_EVjZtl2ZyJNZGX16LoKXEd-PL8OjY-zs9GQeA,3205
6
6
  cocoindex/index.py,sha256=LssEOuZi6AqhwKtZM3QFeQpa9T-0ELi8G5DsrYKECvc,534
@@ -10,16 +10,16 @@ cocoindex/convert.py,sha256=mBUTa_Ag39_ut-yE_jc1wqS3zLjtOm6QKet-bqJ-RWc,5947
10
10
  cocoindex/tests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
11
11
  cocoindex/tests/test_convert.py,sha256=WPRKp0jv_uSEM81RGWEAmsax-J-FtXt90mZ0yEnvGLs,11236
12
12
  cocoindex/__init__.py,sha256=8atBT1HjclUOeiXd7TSzZWaqOR4x_qr5epvCKB7Z7oY,661
13
- cocoindex/flow.py,sha256=5W0tuDy_oc54lEmELvQAujx9f_20CSynZCF5vuNlbYw,22919
13
+ cocoindex/flow.py,sha256=KVbB_Ebm0IpJgZxV4BLg30fjIPmsGFhrtmQOBqCZaIk,23037
14
14
  cocoindex/llm.py,sha256=_3rtahuKcqcEHPkFSwhXOSrekZyGxVApPoYtlU_chcA,348
15
- cocoindex/setting.py,sha256=0bDaLsPPosJxkKqaPcs70MAm5kwZSsxNkKBKKeONDOw,2355
15
+ cocoindex/setting.py,sha256=pms1blwlXIOqZIpye-rfiwzqYUCAC8oEL7mQM5A160g,2356
16
16
  cocoindex/runtime.py,sha256=jqRnWkkIlAhE04gi4y0Y5bzuq9FX4j0aVNU-nengLJk,980
17
17
  cocoindex/op.py,sha256=OGYRYl7gPa7X7iSU30iTrCzvqRBu7jQqfvN4vjG__dA,10730
18
18
  cocoindex/sources.py,sha256=wZFU8lwSXjyofJR-syySH9fTyPnBlAPJ6-1hQNX8fGA,936
19
19
  cocoindex/setup.py,sha256=W1HshwYk_K2aeLOVn_e62ZOXBO9yWsoUboRiH4SjF48,496
20
- cocoindex/cli.py,sha256=57prYaE9iljBcEhV3EqyMMndPwHJsVApvKR9XhvFzLA,8387
20
+ cocoindex/cli.py,sha256=Vh8bNZ41yLr1l_jJR1Z_b7mY-dOvN-EbiCRxDvtIsRk,8885
21
21
  cocoindex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  cocoindex/typing.py,sha256=BI2vPw4Iu4S3aznNJQrfM2LZU_weGYASTXF1W3ZWh_Y,8568
23
23
  cocoindex/storages.py,sha256=MFMsfyOCYMggTWeWrOi82miqOXQmiUuqq828x5htBr0,2207
24
- cocoindex/_engine.cpython-311-darwin.so,sha256=hP2TsPKHLMY19dIzjsu_F-4cw8LN2fKQWi8QzDtCpuM,61705584
25
- cocoindex-0.1.30.dist-info/RECORD,,
24
+ cocoindex/_engine.cpython-311-darwin.so,sha256=K4V4P2YGAXNuNGRK8WcHvkGeEXaa3YYy5zfjABcppM8,58027532
25
+ cocoindex-0.1.32.dist-info/RECORD,,