payi 0.1.0a35__py3-none-any.whl → 0.1.0a37__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/_models.py +4 -4
- payi/_response.py +9 -3
- payi/_version.py +1 -1
- payi/lib/AnthropicInstrumentor.py +97 -0
- payi/lib/Instruments.py +7 -0
- payi/lib/OpenAIInstrumentor.py +89 -0
- payi/lib/Stopwatch.py +27 -0
- payi/lib/helpers.py +12 -10
- payi/lib/instrument.py +522 -0
- payi/resources/billing_models.py +2 -2
- payi/resources/categories/categories.py +2 -2
- payi/resources/categories/resources.py +2 -2
- payi/resources/experiences/experiences.py +2 -2
- payi/resources/experiences/properties.py +2 -2
- payi/resources/experiences/types.py +2 -2
- payi/resources/ingest.py +36 -37
- payi/resources/limits/limits.py +2 -2
- payi/resources/limits/tags.py +2 -2
- payi/resources/price_modifiers.py +2 -2
- payi/resources/requests/properties.py +2 -2
- payi/resources/requests/requests.py +2 -2
- payi/types/__init__.py +3 -0
- payi/types/ingest_bulk_params.py +1 -1
- payi/types/ingest_event_param.py +4 -15
- payi/types/ingest_units_params.py +5 -15
- payi/types/pay_i_common_models_api_router_header_info_param.py +14 -0
- payi/types/shared/evaluation_response.py +0 -1
- {payi-0.1.0a35.dist-info → payi-0.1.0a37.dist-info}/METADATA +9 -8
- {payi-0.1.0a35.dist-info → payi-0.1.0a37.dist-info}/RECORD +31 -25
- {payi-0.1.0a35.dist-info → payi-0.1.0a37.dist-info}/WHEEL +0 -0
- {payi-0.1.0a35.dist-info → payi-0.1.0a37.dist-info}/licenses/LICENSE +0 -0
payi/resources/ingest.py
CHANGED
|
@@ -26,6 +26,7 @@ from .._base_client import make_request_options
|
|
|
26
26
|
from ..types.ingest_response import IngestResponse
|
|
27
27
|
from ..types.ingest_event_param import IngestEventParam
|
|
28
28
|
from ..types.bulk_ingest_response import BulkIngestResponse
|
|
29
|
+
from ..types.pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
|
|
29
30
|
|
|
30
31
|
__all__ = ["IngestResource", "AsyncIngestResource"]
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@ class IngestResource(SyncAPIResource):
|
|
|
34
35
|
@cached_property
|
|
35
36
|
def with_raw_response(self) -> IngestResourceWithRawResponse:
|
|
36
37
|
"""
|
|
37
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
38
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
39
|
the raw response object instead of the parsed content.
|
|
39
40
|
|
|
40
41
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -80,7 +81,7 @@ class IngestResource(SyncAPIResource):
|
|
|
80
81
|
"/api/v1/ingest/bulk",
|
|
81
82
|
body=maybe_transform(events, Iterable[IngestEventParam]),
|
|
82
83
|
options=make_request_options(
|
|
83
|
-
|
|
84
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
84
85
|
),
|
|
85
86
|
cast_to=BulkIngestResponse,
|
|
86
87
|
)
|
|
@@ -96,10 +97,9 @@ class IngestResource(SyncAPIResource):
|
|
|
96
97
|
experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
97
98
|
http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
|
|
98
99
|
properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
99
|
-
provider_request_headers: Optional[Iterable[
|
|
100
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
|
|
100
101
|
provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
|
|
101
|
-
provider_response_headers: Optional[Iterable[
|
|
102
|
-
| NotGiven = NOT_GIVEN,
|
|
102
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
|
|
103
103
|
provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
|
|
104
104
|
provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
|
|
105
105
|
time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -122,29 +122,29 @@ class IngestResource(SyncAPIResource):
|
|
|
122
122
|
category (str): The name of the category
|
|
123
123
|
|
|
124
124
|
resource (str): The name of the resource
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
input (int): The number of input units
|
|
127
127
|
|
|
128
128
|
output (int): The number of output units
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
event_timestamp: (str, datetime, None): The timestamp of the event. Defaults to None.
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
limit_ids (list[str], optional): The limit IDs to associate with the request. Defaults to None.
|
|
133
|
-
|
|
133
|
+
|
|
134
134
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
135
135
|
|
|
136
136
|
experience_name (str, optional): The experience name
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
experience_id (str, optional): The experience instance id
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
user_id (str, optional): The user id
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
149
149
|
"""
|
|
150
150
|
valid_ids_str: str | NotGiven = NOT_GIVEN
|
|
@@ -152,7 +152,7 @@ class IngestResource(SyncAPIResource):
|
|
|
152
152
|
|
|
153
153
|
if limit_ids is None or isinstance(limit_ids, NotGiven):
|
|
154
154
|
valid_ids_str = NOT_GIVEN
|
|
155
|
-
elif not isinstance(limit_ids, list):
|
|
155
|
+
elif not isinstance(limit_ids, list): # type: ignore
|
|
156
156
|
raise TypeError("limit_ids must be a list")
|
|
157
157
|
else:
|
|
158
158
|
# Proceed with the list comprehension if limit_ids is not NotGiven
|
|
@@ -161,7 +161,7 @@ class IngestResource(SyncAPIResource):
|
|
|
161
161
|
|
|
162
162
|
if request_tags is None or isinstance(request_tags, NotGiven):
|
|
163
163
|
valid_tags_str = NOT_GIVEN
|
|
164
|
-
elif not isinstance(request_tags, list):
|
|
164
|
+
elif not isinstance(request_tags, list): # type: ignore
|
|
165
165
|
raise TypeError("request_tags must be a list")
|
|
166
166
|
else:
|
|
167
167
|
# Proceed with the list comprehension if request_tags is not NotGiven
|
|
@@ -173,7 +173,7 @@ class IngestResource(SyncAPIResource):
|
|
|
173
173
|
|
|
174
174
|
if experience_id is None or isinstance(experience_id, NotGiven):
|
|
175
175
|
experience_id = NOT_GIVEN
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
if user_id is None or isinstance(user_id, NotGiven):
|
|
178
178
|
user_id = NOT_GIVEN
|
|
179
179
|
|
|
@@ -221,7 +221,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
221
221
|
@cached_property
|
|
222
222
|
def with_raw_response(self) -> AsyncIngestResourceWithRawResponse:
|
|
223
223
|
"""
|
|
224
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
224
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
225
225
|
the raw response object instead of the parsed content.
|
|
226
226
|
|
|
227
227
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -282,10 +282,9 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
282
282
|
experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
283
283
|
http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
|
|
284
284
|
properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
285
|
-
provider_request_headers: Optional[Iterable[
|
|
285
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
|
|
286
286
|
provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
|
|
287
|
-
provider_response_headers: Optional[Iterable[
|
|
288
|
-
| NotGiven = NOT_GIVEN,
|
|
287
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
|
|
289
288
|
provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
|
|
290
289
|
provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
|
|
291
290
|
time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -307,29 +306,29 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
307
306
|
category (str): The name of the category
|
|
308
307
|
|
|
309
308
|
resource (str): The name of the resource
|
|
310
|
-
|
|
309
|
+
|
|
311
310
|
input (int): The number of input units
|
|
312
|
-
|
|
311
|
+
|
|
313
312
|
output (int): The number of output units
|
|
314
|
-
|
|
313
|
+
|
|
315
314
|
event_timestamp: (datetime, None): The timestamp of the event. Defaults to None.
|
|
316
|
-
|
|
315
|
+
|
|
317
316
|
limit_ids (list[str], optional): The limit IDs to associate with the request. Defaults to None.
|
|
318
|
-
|
|
317
|
+
|
|
319
318
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
320
|
-
|
|
319
|
+
|
|
321
320
|
experience_name (str, optional): The experience name
|
|
322
|
-
|
|
321
|
+
|
|
323
322
|
experience_id (str, optional): The experience instance id
|
|
324
|
-
|
|
323
|
+
|
|
325
324
|
user_id (str, optional): The user id
|
|
326
|
-
|
|
325
|
+
|
|
327
326
|
extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
|
|
328
|
-
|
|
327
|
+
|
|
329
328
|
extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
|
|
330
|
-
|
|
329
|
+
|
|
331
330
|
extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
|
|
332
|
-
|
|
331
|
+
|
|
333
332
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
334
333
|
"""
|
|
335
334
|
valid_ids_str: str | NotGiven = NOT_GIVEN
|
|
@@ -337,7 +336,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
337
336
|
|
|
338
337
|
if limit_ids is None or isinstance(limit_ids, NotGiven):
|
|
339
338
|
valid_ids_str = NOT_GIVEN
|
|
340
|
-
elif not isinstance(limit_ids, list):
|
|
339
|
+
elif not isinstance(limit_ids, list): # type: ignore
|
|
341
340
|
raise TypeError("limit_ids must be a list")
|
|
342
341
|
else:
|
|
343
342
|
# Proceed with the list comprehension if limit_ids is not NotGiven
|
|
@@ -346,7 +345,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
346
345
|
|
|
347
346
|
if request_tags is None or isinstance(request_tags, NotGiven):
|
|
348
347
|
valid_tags_str = NOT_GIVEN
|
|
349
|
-
elif not isinstance(request_tags, list):
|
|
348
|
+
elif not isinstance(request_tags, list): # type: ignore
|
|
350
349
|
raise TypeError("request_tags must be a list")
|
|
351
350
|
else:
|
|
352
351
|
# Proceed with the list comprehension if request_tags is not NotGiven
|
|
@@ -358,7 +357,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
358
357
|
|
|
359
358
|
if experience_id is None or isinstance(experience_id, NotGiven):
|
|
360
359
|
experience_id = NOT_GIVEN
|
|
361
|
-
|
|
360
|
+
|
|
362
361
|
if user_id is None or isinstance(user_id, NotGiven):
|
|
363
362
|
user_id = NOT_GIVEN
|
|
364
363
|
|
payi/resources/limits/limits.py
CHANGED
|
@@ -47,7 +47,7 @@ class LimitsResource(SyncAPIResource):
|
|
|
47
47
|
@cached_property
|
|
48
48
|
def with_raw_response(self) -> LimitsResourceWithRawResponse:
|
|
49
49
|
"""
|
|
50
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
50
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
51
51
|
the raw response object instead of the parsed content.
|
|
52
52
|
|
|
53
53
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -321,7 +321,7 @@ class AsyncLimitsResource(AsyncAPIResource):
|
|
|
321
321
|
@cached_property
|
|
322
322
|
def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse:
|
|
323
323
|
"""
|
|
324
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
324
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
325
325
|
the raw response object instead of the parsed content.
|
|
326
326
|
|
|
327
327
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
payi/resources/limits/tags.py
CHANGED
|
@@ -34,7 +34,7 @@ class TagsResource(SyncAPIResource):
|
|
|
34
34
|
@cached_property
|
|
35
35
|
def with_raw_response(self) -> TagsResourceWithRawResponse:
|
|
36
36
|
"""
|
|
37
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
38
|
the raw response object instead of the parsed content.
|
|
39
39
|
|
|
40
40
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -226,7 +226,7 @@ class AsyncTagsResource(AsyncAPIResource):
|
|
|
226
226
|
@cached_property
|
|
227
227
|
def with_raw_response(self) -> AsyncTagsResourceWithRawResponse:
|
|
228
228
|
"""
|
|
229
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
229
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
230
230
|
the raw response object instead of the parsed content.
|
|
231
231
|
|
|
232
232
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -29,7 +29,7 @@ class PriceModifiersResource(SyncAPIResource):
|
|
|
29
29
|
@cached_property
|
|
30
30
|
def with_raw_response(self) -> PriceModifiersResourceWithRawResponse:
|
|
31
31
|
"""
|
|
32
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
33
33
|
the raw response object instead of the parsed content.
|
|
34
34
|
|
|
35
35
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -163,7 +163,7 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
|
|
|
163
163
|
@cached_property
|
|
164
164
|
def with_raw_response(self) -> AsyncPriceModifiersResourceWithRawResponse:
|
|
165
165
|
"""
|
|
166
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
166
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
167
167
|
the raw response object instead of the parsed content.
|
|
168
168
|
|
|
169
169
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -30,7 +30,7 @@ class PropertiesResource(SyncAPIResource):
|
|
|
30
30
|
@cached_property
|
|
31
31
|
def with_raw_response(self) -> PropertiesResourceWithRawResponse:
|
|
32
32
|
"""
|
|
33
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
34
|
the raw response object instead of the parsed content.
|
|
35
35
|
|
|
36
36
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -86,7 +86,7 @@ class AsyncPropertiesResource(AsyncAPIResource):
|
|
|
86
86
|
@cached_property
|
|
87
87
|
def with_raw_response(self) -> AsyncPropertiesResourceWithRawResponse:
|
|
88
88
|
"""
|
|
89
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
89
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
90
90
|
the raw response object instead of the parsed content.
|
|
91
91
|
|
|
92
92
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -24,7 +24,7 @@ class RequestsResource(SyncAPIResource):
|
|
|
24
24
|
@cached_property
|
|
25
25
|
def with_raw_response(self) -> RequestsResourceWithRawResponse:
|
|
26
26
|
"""
|
|
27
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
27
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
28
28
|
the raw response object instead of the parsed content.
|
|
29
29
|
|
|
30
30
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -49,7 +49,7 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
49
49
|
@cached_property
|
|
50
50
|
def with_raw_response(self) -> AsyncRequestsResourceWithRawResponse:
|
|
51
51
|
"""
|
|
52
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
52
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
53
53
|
the raw response object instead of the parsed content.
|
|
54
54
|
|
|
55
55
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
payi/types/__init__.py
CHANGED
|
@@ -35,3 +35,6 @@ from .price_modifier_update_params import PriceModifierUpdateParams as PriceModi
|
|
|
35
35
|
from .category_list_resources_response import CategoryListResourcesResponse as CategoryListResourcesResponse
|
|
36
36
|
from .price_modifier_retrieve_response import PriceModifierRetrieveResponse as PriceModifierRetrieveResponse
|
|
37
37
|
from .category_delete_resource_response import CategoryDeleteResourceResponse as CategoryDeleteResourceResponse
|
|
38
|
+
from .pay_i_common_models_api_router_header_info_param import (
|
|
39
|
+
PayICommonModelsAPIRouterHeaderInfoParam as PayICommonModelsAPIRouterHeaderInfoParam,
|
|
40
|
+
)
|
payi/types/ingest_bulk_params.py
CHANGED
payi/types/ingest_event_param.py
CHANGED
|
@@ -7,8 +7,9 @@ from datetime import datetime
|
|
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
|
9
9
|
from .._utils import PropertyInfo
|
|
10
|
+
from .pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
|
|
10
11
|
|
|
11
|
-
__all__ = ["IngestEventParam", "Units"
|
|
12
|
+
__all__ = ["IngestEventParam", "Units"]
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class Units(TypedDict, total=False):
|
|
@@ -17,18 +18,6 @@ class Units(TypedDict, total=False):
|
|
|
17
18
|
output: int
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
class ProviderRequestHeader(TypedDict, total=False):
|
|
21
|
-
name: Required[str]
|
|
22
|
-
|
|
23
|
-
value: Optional[str]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class ProviderResponseHeader(TypedDict, total=False):
|
|
27
|
-
name: Required[str]
|
|
28
|
-
|
|
29
|
-
value: Optional[str]
|
|
30
|
-
|
|
31
|
-
|
|
32
21
|
class IngestEventParam(TypedDict, total=False):
|
|
33
22
|
category: Required[str]
|
|
34
23
|
|
|
@@ -54,11 +43,11 @@ class IngestEventParam(TypedDict, total=False):
|
|
|
54
43
|
|
|
55
44
|
properties: Optional[Dict[str, str]]
|
|
56
45
|
|
|
57
|
-
provider_request_headers: Optional[Iterable[
|
|
46
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
|
|
58
47
|
|
|
59
48
|
provider_request_json: Optional[str]
|
|
60
49
|
|
|
61
|
-
provider_response_headers: Optional[Iterable[
|
|
50
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
|
|
62
51
|
|
|
63
52
|
provider_response_json: Union[str, List[str], None]
|
|
64
53
|
|
|
@@ -7,8 +7,9 @@ from datetime import datetime
|
|
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
|
9
9
|
from .._utils import PropertyInfo
|
|
10
|
+
from .pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
|
|
10
11
|
|
|
11
|
-
__all__ = ["IngestUnitsParams", "Units"
|
|
12
|
+
__all__ = ["IngestUnitsParams", "Units"]
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class IngestUnitsParams(TypedDict, total=False):
|
|
@@ -28,11 +29,11 @@ class IngestUnitsParams(TypedDict, total=False):
|
|
|
28
29
|
|
|
29
30
|
properties: Optional[Dict[str, str]]
|
|
30
31
|
|
|
31
|
-
provider_request_headers: Optional[Iterable[
|
|
32
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
|
|
32
33
|
|
|
33
34
|
provider_request_json: Optional[str]
|
|
34
35
|
|
|
35
|
-
provider_response_headers: Optional[Iterable[
|
|
36
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]]
|
|
36
37
|
|
|
37
38
|
provider_response_json: Union[str, List[str], None]
|
|
38
39
|
|
|
@@ -50,19 +51,8 @@ class IngestUnitsParams(TypedDict, total=False):
|
|
|
50
51
|
|
|
51
52
|
user_id: Annotated[Union[str, None], PropertyInfo(alias="xProxy-User-ID")]
|
|
52
53
|
|
|
54
|
+
|
|
53
55
|
class Units(TypedDict, total=False):
|
|
54
56
|
input: int
|
|
55
57
|
|
|
56
58
|
output: int
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class ProviderRequestHeader(TypedDict, total=False):
|
|
60
|
-
name: Required[str]
|
|
61
|
-
|
|
62
|
-
value: Optional[str]
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class ProviderResponseHeader(TypedDict, total=False):
|
|
66
|
-
name: Required[str]
|
|
67
|
-
|
|
68
|
-
value: Optional[str]
|
|
@@ -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 Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["PayICommonModelsAPIRouterHeaderInfoParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PayICommonModelsAPIRouterHeaderInfoParam(TypedDict, total=False):
|
|
12
|
+
name: Required[str]
|
|
13
|
+
|
|
14
|
+
value: Optional[str]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: payi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a37
|
|
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
|
|
@@ -28,6 +28,7 @@ Requires-Dist: httpx<1,>=0.23.0
|
|
|
28
28
|
Requires-Dist: pydantic<3,>=1.9.0
|
|
29
29
|
Requires-Dist: sniffio
|
|
30
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
|
+
Requires-Dist: wrapt>=1.17.2
|
|
31
32
|
Description-Content-Type: text/markdown
|
|
32
33
|
|
|
33
34
|
# Payi Python API library
|
|
@@ -65,7 +66,7 @@ client = Payi(
|
|
|
65
66
|
|
|
66
67
|
limit_response = client.limits.create(
|
|
67
68
|
limit_name="x",
|
|
68
|
-
max=
|
|
69
|
+
max=1,
|
|
69
70
|
)
|
|
70
71
|
print(limit_response.request_id)
|
|
71
72
|
```
|
|
@@ -92,7 +93,7 @@ client = AsyncPayi(
|
|
|
92
93
|
async def main() -> None:
|
|
93
94
|
limit_response = await client.limits.create(
|
|
94
95
|
limit_name="x",
|
|
95
|
-
max=
|
|
96
|
+
max=1,
|
|
96
97
|
)
|
|
97
98
|
print(limit_response.request_id)
|
|
98
99
|
|
|
@@ -129,7 +130,7 @@ client = Payi()
|
|
|
129
130
|
try:
|
|
130
131
|
client.limits.create(
|
|
131
132
|
limit_name="x",
|
|
132
|
-
max=
|
|
133
|
+
max=1,
|
|
133
134
|
)
|
|
134
135
|
except payi.APIConnectionError as e:
|
|
135
136
|
print("The server could not be reached")
|
|
@@ -175,7 +176,7 @@ client = Payi(
|
|
|
175
176
|
# Or, configure per-request:
|
|
176
177
|
client.with_options(max_retries=5).limits.create(
|
|
177
178
|
limit_name="x",
|
|
178
|
-
max=
|
|
179
|
+
max=1,
|
|
179
180
|
)
|
|
180
181
|
```
|
|
181
182
|
|
|
@@ -201,7 +202,7 @@ client = Payi(
|
|
|
201
202
|
# Override per-request:
|
|
202
203
|
client.with_options(timeout=5.0).limits.create(
|
|
203
204
|
limit_name="x",
|
|
204
|
-
max=
|
|
205
|
+
max=1,
|
|
205
206
|
)
|
|
206
207
|
```
|
|
207
208
|
|
|
@@ -245,7 +246,7 @@ from payi import Payi
|
|
|
245
246
|
client = Payi()
|
|
246
247
|
response = client.limits.with_raw_response.create(
|
|
247
248
|
limit_name="x",
|
|
248
|
-
max=
|
|
249
|
+
max=1,
|
|
249
250
|
)
|
|
250
251
|
print(response.headers.get('X-My-Header'))
|
|
251
252
|
|
|
@@ -266,7 +267,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
|
|
|
266
267
|
```python
|
|
267
268
|
with client.limits.with_streaming_response.create(
|
|
268
269
|
limit_name="x",
|
|
269
|
-
max=
|
|
270
|
+
max=1,
|
|
270
271
|
) as response:
|
|
271
272
|
print(response.headers.get("X-My-Header"))
|
|
272
273
|
|
|
@@ -5,13 +5,13 @@ payi/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
|
|
5
5
|
payi/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
|
|
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=B6f-C-F-PbDp3jRKCLksaAS9osC2g1xs7DpoZV1dlUE,28659
|
|
9
9
|
payi/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
|
10
10
|
payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
|
|
11
|
-
payi/_response.py,sha256=
|
|
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=
|
|
14
|
+
payi/_version.py,sha256=A67yjD8NLx9gXE9bL3Mfhrk1I_WHFEwI9UTylp6UwFw,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,25 +23,30 @@ 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/
|
|
26
|
+
payi/lib/AnthropicInstrumentor.py,sha256=aJDG90CeOmPNPq49UXm4yc59hoI1zVI406fNGeT_n8U,3149
|
|
27
|
+
payi/lib/Instruments.py,sha256=cyL2jxjpRluP9rN8Vn1nmVXq2NNLdZuFIsHMQWWqat4,115
|
|
28
|
+
payi/lib/OpenAIInstrumentor.py,sha256=eABTqxFLP109fOto33rBbXLh0FdQPh0a9VoMG4d6zGo,2575
|
|
29
|
+
payi/lib/Stopwatch.py,sha256=vFyGVRvkppamP7W0IuZyypKLMIaqjhB7fcRG0dNyfnQ,757
|
|
30
|
+
payi/lib/helpers.py,sha256=ZgkY8UE2YRc7ok2Pmxg_T9UMqKI8D8542JY3CP8RZCM,1597
|
|
31
|
+
payi/lib/instrument.py,sha256=Ds49BFxqWnUMezL1tRr1IPBbb8rejDrjyi6t4YO9rCU,19549
|
|
27
32
|
payi/resources/__init__.py,sha256=isHGXSl9kOrZDduKrX3UenTwrdTpuKJVBjw6NYSBV20,3592
|
|
28
|
-
payi/resources/billing_models.py,sha256=
|
|
29
|
-
payi/resources/ingest.py,sha256=
|
|
30
|
-
payi/resources/price_modifiers.py,sha256=
|
|
33
|
+
payi/resources/billing_models.py,sha256=5w3RfGXtGlyq5vbTw6hQrx1UlzRBtlq8ArcFlf5e3TY,20152
|
|
34
|
+
payi/resources/ingest.py,sha256=JPtO7foPsftAgG92kSgU29_yOJSYuvIQtQB8WpRZuoQ,18567
|
|
35
|
+
payi/resources/price_modifiers.py,sha256=t-k2F_zf2FhoxiqDHAPBPvhSgTjewlJqh50y58FNMuw,13475
|
|
31
36
|
payi/resources/categories/__init__.py,sha256=w5gMiPdBSzJA_qfoVtFBElaoe8wGf_O63R7R1Spr6Gk,1093
|
|
32
|
-
payi/resources/categories/categories.py,sha256=
|
|
33
|
-
payi/resources/categories/resources.py,sha256=
|
|
37
|
+
payi/resources/categories/categories.py,sha256=FohmajDcadMXzhG3Z1HKGkbSImO7rhzQ0olZXHz8z48,16074
|
|
38
|
+
payi/resources/categories/resources.py,sha256=6NriQERc9qsMjsdK3pKVCHClf33T2RFiMF4dp7QI3r4,18704
|
|
34
39
|
payi/resources/experiences/__init__.py,sha256=Qiyv7Tv6UC-wWpb7XVTyHvBRE0IZTnEpykFpP27xKe0,1556
|
|
35
|
-
payi/resources/experiences/experiences.py,sha256=
|
|
36
|
-
payi/resources/experiences/properties.py,sha256=
|
|
37
|
-
payi/resources/experiences/types.py,sha256=
|
|
40
|
+
payi/resources/experiences/experiences.py,sha256=ZqxkGgyfsEAS6AQhHdIdngvNt4zir6-WeB8W_NBY1io,14574
|
|
41
|
+
payi/resources/experiences/properties.py,sha256=CzuxZ0Guf57oFvm8hwjAp6EaALxC8QM84xu_JKHk-Ww,6568
|
|
42
|
+
payi/resources/experiences/types.py,sha256=PcxmOC9AhYghEeLa90iW1Tnda-34V9NgK8KEWdmWMvk,19372
|
|
38
43
|
payi/resources/limits/__init__.py,sha256=URXh9vglDH-dqbVGk-XcrDa8H5Bg2pgFuVQQecgEtaA,976
|
|
39
|
-
payi/resources/limits/limits.py,sha256=
|
|
40
|
-
payi/resources/limits/tags.py,sha256=
|
|
44
|
+
payi/resources/limits/limits.py,sha256=_kpMb05GnyurCoy9F8WELFy1XYd60jhK-rrIByBqvGs,25824
|
|
45
|
+
payi/resources/limits/tags.py,sha256=s_3sIUOLZ-z67ZKRGzcFia6kBxI6POXTneP8hzNZ78o,18725
|
|
41
46
|
payi/resources/requests/__init__.py,sha256=sWDD18RLuwPB2yzxA29HiwhFdmjZAxzy1qK_4abAZ9E,1080
|
|
42
|
-
payi/resources/requests/properties.py,sha256=
|
|
43
|
-
payi/resources/requests/requests.py,sha256=
|
|
44
|
-
payi/types/__init__.py,sha256=
|
|
47
|
+
payi/resources/requests/properties.py,sha256=ZsUeTMKQB4PNXn-jeoRwG-fqwpXzkRQyrFB8GmaNiQg,6466
|
|
48
|
+
payi/resources/requests/requests.py,sha256=c-kt-qnrD17FvSrxBGoSBFbQDBEYDuJrf23-rPGzN1k,3763
|
|
49
|
+
payi/types/__init__.py,sha256=YPxEXBR-SY7g78u8cKi5cohvuRUlMmUfsY3hS-baOvo,2796
|
|
45
50
|
payi/types/billing_model.py,sha256=zwpKldc0WvS3iGKtDb9KvfxCd3lkv8F4TwFy3ciGMXg,639
|
|
46
51
|
payi/types/billing_model_create_params.py,sha256=iVvmCcw0VxXGI_0YolknD3gmDH2lXVydU1dg2IY4dC4,547
|
|
47
52
|
payi/types/billing_model_list_response.py,sha256=hOFjJPQAKiWEArZeZwd8e1lDi5e41zbN6NvV_1rzJeM,290
|
|
@@ -57,10 +62,10 @@ payi/types/cost_data.py,sha256=PDmleZu-HKKOIh_EZ5EgWvpGiTUSJQadsxedWhFVgEI,283
|
|
|
57
62
|
payi/types/cost_details.py,sha256=w9p79opEG3kcsjkRRP7niaMcUswdfB4Y7HCkVTcQ1zQ,307
|
|
58
63
|
payi/types/default_response.py,sha256=o617LpRsCIZHCZxAc5nVI2JQ3HPGZo4gCDvSDkxkIJ8,270
|
|
59
64
|
payi/types/experience_instance_response.py,sha256=YVWjFpCMAFXsXbU5tgMKrvXHC2F5MsTWdltzRiCUIQA,309
|
|
60
|
-
payi/types/ingest_bulk_params.py,sha256=
|
|
61
|
-
payi/types/ingest_event_param.py,sha256=
|
|
65
|
+
payi/types/ingest_bulk_params.py,sha256=d76YwiXaNeltLS3w86ZxLzTKGa7ymGLJDSelaMQGf8Y,382
|
|
66
|
+
payi/types/ingest_event_param.py,sha256=wA9YuiQceNL3veHO_rVuKZg9o-EB1WLoz0aaF6Wcm-k,1498
|
|
62
67
|
payi/types/ingest_response.py,sha256=14VWaX91XuVZth1JBHY1djw8nF-0o6EK4N_WPq_p-Wc,1193
|
|
63
|
-
payi/types/ingest_units_params.py,sha256=
|
|
68
|
+
payi/types/ingest_units_params.py,sha256=0s_j6268ZmeXDw9lQ_HKLldA_EvNyPcOxM6kFxLwxkA,1749
|
|
64
69
|
payi/types/limit_create_params.py,sha256=SbNoXHwy24kTTOxDhtcewtKxEkmXtTLYh4CTGysojys,578
|
|
65
70
|
payi/types/limit_history_response.py,sha256=sCx2qKBiHU9X2KrYWV8NZiarYMGurof5GF4QobR2-EU,787
|
|
66
71
|
payi/types/limit_list_params.py,sha256=iWM67oL53y2IZ7D3Gyy8mdYv-B7vF-rbmRFn7SBUnJk,364
|
|
@@ -68,6 +73,7 @@ payi/types/limit_reset_params.py,sha256=vgqImSM89pRYY0Z2RNrJuQ6WeDX72ZPg3GWpL9EV
|
|
|
68
73
|
payi/types/limit_response.py,sha256=wYNsbsm5oMtF7W1sTbxlZ5VE0XaS_UbP6y7ZXGKfwqk,752
|
|
69
74
|
payi/types/limit_update_params.py,sha256=crY4w75FWcEXbzysq1rPfD37qR5PTy_dwVRY4C_-T1w,331
|
|
70
75
|
payi/types/paged_limit_list.py,sha256=tUMj5FsxXHGfBubxxltwahwiTl4TaCiVHpv4zmrTb4Q,1314
|
|
76
|
+
payi/types/pay_i_common_models_api_router_header_info_param.py,sha256=91djoPLmoaMWTQOXv9-Ox24dWIrM2hudrRQTCqZpX4c,381
|
|
71
77
|
payi/types/price_modifier.py,sha256=Sw_5tzCGnpjQzR5aZ70_ATpfBRQA_0ue2NRM3yMcvj0,531
|
|
72
78
|
payi/types/price_modifier_create_params.py,sha256=RpcYr2JYFu-pxzY4Dx1ESMp9-FBHfKt03Iw-3tlZvXQ,404
|
|
73
79
|
payi/types/price_modifier_retrieve_response.py,sha256=oFXWr38-O7KHItQlSsr7K8-Arpjq0yKexSUnbWqu62Q,303
|
|
@@ -98,8 +104,8 @@ payi/types/limits/tag_update_response.py,sha256=xLa4aU4eVhNmIaQTsCyEDjx1vatBACFi
|
|
|
98
104
|
payi/types/requests/__init__.py,sha256=K4qfrWMIIg1-UNB0Vu5UdGEmf6TWoF-i3gPc_LT78D8,204
|
|
99
105
|
payi/types/requests/property_create_params.py,sha256=6v1L_4pj5N5k386cbtjSAWr2QJw---WUJ5lyshRnMwc,328
|
|
100
106
|
payi/types/shared/__init__.py,sha256=zgBdtU5-a1ee8l5ABWyzuELwWRTKOCCcOx7gbCgdE4A,161
|
|
101
|
-
payi/types/shared/evaluation_response.py,sha256=
|
|
102
|
-
payi-0.1.
|
|
103
|
-
payi-0.1.
|
|
104
|
-
payi-0.1.
|
|
105
|
-
payi-0.1.
|
|
107
|
+
payi/types/shared/evaluation_response.py,sha256=ejEToMA57PUu1SldEtJ5z9r4fAO3U0tvdjbsyIoVX1s,214
|
|
108
|
+
payi-0.1.0a37.dist-info/METADATA,sha256=2rDEUus361E_chlt4fOLNwxdCYj4f3-U5jsr2R4wXvI,12594
|
|
109
|
+
payi-0.1.0a37.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
110
|
+
payi-0.1.0a37.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
|
|
111
|
+
payi-0.1.0a37.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|