GPTRouter 0.2.6__tar.gz → 0.2.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.2.6 → GPTRouter-0.2.8}/GPTRouter.egg-info/PKG-INFO +1 -1
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/PKG-INFO +1 -1
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/client.py +12 -2
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/setup.py +1 -1
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/GPTRouter.egg-info/SOURCES.txt +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/GPTRouter.egg-info/dependency_links.txt +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/GPTRouter.egg-info/requires.txt +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/GPTRouter.egg-info/top_level.txt +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/LICENSE +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/README.md +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/__init__.py +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/constants.py +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/enums.py +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/exceptions.py +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/gpt_router/models.py +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/pyproject.toml +0 -0
- {GPTRouter-0.2.6 → GPTRouter-0.2.8}/setup.cfg +0 -0
|
@@ -178,6 +178,10 @@ class GPTRouterClient:
|
|
|
178
178
|
*,
|
|
179
179
|
ordered_generation_requests: List[ModelGenerationRequest],
|
|
180
180
|
is_stream=False,
|
|
181
|
+
tag: Optional[str] = None,
|
|
182
|
+
user_id: Optional[str] = None,
|
|
183
|
+
history_id: Optional[str] = None,
|
|
184
|
+
metadata: Optional[dict] = None,
|
|
181
185
|
) -> Union[GenerationResponse, Generator[ChunkedGenerationResponse]]:
|
|
182
186
|
api_path = "/v1/generate"
|
|
183
187
|
api_method = "POST"
|
|
@@ -187,6 +191,10 @@ class GPTRouterClient:
|
|
|
187
191
|
request.dict(exclude_none=True, by_alias=True)
|
|
188
192
|
for request in ordered_generation_requests
|
|
189
193
|
],
|
|
194
|
+
"tag": tag,
|
|
195
|
+
"createdByUserId": user_id,
|
|
196
|
+
"historyId": history_id,
|
|
197
|
+
"metadata": metadata,
|
|
190
198
|
}
|
|
191
199
|
if is_stream:
|
|
192
200
|
return self.stream_events(
|
|
@@ -209,6 +217,7 @@ class GPTRouterClient:
|
|
|
209
217
|
tag: Optional[str] = None,
|
|
210
218
|
user_id: Optional[str] = None,
|
|
211
219
|
history_id: Optional[str] = None,
|
|
220
|
+
metadata: Optional[dict] = None,
|
|
212
221
|
) -> GenerationResponse:
|
|
213
222
|
api_path = "/v1/generate"
|
|
214
223
|
api_method = "POST"
|
|
@@ -221,6 +230,7 @@ class GPTRouterClient:
|
|
|
221
230
|
"tag": tag,
|
|
222
231
|
"createdByUserId": user_id,
|
|
223
232
|
"historyId": history_id,
|
|
233
|
+
"metadata": metadata,
|
|
224
234
|
}
|
|
225
235
|
if is_stream:
|
|
226
236
|
return self.astream_events(
|
|
@@ -249,8 +259,8 @@ class GPTRouterClient:
|
|
|
249
259
|
)
|
|
250
260
|
generated_images = api_response.get("response", [])
|
|
251
261
|
if isinstance(generated_images, dict):
|
|
252
|
-
generated_images = generated_images.get(
|
|
253
|
-
|
|
262
|
+
generated_images = generated_images.get("artifacts", [])
|
|
263
|
+
|
|
254
264
|
return [
|
|
255
265
|
parse_obj_as(ImageGenerationResponse, generated_img)
|
|
256
266
|
for generated_img in generated_images
|
|
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
|
|
File without changes
|