scale-gp-beta 0.1.0a12__py3-none-any.whl → 0.1.0a14__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.
- scale_gp_beta/__init__.py +5 -0
- scale_gp_beta/_utils/_proxy.py +4 -1
- scale_gp_beta/_utils/_resources_proxy.py +24 -0
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/pagination.py +39 -1
- scale_gp_beta/resources/chat/completions.py +136 -1
- scale_gp_beta/resources/dataset_items.py +29 -21
- scale_gp_beta/resources/datasets.py +18 -5
- scale_gp_beta/resources/evaluation_items.py +11 -7
- scale_gp_beta/resources/evaluations.py +142 -21
- scale_gp_beta/resources/files/files.py +10 -5
- scale_gp_beta/resources/models.py +35 -35
- scale_gp_beta/resources/spans.py +312 -24
- scale_gp_beta/types/__init__.py +9 -2
- scale_gp_beta/types/chat/__init__.py +3 -0
- scale_gp_beta/types/chat/completion_models_params.py +31 -0
- scale_gp_beta/types/{dataset_item_batch_create_response.py → chat/completion_models_response.py} +5 -5
- scale_gp_beta/types/chat/model_definition.py +32 -0
- scale_gp_beta/types/component.py +18 -0
- scale_gp_beta/types/component_param.py +19 -0
- scale_gp_beta/types/container.py +35 -0
- scale_gp_beta/types/container_param.py +28 -0
- scale_gp_beta/types/dataset_item.py +2 -0
- scale_gp_beta/types/dataset_item_list_params.py +7 -6
- scale_gp_beta/types/dataset_item_retrieve_params.py +1 -2
- scale_gp_beta/types/dataset_list_params.py +10 -4
- scale_gp_beta/types/evaluation.py +12 -2
- scale_gp_beta/types/evaluation_create_params.py +5 -5
- scale_gp_beta/types/{evaluation_archive_response.py → evaluation_delete_response.py} +2 -2
- scale_gp_beta/types/evaluation_item_list_params.py +6 -5
- scale_gp_beta/types/evaluation_list_params.py +9 -3
- scale_gp_beta/types/evaluation_task.py +139 -33
- scale_gp_beta/types/evaluation_task_param.py +88 -33
- scale_gp_beta/types/evaluation_update_params.py +17 -0
- scale_gp_beta/types/file_list_params.py +5 -4
- scale_gp_beta/types/inference_model.py +0 -4
- scale_gp_beta/types/item_locator.py +7 -0
- scale_gp_beta/types/item_locator_template.py +7 -0
- scale_gp_beta/types/model_list_params.py +17 -18
- scale_gp_beta/types/span.py +40 -1
- scale_gp_beta/types/span_batch_params.py +130 -0
- scale_gp_beta/types/span_create_params.py +71 -3
- scale_gp_beta/types/span_list_params.py +7 -6
- scale_gp_beta/types/span_update_params.py +5 -3
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/METADATA +1 -1
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/RECORD +48 -37
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/licenses/LICENSE +0 -0
scale_gp_beta/resources/spans.py
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Union,
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
6
|
from datetime import datetime
|
|
7
|
-
from typing_extensions import overload
|
|
7
|
+
from typing_extensions import Literal, overload
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
|
-
from ..types import span_list_params, span_create_params, span_update_params
|
|
11
|
+
from ..types import span_list_params, span_batch_params, span_create_params, span_update_params
|
|
12
12
|
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
13
13
|
from .._utils import required_args, maybe_transform, async_maybe_transform
|
|
14
14
|
from .._compat import cached_property
|
|
@@ -19,7 +19,7 @@ from .._response import (
|
|
|
19
19
|
async_to_raw_response_wrapper,
|
|
20
20
|
async_to_streamed_response_wrapper,
|
|
21
21
|
)
|
|
22
|
-
from ..pagination import SyncCursorPage, AsyncCursorPage
|
|
22
|
+
from ..pagination import SyncCursorPage, AsyncCursorPage, SyncAPIListPage, AsyncAPIListPage
|
|
23
23
|
from ..types.span import Span
|
|
24
24
|
from .._base_client import AsyncPaginator, make_request_options
|
|
25
25
|
|
|
@@ -53,11 +53,42 @@ class SpansResource(SyncAPIResource):
|
|
|
53
53
|
name: str,
|
|
54
54
|
start_timestamp: Union[str, datetime],
|
|
55
55
|
trace_id: str,
|
|
56
|
-
|
|
56
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
57
57
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
58
58
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
59
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
59
60
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
60
61
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
62
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
63
|
+
type: Literal[
|
|
64
|
+
"TEXT_INPUT",
|
|
65
|
+
"TEXT_OUTPUT",
|
|
66
|
+
"COMPLETION_INPUT",
|
|
67
|
+
"COMPLETION",
|
|
68
|
+
"KB_RETRIEVAL",
|
|
69
|
+
"KB_INPUT",
|
|
70
|
+
"RERANKING",
|
|
71
|
+
"EXTERNAL_ENDPOINT",
|
|
72
|
+
"PROMPT_ENGINEERING",
|
|
73
|
+
"DOCUMENT_INPUT",
|
|
74
|
+
"MAP_REDUCE",
|
|
75
|
+
"DOCUMENT_SEARCH",
|
|
76
|
+
"DOCUMENT_PROMPT",
|
|
77
|
+
"CUSTOM",
|
|
78
|
+
"INPUT_GUARDRAIL",
|
|
79
|
+
"OUTPUT_GUARDRAIL",
|
|
80
|
+
"CODE_EXECUTION",
|
|
81
|
+
"DATA_MANIPULATION",
|
|
82
|
+
"EVALUATION",
|
|
83
|
+
"FILE_RETRIEVAL",
|
|
84
|
+
"KB_ADD_CHUNK",
|
|
85
|
+
"KB_MANAGEMENT",
|
|
86
|
+
"TRACER",
|
|
87
|
+
"AGENT_TRACER",
|
|
88
|
+
"AGENT_WORKFLOW",
|
|
89
|
+
"STANDALONE",
|
|
90
|
+
]
|
|
91
|
+
| NotGiven = NOT_GIVEN,
|
|
61
92
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
62
93
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
63
94
|
extra_headers: Headers | None = None,
|
|
@@ -71,6 +102,8 @@ class SpansResource(SyncAPIResource):
|
|
|
71
102
|
Args:
|
|
72
103
|
trace_id: id for grouping traces together, uuid is recommended
|
|
73
104
|
|
|
105
|
+
id: The id of the span
|
|
106
|
+
|
|
74
107
|
parent_id: Reference to a parent span_id
|
|
75
108
|
|
|
76
109
|
extra_headers: Send extra headers
|
|
@@ -92,11 +125,42 @@ class SpansResource(SyncAPIResource):
|
|
|
92
125
|
name: str,
|
|
93
126
|
start_timestamp: Union[str, datetime],
|
|
94
127
|
trace_id: str,
|
|
95
|
-
|
|
128
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
96
129
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
97
130
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
131
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
98
132
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
99
133
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
134
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
135
|
+
type: Literal[
|
|
136
|
+
"TEXT_INPUT",
|
|
137
|
+
"TEXT_OUTPUT",
|
|
138
|
+
"COMPLETION_INPUT",
|
|
139
|
+
"COMPLETION",
|
|
140
|
+
"KB_RETRIEVAL",
|
|
141
|
+
"KB_INPUT",
|
|
142
|
+
"RERANKING",
|
|
143
|
+
"EXTERNAL_ENDPOINT",
|
|
144
|
+
"PROMPT_ENGINEERING",
|
|
145
|
+
"DOCUMENT_INPUT",
|
|
146
|
+
"MAP_REDUCE",
|
|
147
|
+
"DOCUMENT_SEARCH",
|
|
148
|
+
"DOCUMENT_PROMPT",
|
|
149
|
+
"CUSTOM",
|
|
150
|
+
"INPUT_GUARDRAIL",
|
|
151
|
+
"OUTPUT_GUARDRAIL",
|
|
152
|
+
"CODE_EXECUTION",
|
|
153
|
+
"DATA_MANIPULATION",
|
|
154
|
+
"EVALUATION",
|
|
155
|
+
"FILE_RETRIEVAL",
|
|
156
|
+
"KB_ADD_CHUNK",
|
|
157
|
+
"KB_MANAGEMENT",
|
|
158
|
+
"TRACER",
|
|
159
|
+
"AGENT_TRACER",
|
|
160
|
+
"AGENT_WORKFLOW",
|
|
161
|
+
"STANDALONE",
|
|
162
|
+
]
|
|
163
|
+
| NotGiven = NOT_GIVEN,
|
|
100
164
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
165
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
166
|
extra_headers: Headers | None = None,
|
|
@@ -110,6 +174,8 @@ class SpansResource(SyncAPIResource):
|
|
|
110
174
|
Args:
|
|
111
175
|
trace_id: id for grouping traces together, uuid is recommended
|
|
112
176
|
|
|
177
|
+
id: The id of the span
|
|
178
|
+
|
|
113
179
|
parent_id: Reference to a parent span_id
|
|
114
180
|
|
|
115
181
|
extra_headers: Send extra headers
|
|
@@ -132,11 +198,42 @@ class SpansResource(SyncAPIResource):
|
|
|
132
198
|
name: str,
|
|
133
199
|
start_timestamp: Union[str, datetime],
|
|
134
200
|
trace_id: str,
|
|
135
|
-
|
|
201
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
136
202
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
137
203
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
204
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
138
205
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
139
206
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
207
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
208
|
+
type: Literal[
|
|
209
|
+
"TEXT_INPUT",
|
|
210
|
+
"TEXT_OUTPUT",
|
|
211
|
+
"COMPLETION_INPUT",
|
|
212
|
+
"COMPLETION",
|
|
213
|
+
"KB_RETRIEVAL",
|
|
214
|
+
"KB_INPUT",
|
|
215
|
+
"RERANKING",
|
|
216
|
+
"EXTERNAL_ENDPOINT",
|
|
217
|
+
"PROMPT_ENGINEERING",
|
|
218
|
+
"DOCUMENT_INPUT",
|
|
219
|
+
"MAP_REDUCE",
|
|
220
|
+
"DOCUMENT_SEARCH",
|
|
221
|
+
"DOCUMENT_PROMPT",
|
|
222
|
+
"CUSTOM",
|
|
223
|
+
"INPUT_GUARDRAIL",
|
|
224
|
+
"OUTPUT_GUARDRAIL",
|
|
225
|
+
"CODE_EXECUTION",
|
|
226
|
+
"DATA_MANIPULATION",
|
|
227
|
+
"EVALUATION",
|
|
228
|
+
"FILE_RETRIEVAL",
|
|
229
|
+
"KB_ADD_CHUNK",
|
|
230
|
+
"KB_MANAGEMENT",
|
|
231
|
+
"TRACER",
|
|
232
|
+
"AGENT_TRACER",
|
|
233
|
+
"AGENT_WORKFLOW",
|
|
234
|
+
"STANDALONE",
|
|
235
|
+
]
|
|
236
|
+
| NotGiven = NOT_GIVEN,
|
|
140
237
|
application_interaction_id: str | NotGiven = NOT_GIVEN,
|
|
141
238
|
application_variant_id: str | NotGiven = NOT_GIVEN,
|
|
142
239
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -153,11 +250,14 @@ class SpansResource(SyncAPIResource):
|
|
|
153
250
|
"name": name,
|
|
154
251
|
"start_timestamp": start_timestamp,
|
|
155
252
|
"trace_id": trace_id,
|
|
156
|
-
"
|
|
253
|
+
"id": id,
|
|
157
254
|
"end_timestamp": end_timestamp,
|
|
158
255
|
"input": input,
|
|
256
|
+
"metadata": metadata,
|
|
159
257
|
"output": output,
|
|
160
258
|
"parent_id": parent_id,
|
|
259
|
+
"status": status,
|
|
260
|
+
"type": type,
|
|
161
261
|
"application_interaction_id": application_interaction_id,
|
|
162
262
|
"application_variant_id": application_variant_id,
|
|
163
263
|
},
|
|
@@ -206,10 +306,11 @@ class SpansResource(SyncAPIResource):
|
|
|
206
306
|
self,
|
|
207
307
|
span_id: str,
|
|
208
308
|
*,
|
|
209
|
-
data: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
210
309
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
310
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
211
311
|
name: str | NotGiven = NOT_GIVEN,
|
|
212
312
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
313
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
213
314
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
214
315
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
215
316
|
extra_headers: Headers | None = None,
|
|
@@ -235,10 +336,11 @@ class SpansResource(SyncAPIResource):
|
|
|
235
336
|
f"/v5/spans/{span_id}",
|
|
236
337
|
body=maybe_transform(
|
|
237
338
|
{
|
|
238
|
-
"data": data,
|
|
239
339
|
"end_timestamp": end_timestamp,
|
|
340
|
+
"metadata": metadata,
|
|
240
341
|
"name": name,
|
|
241
342
|
"output": output,
|
|
343
|
+
"status": status,
|
|
242
344
|
},
|
|
243
345
|
span_update_params.SpanUpdateParams,
|
|
244
346
|
),
|
|
@@ -251,13 +353,14 @@ class SpansResource(SyncAPIResource):
|
|
|
251
353
|
def list(
|
|
252
354
|
self,
|
|
253
355
|
*,
|
|
254
|
-
ending_before:
|
|
356
|
+
ending_before: str | NotGiven = NOT_GIVEN,
|
|
255
357
|
from_ts: int | NotGiven = NOT_GIVEN,
|
|
256
358
|
limit: int | NotGiven = NOT_GIVEN,
|
|
257
|
-
parents_only:
|
|
258
|
-
|
|
359
|
+
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
360
|
+
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
361
|
+
starting_after: str | NotGiven = NOT_GIVEN,
|
|
259
362
|
to_ts: int | NotGiven = NOT_GIVEN,
|
|
260
|
-
trace_id:
|
|
363
|
+
trace_id: str | NotGiven = NOT_GIVEN,
|
|
261
364
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
365
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
366
|
extra_headers: Headers | None = None,
|
|
@@ -295,6 +398,7 @@ class SpansResource(SyncAPIResource):
|
|
|
295
398
|
"from_ts": from_ts,
|
|
296
399
|
"limit": limit,
|
|
297
400
|
"parents_only": parents_only,
|
|
401
|
+
"sort_order": sort_order,
|
|
298
402
|
"starting_after": starting_after,
|
|
299
403
|
"to_ts": to_ts,
|
|
300
404
|
"trace_id": trace_id,
|
|
@@ -305,6 +409,40 @@ class SpansResource(SyncAPIResource):
|
|
|
305
409
|
model=Span,
|
|
306
410
|
)
|
|
307
411
|
|
|
412
|
+
def batch(
|
|
413
|
+
self,
|
|
414
|
+
*,
|
|
415
|
+
items: Iterable[span_batch_params.Item],
|
|
416
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
417
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
418
|
+
extra_headers: Headers | None = None,
|
|
419
|
+
extra_query: Query | None = None,
|
|
420
|
+
extra_body: Body | None = None,
|
|
421
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
422
|
+
) -> SyncAPIListPage[Span]:
|
|
423
|
+
"""
|
|
424
|
+
Create Spans in Batch
|
|
425
|
+
|
|
426
|
+
Args:
|
|
427
|
+
extra_headers: Send extra headers
|
|
428
|
+
|
|
429
|
+
extra_query: Add additional query parameters to the request
|
|
430
|
+
|
|
431
|
+
extra_body: Add additional JSON properties to the request
|
|
432
|
+
|
|
433
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
434
|
+
"""
|
|
435
|
+
return self._get_api_list(
|
|
436
|
+
"/v5/spans/batch",
|
|
437
|
+
page=SyncAPIListPage[Span],
|
|
438
|
+
body=maybe_transform({"items": items}, span_batch_params.SpanBatchParams),
|
|
439
|
+
options=make_request_options(
|
|
440
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
441
|
+
),
|
|
442
|
+
model=Span,
|
|
443
|
+
method="post",
|
|
444
|
+
)
|
|
445
|
+
|
|
308
446
|
|
|
309
447
|
class AsyncSpansResource(AsyncAPIResource):
|
|
310
448
|
@cached_property
|
|
@@ -333,11 +471,42 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
333
471
|
name: str,
|
|
334
472
|
start_timestamp: Union[str, datetime],
|
|
335
473
|
trace_id: str,
|
|
336
|
-
|
|
474
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
337
475
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
338
476
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
477
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
339
478
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
340
479
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
480
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
481
|
+
type: Literal[
|
|
482
|
+
"TEXT_INPUT",
|
|
483
|
+
"TEXT_OUTPUT",
|
|
484
|
+
"COMPLETION_INPUT",
|
|
485
|
+
"COMPLETION",
|
|
486
|
+
"KB_RETRIEVAL",
|
|
487
|
+
"KB_INPUT",
|
|
488
|
+
"RERANKING",
|
|
489
|
+
"EXTERNAL_ENDPOINT",
|
|
490
|
+
"PROMPT_ENGINEERING",
|
|
491
|
+
"DOCUMENT_INPUT",
|
|
492
|
+
"MAP_REDUCE",
|
|
493
|
+
"DOCUMENT_SEARCH",
|
|
494
|
+
"DOCUMENT_PROMPT",
|
|
495
|
+
"CUSTOM",
|
|
496
|
+
"INPUT_GUARDRAIL",
|
|
497
|
+
"OUTPUT_GUARDRAIL",
|
|
498
|
+
"CODE_EXECUTION",
|
|
499
|
+
"DATA_MANIPULATION",
|
|
500
|
+
"EVALUATION",
|
|
501
|
+
"FILE_RETRIEVAL",
|
|
502
|
+
"KB_ADD_CHUNK",
|
|
503
|
+
"KB_MANAGEMENT",
|
|
504
|
+
"TRACER",
|
|
505
|
+
"AGENT_TRACER",
|
|
506
|
+
"AGENT_WORKFLOW",
|
|
507
|
+
"STANDALONE",
|
|
508
|
+
]
|
|
509
|
+
| NotGiven = NOT_GIVEN,
|
|
341
510
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
342
511
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
343
512
|
extra_headers: Headers | None = None,
|
|
@@ -351,6 +520,8 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
351
520
|
Args:
|
|
352
521
|
trace_id: id for grouping traces together, uuid is recommended
|
|
353
522
|
|
|
523
|
+
id: The id of the span
|
|
524
|
+
|
|
354
525
|
parent_id: Reference to a parent span_id
|
|
355
526
|
|
|
356
527
|
extra_headers: Send extra headers
|
|
@@ -372,11 +543,42 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
372
543
|
name: str,
|
|
373
544
|
start_timestamp: Union[str, datetime],
|
|
374
545
|
trace_id: str,
|
|
375
|
-
|
|
546
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
376
547
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
377
548
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
549
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
378
550
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
379
551
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
552
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
553
|
+
type: Literal[
|
|
554
|
+
"TEXT_INPUT",
|
|
555
|
+
"TEXT_OUTPUT",
|
|
556
|
+
"COMPLETION_INPUT",
|
|
557
|
+
"COMPLETION",
|
|
558
|
+
"KB_RETRIEVAL",
|
|
559
|
+
"KB_INPUT",
|
|
560
|
+
"RERANKING",
|
|
561
|
+
"EXTERNAL_ENDPOINT",
|
|
562
|
+
"PROMPT_ENGINEERING",
|
|
563
|
+
"DOCUMENT_INPUT",
|
|
564
|
+
"MAP_REDUCE",
|
|
565
|
+
"DOCUMENT_SEARCH",
|
|
566
|
+
"DOCUMENT_PROMPT",
|
|
567
|
+
"CUSTOM",
|
|
568
|
+
"INPUT_GUARDRAIL",
|
|
569
|
+
"OUTPUT_GUARDRAIL",
|
|
570
|
+
"CODE_EXECUTION",
|
|
571
|
+
"DATA_MANIPULATION",
|
|
572
|
+
"EVALUATION",
|
|
573
|
+
"FILE_RETRIEVAL",
|
|
574
|
+
"KB_ADD_CHUNK",
|
|
575
|
+
"KB_MANAGEMENT",
|
|
576
|
+
"TRACER",
|
|
577
|
+
"AGENT_TRACER",
|
|
578
|
+
"AGENT_WORKFLOW",
|
|
579
|
+
"STANDALONE",
|
|
580
|
+
]
|
|
581
|
+
| NotGiven = NOT_GIVEN,
|
|
380
582
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
381
583
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
382
584
|
extra_headers: Headers | None = None,
|
|
@@ -390,6 +592,8 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
390
592
|
Args:
|
|
391
593
|
trace_id: id for grouping traces together, uuid is recommended
|
|
392
594
|
|
|
595
|
+
id: The id of the span
|
|
596
|
+
|
|
393
597
|
parent_id: Reference to a parent span_id
|
|
394
598
|
|
|
395
599
|
extra_headers: Send extra headers
|
|
@@ -412,11 +616,42 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
412
616
|
name: str,
|
|
413
617
|
start_timestamp: Union[str, datetime],
|
|
414
618
|
trace_id: str,
|
|
415
|
-
|
|
619
|
+
id: str | NotGiven = NOT_GIVEN,
|
|
416
620
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
417
621
|
input: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
622
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
418
623
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
419
624
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
625
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
626
|
+
type: Literal[
|
|
627
|
+
"TEXT_INPUT",
|
|
628
|
+
"TEXT_OUTPUT",
|
|
629
|
+
"COMPLETION_INPUT",
|
|
630
|
+
"COMPLETION",
|
|
631
|
+
"KB_RETRIEVAL",
|
|
632
|
+
"KB_INPUT",
|
|
633
|
+
"RERANKING",
|
|
634
|
+
"EXTERNAL_ENDPOINT",
|
|
635
|
+
"PROMPT_ENGINEERING",
|
|
636
|
+
"DOCUMENT_INPUT",
|
|
637
|
+
"MAP_REDUCE",
|
|
638
|
+
"DOCUMENT_SEARCH",
|
|
639
|
+
"DOCUMENT_PROMPT",
|
|
640
|
+
"CUSTOM",
|
|
641
|
+
"INPUT_GUARDRAIL",
|
|
642
|
+
"OUTPUT_GUARDRAIL",
|
|
643
|
+
"CODE_EXECUTION",
|
|
644
|
+
"DATA_MANIPULATION",
|
|
645
|
+
"EVALUATION",
|
|
646
|
+
"FILE_RETRIEVAL",
|
|
647
|
+
"KB_ADD_CHUNK",
|
|
648
|
+
"KB_MANAGEMENT",
|
|
649
|
+
"TRACER",
|
|
650
|
+
"AGENT_TRACER",
|
|
651
|
+
"AGENT_WORKFLOW",
|
|
652
|
+
"STANDALONE",
|
|
653
|
+
]
|
|
654
|
+
| NotGiven = NOT_GIVEN,
|
|
420
655
|
application_interaction_id: str | NotGiven = NOT_GIVEN,
|
|
421
656
|
application_variant_id: str | NotGiven = NOT_GIVEN,
|
|
422
657
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -433,11 +668,14 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
433
668
|
"name": name,
|
|
434
669
|
"start_timestamp": start_timestamp,
|
|
435
670
|
"trace_id": trace_id,
|
|
436
|
-
"
|
|
671
|
+
"id": id,
|
|
437
672
|
"end_timestamp": end_timestamp,
|
|
438
673
|
"input": input,
|
|
674
|
+
"metadata": metadata,
|
|
439
675
|
"output": output,
|
|
440
676
|
"parent_id": parent_id,
|
|
677
|
+
"status": status,
|
|
678
|
+
"type": type,
|
|
441
679
|
"application_interaction_id": application_interaction_id,
|
|
442
680
|
"application_variant_id": application_variant_id,
|
|
443
681
|
},
|
|
@@ -486,10 +724,11 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
486
724
|
self,
|
|
487
725
|
span_id: str,
|
|
488
726
|
*,
|
|
489
|
-
data: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
490
727
|
end_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
728
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
491
729
|
name: str | NotGiven = NOT_GIVEN,
|
|
492
730
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
731
|
+
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
493
732
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
494
733
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
495
734
|
extra_headers: Headers | None = None,
|
|
@@ -515,10 +754,11 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
515
754
|
f"/v5/spans/{span_id}",
|
|
516
755
|
body=await async_maybe_transform(
|
|
517
756
|
{
|
|
518
|
-
"data": data,
|
|
519
757
|
"end_timestamp": end_timestamp,
|
|
758
|
+
"metadata": metadata,
|
|
520
759
|
"name": name,
|
|
521
760
|
"output": output,
|
|
761
|
+
"status": status,
|
|
522
762
|
},
|
|
523
763
|
span_update_params.SpanUpdateParams,
|
|
524
764
|
),
|
|
@@ -531,13 +771,14 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
531
771
|
def list(
|
|
532
772
|
self,
|
|
533
773
|
*,
|
|
534
|
-
ending_before:
|
|
774
|
+
ending_before: str | NotGiven = NOT_GIVEN,
|
|
535
775
|
from_ts: int | NotGiven = NOT_GIVEN,
|
|
536
776
|
limit: int | NotGiven = NOT_GIVEN,
|
|
537
|
-
parents_only:
|
|
538
|
-
|
|
777
|
+
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
778
|
+
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
779
|
+
starting_after: str | NotGiven = NOT_GIVEN,
|
|
539
780
|
to_ts: int | NotGiven = NOT_GIVEN,
|
|
540
|
-
trace_id:
|
|
781
|
+
trace_id: str | NotGiven = NOT_GIVEN,
|
|
541
782
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
542
783
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
543
784
|
extra_headers: Headers | None = None,
|
|
@@ -575,6 +816,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
575
816
|
"from_ts": from_ts,
|
|
576
817
|
"limit": limit,
|
|
577
818
|
"parents_only": parents_only,
|
|
819
|
+
"sort_order": sort_order,
|
|
578
820
|
"starting_after": starting_after,
|
|
579
821
|
"to_ts": to_ts,
|
|
580
822
|
"trace_id": trace_id,
|
|
@@ -585,6 +827,40 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
585
827
|
model=Span,
|
|
586
828
|
)
|
|
587
829
|
|
|
830
|
+
def batch(
|
|
831
|
+
self,
|
|
832
|
+
*,
|
|
833
|
+
items: Iterable[span_batch_params.Item],
|
|
834
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
835
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
836
|
+
extra_headers: Headers | None = None,
|
|
837
|
+
extra_query: Query | None = None,
|
|
838
|
+
extra_body: Body | None = None,
|
|
839
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
840
|
+
) -> AsyncPaginator[Span, AsyncAPIListPage[Span]]:
|
|
841
|
+
"""
|
|
842
|
+
Create Spans in Batch
|
|
843
|
+
|
|
844
|
+
Args:
|
|
845
|
+
extra_headers: Send extra headers
|
|
846
|
+
|
|
847
|
+
extra_query: Add additional query parameters to the request
|
|
848
|
+
|
|
849
|
+
extra_body: Add additional JSON properties to the request
|
|
850
|
+
|
|
851
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
852
|
+
"""
|
|
853
|
+
return self._get_api_list(
|
|
854
|
+
"/v5/spans/batch",
|
|
855
|
+
page=AsyncAPIListPage[Span],
|
|
856
|
+
body=maybe_transform({"items": items}, span_batch_params.SpanBatchParams),
|
|
857
|
+
options=make_request_options(
|
|
858
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
859
|
+
),
|
|
860
|
+
model=Span,
|
|
861
|
+
method="post",
|
|
862
|
+
)
|
|
863
|
+
|
|
588
864
|
|
|
589
865
|
class SpansResourceWithRawResponse:
|
|
590
866
|
def __init__(self, spans: SpansResource) -> None:
|
|
@@ -602,6 +878,9 @@ class SpansResourceWithRawResponse:
|
|
|
602
878
|
self.list = to_raw_response_wrapper(
|
|
603
879
|
spans.list,
|
|
604
880
|
)
|
|
881
|
+
self.batch = to_raw_response_wrapper(
|
|
882
|
+
spans.batch,
|
|
883
|
+
)
|
|
605
884
|
|
|
606
885
|
|
|
607
886
|
class AsyncSpansResourceWithRawResponse:
|
|
@@ -620,6 +899,9 @@ class AsyncSpansResourceWithRawResponse:
|
|
|
620
899
|
self.list = async_to_raw_response_wrapper(
|
|
621
900
|
spans.list,
|
|
622
901
|
)
|
|
902
|
+
self.batch = async_to_raw_response_wrapper(
|
|
903
|
+
spans.batch,
|
|
904
|
+
)
|
|
623
905
|
|
|
624
906
|
|
|
625
907
|
class SpansResourceWithStreamingResponse:
|
|
@@ -638,6 +920,9 @@ class SpansResourceWithStreamingResponse:
|
|
|
638
920
|
self.list = to_streamed_response_wrapper(
|
|
639
921
|
spans.list,
|
|
640
922
|
)
|
|
923
|
+
self.batch = to_streamed_response_wrapper(
|
|
924
|
+
spans.batch,
|
|
925
|
+
)
|
|
641
926
|
|
|
642
927
|
|
|
643
928
|
class AsyncSpansResourceWithStreamingResponse:
|
|
@@ -656,3 +941,6 @@ class AsyncSpansResourceWithStreamingResponse:
|
|
|
656
941
|
self.list = async_to_streamed_response_wrapper(
|
|
657
942
|
spans.list,
|
|
658
943
|
)
|
|
944
|
+
self.batch = async_to_streamed_response_wrapper(
|
|
945
|
+
spans.batch,
|
|
946
|
+
)
|
scale_gp_beta/types/__init__.py
CHANGED
|
@@ -5,16 +5,22 @@ from __future__ import annotations
|
|
|
5
5
|
from .file import File as File
|
|
6
6
|
from .span import Span as Span
|
|
7
7
|
from .dataset import Dataset as Dataset
|
|
8
|
+
from .component import Component as Component
|
|
9
|
+
from .container import Container as Container
|
|
8
10
|
from .file_list import FileList as FileList
|
|
9
11
|
from .completion import Completion as Completion
|
|
10
12
|
from .evaluation import Evaluation as Evaluation
|
|
11
13
|
from .dataset_item import DatasetItem as DatasetItem
|
|
14
|
+
from .item_locator import ItemLocator as ItemLocator
|
|
15
|
+
from .component_param import ComponentParam as ComponentParam
|
|
16
|
+
from .container_param import ContainerParam as ContainerParam
|
|
12
17
|
from .evaluation_item import EvaluationItem as EvaluationItem
|
|
13
18
|
from .evaluation_task import EvaluationTask as EvaluationTask
|
|
14
19
|
from .inference_model import InferenceModel as InferenceModel
|
|
15
20
|
from .file_list_params import FileListParams as FileListParams
|
|
16
21
|
from .span_list_params import SpanListParams as SpanListParams
|
|
17
22
|
from .model_list_params import ModelListParams as ModelListParams
|
|
23
|
+
from .span_batch_params import SpanBatchParams as SpanBatchParams
|
|
18
24
|
from .file_create_params import FileCreateParams as FileCreateParams
|
|
19
25
|
from .file_update_params import FileUpdateParams as FileUpdateParams
|
|
20
26
|
from .inference_response import InferenceResponse as InferenceResponse
|
|
@@ -28,6 +34,7 @@ from .inference_model_list import InferenceModelList as InferenceModelList
|
|
|
28
34
|
from .dataset_create_params import DatasetCreateParams as DatasetCreateParams
|
|
29
35
|
from .dataset_update_params import DatasetUpdateParams as DatasetUpdateParams
|
|
30
36
|
from .evaluation_task_param import EvaluationTaskParam as EvaluationTaskParam
|
|
37
|
+
from .item_locator_template import ItemLocatorTemplate as ItemLocatorTemplate
|
|
31
38
|
from .model_delete_response import ModelDeleteResponse as ModelDeleteResponse
|
|
32
39
|
from .evaluation_list_params import EvaluationListParams as EvaluationListParams
|
|
33
40
|
from .dataset_delete_response import DatasetDeleteResponse as DatasetDeleteResponse
|
|
@@ -36,14 +43,14 @@ from .inference_create_params import InferenceCreateParams as InferenceCreatePar
|
|
|
36
43
|
from .completion_create_params import CompletionCreateParams as CompletionCreateParams
|
|
37
44
|
from .dataset_item_list_params import DatasetItemListParams as DatasetItemListParams
|
|
38
45
|
from .evaluation_create_params import EvaluationCreateParams as EvaluationCreateParams
|
|
46
|
+
from .evaluation_update_params import EvaluationUpdateParams as EvaluationUpdateParams
|
|
39
47
|
from .inference_response_chunk import InferenceResponseChunk as InferenceResponseChunk
|
|
40
48
|
from .inference_create_response import InferenceCreateResponse as InferenceCreateResponse
|
|
41
49
|
from .dataset_item_update_params import DatasetItemUpdateParams as DatasetItemUpdateParams
|
|
50
|
+
from .evaluation_delete_response import EvaluationDeleteResponse as EvaluationDeleteResponse
|
|
42
51
|
from .evaluation_retrieve_params import EvaluationRetrieveParams as EvaluationRetrieveParams
|
|
43
|
-
from .evaluation_archive_response import EvaluationArchiveResponse as EvaluationArchiveResponse
|
|
44
52
|
from .evaluation_item_list_params import EvaluationItemListParams as EvaluationItemListParams
|
|
45
53
|
from .dataset_item_delete_response import DatasetItemDeleteResponse as DatasetItemDeleteResponse
|
|
46
54
|
from .dataset_item_retrieve_params import DatasetItemRetrieveParams as DatasetItemRetrieveParams
|
|
47
55
|
from .evaluation_item_retrieve_params import EvaluationItemRetrieveParams as EvaluationItemRetrieveParams
|
|
48
56
|
from .dataset_item_batch_create_params import DatasetItemBatchCreateParams as DatasetItemBatchCreateParams
|
|
49
|
-
from .dataset_item_batch_create_response import DatasetItemBatchCreateResponse as DatasetItemBatchCreateResponse
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from .chat_completion import ChatCompletion as ChatCompletion
|
|
6
|
+
from .model_definition import ModelDefinition as ModelDefinition
|
|
6
7
|
from .chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
|
|
7
8
|
from .completion_create_params import CompletionCreateParams as CompletionCreateParams
|
|
9
|
+
from .completion_models_params import CompletionModelsParams as CompletionModelsParams
|
|
8
10
|
from .completion_create_response import CompletionCreateResponse as CompletionCreateResponse
|
|
11
|
+
from .completion_models_response import CompletionModelsResponse as CompletionModelsResponse
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["CompletionModelsParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CompletionModelsParams(TypedDict, total=False):
|
|
11
|
+
ending_before: str
|
|
12
|
+
|
|
13
|
+
limit: int
|
|
14
|
+
|
|
15
|
+
model_vendor: Literal[
|
|
16
|
+
"openai",
|
|
17
|
+
"cohere",
|
|
18
|
+
"vertex_ai",
|
|
19
|
+
"anthropic",
|
|
20
|
+
"azure",
|
|
21
|
+
"gemini",
|
|
22
|
+
"launch",
|
|
23
|
+
"llmengine",
|
|
24
|
+
"model_zoo",
|
|
25
|
+
"bedrock",
|
|
26
|
+
"xai",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
sort_order: Literal["asc", "desc"]
|
|
30
|
+
|
|
31
|
+
starting_after: str
|
scale_gp_beta/types/{dataset_item_batch_create_response.py → chat/completion_models_response.py}
RENAMED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
from typing import List, Optional
|
|
4
4
|
from typing_extensions import Literal
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from .
|
|
6
|
+
from ..._models import BaseModel
|
|
7
|
+
from .model_definition import ModelDefinition
|
|
8
8
|
|
|
9
|
-
__all__ = ["
|
|
9
|
+
__all__ = ["CompletionModelsResponse"]
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
items: List[
|
|
12
|
+
class CompletionModelsResponse(BaseModel):
|
|
13
|
+
items: List[ModelDefinition]
|
|
14
14
|
|
|
15
15
|
object: Optional[Literal["list"]] = None
|