GPTRouter 0.3.7__tar.gz → 0.3.8__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.
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/GPTRouter.egg-info/PKG-INFO +1 -1
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/PKG-INFO +1 -1
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/client.py +10 -1
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/enums.py +6 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/setup.py +1 -1
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/GPTRouter.egg-info/SOURCES.txt +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/GPTRouter.egg-info/dependency_links.txt +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/GPTRouter.egg-info/requires.txt +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/GPTRouter.egg-info/top_level.txt +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/LICENSE +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/README.md +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/__init__.py +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/constants.py +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/exceptions.py +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/gpt_router/models.py +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/pyproject.toml +0 -0
- {GPTRouter-0.3.7 → GPTRouter-0.3.8}/setup.cfg +0 -0
|
@@ -391,9 +391,18 @@ class GPTRouterClient:
|
|
|
391
391
|
)
|
|
392
392
|
generated_images = api_response.get("response", [])
|
|
393
393
|
if isinstance(generated_images, dict):
|
|
394
|
-
generated_images =
|
|
394
|
+
generated_images = self._extract_images_from_dict(generated_images)
|
|
395
395
|
|
|
396
396
|
return [
|
|
397
397
|
parse_obj_as(ImageGenerationResponse, generated_img)
|
|
398
398
|
for generated_img in generated_images
|
|
399
399
|
]
|
|
400
|
+
|
|
401
|
+
def _extract_images_from_dict(self, image_dict: dict) -> List[dict]:
|
|
402
|
+
if artifacts := image_dict.get("artifacts"):
|
|
403
|
+
return artifacts
|
|
404
|
+
|
|
405
|
+
if image_urls := image_dict.get("imageUrls"):
|
|
406
|
+
return [{"url": url} for url in image_urls]
|
|
407
|
+
|
|
408
|
+
return []
|
|
@@ -15,6 +15,7 @@ class ProvidersEnum(Enum):
|
|
|
15
15
|
STABLE_DIFFUSION = "stable-diffusion"
|
|
16
16
|
DALL_E = "dall-e"
|
|
17
17
|
OPENROUTER = "openrouter"
|
|
18
|
+
REPLICATE = "replicate"
|
|
18
19
|
|
|
19
20
|
class ModelsEnum(Enum):
|
|
20
21
|
OPENAI_GPT_35_TURBO_16K = "gpt-3.5-turbo-16k"
|
|
@@ -43,6 +44,8 @@ class ModelsEnum(Enum):
|
|
|
43
44
|
STABLE_DIFFUSION_XL = "stable-diffusion-xl-1024-v1-0"
|
|
44
45
|
STABLE_DIFFUSION_V6 = "stable-diffusion-v1-6"
|
|
45
46
|
|
|
47
|
+
REPLICATE_FLUX = "black-forest-labs/flux-dev"
|
|
48
|
+
|
|
46
49
|
class StreamingEventType(Enum):
|
|
47
50
|
UPDATE = "update"
|
|
48
51
|
META = "meta"
|
|
@@ -150,6 +153,9 @@ class GPTRouterEngines(Enum):
|
|
|
150
153
|
ProvidersEnum.STABLE_DIFFUSION.value, "stable-diffusion-xl-1024-v1-0"
|
|
151
154
|
)
|
|
152
155
|
DALLE_3 = ModelDetails(ProvidersEnum.DALL_E.value, "dall-e-3")
|
|
156
|
+
REPLICATE_FLUX = ModelDetails(
|
|
157
|
+
ProvidersEnum.REPLICATE.value, "black-forest-labs/flux-dev"
|
|
158
|
+
)
|
|
153
159
|
|
|
154
160
|
LLAMA_3_70B_NITRO = ModelDetails(
|
|
155
161
|
ProvidersEnum.OPENROUTER, "meta-llama/llama-3-70b-instruct:nitro"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|