payi 0.1.0a40__py3-none-any.whl → 0.1.0a42__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/resources/ingest.py CHANGED
@@ -24,6 +24,8 @@ from .._response import (
24
24
  )
25
25
  from .._base_client import make_request_options
26
26
  from ..types.ingest_response import IngestResponse
27
+ from ..types.ingest_event_param import IngestEventParam
28
+ from ..types.bulk_ingest_response import BulkIngestResponse
27
29
  from ..types.pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
28
30
 
29
31
  __all__ = ["IngestResource", "AsyncIngestResource"]
@@ -49,6 +51,38 @@ class IngestResource(SyncAPIResource):
49
51
  """
50
52
  return IngestResourceWithStreamingResponse(self)
51
53
 
54
+ def bulk(
55
+ self,
56
+ *,
57
+ events: Iterable[IngestEventParam],
58
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
59
+ # The extra values given here take precedence over values defined on the client or passed to this method.
60
+ extra_headers: Headers | None = None,
61
+ extra_query: Query | None = None,
62
+ extra_body: Body | None = None,
63
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64
+ ) -> BulkIngestResponse:
65
+ """
66
+ Bulk Ingest
67
+
68
+ Args:
69
+ extra_headers: Send extra headers
70
+
71
+ extra_query: Add additional query parameters to the request
72
+
73
+ extra_body: Add additional JSON properties to the request
74
+
75
+ timeout: Override the client-level default timeout for this request, in seconds
76
+ """
77
+ return self._post(
78
+ "/api/v1/ingest/bulk",
79
+ body=maybe_transform(events, Iterable[IngestEventParam]),
80
+ options=make_request_options(
81
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
82
+ ),
83
+ cast_to=BulkIngestResponse,
84
+ )
85
+
52
86
  def units(
53
87
  self,
54
88
  *,
@@ -200,6 +234,38 @@ class AsyncIngestResource(AsyncAPIResource):
200
234
  """
201
235
  return AsyncIngestResourceWithStreamingResponse(self)
202
236
 
237
+ async def bulk(
238
+ self,
239
+ *,
240
+ events: Iterable[IngestEventParam],
241
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
242
+ # The extra values given here take precedence over values defined on the client or passed to this method.
243
+ extra_headers: Headers | None = None,
244
+ extra_query: Query | None = None,
245
+ extra_body: Body | None = None,
246
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
247
+ ) -> BulkIngestResponse:
248
+ """
249
+ Bulk Ingest
250
+
251
+ Args:
252
+ extra_headers: Send extra headers
253
+
254
+ extra_query: Add additional query parameters to the request
255
+
256
+ extra_body: Add additional JSON properties to the request
257
+
258
+ timeout: Override the client-level default timeout for this request, in seconds
259
+ """
260
+ return await self._post(
261
+ "/api/v1/ingest/bulk",
262
+ body=await async_maybe_transform(events, Iterable[IngestEventParam]),
263
+ options=make_request_options(
264
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
265
+ ),
266
+ cast_to=BulkIngestResponse,
267
+ )
268
+
203
269
  async def units(
204
270
  self,
205
271
  *,
@@ -334,6 +400,9 @@ class IngestResourceWithRawResponse:
334
400
  def __init__(self, ingest: IngestResource) -> None:
335
401
  self._ingest = ingest
336
402
 
403
+ self.bulk = to_raw_response_wrapper(
404
+ ingest.bulk,
405
+ )
337
406
  self.units = to_raw_response_wrapper(
338
407
  ingest.units,
339
408
  )
@@ -343,6 +412,9 @@ class AsyncIngestResourceWithRawResponse:
343
412
  def __init__(self, ingest: AsyncIngestResource) -> None:
344
413
  self._ingest = ingest
345
414
 
415
+ self.bulk = async_to_raw_response_wrapper(
416
+ ingest.bulk,
417
+ )
346
418
  self.units = async_to_raw_response_wrapper(
347
419
  ingest.units,
348
420
  )
@@ -352,6 +424,9 @@ class IngestResourceWithStreamingResponse:
352
424
  def __init__(self, ingest: IngestResource) -> None:
353
425
  self._ingest = ingest
354
426
 
427
+ self.bulk = to_streamed_response_wrapper(
428
+ ingest.bulk,
429
+ )
355
430
  self.units = to_streamed_response_wrapper(
356
431
  ingest.units,
357
432
  )
@@ -361,6 +436,9 @@ class AsyncIngestResourceWithStreamingResponse:
361
436
  def __init__(self, ingest: AsyncIngestResource) -> None:
362
437
  self._ingest = ingest
363
438
 
439
+ self.bulk = async_to_streamed_response_wrapper(
440
+ ingest.bulk,
441
+ )
364
442
  self.units = async_to_streamed_response_wrapper(
365
443
  ingest.units,
366
444
  )
payi/types/__init__.py CHANGED
@@ -15,10 +15,13 @@ from .default_response import DefaultResponse as DefaultResponse
15
15
  from .paged_limit_list import PagedLimitList as PagedLimitList
16
16
  from .category_response import CategoryResponse as CategoryResponse
17
17
  from .limit_list_params import LimitListParams as LimitListParams
18
+ from .ingest_bulk_params import IngestBulkParams as IngestBulkParams
19
+ from .ingest_event_param import IngestEventParam as IngestEventParam
18
20
  from .limit_reset_params import LimitResetParams as LimitResetParams
19
21
  from .ingest_units_params import IngestUnitsParams as IngestUnitsParams
20
22
  from .limit_create_params import LimitCreateParams as LimitCreateParams
21
23
  from .limit_update_params import LimitUpdateParams as LimitUpdateParams
24
+ from .bulk_ingest_response import BulkIngestResponse as BulkIngestResponse
22
25
  from .category_list_response import CategoryListResponse as CategoryListResponse
23
26
  from .limit_history_response import LimitHistoryResponse as LimitHistoryResponse
24
27
  from .category_delete_response import CategoryDeleteResponse as CategoryDeleteResponse
@@ -0,0 +1,51 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["BulkIngestResponse", "Error", "ErrorXproxyResult", "ErrorXproxyResultXproxyError"]
11
+
12
+
13
+ class ErrorXproxyResultXproxyError(BaseModel):
14
+ code: Optional[str] = None
15
+
16
+ message: Optional[str] = None
17
+
18
+
19
+ class ErrorXproxyResult(BaseModel):
20
+ message: str
21
+
22
+ status_code: int = FieldInfo(alias="statusCode")
23
+
24
+ xproxy_error: Optional[ErrorXproxyResultXproxyError] = None
25
+
26
+
27
+ class Error(BaseModel):
28
+ item_index: Optional[int] = None
29
+
30
+ xproxy_result: Optional[ErrorXproxyResult] = None
31
+ """
32
+ Represents an generic error that occurred as a result of processing a request.
33
+ APIM returns an (not customizable) error response body of { "statusCode",
34
+ "message" } and this class matches this schema. Derived classes may add
35
+ additional required fields if these classes are specified as produced as a
36
+ return type specific endpoints.
37
+ """
38
+
39
+
40
+ class BulkIngestResponse(BaseModel):
41
+ ingest_count: int
42
+
43
+ ingest_timestamp: datetime
44
+
45
+ request_id: str
46
+
47
+ error_count: Optional[int] = None
48
+
49
+ errors: Optional[List[Error]] = None
50
+
51
+ total_count: Optional[int] = None
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Iterable
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ from .ingest_event_param import IngestEventParam
9
+
10
+ __all__ = ["IngestBulkParams"]
11
+
12
+
13
+ class IngestBulkParams(TypedDict, total=False):
14
+ events: Required[Iterable[IngestEventParam]]
@@ -0,0 +1,60 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union, Iterable, Optional
6
+ from datetime import datetime
7
+ from typing_extensions import Required, Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+ from .pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
11
+
12
+ __all__ = ["IngestEventParam", "Units"]
13
+
14
+
15
+ class Units(TypedDict, total=False):
16
+ input: int
17
+
18
+ output: int
19
+
20
+
21
+ class IngestEventParam(TypedDict, total=False):
22
+ category: Required[str]
23
+
24
+ resource: Required[str]
25
+
26
+ units: Required[Dict[str, Units]]
27
+
28
+ csat_rating: Optional[int]
29
+
30
+ end_to_end_latency_ms: Optional[int]
31
+
32
+ event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
33
+
34
+ experience_id: Optional[str]
35
+
36
+ experience_name: Optional[str]
37
+
38
+ experience_properties: Optional[Dict[str, str]]
39
+
40
+ http_status_code: Optional[int]
41
+
42
+ limit_ids: Optional[List[str]]
43
+
44
+ properties: Optional[Dict[str, str]]
45
+
46
+ provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
47
+
48
+ provider_request_json: Optional[str]
49
+
50
+ provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
51
+
52
+ provider_response_json: Union[str, List[str], None]
53
+
54
+ provider_uri: Optional[str]
55
+
56
+ request_tags: Optional[List[str]]
57
+
58
+ time_to_first_token_ms: Optional[int]
59
+
60
+ user_id: Optional[str]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: payi
3
- Version: 0.1.0a40
3
+ Version: 0.1.0a42
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
@@ -2,16 +2,16 @@ payi/__init__.py,sha256=_eeZx9fx2Wp81adXh7qrpkmXCso7TiRSvIlLkQ0sQhY,2399
2
2
  payi/_base_client.py,sha256=CiHJoJuzSweHB7oidXWIlWdU0vrLCpPc9hMlj_S-anE,68128
3
3
  payi/_client.py,sha256=aUtMEmV02nTs3_pYYAR-OchCkofUHeXhhRs43tyDHLE,18760
4
4
  payi/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
- payi/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
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=B6f-C-F-PbDp3jRKCLksaAS9osC2g1xs7DpoZV1dlUE,28659
8
+ payi/_models.py,sha256=uZvPAaaeDwCYwvB-yq7nxZnZ70I2Na_KjSAqaPQWfh0,28659
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=CfrNS_3wbL8o9dRyRVfZQ5E1GUlA4CUIUEK8olmfGqE,28777
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=70Q3C2mH_Y5XHCDAYiBgNkVy3fyBDWf8eUqRwndh9Zc,165
14
+ payi/_version.py,sha256=syoJ9yR_LixpOg_5N4PL2hK4IdmTB8nddKZyaqhnpbM,165
15
15
  payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  payi/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  payi/_utils/_logs.py,sha256=fmnf5D9TOgkgZKfgYmSa3PiUc3SZgkchn6CzJUeo0SQ,768
@@ -23,15 +23,16 @@ payi/_utils/_transform.py,sha256=Dkkyr7OveGmOolepcvXmVJWE3kqim4b0nM0h7yWbgeY,134
23
23
  payi/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
24
24
  payi/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
25
  payi/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
- payi/lib/AnthropicInstrumentor.py,sha256=XMLr8BIrBo7U3VPBnhyp9Wj-icZmu0MGVvvyDPmlF4c,4549
27
- payi/lib/Instruments.py,sha256=cyL2jxjpRluP9rN8Vn1nmVXq2NNLdZuFIsHMQWWqat4,115
28
- payi/lib/OpenAIInstrumentor.py,sha256=G3H8s1bNnq-LECAHjCkQDTG59pwnLPXKQKlQbhqgs4k,3998
29
- payi/lib/Stopwatch.py,sha256=vFyGVRvkppamP7W0IuZyypKLMIaqjhB7fcRG0dNyfnQ,757
26
+ payi/lib/AnthropicInstrumentor.py,sha256=1dJTFs5WfPxbIjWcYV2tP3kiYc4g3WyyyR4XWQ-WI_g,5300
27
+ payi/lib/BedrockInstrumentor.py,sha256=B5deT8TcUvOsRdIewbbHtsxTS7_oHJ05ZUIdFziWf8E,10082
28
+ payi/lib/Instruments.py,sha256=bapmVS9jbHtFknXCKDzsFFWvf5XLtzEpdlvI7iEWY-o,147
29
+ payi/lib/OpenAIInstrumentor.py,sha256=i1824A0k1Ne0CmpRH8aqMpNBV72NitdZvjonWCRoXXE,4796
30
+ payi/lib/Stopwatch.py,sha256=7OJlxvr2Jyb6Zr1LYCYKczRB7rDVKkIR7gc4YoleNdE,764
30
31
  payi/lib/helpers.py,sha256=ZgkY8UE2YRc7ok2Pmxg_T9UMqKI8D8542JY3CP8RZCM,1597
31
- payi/lib/instrument.py,sha256=rLSwXRQZkTmMpWGpTzgZ42_4BOxJjGrTR3hwpF8XHro,20279
32
+ payi/lib/instrument.py,sha256=Lil1j8Yb5naUpYXd5WQS-LLcE4xqjJzLfomOwfLqUow,32264
32
33
  payi/resources/__init__.py,sha256=isHGXSl9kOrZDduKrX3UenTwrdTpuKJVBjw6NYSBV20,3592
33
34
  payi/resources/billing_models.py,sha256=5w3RfGXtGlyq5vbTw6hQrx1UlzRBtlq8ArcFlf5e3TY,20152
34
- payi/resources/ingest.py,sha256=SvQspsYled4_ErOZKzVtazBIk0tUC1e34Lw8qw4SNEM,15484
35
+ payi/resources/ingest.py,sha256=xdVD0fHGkVpsgqxNTkly_X7UdLyWLNb9_uU8tzWB5Jc,18430
35
36
  payi/resources/price_modifiers.py,sha256=t-k2F_zf2FhoxiqDHAPBPvhSgTjewlJqh50y58FNMuw,13475
36
37
  payi/resources/categories/__init__.py,sha256=w5gMiPdBSzJA_qfoVtFBElaoe8wGf_O63R7R1Spr6Gk,1093
37
38
  payi/resources/categories/categories.py,sha256=FohmajDcadMXzhG3Z1HKGkbSImO7rhzQ0olZXHz8z48,16074
@@ -49,11 +50,12 @@ payi/resources/requests/__init__.py,sha256=k7ipgDb5QXAv7WYhgQq0-6Zn9INJikMzRGexu
49
50
  payi/resources/requests/properties.py,sha256=ZsUeTMKQB4PNXn-jeoRwG-fqwpXzkRQyrFB8GmaNiQg,6466
50
51
  payi/resources/requests/requests.py,sha256=uxfdUe_mNmG5kzHTa4YcS5m2wwIc5h__YSx54LfiLWQ,4840
51
52
  payi/resources/requests/result.py,sha256=dEIwYEi_p36t_hErr_V1E2hmBLLgopcLnIReAWT8ygk,6161
52
- payi/types/__init__.py,sha256=a_uGQ-yPLCCjeyJRE4xAzI_0MjoKkuIoRMQXuSEL8VI,2641
53
+ payi/types/__init__.py,sha256=WZhGgB9kGD48NljvFFu3TeLhA_PKqDdMUsnxvSKxhc4,2854
53
54
  payi/types/billing_model.py,sha256=zwpKldc0WvS3iGKtDb9KvfxCd3lkv8F4TwFy3ciGMXg,639
54
55
  payi/types/billing_model_create_params.py,sha256=iVvmCcw0VxXGI_0YolknD3gmDH2lXVydU1dg2IY4dC4,547
55
56
  payi/types/billing_model_list_response.py,sha256=hOFjJPQAKiWEArZeZwd8e1lDi5e41zbN6NvV_1rzJeM,290
56
57
  payi/types/billing_model_update_params.py,sha256=NHNxDUZyYeYEroSyUx8eVh-kyY2YUo3jfRI-eMx2QAY,547
58
+ payi/types/bulk_ingest_response.py,sha256=78J3vlL7muZx9Z20H--UkvM8P19g0cDL9SZoHy7XM68,1330
57
59
  payi/types/category_delete_resource_response.py,sha256=PLz4wZA1XMpS9SUYB_j4hEw5EoZ0VVE9Ll-MQ26SAfc,339
58
60
  payi/types/category_delete_response.py,sha256=exq8rNDGoq2-YN528V8osdcmuptJ-k63rmCvPMm6hLA,323
59
61
  payi/types/category_list_resources_response.py,sha256=n0DxY7N3Iftwfl0lUEx5v55V0kxbOX0EgjXlEfJtYRQ,337
@@ -64,6 +66,8 @@ payi/types/cost_data.py,sha256=1i842P25SBy2sB3OWGj9LO_mMKtzmyUPBrqY_mSw01o,488
64
66
  payi/types/cost_details.py,sha256=w9p79opEG3kcsjkRRP7niaMcUswdfB4Y7HCkVTcQ1zQ,307
65
67
  payi/types/default_response.py,sha256=o617LpRsCIZHCZxAc5nVI2JQ3HPGZo4gCDvSDkxkIJ8,270
66
68
  payi/types/experience_instance_response.py,sha256=N07MH6hjs1ISHLVpR2FG-u4awsZ_GGi97UNMXAWV1yA,296
69
+ payi/types/ingest_bulk_params.py,sha256=d76YwiXaNeltLS3w86ZxLzTKGa7ymGLJDSelaMQGf8Y,382
70
+ payi/types/ingest_event_param.py,sha256=wA9YuiQceNL3veHO_rVuKZg9o-EB1WLoz0aaF6Wcm-k,1498
67
71
  payi/types/ingest_response.py,sha256=KZfsgUhC942QkkjDFMqjJwCRoO2vkXv-Sx3X_xjijfg,1449
68
72
  payi/types/ingest_units_params.py,sha256=0s_j6268ZmeXDw9lQ_HKLldA_EvNyPcOxM6kFxLwxkA,1749
69
73
  payi/types/limit_create_params.py,sha256=Av8oMCxlKH7VB2MtYN5-25rAjqDDTPHjsXIQ2xubmck,549
@@ -109,7 +113,7 @@ payi/types/requests/request_result.py,sha256=phYQiqhwNaR9igP-Fhs34Y-__dlT7L4wq-r
109
113
  payi/types/shared/__init__.py,sha256=-xz5dxK5LBjLnsi2LpLq5btaGDFp-mSjJ0y2qKy0Yus,264
110
114
  payi/types/shared/evaluation_response.py,sha256=ejEToMA57PUu1SldEtJ5z9r4fAO3U0tvdjbsyIoVX1s,214
111
115
  payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py,sha256=XmIzJXy4zAi-mfrDvEXiYjO3qF1EvugGUl-Gijj4TA4,268
112
- payi-0.1.0a40.dist-info/METADATA,sha256=qTLzlfTKFZ8cEWce30AegO7WzqqjejiYc6kJi3SqYN8,12625
113
- payi-0.1.0a40.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
114
- payi-0.1.0a40.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
115
- payi-0.1.0a40.dist-info/RECORD,,
116
+ payi-0.1.0a42.dist-info/METADATA,sha256=1es3OC78vuBpWdllOFArADvhJy1isg054tkTr2E0PXM,12625
117
+ payi-0.1.0a42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
118
+ payi-0.1.0a42.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
119
+ payi-0.1.0a42.dist-info/RECORD,,