GPTRouter 0.5.3__tar.gz → 0.5.5__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.5.3
3
+ Version: 0.5.5
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.5.3
3
+ Version: 0.5.5
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,7 +1,7 @@
1
1
  from uuid import UUID
2
2
  from pydantic import BaseModel, Field, root_validator, validator
3
3
  from enum import Enum
4
- from typing import Dict, List, Optional, Any, Union
4
+ from typing import Dict, List, Literal, Optional, Any, Union
5
5
  from humps import camelize
6
6
 
7
7
 
@@ -32,8 +32,21 @@ class ExtendedThinking(BaseModel):
32
32
  budget_tokens: Optional[int] = 1024
33
33
 
34
34
 
35
+ class UserLocationApproximate(BaseModel):
36
+ city: Optional[str] = None
37
+ country: Optional[str] = None
38
+ region: Optional[str] = None
39
+ timezone: Optional[str] = None
40
+
41
+
42
+ class UserLocation(BaseModel):
43
+ type: Optional[str] = None
44
+ approximate: Optional[UserLocationApproximate] = None
45
+
46
+
35
47
  class WebSearchOptions(BaseModel):
36
48
  search_context_size: Optional[SearchContextSize] = None
49
+ user_location: Optional[Union[dict, UserLocation]] = None
37
50
 
38
51
 
39
52
  class GenerationParams(BaseModel):
@@ -62,6 +75,7 @@ class GenerationParams(BaseModel):
62
75
  colasce_into_thinking_tag: Optional[bool] = None
63
76
  use_response_api: Optional[bool] = None
64
77
  web_search_options: Optional[WebSearchOptions] = None
78
+ reasoning_effort: Optional[Literal["low", "medium", "high"]] = None
65
79
 
66
80
 
67
81
  class ModelGenerationRequest(BaseModel):
@@ -88,6 +102,7 @@ class Choice(BaseModel):
88
102
  finish_reason: str
89
103
  role: Optional[str] = None
90
104
  function_call: Optional[Any] = None
105
+ citations: Optional[List[dict | Any]] = None
91
106
 
92
107
 
93
108
  class GenerationResponse(BaseModel):
@@ -119,6 +134,10 @@ class ImageGenerationRequest(BaseModel):
119
134
  width: Optional[int] = Field(None, alias="width")
120
135
  height: Optional[int] = Field(None, alias="height")
121
136
  num_inference_steps: Optional[int] = Field(None, alias="numInferenceSteps")
137
+ app_id: Optional[str] = Field(None, alias="appId")
138
+ user_id: Optional[str] = Field(None, alias="createdByUserId")
139
+ history_id: Optional[str] = Field(None, alias="historyId")
140
+ feature: Optional[str] = Field(None, alias="feature")
122
141
 
123
142
  class Config:
124
143
  allow_population_by_field_name = True
@@ -151,11 +170,11 @@ class ImageEditRequest(BaseModel):
151
170
  response_format: Optional[str] = Field(alias="responseFormat", default=None)
152
171
  size: Optional[str] = Field(default="1024x1024")
153
172
  user: Optional[str] = Field(default=None)
154
-
173
+
155
174
  class Config:
156
175
  allow_population_by_field_name = True
157
176
  protected_namespaces = ()
158
-
177
+
159
178
  def dict(self, *args, **kwargs):
160
179
  base_dict = super().dict(*args, **kwargs, exclude_none=True, by_alias=True)
161
180
  return base_dict
@@ -3,10 +3,9 @@ from setuptools import setup
3
3
  with open("README.md", "r") as fh:
4
4
  long_description = fh.read()
5
5
 
6
-
7
6
  setup(
8
7
  name="GPTRouter",
9
- version="0.5.3",
8
+ version="0.5.5",
10
9
  description="A Python package for working with GPTRouter APIs",
11
10
  long_description=long_description,
12
11
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes