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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: GPTRouter
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: A Python package for working with GPTRouter APIs
5
5
  Author-email: sirjanpreet@writesonic.com
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: GPTRouter
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: A Python package for working with GPTRouter APIs
5
5
  Author-email: sirjanpreet@writesonic.com
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -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('artifacts', [])
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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="GPTRouter",
8
- version="0.2.6",
8
+ version="0.2.8",
9
9
  description="A Python package for working with GPTRouter APIs",
10
10
  long_description=long_description,
11
11
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes