payi 0.1.0a121__py3-none-any.whl → 0.1.0a123__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/__init__.py +3 -1
- payi/_base_client.py +9 -9
- payi/_client.py +8 -8
- payi/_models.py +10 -4
- payi/_qs.py +7 -7
- payi/_types.py +18 -11
- payi/_utils/_transform.py +2 -2
- payi/_utils/_utils.py +4 -4
- payi/_version.py +1 -1
- payi/lib/instrument.py +5 -1
- payi/resources/categories/categories.py +21 -21
- payi/resources/categories/fixed_cost_resources.py +7 -7
- payi/resources/categories/resources.py +23 -23
- payi/resources/ingest.py +109 -127
- payi/resources/limits/limits.py +35 -35
- payi/resources/limits/tags.py +11 -11
- payi/resources/requests/request_id/properties.py +3 -3
- payi/resources/requests/request_id/result.py +3 -3
- payi/resources/requests/response_id/properties.py +3 -3
- payi/resources/requests/response_id/result.py +3 -3
- payi/resources/use_cases/definitions/definitions.py +27 -27
- payi/resources/use_cases/definitions/kpis.py +23 -23
- payi/resources/use_cases/definitions/limit_config.py +11 -11
- payi/resources/use_cases/definitions/version.py +3 -3
- payi/resources/use_cases/kpis.py +15 -15
- payi/resources/use_cases/properties.py +3 -3
- payi/resources/use_cases/use_cases.py +7 -7
- {payi-0.1.0a121.dist-info → payi-0.1.0a123.dist-info}/METADATA +1 -1
- {payi-0.1.0a121.dist-info → payi-0.1.0a123.dist-info}/RECORD +31 -31
- {payi-0.1.0a121.dist-info → payi-0.1.0a123.dist-info}/WHEEL +0 -0
- {payi-0.1.0a121.dist-info → payi-0.1.0a123.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ from datetime import datetime
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..._types import
|
|
10
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from ..._compat import cached_property
|
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -51,16 +51,16 @@ class ResourcesResource(SyncAPIResource):
|
|
|
51
51
|
*,
|
|
52
52
|
category: str,
|
|
53
53
|
units: Dict[str, resource_create_params.Units],
|
|
54
|
-
max_input_units: Optional[int] |
|
|
55
|
-
max_output_units: Optional[int] |
|
|
56
|
-
max_total_units: Optional[int] |
|
|
57
|
-
start_timestamp: Union[str, datetime, None] |
|
|
54
|
+
max_input_units: Optional[int] | Omit = omit,
|
|
55
|
+
max_output_units: Optional[int] | Omit = omit,
|
|
56
|
+
max_total_units: Optional[int] | Omit = omit,
|
|
57
|
+
start_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
58
58
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
59
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
60
|
extra_headers: Headers | None = None,
|
|
61
61
|
extra_query: Query | None = None,
|
|
62
62
|
extra_body: Body | None = None,
|
|
63
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
64
|
) -> CategoryResourceResponse:
|
|
65
65
|
"""
|
|
66
66
|
Create a Resource
|
|
@@ -107,7 +107,7 @@ class ResourcesResource(SyncAPIResource):
|
|
|
107
107
|
extra_headers: Headers | None = None,
|
|
108
108
|
extra_query: Query | None = None,
|
|
109
109
|
extra_body: Body | None = None,
|
|
110
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
110
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
111
111
|
) -> CategoryResourceResponse:
|
|
112
112
|
"""
|
|
113
113
|
Get a Resource version details
|
|
@@ -140,15 +140,15 @@ class ResourcesResource(SyncAPIResource):
|
|
|
140
140
|
resource: str,
|
|
141
141
|
*,
|
|
142
142
|
category: str,
|
|
143
|
-
cursor: str |
|
|
144
|
-
limit: int |
|
|
145
|
-
sort_ascending: bool |
|
|
143
|
+
cursor: str | Omit = omit,
|
|
144
|
+
limit: int | Omit = omit,
|
|
145
|
+
sort_ascending: bool | Omit = omit,
|
|
146
146
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
147
147
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
148
148
|
extra_headers: Headers | None = None,
|
|
149
149
|
extra_query: Query | None = None,
|
|
150
150
|
extra_body: Body | None = None,
|
|
151
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
151
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
152
152
|
) -> SyncCursorPage[CategoryResourceResponse]:
|
|
153
153
|
"""
|
|
154
154
|
Get a list of versions of a Resource
|
|
@@ -197,7 +197,7 @@ class ResourcesResource(SyncAPIResource):
|
|
|
197
197
|
extra_headers: Headers | None = None,
|
|
198
198
|
extra_query: Query | None = None,
|
|
199
199
|
extra_body: Body | None = None,
|
|
200
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
200
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
201
201
|
) -> CategoryResourceResponse:
|
|
202
202
|
"""
|
|
203
203
|
Delete a version of the Resource
|
|
@@ -252,16 +252,16 @@ class AsyncResourcesResource(AsyncAPIResource):
|
|
|
252
252
|
*,
|
|
253
253
|
category: str,
|
|
254
254
|
units: Dict[str, resource_create_params.Units],
|
|
255
|
-
max_input_units: Optional[int] |
|
|
256
|
-
max_output_units: Optional[int] |
|
|
257
|
-
max_total_units: Optional[int] |
|
|
258
|
-
start_timestamp: Union[str, datetime, None] |
|
|
255
|
+
max_input_units: Optional[int] | Omit = omit,
|
|
256
|
+
max_output_units: Optional[int] | Omit = omit,
|
|
257
|
+
max_total_units: Optional[int] | Omit = omit,
|
|
258
|
+
start_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
259
259
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
260
260
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
261
261
|
extra_headers: Headers | None = None,
|
|
262
262
|
extra_query: Query | None = None,
|
|
263
263
|
extra_body: Body | None = None,
|
|
264
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
264
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
265
265
|
) -> CategoryResourceResponse:
|
|
266
266
|
"""
|
|
267
267
|
Create a Resource
|
|
@@ -308,7 +308,7 @@ class AsyncResourcesResource(AsyncAPIResource):
|
|
|
308
308
|
extra_headers: Headers | None = None,
|
|
309
309
|
extra_query: Query | None = None,
|
|
310
310
|
extra_body: Body | None = None,
|
|
311
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
311
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
312
312
|
) -> CategoryResourceResponse:
|
|
313
313
|
"""
|
|
314
314
|
Get a Resource version details
|
|
@@ -341,15 +341,15 @@ class AsyncResourcesResource(AsyncAPIResource):
|
|
|
341
341
|
resource: str,
|
|
342
342
|
*,
|
|
343
343
|
category: str,
|
|
344
|
-
cursor: str |
|
|
345
|
-
limit: int |
|
|
346
|
-
sort_ascending: bool |
|
|
344
|
+
cursor: str | Omit = omit,
|
|
345
|
+
limit: int | Omit = omit,
|
|
346
|
+
sort_ascending: bool | Omit = omit,
|
|
347
347
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
348
348
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
349
349
|
extra_headers: Headers | None = None,
|
|
350
350
|
extra_query: Query | None = None,
|
|
351
351
|
extra_body: Body | None = None,
|
|
352
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
352
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
353
353
|
) -> AsyncPaginator[CategoryResourceResponse, AsyncCursorPage[CategoryResourceResponse]]:
|
|
354
354
|
"""
|
|
355
355
|
Get a list of versions of a Resource
|
|
@@ -398,7 +398,7 @@ class AsyncResourcesResource(AsyncAPIResource):
|
|
|
398
398
|
extra_headers: Headers | None = None,
|
|
399
399
|
extra_query: Query | None = None,
|
|
400
400
|
extra_body: Body | None = None,
|
|
401
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
401
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
402
402
|
) -> CategoryResourceResponse:
|
|
403
403
|
"""
|
|
404
404
|
Delete a version of the Resource
|
payi/resources/ingest.py
CHANGED
|
@@ -10,7 +10,7 @@ import httpx
|
|
|
10
10
|
from payi._utils._utils import is_given
|
|
11
11
|
|
|
12
12
|
from ..types import ingest_units_params
|
|
13
|
-
from .._types import
|
|
13
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
14
14
|
from .._utils import maybe_transform, strip_not_given, async_maybe_transform
|
|
15
15
|
from .._compat import cached_property
|
|
16
16
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -53,13 +53,13 @@ class IngestResource(SyncAPIResource):
|
|
|
53
53
|
def bulk(
|
|
54
54
|
self,
|
|
55
55
|
*,
|
|
56
|
-
events: Iterable[IngestEventParam] |
|
|
56
|
+
events: Iterable[IngestEventParam] | Omit = omit,
|
|
57
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
59
|
extra_headers: Headers | None = None,
|
|
60
60
|
extra_query: Query | None = None,
|
|
61
61
|
extra_body: Body | None = None,
|
|
62
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
63
|
) -> BulkIngestResponse:
|
|
64
64
|
"""
|
|
65
65
|
Bulk Ingest
|
|
@@ -87,38 +87,38 @@ class IngestResource(SyncAPIResource):
|
|
|
87
87
|
*,
|
|
88
88
|
category: str,
|
|
89
89
|
units: Dict[str, IngestUnits],
|
|
90
|
-
end_to_end_latency_ms: Optional[int] |
|
|
91
|
-
event_timestamp: Union[str, datetime, None] |
|
|
92
|
-
http_status_code: Optional[int] |
|
|
93
|
-
properties: Optional[Dict[str, str]] |
|
|
94
|
-
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
95
|
-
provider_request_json: Optional[str] |
|
|
96
|
-
provider_request_reasoning_json: Optional[str] |
|
|
90
|
+
end_to_end_latency_ms: Optional[int] | Omit = omit,
|
|
91
|
+
event_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
92
|
+
http_status_code: Optional[int] | Omit = omit,
|
|
93
|
+
properties: Optional[Dict[str, str]] | Omit = omit,
|
|
94
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
95
|
+
provider_request_json: Optional[str] | Omit = omit,
|
|
96
|
+
provider_request_reasoning_json: Optional[str] | Omit = omit,
|
|
97
97
|
provider_response_function_calls: Optional[Iterable[ingest_units_params.ProviderResponseFunctionCall]]
|
|
98
|
-
|
|
|
99
|
-
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
100
|
-
provider_response_id: Optional[str] |
|
|
101
|
-
provider_response_json: Union[str, SequenceNotStr[str], None] |
|
|
102
|
-
provider_uri: Optional[str] |
|
|
103
|
-
resource: Optional[str] |
|
|
104
|
-
time_to_first_completion_token_ms: Optional[int] |
|
|
105
|
-
time_to_first_token_ms: Optional[int] |
|
|
106
|
-
use_case_properties: Optional[Dict[str, str]] |
|
|
107
|
-
limit_ids: Optional[list[str]] |
|
|
108
|
-
request_tags: Optional[list[str]] |
|
|
109
|
-
use_case_id: Optional[str] |
|
|
110
|
-
use_case_name: Optional[str] |
|
|
111
|
-
use_case_step: Optional[str] |
|
|
112
|
-
use_case_version: Optional[int] |
|
|
113
|
-
user_id: Optional[str] |
|
|
114
|
-
resource_scope: Optional[str] |
|
|
115
|
-
account_name: Optional[str] |
|
|
98
|
+
| Omit = omit,
|
|
99
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
100
|
+
provider_response_id: Optional[str] | Omit = omit,
|
|
101
|
+
provider_response_json: Union[str, SequenceNotStr[str], None] | Omit = omit,
|
|
102
|
+
provider_uri: Optional[str] | Omit = omit,
|
|
103
|
+
resource: Optional[str] | Omit = omit,
|
|
104
|
+
time_to_first_completion_token_ms: Optional[int] | Omit = omit,
|
|
105
|
+
time_to_first_token_ms: Optional[int] | Omit = omit,
|
|
106
|
+
use_case_properties: Optional[Dict[str, str]] | Omit = omit,
|
|
107
|
+
limit_ids: Optional[list[str]] | Omit = omit,
|
|
108
|
+
request_tags: Optional[list[str]] | Omit = omit,
|
|
109
|
+
use_case_id: Optional[str] | Omit = omit,
|
|
110
|
+
use_case_name: Optional[str] | Omit = omit,
|
|
111
|
+
use_case_step: Optional[str] | Omit = omit,
|
|
112
|
+
use_case_version: Optional[int] | Omit = omit,
|
|
113
|
+
user_id: Optional[str] | Omit = omit,
|
|
114
|
+
resource_scope: Optional[str] | Omit = omit,
|
|
115
|
+
account_name: Optional[str] | Omit = omit,
|
|
116
116
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
117
117
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
118
118
|
extra_headers: Headers | None = None,
|
|
119
119
|
extra_query: Query | None = None,
|
|
120
120
|
extra_body: Body | None = None,
|
|
121
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
121
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
122
122
|
) -> IngestResponse:
|
|
123
123
|
"""
|
|
124
124
|
Ingest an Event
|
|
@@ -164,62 +164,53 @@ class IngestResource(SyncAPIResource):
|
|
|
164
164
|
|
|
165
165
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
166
166
|
"""
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
use_case_version_str: str |
|
|
167
|
+
request_tags = request_tags
|
|
168
|
+
valid_ids_str: str | Omit = omit
|
|
169
|
+
use_case_version_str: str | Omit = omit
|
|
170
170
|
|
|
171
|
-
if limit_ids is None or
|
|
172
|
-
valid_ids_str =
|
|
171
|
+
if limit_ids is None or not is_given(limit_ids):
|
|
172
|
+
valid_ids_str = omit
|
|
173
173
|
elif not isinstance(limit_ids, list): # type: ignore
|
|
174
174
|
raise TypeError("limit_ids must be a list")
|
|
175
175
|
else:
|
|
176
|
-
# Proceed with the list comprehension if limit_ids is
|
|
176
|
+
# Proceed with the list comprehension if limit_ids is given
|
|
177
177
|
valid_ids = [id.strip() for id in limit_ids if id.strip()]
|
|
178
|
-
valid_ids_str = ",".join(valid_ids) if valid_ids else
|
|
178
|
+
valid_ids_str = ",".join(valid_ids) if valid_ids else omit
|
|
179
179
|
|
|
180
|
-
if
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if use_case_step is None or isinstance(use_case_step, NotGiven):
|
|
193
|
-
use_case_step = NOT_GIVEN
|
|
194
|
-
|
|
195
|
-
if use_case_id is None or isinstance(use_case_id, NotGiven):
|
|
196
|
-
use_case_id = NOT_GIVEN
|
|
197
|
-
|
|
198
|
-
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
199
|
-
use_case_version_str = NOT_GIVEN
|
|
180
|
+
if use_case_name is None or not is_given(use_case_name):
|
|
181
|
+
use_case_name = omit
|
|
182
|
+
|
|
183
|
+
if use_case_step is None or not is_given(use_case_step):
|
|
184
|
+
use_case_step = omit
|
|
185
|
+
|
|
186
|
+
if use_case_id is None or not is_given(use_case_id):
|
|
187
|
+
use_case_id = omit
|
|
188
|
+
|
|
189
|
+
if use_case_version is None or not is_given(use_case_version):
|
|
190
|
+
use_case_version_str = omit
|
|
200
191
|
else:
|
|
201
192
|
use_case_version_str = str(use_case_version)
|
|
202
193
|
|
|
203
|
-
if user_id is None or
|
|
204
|
-
user_id =
|
|
194
|
+
if user_id is None or not is_given(user_id):
|
|
195
|
+
user_id = omit
|
|
205
196
|
|
|
206
|
-
if resource_scope is None or
|
|
207
|
-
resource_scope =
|
|
197
|
+
if resource_scope is None or not is_given(resource_scope):
|
|
198
|
+
resource_scope = omit
|
|
208
199
|
|
|
209
|
-
if account_name is None or
|
|
210
|
-
account_name =
|
|
200
|
+
if account_name is None or not is_given(account_name):
|
|
201
|
+
account_name = omit
|
|
211
202
|
|
|
212
203
|
extra_headers = {
|
|
213
204
|
**strip_not_given(
|
|
214
205
|
{
|
|
215
206
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
216
|
-
"xProxy-Request-Tags":
|
|
207
|
+
"xProxy-Request-Tags": omit,
|
|
217
208
|
"xProxy-UseCase-ID": use_case_id,
|
|
218
209
|
"xProxy-UseCase-Name": use_case_name,
|
|
219
210
|
"xProxy-UseCase-Step": use_case_step,
|
|
220
211
|
"xProxy-UseCase-Version": use_case_version_str
|
|
221
212
|
if is_given(use_case_version)
|
|
222
|
-
else
|
|
213
|
+
else omit,
|
|
223
214
|
"xProxy-User-ID": user_id,
|
|
224
215
|
"xProxy-Resource-Scope": resource_scope,
|
|
225
216
|
"xProxy-Account-Name": account_name,
|
|
@@ -283,13 +274,13 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
283
274
|
async def bulk(
|
|
284
275
|
self,
|
|
285
276
|
*,
|
|
286
|
-
events: Iterable[IngestEventParam] |
|
|
277
|
+
events: Iterable[IngestEventParam] | Omit = omit,
|
|
287
278
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
288
279
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
289
280
|
extra_headers: Headers | None = None,
|
|
290
281
|
extra_query: Query | None = None,
|
|
291
282
|
extra_body: Body | None = None,
|
|
292
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
283
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
293
284
|
) -> BulkIngestResponse:
|
|
294
285
|
"""
|
|
295
286
|
Bulk Ingest
|
|
@@ -317,37 +308,37 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
317
308
|
*,
|
|
318
309
|
category: str,
|
|
319
310
|
units: Dict[str, IngestUnits],
|
|
320
|
-
end_to_end_latency_ms: Optional[int] |
|
|
321
|
-
event_timestamp: Union[str, datetime, None] |
|
|
322
|
-
http_status_code: Optional[int] |
|
|
323
|
-
properties: Optional[Dict[str, str]] |
|
|
324
|
-
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
325
|
-
provider_request_json: Optional[str] |
|
|
326
|
-
provider_request_reasoning_json: Optional[str] |
|
|
311
|
+
end_to_end_latency_ms: Optional[int] | Omit = omit,
|
|
312
|
+
event_timestamp: Union[str, datetime, None] | Omit = omit,
|
|
313
|
+
http_status_code: Optional[int] | Omit = omit,
|
|
314
|
+
properties: Optional[Dict[str, str]] | Omit = omit,
|
|
315
|
+
provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
316
|
+
provider_request_json: Optional[str] | Omit = omit,
|
|
317
|
+
provider_request_reasoning_json: Optional[str] | Omit = omit,
|
|
327
318
|
provider_response_function_calls: Optional[Iterable[ingest_units_params.ProviderResponseFunctionCall]]
|
|
328
|
-
|
|
|
329
|
-
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] |
|
|
330
|
-
provider_response_id: Optional[str] |
|
|
331
|
-
provider_response_json: Union[str, SequenceNotStr[str], None] |
|
|
332
|
-
provider_uri: Optional[str] |
|
|
333
|
-
resource: Optional[str] |
|
|
334
|
-
time_to_first_completion_token_ms: Optional[int] |
|
|
335
|
-
time_to_first_token_ms: Optional[int] |
|
|
336
|
-
use_case_properties: Optional[Dict[str, str]] |
|
|
337
|
-
limit_ids: Optional[list[str]] |
|
|
338
|
-
request_tags: Optional[list[str]] |
|
|
339
|
-
use_case_id: Optional[str] |
|
|
340
|
-
use_case_name: Optional[str] |
|
|
341
|
-
use_case_step: Optional[str] |
|
|
342
|
-
use_case_version: Optional[int] |
|
|
343
|
-
user_id: Optional[str] |
|
|
344
|
-
resource_scope: Union[str, None] |
|
|
345
|
-
account_name: Optional[str] |
|
|
319
|
+
| Omit = omit,
|
|
320
|
+
provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | Omit = omit,
|
|
321
|
+
provider_response_id: Optional[str] | Omit = omit,
|
|
322
|
+
provider_response_json: Union[str, SequenceNotStr[str], None] | Omit = omit,
|
|
323
|
+
provider_uri: Optional[str] | Omit = omit,
|
|
324
|
+
resource: Optional[str] | Omit = omit,
|
|
325
|
+
time_to_first_completion_token_ms: Optional[int] | Omit = omit,
|
|
326
|
+
time_to_first_token_ms: Optional[int] | Omit = omit,
|
|
327
|
+
use_case_properties: Optional[Dict[str, str]] | Omit = omit,
|
|
328
|
+
limit_ids: Optional[list[str]] | Omit = omit,
|
|
329
|
+
request_tags: Optional[list[str]] | Omit = omit,
|
|
330
|
+
use_case_id: Optional[str] | Omit = omit,
|
|
331
|
+
use_case_name: Optional[str] | Omit = omit,
|
|
332
|
+
use_case_step: Optional[str] | Omit = omit,
|
|
333
|
+
use_case_version: Optional[int] | Omit = omit,
|
|
334
|
+
user_id: Optional[str] | Omit = omit,
|
|
335
|
+
resource_scope: Union[str, None] | Omit = omit,
|
|
336
|
+
account_name: Optional[str] | Omit = omit,
|
|
346
337
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
347
338
|
extra_headers: Headers | None = None,
|
|
348
339
|
extra_query: Query | None = None,
|
|
349
340
|
extra_body: Body | None = None,
|
|
350
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
341
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
351
342
|
) -> IngestResponse:
|
|
352
343
|
"""
|
|
353
344
|
Ingest an Event
|
|
@@ -393,63 +384,54 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
393
384
|
|
|
394
385
|
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
395
386
|
"""
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
use_case_version_str: str |
|
|
387
|
+
request_tags = request_tags
|
|
388
|
+
valid_ids_str: str | Omit = omit
|
|
389
|
+
use_case_version_str: str | Omit = omit
|
|
399
390
|
|
|
400
|
-
if limit_ids is None or
|
|
401
|
-
valid_ids_str =
|
|
391
|
+
if limit_ids is None or not is_given(limit_ids):
|
|
392
|
+
valid_ids_str = omit
|
|
402
393
|
elif not isinstance(limit_ids, list): # type: ignore
|
|
403
394
|
raise TypeError("limit_ids must be a list")
|
|
404
395
|
else:
|
|
405
|
-
# Proceed with the list comprehension if limit_ids is
|
|
396
|
+
# Proceed with the list comprehension if limit_ids is given
|
|
406
397
|
valid_ids = [id.strip() for id in limit_ids if id.strip()]
|
|
407
|
-
valid_ids_str = ",".join(valid_ids) if valid_ids else
|
|
398
|
+
valid_ids_str = ",".join(valid_ids) if valid_ids else omit
|
|
408
399
|
|
|
409
|
-
if
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if use_case_step is None or isinstance(use_case_step, NotGiven):
|
|
422
|
-
use_case_step = NOT_GIVEN
|
|
423
|
-
|
|
424
|
-
if use_case_id is None or isinstance(use_case_id, NotGiven):
|
|
425
|
-
use_case_id = NOT_GIVEN
|
|
426
|
-
|
|
427
|
-
if use_case_version is None or isinstance(use_case_version, NotGiven):
|
|
428
|
-
use_case_version_str = NOT_GIVEN
|
|
400
|
+
if use_case_name is None or not is_given(use_case_name):
|
|
401
|
+
use_case_name = omit
|
|
402
|
+
|
|
403
|
+
if use_case_step is None or not is_given(use_case_step):
|
|
404
|
+
use_case_step = omit
|
|
405
|
+
|
|
406
|
+
if use_case_id is None or not is_given(use_case_id):
|
|
407
|
+
use_case_id = omit
|
|
408
|
+
|
|
409
|
+
if use_case_version is None or not is_given(use_case_version):
|
|
410
|
+
use_case_version_str = omit
|
|
429
411
|
else:
|
|
430
412
|
use_case_version_str = str(use_case_version)
|
|
431
413
|
|
|
432
|
-
if user_id is None or
|
|
433
|
-
user_id =
|
|
414
|
+
if user_id is None or not is_given(user_id):
|
|
415
|
+
user_id = omit
|
|
434
416
|
|
|
435
|
-
if resource_scope is None or
|
|
436
|
-
resource_scope =
|
|
417
|
+
if resource_scope is None or not is_given(resource_scope):
|
|
418
|
+
resource_scope = omit
|
|
437
419
|
|
|
438
|
-
if account_name is None or
|
|
439
|
-
account_name =
|
|
420
|
+
if account_name is None or not is_given(account_name):
|
|
421
|
+
account_name = omit
|
|
440
422
|
|
|
441
423
|
extra_headers = {
|
|
442
424
|
**strip_not_given(
|
|
443
425
|
{
|
|
444
426
|
"xProxy-Account-Name": account_name,
|
|
445
427
|
"xProxy-Limit-IDs": valid_ids_str,
|
|
446
|
-
"xProxy-Request-Tags":
|
|
428
|
+
"xProxy-Request-Tags": omit,
|
|
447
429
|
"xProxy-UseCase-ID": use_case_id,
|
|
448
430
|
"xProxy-UseCase-Name": use_case_name,
|
|
449
431
|
"xProxy-UseCase-Step": use_case_step,
|
|
450
432
|
"xProxy-UseCase-Version": use_case_version_str
|
|
451
433
|
if is_given(use_case_version)
|
|
452
|
-
else
|
|
434
|
+
else omit,
|
|
453
435
|
"xProxy-User-ID": user_id,
|
|
454
436
|
"xProxy-Resource-Scope": resource_scope,
|
|
455
437
|
}
|