indoxrouter 0.1.21__py3-none-any.whl → 0.1.22__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 +11 -4
- {indoxrouter-0.1.21.dist-info → indoxrouter-0.1.22.dist-info}/METADATA +1 -1
- indoxrouter-0.1.22.dist-info/RECORD +8 -0
- indoxrouter-0.1.21.dist-info/RECORD +0 -8
- {indoxrouter-0.1.21.dist-info → indoxrouter-0.1.22.dist-info}/WHEEL +0 -0
- {indoxrouter-0.1.21.dist-info → indoxrouter-0.1.22.dist-info}/top_level.txt +0 -0
indoxrouter/client.py
CHANGED
@@ -647,10 +647,11 @@ class Client:
|
|
647
647
|
# Format the model string
|
648
648
|
formatted_model = self._format_model_string(model)
|
649
649
|
|
650
|
-
# Extract provider from model string if present
|
650
|
+
# Extract provider and model name from model string if present
|
651
651
|
provider = "openai" # Default provider
|
652
|
+
model_name = model
|
652
653
|
if "/" in model:
|
653
|
-
provider,
|
654
|
+
provider, model_name = model.split("/", 1)
|
654
655
|
|
655
656
|
# Filter out problematic parameters
|
656
657
|
filtered_kwargs = {}
|
@@ -676,14 +677,14 @@ class Client:
|
|
676
677
|
elif size is not None:
|
677
678
|
# Convert size to aspect_ratio
|
678
679
|
formatted_size = self._format_image_size_for_provider(
|
679
|
-
size, provider,
|
680
|
+
size, provider, model_name
|
680
681
|
)
|
681
682
|
data["aspect_ratio"] = formatted_size
|
682
683
|
else:
|
683
684
|
# Default aspect_ratio for Google
|
684
685
|
data["aspect_ratio"] = "1:1"
|
685
686
|
elif provider.lower() == "xai":
|
686
|
-
# xAI doesn't support size parameter
|
687
|
+
# xAI doesn't support size parameter - do not include it
|
687
688
|
pass
|
688
689
|
elif size is not None:
|
689
690
|
# For other providers (like OpenAI), use size as is
|
@@ -738,6 +739,12 @@ class Client:
|
|
738
739
|
if filtered_kwargs:
|
739
740
|
data["additional_params"] = filtered_kwargs
|
740
741
|
|
742
|
+
# Special case handling for specific models
|
743
|
+
if provider.lower() == "openai" and "gpt-image" in model_name.lower():
|
744
|
+
# Remove response_format for gpt-image models unless explicitly provided
|
745
|
+
if response_format is None and "response_format" in data:
|
746
|
+
del data["response_format"]
|
747
|
+
|
741
748
|
return self._request("POST", IMAGE_ENDPOINT, data)
|
742
749
|
|
743
750
|
def models(self, provider: Optional[str] = None) -> Dict[str, Any]:
|
@@ -0,0 +1,8 @@
|
|
1
|
+
indoxrouter/__init__.py,sha256=kwGvH8F5oqm2O4kLs-UtPfcY0AYiy5ZDUg-Sh3iYJA4,1627
|
2
|
+
indoxrouter/client.py,sha256=oAUpx_RDpEIHav_dgb4sc7f_Agji3UXPlvMWLFCnQwE,38437
|
3
|
+
indoxrouter/constants.py,sha256=GezZ9nuwK3A37xpWlcfXCrMsIIlCdP7xnvEkPBMyn5g,1383
|
4
|
+
indoxrouter/exceptions.py,sha256=qs7f9AnJ7SkOyf9N5qRaZIKpECE8uBq1Pvcg19Jif-U,1718
|
5
|
+
indoxrouter-0.1.22.dist-info/METADATA,sha256=aULhnVEH964jtJCoedkHH1SMCGZMkAJl3FK6CYsE-KY,6639
|
6
|
+
indoxrouter-0.1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
indoxrouter-0.1.22.dist-info/top_level.txt,sha256=v6FGWkw0QAnXhyYtnXLI1cxzna0iveNvZUotVzCWabM,12
|
8
|
+
indoxrouter-0.1.22.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
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,,
|
File without changes
|
File without changes
|