payi 0.1.0a75__py3-none-any.whl → 0.1.0a77__py3-none-any.whl
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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi/_base_client.py +6 -0
- payi/_models.py +2 -0
- payi/_types.py +2 -0
- payi/_version.py +1 -1
- payi/lib/AnthropicInstrumentor.py +3 -3
- payi/lib/OpenAIInstrumentor.py +2 -3
- {payi-0.1.0a75.dist-info → payi-0.1.0a77.dist-info}/METADATA +2 -7
- {payi-0.1.0a75.dist-info → payi-0.1.0a77.dist-info}/RECORD +10 -10
- {payi-0.1.0a75.dist-info → payi-0.1.0a77.dist-info}/WHEEL +0 -0
- {payi-0.1.0a75.dist-info → payi-0.1.0a77.dist-info}/licenses/LICENSE +0 -0
payi/_base_client.py
CHANGED
|
@@ -960,6 +960,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
960
960
|
if self.custom_auth is not None:
|
|
961
961
|
kwargs["auth"] = self.custom_auth
|
|
962
962
|
|
|
963
|
+
if options.follow_redirects is not None:
|
|
964
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
|
965
|
+
|
|
963
966
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
|
964
967
|
|
|
965
968
|
response = None
|
|
@@ -1460,6 +1463,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1460
1463
|
if self.custom_auth is not None:
|
|
1461
1464
|
kwargs["auth"] = self.custom_auth
|
|
1462
1465
|
|
|
1466
|
+
if options.follow_redirects is not None:
|
|
1467
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
|
1468
|
+
|
|
1463
1469
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
|
1464
1470
|
|
|
1465
1471
|
response = None
|
payi/_models.py
CHANGED
|
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
|
|
|
737
737
|
idempotency_key: str
|
|
738
738
|
json_data: Body
|
|
739
739
|
extra_json: AnyMapping
|
|
740
|
+
follow_redirects: bool
|
|
740
741
|
|
|
741
742
|
|
|
742
743
|
@final
|
|
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
|
|
|
750
751
|
files: Union[HttpxRequestFiles, None] = None
|
|
751
752
|
idempotency_key: Union[str, None] = None
|
|
752
753
|
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
|
|
754
|
+
follow_redirects: Union[bool, None] = None
|
|
753
755
|
|
|
754
756
|
# It should be noted that we cannot use `json` here as that would override
|
|
755
757
|
# a BaseModel method in an incompatible fashion.
|
payi/_types.py
CHANGED
|
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
|
|
|
100
100
|
params: Query
|
|
101
101
|
extra_json: AnyMapping
|
|
102
102
|
idempotency_key: str
|
|
103
|
+
follow_redirects: bool
|
|
103
104
|
|
|
104
105
|
|
|
105
106
|
# Sentinel class used until PEP 0661 is accepted
|
|
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
|
|
|
215
216
|
|
|
216
217
|
class HttpxSendArgs(TypedDict, total=False):
|
|
217
218
|
auth: httpx.Auth
|
|
219
|
+
follow_redirects: bool
|
payi/_version.py
CHANGED
|
@@ -201,13 +201,13 @@ class _AnthropicProviderRequest(_ProviderRequest):
|
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
def has_image_and_get_texts(encoding: tiktoken.Encoding, content: Union[str, 'list[Any]']) -> 'tuple[bool, int]':
|
|
204
|
-
if isinstance(content,
|
|
205
|
-
return False, 0
|
|
206
|
-
elif isinstance(content, list): # type: ignore
|
|
204
|
+
if isinstance(content, list): # type: ignore
|
|
207
205
|
has_image = any(item.get("type") == "image" for item in content)
|
|
208
206
|
if has_image is False:
|
|
209
207
|
return has_image, 0
|
|
210
208
|
|
|
211
209
|
token_count = sum(len(encoding.encode(item.get("text", ""))) for item in content if item.get("type") == "text")
|
|
212
210
|
return has_image, token_count
|
|
211
|
+
|
|
212
|
+
return False, 0
|
|
213
213
|
|
payi/lib/OpenAIInstrumentor.py
CHANGED
|
@@ -293,15 +293,14 @@ class _OpenAiProviderRequest(_ProviderRequest):
|
|
|
293
293
|
|
|
294
294
|
@staticmethod
|
|
295
295
|
def has_image_and_get_texts(encoding: tiktoken.Encoding, content: Union[str, 'list[Any]'], image_type: str = "image_url", text_type:str = "text") -> 'tuple[bool, int]':
|
|
296
|
-
if isinstance(content,
|
|
297
|
-
return False, 0
|
|
298
|
-
elif isinstance(content, list): # type: ignore
|
|
296
|
+
if isinstance(content, list): # type: ignore
|
|
299
297
|
has_image = any(item.get("type") == image_type for item in content)
|
|
300
298
|
if has_image is False:
|
|
301
299
|
return has_image, 0
|
|
302
300
|
|
|
303
301
|
token_count = sum(len(encoding.encode(item.get("text", ""))) for item in content if item.get("type") == text_type)
|
|
304
302
|
return has_image, token_count
|
|
303
|
+
return False, 0
|
|
305
304
|
|
|
306
305
|
class _OpenAiEmbeddingsProviderRequest(_OpenAiProviderRequest):
|
|
307
306
|
def __init__(self, instrumentor: _PayiInstrumentor):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a77
|
|
4
4
|
Summary: The official Python library for the payi API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Pay-i/pay-i-python
|
|
@@ -188,12 +188,7 @@ client = Payi()
|
|
|
188
188
|
use_case_definition = client.use_cases.definitions.create(
|
|
189
189
|
description="x",
|
|
190
190
|
name="x",
|
|
191
|
-
limit_config={
|
|
192
|
-
"max": 0,
|
|
193
|
-
"limit_tags": ["tag1", "tag2"],
|
|
194
|
-
"limit_type": "block",
|
|
195
|
-
"threshold": 0,
|
|
196
|
-
},
|
|
191
|
+
limit_config={"max": 0},
|
|
197
192
|
)
|
|
198
193
|
print(use_case_definition.limit_config)
|
|
199
194
|
```
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
payi/__init__.py,sha256=4FRZqYbTvadWzWaSOtI2PmlFVjY4Z-jAi-T0DZAqR8c,2510
|
|
2
|
-
payi/_base_client.py,sha256=
|
|
2
|
+
payi/_base_client.py,sha256=b8EliKyjMXslDv4v36gTGE_tIg3h9wi8eQmwAJ2xaBg,65090
|
|
3
3
|
payi/_client.py,sha256=NoznzJFIQsFjEcPZWGJpHr94mOTMaQBuH-U_WGdjB10,17882
|
|
4
4
|
payi/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
|
5
5
|
payi/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
6
|
payi/_exceptions.py,sha256=ItygKNrNXIVY0H6LsGVZvFuAHB3Vtm_VZXmWzCnpHy0,3216
|
|
7
7
|
payi/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
|
|
8
|
-
payi/_models.py,sha256=
|
|
8
|
+
payi/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
|
|
9
9
|
payi/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
|
10
10
|
payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
|
|
11
11
|
payi/_response.py,sha256=rh9oJAvCKcPwQFm4iqH_iVrmK8bNx--YP_A2a4kN1OU,28776
|
|
12
12
|
payi/_streaming.py,sha256=Z_wIyo206T6Jqh2rolFg2VXZgX24PahLmpURp0-NssU,10092
|
|
13
|
-
payi/_types.py,sha256=
|
|
14
|
-
payi/_version.py,sha256=
|
|
13
|
+
payi/_types.py,sha256=7jE5MoQQFVoVxw5vVzvZ2Ao0kcjfNOGsBgyJfLBEnMo,6195
|
|
14
|
+
payi/_version.py,sha256=wGt5jNH0E97HeewXFLO6adzkx0gEYgIP8AihAT_HARo,165
|
|
15
15
|
payi/pagination.py,sha256=k2356QGPOUSjRF2vHpwLBdF6P-2vnQzFfRIJQAHGQ7A,1258
|
|
16
16
|
payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
payi/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
|
@@ -25,9 +25,9 @@ payi/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,156
|
|
|
25
25
|
payi/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
|
|
26
26
|
payi/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
|
|
27
27
|
payi/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
28
|
-
payi/lib/AnthropicInstrumentor.py,sha256=
|
|
28
|
+
payi/lib/AnthropicInstrumentor.py,sha256=pr4spNSyTM_VMtdWwoZPCV2o0ERGppoMhHo5rVHdmI8,7609
|
|
29
29
|
payi/lib/BedrockInstrumentor.py,sha256=4IfOwq_MSGlvlSMxAocVu0G-Ctoir6nSL9KtpGfga8I,13969
|
|
30
|
-
payi/lib/OpenAIInstrumentor.py,sha256=
|
|
30
|
+
payi/lib/OpenAIInstrumentor.py,sha256=xmm2jxuVtuBZUNgORwgCZqiAGE_e6E28IwMEy9i7-nc,17361
|
|
31
31
|
payi/lib/Stopwatch.py,sha256=7OJlxvr2Jyb6Zr1LYCYKczRB7rDVKkIR7gc4YoleNdE,764
|
|
32
32
|
payi/lib/VertexInstrumentor.py,sha256=R0s3aEW7haj4aC5t1lMeA9siOgYvxlKQShLJ-B5iiNM,11642
|
|
33
33
|
payi/lib/helpers.py,sha256=K1KAfWrpPT1UUGNxspLe1lHzQjP3XV5Pkh9IU4pKMok,4624
|
|
@@ -141,7 +141,7 @@ payi/types/use_cases/definitions/kpi_retrieve_response.py,sha256=uQXliSvS3k-yDYw
|
|
|
141
141
|
payi/types/use_cases/definitions/kpi_update_params.py,sha256=jbawdWAdMnsTWVH0qfQGb8W7_TXe3lq4zjSRu44d8p8,373
|
|
142
142
|
payi/types/use_cases/definitions/kpi_update_response.py,sha256=zLyEoT0S8d7XHsnXZYT8tM7yDw0Aze0Mk-_Z6QeMtc8,459
|
|
143
143
|
payi/types/use_cases/definitions/limit_config_create_params.py,sha256=pzQza_16N3z8cFNEKr6gPbFvuGFrwNuGxAYb--Kbo2M,449
|
|
144
|
-
payi-0.1.
|
|
145
|
-
payi-0.1.
|
|
146
|
-
payi-0.1.
|
|
147
|
-
payi-0.1.
|
|
144
|
+
payi-0.1.0a77.dist-info/METADATA,sha256=RXzXLw8b3r97mwWsST8Zt8u8bwyU331k36T83w2AaO8,15180
|
|
145
|
+
payi-0.1.0a77.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
146
|
+
payi-0.1.0a77.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
|
|
147
|
+
payi-0.1.0a77.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|