payi 0.1.0a74__py3-none-any.whl → 0.1.0a76__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/_version.py +1 -1
- payi/lib/AnthropicInstrumentor.py +3 -3
- payi/lib/OpenAIInstrumentor.py +2 -3
- {payi-0.1.0a74.dist-info → payi-0.1.0a76.dist-info}/METADATA +1 -1
- {payi-0.1.0a74.dist-info → payi-0.1.0a76.dist-info}/RECORD +7 -7
- {payi-0.1.0a74.dist-info → payi-0.1.0a76.dist-info}/WHEEL +0 -0
- {payi-0.1.0a74.dist-info → payi-0.1.0a76.dist-info}/licenses/LICENSE +0 -0
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):
|
|
@@ -11,7 +11,7 @@ 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
13
|
payi/_types.py,sha256=2mbMK86K3W1aMTW7sOGQ-VND6-A2IuXKm8p4sYFztBU,6141
|
|
14
|
-
payi/_version.py,sha256=
|
|
14
|
+
payi/_version.py,sha256=4YxluuKLNaSBCqHaBtEGWEaho-Cg6sy67mKYht04Ys0,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.0a76.dist-info/METADATA,sha256=eAuQd6niYj2-Tta60IPoh9WVIchQr7y_P7_BnAfMiig,15290
|
|
145
|
+
payi-0.1.0a76.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
146
|
+
payi-0.1.0a76.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
|
|
147
|
+
payi-0.1.0a76.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|