licos-dev-cli 0.2.11__tar.gz → 0.2.13__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: licos-dev-cli
3
- Version: 0.2.11
3
+ Version: 0.2.13
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.12
7
+ Requires-Dist: licos-dev-sdk>=0.2.14
@@ -4,11 +4,11 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "licos-dev-cli"
7
- version = "0.2.11"
7
+ version = "0.2.13"
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.12",
11
+ "licos-dev-sdk>=0.2.14",
12
12
  "click>=8.1",
13
13
  ]
14
14
 
@@ -433,23 +433,28 @@ def vision_group():
433
433
 
434
434
 
435
435
  @vision_group.command("understand")
436
- @click.option("--image-url", multiple=True, help="Image URL. Can be repeated.")
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.")
437
439
  @click.option("-p", "--prompt", default="Describe this image.")
438
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.")
439
442
  @click.option("--raw-request", default=None, help="Raw JSON request body")
440
- def vision_understand(image_url, prompt, model, raw_request):
443
+ def vision_understand(image, image_url, file_path, prompt, model, mime_type, raw_request):
441
444
  """Understand one or more images with the catalog vision model."""
442
445
  from licos_dev_sdk import VisionClient
443
446
 
444
447
  raw_payload = _json_option(raw_request, "--raw-request")
445
448
  if raw_payload is not None and not isinstance(raw_payload, dict):
446
449
  raise click.BadParameter("--raw-request must be a JSON object")
447
- if raw_payload is None and not image_url:
448
- raise click.UsageError("Provide --image-url or --raw-request.")
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.")
449
452
  result = VisionClient().understand(
450
- image_urls=list(image_url),
453
+ images=[*image, *image_url],
454
+ file_paths=list(file_path),
451
455
  prompt=prompt,
452
456
  model=model,
457
+ mime_type=mime_type,
453
458
  raw_request=raw_payload,
454
459
  )
455
460
  _echo_json(result)
@@ -464,35 +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("--image", "image", multiple=True, help="Source/reference image URL or Base64 data URI")
469
- @click.option("--image-url", "image_url", multiple=True, help="Alias for --image")
470
- @click.option("--reference-image", default=None, help="Alias for --image")
471
- @click.option("--file-path", "file_path", multiple=True, help="Local source/reference image path")
472
- @click.option("--input-capabilities", default=None, help="Override image model input filter: text or image")
473
- @click.option("--negative-prompt", default=None)
474
- @click.option("--count", default=1, type=int)
475
- @click.option("--size", default=None)
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)
476
481
  @click.option("--model", default=None)
477
- @click.option("--parameters", default=None, help="Parameters JSON object")
478
- @click.option("--raw-request", default=None, help="Raw JSON request body")
479
- @click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
480
- def image_generate(
481
- prompt,
482
- image,
483
- image_url,
484
- reference_image,
485
- file_path,
486
- input_capabilities,
487
- negative_prompt,
488
- count,
489
- size,
490
- model,
491
- parameters,
492
- raw_request,
493
- no_wait,
494
- ):
495
- """Generate images from text, image URLs/Base64, or local image files."""
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."""
496
501
  from licos_dev_sdk import ImageGenerationClient
497
502
 
498
503
  parameter_payload = _json_option(parameters, "--parameters") or {}
@@ -505,16 +510,16 @@ def image_generate(
505
510
  raise click.UsageError("Provide --prompt or --raw-request.")
506
511
  result = ImageGenerationClient().generate(
507
512
  prompt or "",
508
- negative_prompt=negative_prompt,
509
- count=count,
510
- size=size,
511
- images=[*image, *image_url],
512
- reference_image=reference_image,
513
- file_paths=list(file_path),
514
- input_capabilities=input_capabilities,
515
- model=model,
516
- parameters=parameter_payload,
517
- raw_request=raw_payload,
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,
518
523
  wait=not no_wait,
519
524
  )
520
525
  _echo_json(result)
@@ -530,13 +535,31 @@ def video_generation_group():
530
535
 
531
536
  @video_generation_group.command("generate")
532
537
  @click.option("-p", "--prompt")
533
- @click.option("--image-url", default=None)
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")
534
543
  @click.option("--model", default=None)
535
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.")
536
546
  @click.option("--parameters", default=None, help="Parameters JSON object")
537
547
  @click.option("--raw-request", default=None, help="Raw JSON request body")
538
548
  @click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
539
- def video_generate(prompt, image_url, model, input_capabilities, parameters, raw_request, no_wait):
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
+ ):
540
563
  """Generate a video from a text prompt and optional first-frame image."""
541
564
  from licos_dev_sdk import VideoGenerationClient
542
565
 
@@ -550,9 +573,14 @@ def video_generate(prompt, image_url, model, input_capabilities, parameters, raw
550
573
  raise click.UsageError("Provide --prompt or --raw-request.")
551
574
  result = VideoGenerationClient().generate(
552
575
  prompt or "",
576
+ image=image,
553
577
  image_url=image_url,
578
+ reference_image=reference_image,
579
+ first_frame_url=first_frame_url,
580
+ file_path=file_path,
554
581
  model=model,
555
582
  input_capabilities=input_capabilities,
583
+ mime_type=mime_type,
556
584
  parameters=parameter_payload,
557
585
  raw_request=raw_payload,
558
586
  wait=not no_wait,
@@ -569,13 +597,16 @@ def audio_group():
569
597
 
570
598
 
571
599
  @audio_group.command("recognize")
572
- @click.option("--audio-url", multiple=True, help="Audio URL. Can be repeated.")
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.")
573
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.")
574
605
  @click.option("--parameters", default=None, help="Parameters JSON object")
575
606
  @click.option("--raw-request", default=None, help="Raw JSON request body")
576
607
  @click.option("--no-wait", is_flag=True, help="Return submit response without polling async tasks")
577
- def audio_recognize(audio_url, model, parameters, raw_request, no_wait):
578
- """Recognize speech from one or more audio URLs."""
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."""
579
610
  from licos_dev_sdk import SpeechRecognitionClient
580
611
 
581
612
  parameter_payload = _json_option(parameters, "--parameters") or {}
@@ -584,11 +615,13 @@ def audio_recognize(audio_url, model, parameters, raw_request, no_wait):
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.")
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.")
589
620
  result = SpeechRecognitionClient().recognize(
590
- audio_urls=list(audio_url),
621
+ audios=[*audio, *audio_url],
622
+ file_paths=list(file_path),
591
623
  model=model,
624
+ mime_type=mime_type,
592
625
  parameters=parameter_payload,
593
626
  raw_request=raw_payload,
594
627
  wait=not no_wait,