licos-dev-cli 0.2.11__tar.gz → 0.2.12__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.11 → licos_dev_cli-0.2.12}/PKG-INFO +2 -2
- {licos_dev_cli-0.2.11 → licos_dev_cli-0.2.12}/pyproject.toml +2 -2
- {licos_dev_cli-0.2.11 → licos_dev_cli-0.2.12}/src/licos_dev_cli/main.py +92 -59
- {licos_dev_cli-0.2.11 → licos_dev_cli-0.2.12}/.gitignore +0 -0
- {licos_dev_cli-0.2.11 → licos_dev_cli-0.2.12}/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.12
|
|
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.13
|
|
@@ -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.12"
|
|
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.13",
|
|
12
12
|
"click>=8.1",
|
|
13
13
|
]
|
|
14
14
|
|
|
@@ -432,27 +432,32 @@ def vision_group():
|
|
|
432
432
|
pass
|
|
433
433
|
|
|
434
434
|
|
|
435
|
-
@vision_group.command("understand")
|
|
436
|
-
@click.option("--image
|
|
437
|
-
@click.option("-
|
|
438
|
-
@click.option("--
|
|
439
|
-
@click.option("
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
435
|
+
@vision_group.command("understand")
|
|
436
|
+
@click.option("--image", "image", multiple=True, help="Image URL, Base64 data URI, or plain Base64 image data. Can be repeated.")
|
|
437
|
+
@click.option("--image-url", "image_url", multiple=True, help="Alias for --image. Can be repeated.")
|
|
438
|
+
@click.option("--file-path", "file_path", multiple=True, help="Local image file path. Can be repeated.")
|
|
439
|
+
@click.option("-p", "--prompt", default="Describe this image.")
|
|
440
|
+
@click.option("--model", default=None)
|
|
441
|
+
@click.option("--mime-type", default=None, help="MIME type for plain Base64 image inputs. Defaults to image/png.")
|
|
442
|
+
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
443
|
+
def vision_understand(image, image_url, file_path, prompt, model, mime_type, raw_request):
|
|
444
|
+
"""Understand one or more images with the catalog vision model."""
|
|
445
|
+
from licos_dev_sdk import VisionClient
|
|
446
|
+
|
|
447
|
+
raw_payload = _json_option(raw_request, "--raw-request")
|
|
448
|
+
if raw_payload is not None and not isinstance(raw_payload, dict):
|
|
449
|
+
raise click.BadParameter("--raw-request must be a JSON object")
|
|
450
|
+
if raw_payload is None and not image_url and not image and not file_path:
|
|
451
|
+
raise click.UsageError("Provide --image, --image-url, --file-path, or --raw-request.")
|
|
452
|
+
result = VisionClient().understand(
|
|
453
|
+
images=[*image, *image_url],
|
|
454
|
+
file_paths=list(file_path),
|
|
455
|
+
prompt=prompt,
|
|
456
|
+
model=model,
|
|
457
|
+
mime_type=mime_type,
|
|
458
|
+
raw_request=raw_payload,
|
|
459
|
+
)
|
|
460
|
+
_echo_json(result)
|
|
456
461
|
|
|
457
462
|
|
|
458
463
|
# ── Image Generation ─────────────────────────────────────────────────────────
|
|
@@ -528,18 +533,36 @@ def video_generation_group():
|
|
|
528
533
|
pass
|
|
529
534
|
|
|
530
535
|
|
|
531
|
-
@video_generation_group.command("generate")
|
|
532
|
-
@click.option("-p", "--prompt")
|
|
533
|
-
@click.option("--image
|
|
534
|
-
@click.option("--
|
|
535
|
-
@click.option("--
|
|
536
|
-
@click.option("--
|
|
537
|
-
@click.option("--
|
|
538
|
-
@click.option("--
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
536
|
+
@video_generation_group.command("generate")
|
|
537
|
+
@click.option("-p", "--prompt")
|
|
538
|
+
@click.option("--image", default=None, help="Source/reference image URL, Base64 data URI, or plain Base64 image data")
|
|
539
|
+
@click.option("--image-url", default=None, help="Alias for --image")
|
|
540
|
+
@click.option("--reference-image", default=None, help="Alias for --image")
|
|
541
|
+
@click.option("--first-frame-url", default=None, help="Alias for --image")
|
|
542
|
+
@click.option("--file-path", default=None, help="Local source/reference image path")
|
|
543
|
+
@click.option("--model", default=None)
|
|
544
|
+
@click.option("--input-capabilities", default=None, help="Override video model input filter: text or image")
|
|
545
|
+
@click.option("--mime-type", default=None, help="MIME type for plain Base64 image inputs. Defaults to image/png.")
|
|
546
|
+
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
547
|
+
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
548
|
+
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
549
|
+
def video_generate(
|
|
550
|
+
prompt,
|
|
551
|
+
image,
|
|
552
|
+
image_url,
|
|
553
|
+
reference_image,
|
|
554
|
+
first_frame_url,
|
|
555
|
+
file_path,
|
|
556
|
+
model,
|
|
557
|
+
input_capabilities,
|
|
558
|
+
mime_type,
|
|
559
|
+
parameters,
|
|
560
|
+
raw_request,
|
|
561
|
+
no_wait,
|
|
562
|
+
):
|
|
563
|
+
"""Generate a video from a text prompt and optional first-frame image."""
|
|
564
|
+
from licos_dev_sdk import VideoGenerationClient
|
|
565
|
+
|
|
543
566
|
parameter_payload = _json_option(parameters, "--parameters") or {}
|
|
544
567
|
raw_payload = _json_option(raw_request, "--raw-request")
|
|
545
568
|
if not isinstance(parameter_payload, dict):
|
|
@@ -548,14 +571,19 @@ def video_generate(prompt, image_url, model, input_capabilities, parameters, raw
|
|
|
548
571
|
raise click.BadParameter("--raw-request must be a JSON object")
|
|
549
572
|
if raw_payload is None and not prompt:
|
|
550
573
|
raise click.UsageError("Provide --prompt or --raw-request.")
|
|
551
|
-
result = VideoGenerationClient().generate(
|
|
552
|
-
prompt or "",
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
574
|
+
result = VideoGenerationClient().generate(
|
|
575
|
+
prompt or "",
|
|
576
|
+
image=image,
|
|
577
|
+
image_url=image_url,
|
|
578
|
+
reference_image=reference_image,
|
|
579
|
+
first_frame_url=first_frame_url,
|
|
580
|
+
file_path=file_path,
|
|
581
|
+
model=model,
|
|
582
|
+
input_capabilities=input_capabilities,
|
|
583
|
+
mime_type=mime_type,
|
|
584
|
+
parameters=parameter_payload,
|
|
585
|
+
raw_request=raw_payload,
|
|
586
|
+
wait=not no_wait,
|
|
559
587
|
)
|
|
560
588
|
_echo_json(result)
|
|
561
589
|
|
|
@@ -568,30 +596,35 @@ def audio_group():
|
|
|
568
596
|
pass
|
|
569
597
|
|
|
570
598
|
|
|
571
|
-
@audio_group.command("recognize")
|
|
572
|
-
@click.option("--audio
|
|
573
|
-
@click.option("--
|
|
574
|
-
@click.option("--
|
|
575
|
-
@click.option("--
|
|
576
|
-
@click.option("--
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
599
|
+
@audio_group.command("recognize")
|
|
600
|
+
@click.option("--audio", "audio", multiple=True, help="Audio URL, Base64 data URI, or plain Base64 audio data. Can be repeated.")
|
|
601
|
+
@click.option("--audio-url", "audio_url", multiple=True, help="Alias for --audio. Can be repeated.")
|
|
602
|
+
@click.option("--file-path", "file_path", multiple=True, help="Local audio file path. Can be repeated.")
|
|
603
|
+
@click.option("--model", default=None)
|
|
604
|
+
@click.option("--mime-type", default=None, help="MIME type for plain Base64 audio inputs. Defaults to audio/wav.")
|
|
605
|
+
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
606
|
+
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
607
|
+
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
608
|
+
def audio_recognize(audio, audio_url, file_path, model, mime_type, parameters, raw_request, no_wait):
|
|
609
|
+
"""Recognize speech from one or more audio inputs."""
|
|
610
|
+
from licos_dev_sdk import SpeechRecognitionClient
|
|
611
|
+
|
|
581
612
|
parameter_payload = _json_option(parameters, "--parameters") or {}
|
|
582
613
|
raw_payload = _json_option(raw_request, "--raw-request")
|
|
583
614
|
if not isinstance(parameter_payload, dict):
|
|
584
615
|
raise click.BadParameter("--parameters must be a JSON object")
|
|
585
616
|
if raw_payload is not None and not isinstance(raw_payload, dict):
|
|
586
617
|
raise click.BadParameter("--raw-request must be a JSON object")
|
|
587
|
-
if raw_payload is None and not audio_url:
|
|
588
|
-
raise click.UsageError("Provide --audio-url or --raw-request.")
|
|
589
|
-
result = SpeechRecognitionClient().recognize(
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
618
|
+
if raw_payload is None and not audio and not audio_url and not file_path:
|
|
619
|
+
raise click.UsageError("Provide --audio, --audio-url, --file-path, or --raw-request.")
|
|
620
|
+
result = SpeechRecognitionClient().recognize(
|
|
621
|
+
audios=[*audio, *audio_url],
|
|
622
|
+
file_paths=list(file_path),
|
|
623
|
+
model=model,
|
|
624
|
+
mime_type=mime_type,
|
|
625
|
+
parameters=parameter_payload,
|
|
626
|
+
raw_request=raw_payload,
|
|
627
|
+
wait=not no_wait,
|
|
595
628
|
)
|
|
596
629
|
_echo_json(result)
|
|
597
630
|
|
|
File without changes
|
|
File without changes
|