payi 0.1.0a34__py3-none-any.whl → 0.1.0a36__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 +9 -5
- 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 +14 -9
- payi/lib/instrument.py +514 -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/__init__.py +0 -14
- payi/resources/experiences/experiences.py +2 -34
- payi/resources/experiences/properties.py +4 -4
- payi/resources/experiences/types.py +2 -2
- payi/resources/ingest.py +45 -47
- 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 +4 -4
- payi/resources/requests/requests.py +2 -2
- payi/types/experiences/__init__.py +0 -2
- payi/types/ingest_bulk_params.py +1 -1
- payi/types/ingest_event_param.py +18 -8
- payi/types/ingest_units_params.py +19 -8
- payi/types/limit_history_response.py +1 -1
- payi/types/shared/evaluation_response.py +0 -1
- {payi-0.1.0a34.dist-info → payi-0.1.0a36.dist-info}/METADATA +12 -12
- {payi-0.1.0a34.dist-info → payi-0.1.0a36.dist-info}/RECORD +33 -31
- payi/resources/experiences/csat.py +0 -188
- payi/types/experiences/csat_create_params.py +0 -14
- payi/types/experiences/csat_response.py +0 -10
- {payi-0.1.0a34.dist-info → payi-0.1.0a36.dist-info}/WHEEL +0 -0
- {payi-0.1.0a34.dist-info → payi-0.1.0a36.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
@@ -59,7 +59,7 @@ class PropertiesResource(SyncAPIResource):
|
|
|
59
59
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
60
60
|
) -> ExperienceInstanceResponse:
|
|
61
61
|
"""
|
|
62
|
-
Update
|
|
62
|
+
Update Experience properties
|
|
63
63
|
|
|
64
64
|
Args:
|
|
65
65
|
extra_headers: Send extra 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
|
|
@@ -115,7 +115,7 @@ class AsyncPropertiesResource(AsyncAPIResource):
|
|
|
115
115
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
116
116
|
) -> ExperienceInstanceResponse:
|
|
117
117
|
"""
|
|
118
|
-
Update
|
|
118
|
+
Update Experience properties
|
|
119
119
|
|
|
120
120
|
Args:
|
|
121
121
|
extra_headers: Send extra headers
|
|
@@ -31,7 +31,7 @@ class TypesResource(SyncAPIResource):
|
|
|
31
31
|
@cached_property
|
|
32
32
|
def with_raw_response(self) -> TypesResourceWithRawResponse:
|
|
33
33
|
"""
|
|
34
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
35
|
the raw response object instead of the parsed content.
|
|
36
36
|
|
|
37
37
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -238,7 +238,7 @@ class AsyncTypesResource(AsyncAPIResource):
|
|
|
238
238
|
@cached_property
|
|
239
239
|
def with_raw_response(self) -> AsyncTypesResourceWithRawResponse:
|
|
240
240
|
"""
|
|
241
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
241
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
242
242
|
the raw response object instead of the parsed content.
|
|
243
243
|
|
|
244
244
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
payi/resources/ingest.py
CHANGED
|
@@ -34,7 +34,7 @@ class IngestResource(SyncAPIResource):
|
|
|
34
34
|
@cached_property
|
|
35
35
|
def with_raw_response(self) -> IngestResourceWithRawResponse:
|
|
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
|
|
@@ -80,7 +80,7 @@ class IngestResource(SyncAPIResource):
|
|
|
80
80
|
"/api/v1/ingest/bulk",
|
|
81
81
|
body=maybe_transform(events, Iterable[IngestEventParam]),
|
|
82
82
|
options=make_request_options(
|
|
83
|
-
|
|
83
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
84
84
|
),
|
|
85
85
|
cast_to=BulkIngestResponse,
|
|
86
86
|
)
|
|
@@ -96,12 +96,12 @@ class IngestResource(SyncAPIResource):
|
|
|
96
96
|
experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
97
97
|
http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
|
|
98
98
|
properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
provider_request_headers: Optional[Iterable[ingest_units_params.ProviderRequestHeader]] | NotGiven = NOT_GIVEN,
|
|
100
|
+
provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
|
|
101
|
+
provider_response_headers: Optional[Iterable[ingest_units_params.ProviderResponseHeader]]
|
|
102
|
+
| NotGiven = NOT_GIVEN,
|
|
103
|
+
provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
|
|
103
104
|
provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
|
|
104
|
-
provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
105
105
|
time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
|
|
106
106
|
limit_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
107
107
|
request_tags: Union[list[str], None] | 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
|
|
|
@@ -201,12 +201,11 @@ class IngestResource(SyncAPIResource):
|
|
|
201
201
|
"experience_properties": experience_properties,
|
|
202
202
|
"http_status_code": http_status_code,
|
|
203
203
|
"properties": properties,
|
|
204
|
-
"provider_prompt": provider_prompt,
|
|
205
204
|
"provider_request_headers": provider_request_headers,
|
|
206
|
-
"
|
|
205
|
+
"provider_request_json": provider_request_json,
|
|
207
206
|
"provider_response_headers": provider_response_headers,
|
|
207
|
+
"provider_response_json": provider_response_json,
|
|
208
208
|
"provider_uri": provider_uri,
|
|
209
|
-
"provisioned_resource_name": provisioned_resource_name,
|
|
210
209
|
"time_to_first_token_ms": time_to_first_token_ms,
|
|
211
210
|
},
|
|
212
211
|
ingest_units_params.IngestUnitsParams,
|
|
@@ -222,7 +221,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
222
221
|
@cached_property
|
|
223
222
|
def with_raw_response(self) -> AsyncIngestResourceWithRawResponse:
|
|
224
223
|
"""
|
|
225
|
-
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
|
|
226
225
|
the raw response object instead of the parsed content.
|
|
227
226
|
|
|
228
227
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
@@ -283,12 +282,12 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
283
282
|
experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
284
283
|
http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
|
|
285
284
|
properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
provider_request_headers: Optional[Iterable[ingest_units_params.ProviderRequestHeader]] | NotGiven = NOT_GIVEN,
|
|
286
|
+
provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
|
|
287
|
+
provider_response_headers: Optional[Iterable[ingest_units_params.ProviderResponseHeader]]
|
|
288
|
+
| NotGiven = NOT_GIVEN,
|
|
289
|
+
provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
|
|
290
290
|
provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
|
|
291
|
-
provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
292
291
|
time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
|
|
293
292
|
limit_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
294
293
|
request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
@@ -308,29 +307,29 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
308
307
|
category (str): The name of the category
|
|
309
308
|
|
|
310
309
|
resource (str): The name of the resource
|
|
311
|
-
|
|
310
|
+
|
|
312
311
|
input (int): The number of input units
|
|
313
|
-
|
|
312
|
+
|
|
314
313
|
output (int): The number of output units
|
|
315
|
-
|
|
314
|
+
|
|
316
315
|
event_timestamp: (datetime, None): The timestamp of the event. Defaults to None.
|
|
317
|
-
|
|
316
|
+
|
|
318
317
|
limit_ids (list[str], optional): The limit IDs to associate with the request. Defaults to None.
|
|
319
|
-
|
|
318
|
+
|
|
320
319
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
321
|
-
|
|
320
|
+
|
|
322
321
|
experience_name (str, optional): The experience name
|
|
323
|
-
|
|
322
|
+
|
|
324
323
|
experience_id (str, optional): The experience instance id
|
|
325
|
-
|
|
324
|
+
|
|
326
325
|
user_id (str, optional): The user id
|
|
327
|
-
|
|
326
|
+
|
|
328
327
|
extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
|
|
329
|
-
|
|
328
|
+
|
|
330
329
|
extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
|
|
331
|
-
|
|
330
|
+
|
|
332
331
|
extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
|
|
333
|
-
|
|
332
|
+
|
|
334
333
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
335
334
|
"""
|
|
336
335
|
valid_ids_str: str | NotGiven = NOT_GIVEN
|
|
@@ -338,7 +337,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
338
337
|
|
|
339
338
|
if limit_ids is None or isinstance(limit_ids, NotGiven):
|
|
340
339
|
valid_ids_str = NOT_GIVEN
|
|
341
|
-
elif not isinstance(limit_ids, list):
|
|
340
|
+
elif not isinstance(limit_ids, list): # type: ignore
|
|
342
341
|
raise TypeError("limit_ids must be a list")
|
|
343
342
|
else:
|
|
344
343
|
# Proceed with the list comprehension if limit_ids is not NotGiven
|
|
@@ -347,7 +346,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
347
346
|
|
|
348
347
|
if request_tags is None or isinstance(request_tags, NotGiven):
|
|
349
348
|
valid_tags_str = NOT_GIVEN
|
|
350
|
-
elif not isinstance(request_tags, list):
|
|
349
|
+
elif not isinstance(request_tags, list): # type: ignore
|
|
351
350
|
raise TypeError("request_tags must be a list")
|
|
352
351
|
else:
|
|
353
352
|
# Proceed with the list comprehension if request_tags is not NotGiven
|
|
@@ -359,7 +358,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
359
358
|
|
|
360
359
|
if experience_id is None or isinstance(experience_id, NotGiven):
|
|
361
360
|
experience_id = NOT_GIVEN
|
|
362
|
-
|
|
361
|
+
|
|
363
362
|
if user_id is None or isinstance(user_id, NotGiven):
|
|
364
363
|
user_id = NOT_GIVEN
|
|
365
364
|
|
|
@@ -387,12 +386,11 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
387
386
|
"experience_properties": experience_properties,
|
|
388
387
|
"http_status_code": http_status_code,
|
|
389
388
|
"properties": properties,
|
|
390
|
-
"provider_prompt": provider_prompt,
|
|
391
389
|
"provider_request_headers": provider_request_headers,
|
|
392
|
-
"
|
|
390
|
+
"provider_request_json": provider_request_json,
|
|
393
391
|
"provider_response_headers": provider_response_headers,
|
|
392
|
+
"provider_response_json": provider_response_json,
|
|
394
393
|
"provider_uri": provider_uri,
|
|
395
|
-
"provisioned_resource_name": provisioned_resource_name,
|
|
396
394
|
"time_to_first_token_ms": time_to_first_token_ms,
|
|
397
395
|
},
|
|
398
396
|
ingest_units_params.IngestUnitsParams,
|
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
|
|
@@ -59,7 +59,7 @@ class PropertiesResource(SyncAPIResource):
|
|
|
59
59
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
60
60
|
) -> PropertiesResponse:
|
|
61
61
|
"""
|
|
62
|
-
|
|
62
|
+
Update Request properties
|
|
63
63
|
|
|
64
64
|
Args:
|
|
65
65
|
extra_headers: Send extra 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
|
|
@@ -115,7 +115,7 @@ class AsyncPropertiesResource(AsyncAPIResource):
|
|
|
115
115
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
116
116
|
) -> PropertiesResponse:
|
|
117
117
|
"""
|
|
118
|
-
|
|
118
|
+
Update Request properties
|
|
119
119
|
|
|
120
120
|
Args:
|
|
121
121
|
extra_headers: Send extra 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
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from .csat_response import CsatResponse as CsatResponse
|
|
6
5
|
from .experience_type import ExperienceType as ExperienceType
|
|
7
6
|
from .type_list_params import TypeListParams as TypeListParams
|
|
8
|
-
from .csat_create_params import CsatCreateParams as CsatCreateParams
|
|
9
7
|
from .type_create_params import TypeCreateParams as TypeCreateParams
|
|
10
8
|
from .type_list_response import TypeListResponse as TypeListResponse
|
|
11
9
|
from .type_update_params import TypeUpdateParams as TypeUpdateParams
|
payi/types/ingest_bulk_params.py
CHANGED
payi/types/ingest_event_param.py
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, List, Union, Optional
|
|
5
|
+
from typing import Dict, List, Union, Iterable, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
|
9
9
|
from .._utils import PropertyInfo
|
|
10
10
|
|
|
11
|
-
__all__ = ["IngestEventParam", "Units"]
|
|
11
|
+
__all__ = ["IngestEventParam", "Units", "ProviderRequestHeader", "ProviderResponseHeader"]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class Units(TypedDict, total=False):
|
|
@@ -17,6 +17,18 @@ class Units(TypedDict, total=False):
|
|
|
17
17
|
output: int
|
|
18
18
|
|
|
19
19
|
|
|
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
|
+
|
|
20
32
|
class IngestEventParam(TypedDict, total=False):
|
|
21
33
|
category: Required[str]
|
|
22
34
|
|
|
@@ -42,18 +54,16 @@ class IngestEventParam(TypedDict, total=False):
|
|
|
42
54
|
|
|
43
55
|
properties: Optional[Dict[str, str]]
|
|
44
56
|
|
|
45
|
-
|
|
57
|
+
provider_request_headers: Optional[Iterable[ProviderRequestHeader]]
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
provider_request_json: Optional[str]
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
provider_response_headers: Optional[Iterable[ProviderResponseHeader]]
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
provider_response_json: Union[str, List[str], None]
|
|
52
64
|
|
|
53
65
|
provider_uri: Optional[str]
|
|
54
66
|
|
|
55
|
-
provisioned_resource_name: Optional[str]
|
|
56
|
-
|
|
57
67
|
request_tags: Optional[List[str]]
|
|
58
68
|
|
|
59
69
|
time_to_first_token_ms: Optional[int]
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, List, Union, Optional
|
|
5
|
+
from typing import Dict, List, Union, Iterable, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
|
9
9
|
from .._utils import PropertyInfo
|
|
10
10
|
|
|
11
|
-
__all__ = ["IngestUnitsParams", "Units"]
|
|
11
|
+
__all__ = ["IngestUnitsParams", "Units", "ProviderRequestHeader", "ProviderResponseHeader"]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class IngestUnitsParams(TypedDict, total=False):
|
|
@@ -28,18 +28,16 @@ class IngestUnitsParams(TypedDict, total=False):
|
|
|
28
28
|
|
|
29
29
|
properties: Optional[Dict[str, str]]
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
provider_request_headers: Optional[Iterable[ProviderRequestHeader]]
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
provider_request_json: Optional[str]
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
provider_response_headers: Optional[Iterable[ProviderResponseHeader]]
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
provider_response_json: Union[str, List[str], None]
|
|
38
38
|
|
|
39
39
|
provider_uri: Optional[str]
|
|
40
40
|
|
|
41
|
-
provisioned_resource_name: Optional[str]
|
|
42
|
-
|
|
43
41
|
time_to_first_token_ms: Optional[int]
|
|
44
42
|
|
|
45
43
|
limit_ids: Annotated[Union[list[str], None], PropertyInfo(alias="xProxy-Limit-IDs")]
|
|
@@ -52,7 +50,20 @@ class IngestUnitsParams(TypedDict, total=False):
|
|
|
52
50
|
|
|
53
51
|
user_id: Annotated[Union[str, None], PropertyInfo(alias="xProxy-User-ID")]
|
|
54
52
|
|
|
53
|
+
|
|
55
54
|
class Units(TypedDict, total=False):
|
|
56
55
|
input: int
|
|
57
56
|
|
|
58
57
|
output: int
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class ProviderRequestHeader(TypedDict, total=False):
|
|
61
|
+
name: Required[str]
|
|
62
|
+
|
|
63
|
+
value: Optional[str]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class ProviderResponseHeader(TypedDict, total=False):
|
|
67
|
+
name: Required[str]
|
|
68
|
+
|
|
69
|
+
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.0a36
|
|
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")
|
|
@@ -142,7 +143,7 @@ except payi.APIStatusError as e:
|
|
|
142
143
|
print(e.response)
|
|
143
144
|
```
|
|
144
145
|
|
|
145
|
-
Error codes are as
|
|
146
|
+
Error codes are as follows:
|
|
146
147
|
|
|
147
148
|
| Status Code | Error Type |
|
|
148
149
|
| ----------- | -------------------------- |
|
|
@@ -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
|
|
|
@@ -285,8 +286,7 @@ If you need to access undocumented endpoints, params, or response properties, th
|
|
|
285
286
|
#### Undocumented endpoints
|
|
286
287
|
|
|
287
288
|
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
|
|
288
|
-
http verbs. Options on the client will be respected (such as retries)
|
|
289
|
-
request.
|
|
289
|
+
http verbs. Options on the client will be respected (such as retries) when making this request.
|
|
290
290
|
|
|
291
291
|
```py
|
|
292
292
|
import httpx
|
|
@@ -358,7 +358,7 @@ with Payi() as client:
|
|
|
358
358
|
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
359
359
|
|
|
360
360
|
1. Changes that only affect static types, without breaking runtime behavior.
|
|
361
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_
|
|
361
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
362
362
|
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
363
363
|
|
|
364
364
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|