GPTRouter 0.3.0__tar.gz → 0.3.2__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.3.0
3
+ Version: 0.3.2
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.3.0
3
+ Version: 0.3.2
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
@@ -62,9 +62,9 @@ class GPTRouterClient:
62
62
  payload.update(
63
63
  {
64
64
  "metadata": metadata,
65
- "tag": model_router_metadata.tag if model_router_metadata else None,
66
- "createdByUserId": model_router_metadata.created_by_user_id,
67
- "historyId": str(model_router_metadata.history_id) if model_router_metadata.history_id else None,
65
+ "tag": metadata.get('tag'),
66
+ "createdByUserId": metadata['created_by_user_id'],
67
+ "historyId": str(metadata['history_id']) if metadata.get('history_id') else None,
68
68
  }
69
69
  )
70
70
 
@@ -76,7 +76,7 @@ class GPTRouterClient:
76
76
  async with httpx.AsyncClient() as client:
77
77
  response = await client.request(
78
78
  method,
79
- url=self.base_url + "/api" + path,
79
+ url=self.base_url.rstrip('/') + ('/api' if not self.base_url.endswith('/api') else '') + path,
80
80
  headers={
81
81
  "content-type": "application/json",
82
82
  "ws-secret": self.api_key,
@@ -102,7 +102,7 @@ class GPTRouterClient:
102
102
  with httpx.Client() as client:
103
103
  response = client.request(
104
104
  method,
105
- url=self.base_url + "/api" + path,
105
+ url=self.base_url.rstrip('/') + ('/api' if not self.base_url.endswith('/api') else '') + path,
106
106
  headers={
107
107
  "content-type": "application/json",
108
108
  "ws-secret": self.api_key,
@@ -128,7 +128,7 @@ class GPTRouterClient:
128
128
  async with httpx.AsyncClient() as client:
129
129
  async with client.stream(
130
130
  method,
131
- url=f"{self.base_url}/api{path}",
131
+ url=self.base_url.rstrip('/') + ('/api' if not self.base_url.endswith('/api') else '') + path,
132
132
  data=json.dumps(payload),
133
133
  headers={
134
134
  "Content-type": "application/json",
@@ -167,7 +167,7 @@ class GPTRouterClient:
167
167
  with httpx.Client() as client:
168
168
  with client.stream(
169
169
  method=method,
170
- url=f"{self.base_url}/api{path}",
170
+ url=self.base_url.rstrip('/') + ('/api' if not self.base_url.endswith('/api') else '') + path,
171
171
  data=json.dumps(payload),
172
172
  headers={
173
173
  "Content-type": "application/json",
@@ -28,7 +28,7 @@ class GenerationParams(BaseModel):
28
28
  function_call: Optional[dict] = None
29
29
  tools: Optional[List[Any]] = None
30
30
  response_format: Optional[Dict[str, Any]] = None
31
- parallel_tool_calls: Optional[bool] = False
31
+ parallel_tool_calls: Optional[bool] = None
32
32
  tag: Optional[str] = None
33
33
  user_id: Optional[str] = None
34
34
  history_id: Optional[str] = None
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="GPTRouter",
8
- version="0.3.0",
8
+ version="0.3.2",
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