licos-dev-cli 0.2.10__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.10 → licos_dev_cli-0.2.12}/PKG-INFO +2 -2
- {licos_dev_cli-0.2.10 → licos_dev_cli-0.2.12}/pyproject.toml +2 -2
- {licos_dev_cli-0.2.10 → licos_dev_cli-0.2.12}/src/licos_dev_cli/main.py +130 -74
- {licos_dev_cli-0.2.10 → licos_dev_cli-0.2.12}/.gitignore +0 -0
- {licos_dev_cli-0.2.10 → 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 ─────────────────────────────────────────────────────────
|
|
@@ -464,16 +469,35 @@ def image_generation_group():
|
|
|
464
469
|
|
|
465
470
|
|
|
466
471
|
@image_generation_group.command("generate")
|
|
467
|
-
@click.option("-p", "--prompt")
|
|
468
|
-
@click.option("--
|
|
469
|
-
@click.option("--
|
|
470
|
-
@click.option("--
|
|
472
|
+
@click.option("-p", "--prompt")
|
|
473
|
+
@click.option("--image", "image", multiple=True, help="Source/reference image URL or Base64 data URI")
|
|
474
|
+
@click.option("--image-url", "image_url", multiple=True, help="Alias for --image")
|
|
475
|
+
@click.option("--reference-image", default=None, help="Alias for --image")
|
|
476
|
+
@click.option("--file-path", "file_path", multiple=True, help="Local source/reference image path")
|
|
477
|
+
@click.option("--input-capabilities", default=None, help="Override image model input filter: text or image")
|
|
478
|
+
@click.option("--negative-prompt", default=None)
|
|
479
|
+
@click.option("--count", default=1, type=int)
|
|
480
|
+
@click.option("--size", default=None)
|
|
471
481
|
@click.option("--model", default=None)
|
|
472
|
-
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
473
|
-
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
474
|
-
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
475
|
-
def image_generate(
|
|
476
|
-
|
|
482
|
+
@click.option("--parameters", default=None, help="Parameters JSON object")
|
|
483
|
+
@click.option("--raw-request", default=None, help="Raw JSON request body")
|
|
484
|
+
@click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
|
|
485
|
+
def image_generate(
|
|
486
|
+
prompt,
|
|
487
|
+
image,
|
|
488
|
+
image_url,
|
|
489
|
+
reference_image,
|
|
490
|
+
file_path,
|
|
491
|
+
input_capabilities,
|
|
492
|
+
negative_prompt,
|
|
493
|
+
count,
|
|
494
|
+
size,
|
|
495
|
+
model,
|
|
496
|
+
parameters,
|
|
497
|
+
raw_request,
|
|
498
|
+
no_wait,
|
|
499
|
+
):
|
|
500
|
+
"""Generate images from text, image URLs/Base64, or local image files."""
|
|
477
501
|
from licos_dev_sdk import ImageGenerationClient
|
|
478
502
|
|
|
479
503
|
parameter_payload = _json_option(parameters, "--parameters") or {}
|
|
@@ -486,12 +510,16 @@ def image_generate(prompt, negative_prompt, count, size, model, parameters, raw_
|
|
|
486
510
|
raise click.UsageError("Provide --prompt or --raw-request.")
|
|
487
511
|
result = ImageGenerationClient().generate(
|
|
488
512
|
prompt or "",
|
|
489
|
-
negative_prompt=negative_prompt,
|
|
490
|
-
count=count,
|
|
491
|
-
size=size,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
513
|
+
negative_prompt=negative_prompt,
|
|
514
|
+
count=count,
|
|
515
|
+
size=size,
|
|
516
|
+
images=[*image, *image_url],
|
|
517
|
+
reference_image=reference_image,
|
|
518
|
+
file_paths=list(file_path),
|
|
519
|
+
input_capabilities=input_capabilities,
|
|
520
|
+
model=model,
|
|
521
|
+
parameters=parameter_payload,
|
|
522
|
+
raw_request=raw_payload,
|
|
495
523
|
wait=not no_wait,
|
|
496
524
|
)
|
|
497
525
|
_echo_json(result)
|
|
@@ -505,18 +533,36 @@ def video_generation_group():
|
|
|
505
533
|
pass
|
|
506
534
|
|
|
507
535
|
|
|
508
|
-
@video_generation_group.command("generate")
|
|
509
|
-
@click.option("-p", "--prompt")
|
|
510
|
-
@click.option("--image
|
|
511
|
-
@click.option("--
|
|
512
|
-
@click.option("--
|
|
513
|
-
@click.option("--
|
|
514
|
-
@click.option("--
|
|
515
|
-
@click.option("--
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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
|
+
|
|
520
566
|
parameter_payload = _json_option(parameters, "--parameters") or {}
|
|
521
567
|
raw_payload = _json_option(raw_request, "--raw-request")
|
|
522
568
|
if not isinstance(parameter_payload, dict):
|
|
@@ -525,14 +571,19 @@ def video_generate(prompt, image_url, model, input_capabilities, parameters, raw
|
|
|
525
571
|
raise click.BadParameter("--raw-request must be a JSON object")
|
|
526
572
|
if raw_payload is None and not prompt:
|
|
527
573
|
raise click.UsageError("Provide --prompt or --raw-request.")
|
|
528
|
-
result = VideoGenerationClient().generate(
|
|
529
|
-
prompt or "",
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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,
|
|
536
587
|
)
|
|
537
588
|
_echo_json(result)
|
|
538
589
|
|
|
@@ -545,30 +596,35 @@ def audio_group():
|
|
|
545
596
|
pass
|
|
546
597
|
|
|
547
598
|
|
|
548
|
-
@audio_group.command("recognize")
|
|
549
|
-
@click.option("--audio
|
|
550
|
-
@click.option("--
|
|
551
|
-
@click.option("--
|
|
552
|
-
@click.option("--
|
|
553
|
-
@click.option("--
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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
|
+
|
|
558
612
|
parameter_payload = _json_option(parameters, "--parameters") or {}
|
|
559
613
|
raw_payload = _json_option(raw_request, "--raw-request")
|
|
560
614
|
if not isinstance(parameter_payload, dict):
|
|
561
615
|
raise click.BadParameter("--parameters must be a JSON object")
|
|
562
616
|
if raw_payload is not None and not isinstance(raw_payload, dict):
|
|
563
617
|
raise click.BadParameter("--raw-request must be a JSON object")
|
|
564
|
-
if raw_payload is None and not audio_url:
|
|
565
|
-
raise click.UsageError("Provide --audio-url or --raw-request.")
|
|
566
|
-
result = SpeechRecognitionClient().recognize(
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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,
|
|
572
628
|
)
|
|
573
629
|
_echo_json(result)
|
|
574
630
|
|
|
File without changes
|
|
File without changes
|