licos-dev-cli 0.2.5__tar.gz → 0.2.7__tar.gz
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.
- {licos_dev_cli-0.2.5 → licos_dev_cli-0.2.7}/PKG-INFO +2 -2
- {licos_dev_cli-0.2.5 → licos_dev_cli-0.2.7}/pyproject.toml +2 -2
- {licos_dev_cli-0.2.5 → licos_dev_cli-0.2.7}/src/licos_dev_cli/main.py +90 -51
- {licos_dev_cli-0.2.5 → licos_dev_cli-0.2.7}/.gitignore +0 -0
- {licos_dev_cli-0.2.5 → licos_dev_cli-0.2.7}/src/licos_dev_cli/__init__.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: licos-dev-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: LICOS Dev CLI - generate files and call model capabilities
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: click>=8.1
|
|
7
|
-
Requires-Dist: licos-dev-sdk>=0.2.
|
|
7
|
+
Requires-Dist: licos-dev-sdk>=0.2.8
|
|
@@ -4,11 +4,11 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "licos-dev-cli"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.7"
|
|
8
8
|
description = "LICOS Dev CLI - generate files and call model capabilities"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"licos-dev-sdk>=0.2.
|
|
11
|
+
"licos-dev-sdk>=0.2.8",
|
|
12
12
|
"click>=8.1",
|
|
13
13
|
]
|
|
14
14
|
|
|
@@ -76,18 +76,34 @@ def pdf(input_path, content, filename, output_dir, content_type, page_size):
|
|
|
76
76
|
@click.option("--format", "content_type", default="markdown")
|
|
77
77
|
@click.option("--font", default="Arial")
|
|
78
78
|
@click.option("--font-size", default=11, type=int)
|
|
79
|
-
def docx(input_path, content, filename, output_dir, content_type, font, font_size):
|
|
80
|
-
"""Generate DOCX from Markdown or HTML."""
|
|
81
|
-
from licos_dev_sdk import create_docx
|
|
82
|
-
text = _read_input(input_path, content)
|
|
83
|
-
path = create_docx(text, filename, content_type=content_type, output_dir=output_dir, font_name=font, font_size=font_size)
|
|
84
|
-
click.echo(path)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@
|
|
90
|
-
@click.option("-
|
|
79
|
+
def docx(input_path, content, filename, output_dir, content_type, font, font_size):
|
|
80
|
+
"""Generate DOCX from Markdown or HTML."""
|
|
81
|
+
from licos_dev_sdk import create_docx
|
|
82
|
+
text = _read_input(input_path, content)
|
|
83
|
+
path = create_docx(text, filename, content_type=content_type, output_dir=output_dir, font_name=font, font_size=font_size)
|
|
84
|
+
click.echo(path)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@cli.command("docx-template")
|
|
88
|
+
@click.option("-t", "--template", "template_path", required=True, help="DOCX template path")
|
|
89
|
+
@click.option("-i", "--input", "input_path", help="JSON data file")
|
|
90
|
+
@click.option("-d", "--data", "data_content", help="JSON data")
|
|
91
|
+
@click.option("-f", "--filename", required=True)
|
|
92
|
+
@click.option("-o", "--output-dir", default=None)
|
|
93
|
+
def docx_template(template_path, input_path, data_content, filename, output_dir):
|
|
94
|
+
"""Generate DOCX by rendering a DOCX template with JSON data."""
|
|
95
|
+
from licos_dev_sdk import create_docx_from_template
|
|
96
|
+
data = _read_json(input_path, data_content)
|
|
97
|
+
if not isinstance(data, dict):
|
|
98
|
+
raise click.BadParameter("template data must be a JSON object")
|
|
99
|
+
path = create_docx_from_template(template_path, data, filename, output_dir=output_dir)
|
|
100
|
+
click.echo(path)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# ── XLSX ─────────────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
@cli.command()
|
|
106
|
+
@click.option("-i", "--input", "input_path")
|
|
91
107
|
@click.option("-c", "--content", help="JSON data")
|
|
92
108
|
@click.option("-f", "--filename", required=True)
|
|
93
109
|
@click.option("-o", "--output-dir", default=None)
|
|
@@ -97,11 +113,34 @@ def xlsx(input_path, content, filename, output_dir, sheet_name, header_color):
|
|
|
97
113
|
"""Generate XLSX from JSON data."""
|
|
98
114
|
from licos_dev_sdk import create_xlsx
|
|
99
115
|
data = _read_json(input_path, content)
|
|
100
|
-
path = create_xlsx(data, filename, output_dir=output_dir, sheet_name=sheet_name, header_color=header_color)
|
|
101
|
-
click.echo(path)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
path = create_xlsx(data, filename, output_dir=output_dir, sheet_name=sheet_name, header_color=header_color)
|
|
117
|
+
click.echo(path)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@cli.command("xlsx-workbook")
|
|
121
|
+
@click.option("-i", "--input", "input_path")
|
|
122
|
+
@click.option("-c", "--content", help="JSON workbook data")
|
|
123
|
+
@click.option("-f", "--filename", required=True)
|
|
124
|
+
@click.option("-o", "--output-dir", default=None)
|
|
125
|
+
@click.option("--header-color", default="4472C4")
|
|
126
|
+
@click.option("--freeze-header/--no-freeze-header", default=True)
|
|
127
|
+
@click.option("--autofilter/--no-autofilter", default=True)
|
|
128
|
+
def xlsx_workbook(input_path, content, filename, output_dir, header_color, freeze_header, autofilter):
|
|
129
|
+
"""Generate multi-sheet XLSX from JSON workbook data."""
|
|
130
|
+
from licos_dev_sdk import create_xlsx_workbook
|
|
131
|
+
data = _read_json(input_path, content)
|
|
132
|
+
path = create_xlsx_workbook(
|
|
133
|
+
data,
|
|
134
|
+
filename,
|
|
135
|
+
output_dir=output_dir,
|
|
136
|
+
header_color=header_color,
|
|
137
|
+
freeze_header=freeze_header,
|
|
138
|
+
autofilter=autofilter,
|
|
139
|
+
)
|
|
140
|
+
click.echo(path)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
# ── CSV ──────────────────────────────────────────────────────────────────────
|
|
105
144
|
|
|
106
145
|
@cli.command()
|
|
107
146
|
@click.option("-i", "--input", "input_path")
|
|
@@ -298,27 +337,27 @@ def html_cmd(input_path, content, filename, output_dir, content_type):
|
|
|
298
337
|
|
|
299
338
|
# ── Model Catalog ────────────────────────────────────────────────────────────
|
|
300
339
|
|
|
301
|
-
@cli.command("model-catalog")
|
|
302
|
-
@click.option("--refresh", is_flag=True, help="Bypass local catalog cache")
|
|
303
|
-
@click.option("--workspace-id", default=None, help="Workspace id; defaults to runtime workspace")
|
|
304
|
-
@click.option("--input-capabilities", default=None, help="Optional input capabilities filter, for example text or image")
|
|
305
|
-
@click.option(
|
|
306
|
-
"--category-code",
|
|
307
|
-
default="llm",
|
|
308
|
-
help="Model category code, for example llm, vision_llm, image_generation",
|
|
309
|
-
)
|
|
310
|
-
def model_catalog(refresh, workspace_id, input_capabilities, category_code):
|
|
311
|
-
"""Print platform model capability catalog."""
|
|
312
|
-
from licos_dev_sdk import fetch_model_catalogs
|
|
313
|
-
|
|
314
|
-
_echo_json(
|
|
315
|
-
fetch_model_catalogs(
|
|
316
|
-
refresh=refresh,
|
|
317
|
-
workspace_id=workspace_id,
|
|
318
|
-
category_code=category_code,
|
|
319
|
-
input_capabilities=input_capabilities,
|
|
320
|
-
)
|
|
321
|
-
)
|
|
340
|
+
@cli.command("model-catalog")
|
|
341
|
+
@click.option("--refresh", is_flag=True, help="Bypass local catalog cache")
|
|
342
|
+
@click.option("--workspace-id", default=None, help="Workspace id; defaults to runtime workspace")
|
|
343
|
+
@click.option("--input-capabilities", default=None, help="Optional input capabilities filter, for example text or image")
|
|
344
|
+
@click.option(
|
|
345
|
+
"--category-code",
|
|
346
|
+
default="llm",
|
|
347
|
+
help="Model category code, for example llm, vision_llm, image_generation",
|
|
348
|
+
)
|
|
349
|
+
def model_catalog(refresh, workspace_id, input_capabilities, category_code):
|
|
350
|
+
"""Print platform model capability catalog."""
|
|
351
|
+
from licos_dev_sdk import fetch_model_catalogs
|
|
352
|
+
|
|
353
|
+
_echo_json(
|
|
354
|
+
fetch_model_catalogs(
|
|
355
|
+
refresh=refresh,
|
|
356
|
+
workspace_id=workspace_id,
|
|
357
|
+
category_code=category_code,
|
|
358
|
+
input_capabilities=input_capabilities,
|
|
359
|
+
)
|
|
360
|
+
)
|
|
322
361
|
|
|
323
362
|
|
|
324
363
|
# ── LLM ──────────────────────────────────────────────────────────────────────
|
|
@@ -469,12 +508,12 @@ def video_generation_group():
|
|
|
469
508
|
@video_generation_group.command("generate")
|
|
470
509
|
@click.option("-p", "--prompt")
|
|
471
510
|
@click.option("--image-url", default=None)
|
|
472
|
-
@click.option("--model", default=None)
|
|
473
|
-
@click.option("--input-capabilities", default=None, help="Override video model input filter: text or image")
|
|
474
|
-
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
475
|
-
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
476
|
-
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
477
|
-
def video_generate(prompt, image_url, model, input_capabilities, parameters, raw_request, no_wait):
|
|
511
|
+
@click.option("--model", default=None)
|
|
512
|
+
@click.option("--input-capabilities", default=None, help="Override video model input filter: text or image")
|
|
513
|
+
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
514
|
+
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
515
|
+
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
516
|
+
def video_generate(prompt, image_url, model, input_capabilities, parameters, raw_request, no_wait):
|
|
478
517
|
"""Generate a video from a text prompt and optional first-frame image."""
|
|
479
518
|
from licos_dev_sdk import VideoGenerationClient
|
|
480
519
|
|
|
@@ -487,13 +526,13 @@ def video_generate(prompt, image_url, model, input_capabilities, parameters, raw
|
|
|
487
526
|
if raw_payload is None and not prompt:
|
|
488
527
|
raise click.UsageError("Provide --prompt or --raw-request.")
|
|
489
528
|
result = VideoGenerationClient().generate(
|
|
490
|
-
prompt or "",
|
|
491
|
-
image_url=image_url,
|
|
492
|
-
model=model,
|
|
493
|
-
input_capabilities=input_capabilities,
|
|
494
|
-
parameters=parameter_payload,
|
|
495
|
-
raw_request=raw_payload,
|
|
496
|
-
wait=not no_wait,
|
|
529
|
+
prompt or "",
|
|
530
|
+
image_url=image_url,
|
|
531
|
+
model=model,
|
|
532
|
+
input_capabilities=input_capabilities,
|
|
533
|
+
parameters=parameter_payload,
|
|
534
|
+
raw_request=raw_payload,
|
|
535
|
+
wait=not no_wait,
|
|
497
536
|
)
|
|
498
537
|
_echo_json(result)
|
|
499
538
|
|
|
File without changes
|
|
File without changes
|