indoxrouter 0.1.19__py3-none-any.whl → 0.1.21__py3-none-any.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.
indoxrouter/client.py CHANGED
@@ -597,6 +597,8 @@ class Client:
597
597
  output_mime_type: Optional[str] = None,
598
598
  add_watermark: Optional[bool] = None,
599
599
  enhance_prompt: Optional[bool] = None,
600
+ # Google-specific direct parameters
601
+ aspect_ratio: Optional[str] = None,
600
602
  **kwargs,
601
603
  ) -> Dict[str, Any]:
602
604
  """
@@ -608,7 +610,7 @@ class Client:
608
610
 
609
611
  # Provider-specific parameters - will only be included if explicitly provided
610
612
  # Note: Different providers support different parameters
611
- size: Image size - For OpenAI: "1024x1024", "512x512", etc. For Google: "1:1", "4:3", etc.
613
+ size: Image size - For OpenAI: "1024x1024", "512x512", etc. For Google: use aspect_ratio instead
612
614
  n: Number of images to generate
613
615
  quality: Image quality (e.g., "standard", "hd") - supported by some providers
614
616
  style: Image style (e.g., "vivid", "natural") - supported by some providers
@@ -635,6 +637,7 @@ class Client:
635
637
  output_mime_type: MIME type of the generated image
636
638
  add_watermark: Whether to add a watermark to the generated images
637
639
  enhance_prompt: Whether to use prompt rewriting logic
640
+ aspect_ratio: Aspect ratio for Google models (e.g., "1:1", "16:9") - preferred over size
638
641
 
639
642
  **kwargs: Additional parameters to pass to the API
640
643
 
@@ -665,13 +668,26 @@ class Client:
665
668
  if n is not None:
666
669
  data["n"] = n
667
670
 
668
- # Handle size parameter with provider-specific formatting
669
- if size is not None:
670
- formatted_size = self._format_image_size_for_provider(size, provider, model)
671
- data["size"] = formatted_size
672
- elif provider.lower() == "google":
673
- # Default size for Google if not provided
674
- data["size"] = "1:1"
671
+ # Handle size/aspect_ratio parameters based on provider
672
+ if provider.lower() == "google":
673
+ # For Google, use aspect_ratio instead of size
674
+ if aspect_ratio is not None:
675
+ data["aspect_ratio"] = aspect_ratio
676
+ elif size is not None:
677
+ # Convert size to aspect_ratio
678
+ formatted_size = self._format_image_size_for_provider(
679
+ size, provider, model
680
+ )
681
+ data["aspect_ratio"] = formatted_size
682
+ else:
683
+ # Default aspect_ratio for Google
684
+ data["aspect_ratio"] = "1:1"
685
+ elif provider.lower() == "xai":
686
+ # xAI doesn't support size parameter
687
+ pass
688
+ elif size is not None:
689
+ # For other providers (like OpenAI), use size as is
690
+ data["size"] = size
675
691
 
676
692
  if quality is not None:
677
693
  data["quality"] = quality
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: indoxrouter
3
- Version: 0.1.19
3
+ Version: 0.1.21
4
4
  Summary: A unified client for various AI providers
5
5
  Author-email: indoxRouter Team <ashkan.eskandari.dev@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,8 @@
1
+ indoxrouter/__init__.py,sha256=kwGvH8F5oqm2O4kLs-UtPfcY0AYiy5ZDUg-Sh3iYJA4,1627
2
+ indoxrouter/client.py,sha256=5oNwvLMzFV9_jEffCZe0fzQy0m-807rFSS2NmJNv4_s,38023
3
+ indoxrouter/constants.py,sha256=GezZ9nuwK3A37xpWlcfXCrMsIIlCdP7xnvEkPBMyn5g,1383
4
+ indoxrouter/exceptions.py,sha256=qs7f9AnJ7SkOyf9N5qRaZIKpECE8uBq1Pvcg19Jif-U,1718
5
+ indoxrouter-0.1.21.dist-info/METADATA,sha256=znCM17Sp8qaLphTKtJKx4Bmz4Om8Ys91Jo5hF9yyVEI,6639
6
+ indoxrouter-0.1.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ indoxrouter-0.1.21.dist-info/top_level.txt,sha256=v6FGWkw0QAnXhyYtnXLI1cxzna0iveNvZUotVzCWabM,12
8
+ indoxrouter-0.1.21.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- indoxrouter/__init__.py,sha256=kwGvH8F5oqm2O4kLs-UtPfcY0AYiy5ZDUg-Sh3iYJA4,1627
2
- indoxrouter/client.py,sha256=5y2MFHYx-ge82K30yPYnDRUe4jS9aCF6n3D1JaB1Crw,37298
3
- indoxrouter/constants.py,sha256=GezZ9nuwK3A37xpWlcfXCrMsIIlCdP7xnvEkPBMyn5g,1383
4
- indoxrouter/exceptions.py,sha256=qs7f9AnJ7SkOyf9N5qRaZIKpECE8uBq1Pvcg19Jif-U,1718
5
- indoxrouter-0.1.19.dist-info/METADATA,sha256=bYZiVHEyt-yKnngnshHSu4fMHuBl1MnJqeWbKByr0aU,6639
6
- indoxrouter-0.1.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- indoxrouter-0.1.19.dist-info/top_level.txt,sha256=v6FGWkw0QAnXhyYtnXLI1cxzna0iveNvZUotVzCWabM,12
8
- indoxrouter-0.1.19.dist-info/RECORD,,