scale-gp-beta 0.1.0a23__py3-none-any.whl → 0.1.0a25__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 +2 -1
- scale_gp_beta/_base_client.py +22 -0
- scale_gp_beta/_client.py +19 -1
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/lib/tracing/span.py +84 -53
- scale_gp_beta/lib/tracing/trace_queue_manager.py +7 -3
- scale_gp_beta/lib/tracing/tracing.py +9 -3
- scale_gp_beta/lib/tracing/types.py +1 -3
- scale_gp_beta/resources/__init__.py +14 -0
- scale_gp_beta/resources/chat/completions.py +4 -2
- scale_gp_beta/resources/models.py +2 -0
- scale_gp_beta/resources/questions.py +693 -0
- scale_gp_beta/resources/spans.py +124 -92
- scale_gp_beta/types/__init__.py +4 -1
- scale_gp_beta/types/chat/chat_completion.py +1 -1
- scale_gp_beta/types/chat/chat_completion_chunk.py +1 -1
- scale_gp_beta/types/chat/completion_models_params.py +1 -0
- scale_gp_beta/types/chat/model_definition.py +1 -0
- scale_gp_beta/types/inference_model.py +1 -0
- scale_gp_beta/types/model_list_params.py +1 -0
- scale_gp_beta/types/question.py +175 -0
- scale_gp_beta/types/question_create_params.py +121 -0
- scale_gp_beta/types/{span_search_response.py → question_list.py} +4 -4
- scale_gp_beta/types/question_list_params.py +17 -0
- scale_gp_beta/types/span.py +1 -3
- scale_gp_beta/types/span_batch_params.py +1 -3
- scale_gp_beta/types/span_create_params.py +1 -3
- scale_gp_beta/types/span_search_params.py +45 -33
- scale_gp_beta/types/span_update_params.py +1 -1
- scale_gp_beta/types/span_upsert_batch_params.py +1 -3
- {scale_gp_beta-0.1.0a23.dist-info → scale_gp_beta-0.1.0a25.dist-info}/METADATA +41 -1
- {scale_gp_beta-0.1.0a23.dist-info → scale_gp_beta-0.1.0a25.dist-info}/RECORD +34 -30
- {scale_gp_beta-0.1.0a23.dist-info → scale_gp_beta-0.1.0a25.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a23.dist-info → scale_gp_beta-0.1.0a25.dist-info}/licenses/LICENSE +0 -0
scale_gp_beta/resources/spans.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Union, Iterable
|
|
5
|
+
from typing import Dict, List, Union, Iterable
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Literal
|
|
8
8
|
|
|
@@ -25,10 +25,10 @@ from .._response import (
|
|
|
25
25
|
async_to_raw_response_wrapper,
|
|
26
26
|
async_to_streamed_response_wrapper,
|
|
27
27
|
)
|
|
28
|
+
from ..pagination import SyncCursorPage, AsyncCursorPage
|
|
28
29
|
from ..types.span import Span
|
|
29
|
-
from .._base_client import make_request_options
|
|
30
|
+
from .._base_client import AsyncPaginator, make_request_options
|
|
30
31
|
from ..types.span_batch_response import SpanBatchResponse
|
|
31
|
-
from ..types.span_search_response import SpanSearchResponse
|
|
32
32
|
from ..types.span_upsert_batch_response import SpanUpsertBatchResponse
|
|
33
33
|
|
|
34
34
|
__all__ = ["SpansResource", "AsyncSpansResource"]
|
|
@@ -69,7 +69,7 @@ class SpansResource(SyncAPIResource):
|
|
|
69
69
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
70
70
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
71
71
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
72
|
-
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
72
|
+
status: Literal["SUCCESS", "ERROR", "CANCELED"] | NotGiven = NOT_GIVEN,
|
|
73
73
|
type: Literal[
|
|
74
74
|
"TEXT_INPUT",
|
|
75
75
|
"TEXT_OUTPUT",
|
|
@@ -85,8 +85,6 @@ class SpansResource(SyncAPIResource):
|
|
|
85
85
|
"DOCUMENT_SEARCH",
|
|
86
86
|
"DOCUMENT_PROMPT",
|
|
87
87
|
"CUSTOM",
|
|
88
|
-
"INPUT_GUARDRAIL",
|
|
89
|
-
"OUTPUT_GUARDRAIL",
|
|
90
88
|
"CODE_EXECUTION",
|
|
91
89
|
"DATA_MANIPULATION",
|
|
92
90
|
"EVALUATION",
|
|
@@ -198,7 +196,7 @@ class SpansResource(SyncAPIResource):
|
|
|
198
196
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
199
197
|
name: str | NotGiven = NOT_GIVEN,
|
|
200
198
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
201
|
-
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
199
|
+
status: Literal["SUCCESS", "ERROR", "CANCELED"] | NotGiven = NOT_GIVEN,
|
|
202
200
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
203
201
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
204
202
|
extra_headers: Headers | None = None,
|
|
@@ -279,40 +277,44 @@ class SpansResource(SyncAPIResource):
|
|
|
279
277
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
280
278
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
281
279
|
to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
280
|
+
excluded_span_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
281
|
+
excluded_trace_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
282
282
|
extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
283
283
|
group_id: str | NotGiven = NOT_GIVEN,
|
|
284
|
-
|
|
284
|
+
names: List[str] | NotGiven = NOT_GIVEN,
|
|
285
285
|
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
286
286
|
span_id: str | NotGiven = NOT_GIVEN,
|
|
287
|
-
|
|
287
|
+
span_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
288
|
+
statuses: List[Literal["SUCCESS", "ERROR", "CANCELED"]] | NotGiven = NOT_GIVEN,
|
|
288
289
|
trace_id: str | NotGiven = NOT_GIVEN,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
290
|
+
trace_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
291
|
+
types: List[
|
|
292
|
+
Literal[
|
|
293
|
+
"TEXT_INPUT",
|
|
294
|
+
"TEXT_OUTPUT",
|
|
295
|
+
"COMPLETION_INPUT",
|
|
296
|
+
"COMPLETION",
|
|
297
|
+
"KB_RETRIEVAL",
|
|
298
|
+
"KB_INPUT",
|
|
299
|
+
"RERANKING",
|
|
300
|
+
"EXTERNAL_ENDPOINT",
|
|
301
|
+
"PROMPT_ENGINEERING",
|
|
302
|
+
"DOCUMENT_INPUT",
|
|
303
|
+
"MAP_REDUCE",
|
|
304
|
+
"DOCUMENT_SEARCH",
|
|
305
|
+
"DOCUMENT_PROMPT",
|
|
306
|
+
"CUSTOM",
|
|
307
|
+
"CODE_EXECUTION",
|
|
308
|
+
"DATA_MANIPULATION",
|
|
309
|
+
"EVALUATION",
|
|
310
|
+
"FILE_RETRIEVAL",
|
|
311
|
+
"KB_ADD_CHUNK",
|
|
312
|
+
"KB_MANAGEMENT",
|
|
313
|
+
"TRACER",
|
|
314
|
+
"AGENT_TRACER",
|
|
315
|
+
"AGENT_WORKFLOW",
|
|
316
|
+
"STANDALONE",
|
|
317
|
+
]
|
|
316
318
|
]
|
|
317
319
|
| NotGiven = NOT_GIVEN,
|
|
318
320
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -321,7 +323,7 @@ class SpansResource(SyncAPIResource):
|
|
|
321
323
|
extra_query: Query | None = None,
|
|
322
324
|
extra_body: Body | None = None,
|
|
323
325
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
324
|
-
) ->
|
|
326
|
+
) -> SyncCursorPage[Span]:
|
|
325
327
|
"""
|
|
326
328
|
Search and list spans
|
|
327
329
|
|
|
@@ -330,19 +332,27 @@ class SpansResource(SyncAPIResource):
|
|
|
330
332
|
|
|
331
333
|
to_ts: The ending (most recent) timestamp in ISO format.
|
|
332
334
|
|
|
335
|
+
excluded_span_ids: List of span IDs to exclude from results
|
|
336
|
+
|
|
337
|
+
excluded_trace_ids: List of trace IDs to exclude from results
|
|
338
|
+
|
|
333
339
|
extra_metadata: Filter on custom metadata key-value pairs
|
|
334
340
|
|
|
335
341
|
group_id: Filter by group ID
|
|
336
342
|
|
|
337
|
-
|
|
343
|
+
names: Filter by trace/span name
|
|
338
344
|
|
|
339
345
|
parents_only: Only fetch spans that are the top-level (ie. have no parent_id)
|
|
340
346
|
|
|
341
|
-
span_id: Filter by span ID
|
|
347
|
+
span_id: Filter by span ID (deprecated: use span_ids instead)
|
|
348
|
+
|
|
349
|
+
span_ids: Filter by span IDs
|
|
350
|
+
|
|
351
|
+
statuses: Filter on span status
|
|
342
352
|
|
|
343
|
-
|
|
353
|
+
trace_id: Filter by trace ID (deprecated: use trace_ids instead)
|
|
344
354
|
|
|
345
|
-
|
|
355
|
+
trace_ids: Filter by trace IDs
|
|
346
356
|
|
|
347
357
|
extra_headers: Send extra headers
|
|
348
358
|
|
|
@@ -352,18 +362,23 @@ class SpansResource(SyncAPIResource):
|
|
|
352
362
|
|
|
353
363
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
354
364
|
"""
|
|
355
|
-
return self.
|
|
365
|
+
return self._get_api_list(
|
|
356
366
|
"/v5/spans/search",
|
|
367
|
+
page=SyncCursorPage[Span],
|
|
357
368
|
body=maybe_transform(
|
|
358
369
|
{
|
|
370
|
+
"excluded_span_ids": excluded_span_ids,
|
|
371
|
+
"excluded_trace_ids": excluded_trace_ids,
|
|
359
372
|
"extra_metadata": extra_metadata,
|
|
360
373
|
"group_id": group_id,
|
|
361
|
-
"
|
|
374
|
+
"names": names,
|
|
362
375
|
"parents_only": parents_only,
|
|
363
376
|
"span_id": span_id,
|
|
364
|
-
"
|
|
377
|
+
"span_ids": span_ids,
|
|
378
|
+
"statuses": statuses,
|
|
365
379
|
"trace_id": trace_id,
|
|
366
|
-
"
|
|
380
|
+
"trace_ids": trace_ids,
|
|
381
|
+
"types": types,
|
|
367
382
|
},
|
|
368
383
|
span_search_params.SpanSearchParams,
|
|
369
384
|
),
|
|
@@ -384,7 +399,8 @@ class SpansResource(SyncAPIResource):
|
|
|
384
399
|
span_search_params.SpanSearchParams,
|
|
385
400
|
),
|
|
386
401
|
),
|
|
387
|
-
|
|
402
|
+
model=Span,
|
|
403
|
+
method="post",
|
|
388
404
|
)
|
|
389
405
|
|
|
390
406
|
def upsert_batch(
|
|
@@ -455,7 +471,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
455
471
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
456
472
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
457
473
|
parent_id: str | NotGiven = NOT_GIVEN,
|
|
458
|
-
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
474
|
+
status: Literal["SUCCESS", "ERROR", "CANCELED"] | NotGiven = NOT_GIVEN,
|
|
459
475
|
type: Literal[
|
|
460
476
|
"TEXT_INPUT",
|
|
461
477
|
"TEXT_OUTPUT",
|
|
@@ -471,8 +487,6 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
471
487
|
"DOCUMENT_SEARCH",
|
|
472
488
|
"DOCUMENT_PROMPT",
|
|
473
489
|
"CUSTOM",
|
|
474
|
-
"INPUT_GUARDRAIL",
|
|
475
|
-
"OUTPUT_GUARDRAIL",
|
|
476
490
|
"CODE_EXECUTION",
|
|
477
491
|
"DATA_MANIPULATION",
|
|
478
492
|
"EVALUATION",
|
|
@@ -584,7 +598,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
584
598
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
585
599
|
name: str | NotGiven = NOT_GIVEN,
|
|
586
600
|
output: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
587
|
-
status: Literal["SUCCESS", "ERROR"] | NotGiven = NOT_GIVEN,
|
|
601
|
+
status: Literal["SUCCESS", "ERROR", "CANCELED"] | NotGiven = NOT_GIVEN,
|
|
588
602
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
589
603
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
590
604
|
extra_headers: Headers | None = None,
|
|
@@ -656,7 +670,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
656
670
|
cast_to=SpanBatchResponse,
|
|
657
671
|
)
|
|
658
672
|
|
|
659
|
-
|
|
673
|
+
def search(
|
|
660
674
|
self,
|
|
661
675
|
*,
|
|
662
676
|
ending_before: str | NotGiven = NOT_GIVEN,
|
|
@@ -665,40 +679,44 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
665
679
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
666
680
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
667
681
|
to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
682
|
+
excluded_span_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
683
|
+
excluded_trace_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
668
684
|
extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
669
685
|
group_id: str | NotGiven = NOT_GIVEN,
|
|
670
|
-
|
|
686
|
+
names: List[str] | NotGiven = NOT_GIVEN,
|
|
671
687
|
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
672
688
|
span_id: str | NotGiven = NOT_GIVEN,
|
|
673
|
-
|
|
689
|
+
span_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
690
|
+
statuses: List[Literal["SUCCESS", "ERROR", "CANCELED"]] | NotGiven = NOT_GIVEN,
|
|
674
691
|
trace_id: str | NotGiven = NOT_GIVEN,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
692
|
+
trace_ids: List[str] | NotGiven = NOT_GIVEN,
|
|
693
|
+
types: List[
|
|
694
|
+
Literal[
|
|
695
|
+
"TEXT_INPUT",
|
|
696
|
+
"TEXT_OUTPUT",
|
|
697
|
+
"COMPLETION_INPUT",
|
|
698
|
+
"COMPLETION",
|
|
699
|
+
"KB_RETRIEVAL",
|
|
700
|
+
"KB_INPUT",
|
|
701
|
+
"RERANKING",
|
|
702
|
+
"EXTERNAL_ENDPOINT",
|
|
703
|
+
"PROMPT_ENGINEERING",
|
|
704
|
+
"DOCUMENT_INPUT",
|
|
705
|
+
"MAP_REDUCE",
|
|
706
|
+
"DOCUMENT_SEARCH",
|
|
707
|
+
"DOCUMENT_PROMPT",
|
|
708
|
+
"CUSTOM",
|
|
709
|
+
"CODE_EXECUTION",
|
|
710
|
+
"DATA_MANIPULATION",
|
|
711
|
+
"EVALUATION",
|
|
712
|
+
"FILE_RETRIEVAL",
|
|
713
|
+
"KB_ADD_CHUNK",
|
|
714
|
+
"KB_MANAGEMENT",
|
|
715
|
+
"TRACER",
|
|
716
|
+
"AGENT_TRACER",
|
|
717
|
+
"AGENT_WORKFLOW",
|
|
718
|
+
"STANDALONE",
|
|
719
|
+
]
|
|
702
720
|
]
|
|
703
721
|
| NotGiven = NOT_GIVEN,
|
|
704
722
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -707,7 +725,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
707
725
|
extra_query: Query | None = None,
|
|
708
726
|
extra_body: Body | None = None,
|
|
709
727
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
710
|
-
) ->
|
|
728
|
+
) -> AsyncPaginator[Span, AsyncCursorPage[Span]]:
|
|
711
729
|
"""
|
|
712
730
|
Search and list spans
|
|
713
731
|
|
|
@@ -716,19 +734,27 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
716
734
|
|
|
717
735
|
to_ts: The ending (most recent) timestamp in ISO format.
|
|
718
736
|
|
|
737
|
+
excluded_span_ids: List of span IDs to exclude from results
|
|
738
|
+
|
|
739
|
+
excluded_trace_ids: List of trace IDs to exclude from results
|
|
740
|
+
|
|
719
741
|
extra_metadata: Filter on custom metadata key-value pairs
|
|
720
742
|
|
|
721
743
|
group_id: Filter by group ID
|
|
722
744
|
|
|
723
|
-
|
|
745
|
+
names: Filter by trace/span name
|
|
724
746
|
|
|
725
747
|
parents_only: Only fetch spans that are the top-level (ie. have no parent_id)
|
|
726
748
|
|
|
727
|
-
span_id: Filter by span ID
|
|
749
|
+
span_id: Filter by span ID (deprecated: use span_ids instead)
|
|
728
750
|
|
|
729
|
-
|
|
751
|
+
span_ids: Filter by span IDs
|
|
730
752
|
|
|
731
|
-
|
|
753
|
+
statuses: Filter on span status
|
|
754
|
+
|
|
755
|
+
trace_id: Filter by trace ID (deprecated: use trace_ids instead)
|
|
756
|
+
|
|
757
|
+
trace_ids: Filter by trace IDs
|
|
732
758
|
|
|
733
759
|
extra_headers: Send extra headers
|
|
734
760
|
|
|
@@ -738,18 +764,23 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
738
764
|
|
|
739
765
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
740
766
|
"""
|
|
741
|
-
return
|
|
767
|
+
return self._get_api_list(
|
|
742
768
|
"/v5/spans/search",
|
|
743
|
-
|
|
769
|
+
page=AsyncCursorPage[Span],
|
|
770
|
+
body=maybe_transform(
|
|
744
771
|
{
|
|
772
|
+
"excluded_span_ids": excluded_span_ids,
|
|
773
|
+
"excluded_trace_ids": excluded_trace_ids,
|
|
745
774
|
"extra_metadata": extra_metadata,
|
|
746
775
|
"group_id": group_id,
|
|
747
|
-
"
|
|
776
|
+
"names": names,
|
|
748
777
|
"parents_only": parents_only,
|
|
749
778
|
"span_id": span_id,
|
|
750
|
-
"
|
|
779
|
+
"span_ids": span_ids,
|
|
780
|
+
"statuses": statuses,
|
|
751
781
|
"trace_id": trace_id,
|
|
752
|
-
"
|
|
782
|
+
"trace_ids": trace_ids,
|
|
783
|
+
"types": types,
|
|
753
784
|
},
|
|
754
785
|
span_search_params.SpanSearchParams,
|
|
755
786
|
),
|
|
@@ -758,7 +789,7 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
758
789
|
extra_query=extra_query,
|
|
759
790
|
extra_body=extra_body,
|
|
760
791
|
timeout=timeout,
|
|
761
|
-
query=
|
|
792
|
+
query=maybe_transform(
|
|
762
793
|
{
|
|
763
794
|
"ending_before": ending_before,
|
|
764
795
|
"from_ts": from_ts,
|
|
@@ -770,7 +801,8 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
770
801
|
span_search_params.SpanSearchParams,
|
|
771
802
|
),
|
|
772
803
|
),
|
|
773
|
-
|
|
804
|
+
model=Span,
|
|
805
|
+
method="post",
|
|
774
806
|
)
|
|
775
807
|
|
|
776
808
|
async def upsert_batch(
|
scale_gp_beta/types/__init__.py
CHANGED
|
@@ -5,6 +5,7 @@ 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 .question import Question as Question
|
|
8
9
|
from .component import Component as Component
|
|
9
10
|
from .container import Container as Container
|
|
10
11
|
from .file_list import FileList as FileList
|
|
@@ -12,6 +13,7 @@ from .completion import Completion as Completion
|
|
|
12
13
|
from .evaluation import Evaluation as Evaluation
|
|
13
14
|
from .dataset_item import DatasetItem as DatasetItem
|
|
14
15
|
from .item_locator import ItemLocator as ItemLocator
|
|
16
|
+
from .question_list import QuestionList as QuestionList
|
|
15
17
|
from .component_param import ComponentParam as ComponentParam
|
|
16
18
|
from .container_param import ContainerParam as ContainerParam
|
|
17
19
|
from .evaluation_item import EvaluationItem as EvaluationItem
|
|
@@ -32,13 +34,14 @@ from .model_update_params import ModelUpdateParams as ModelUpdateParams
|
|
|
32
34
|
from .span_batch_response import SpanBatchResponse as SpanBatchResponse
|
|
33
35
|
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
|
|
34
36
|
from .inference_model_list import InferenceModelList as InferenceModelList
|
|
35
|
-
from .
|
|
37
|
+
from .question_list_params import QuestionListParams as QuestionListParams
|
|
36
38
|
from .dataset_create_params import DatasetCreateParams as DatasetCreateParams
|
|
37
39
|
from .dataset_update_params import DatasetUpdateParams as DatasetUpdateParams
|
|
38
40
|
from .evaluation_task_param import EvaluationTaskParam as EvaluationTaskParam
|
|
39
41
|
from .item_locator_template import ItemLocatorTemplate as ItemLocatorTemplate
|
|
40
42
|
from .model_delete_response import ModelDeleteResponse as ModelDeleteResponse
|
|
41
43
|
from .evaluation_list_params import EvaluationListParams as EvaluationListParams
|
|
44
|
+
from .question_create_params import QuestionCreateParams as QuestionCreateParams
|
|
42
45
|
from .dataset_delete_response import DatasetDeleteResponse as DatasetDeleteResponse
|
|
43
46
|
from .dataset_retrieve_params import DatasetRetrieveParams as DatasetRetrieveParams
|
|
44
47
|
from .inference_create_params import InferenceCreateParams as InferenceCreateParams
|
|
@@ -276,7 +276,7 @@ class ChatCompletion(BaseModel):
|
|
|
276
276
|
|
|
277
277
|
object: Optional[Literal["chat.completion"]] = None
|
|
278
278
|
|
|
279
|
-
service_tier: Optional[Literal["
|
|
279
|
+
service_tier: Optional[Literal["auto", "default", "flex", "scale"]] = None
|
|
280
280
|
|
|
281
281
|
system_fingerprint: Optional[str] = None
|
|
282
282
|
|
|
@@ -227,7 +227,7 @@ class ChatCompletionChunk(BaseModel):
|
|
|
227
227
|
|
|
228
228
|
object: Optional[Literal["chat.completion.chunk"]] = None
|
|
229
229
|
|
|
230
|
-
service_tier: Optional[Literal["
|
|
230
|
+
service_tier: Optional[Literal["auto", "default", "flex", "scale"]] = None
|
|
231
231
|
|
|
232
232
|
system_fingerprint: Optional[str] = None
|
|
233
233
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Union, Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
|
6
|
+
|
|
7
|
+
from .._utils import PropertyInfo
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"Question",
|
|
12
|
+
"CategoricalQuestion",
|
|
13
|
+
"CategoricalQuestionConfiguration",
|
|
14
|
+
"RatingQuestion",
|
|
15
|
+
"RatingQuestionConfiguration",
|
|
16
|
+
"NumberQuestion",
|
|
17
|
+
"NumberQuestionConfiguration",
|
|
18
|
+
"FreeTextQuestion",
|
|
19
|
+
"FreeTextQuestionConfiguration",
|
|
20
|
+
"FormQuestion",
|
|
21
|
+
"FormQuestionConfiguration",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CategoricalQuestionConfiguration(BaseModel):
|
|
26
|
+
choices: List[str]
|
|
27
|
+
"""Categorical answer choices (must contain at least one entry)"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class CategoricalQuestion(BaseModel):
|
|
31
|
+
id: str
|
|
32
|
+
"""Unique identifier of the entity"""
|
|
33
|
+
|
|
34
|
+
configuration: CategoricalQuestionConfiguration
|
|
35
|
+
|
|
36
|
+
created_at: datetime
|
|
37
|
+
"""ISO-timestamp when the entity was created"""
|
|
38
|
+
|
|
39
|
+
created_by_user_id: str
|
|
40
|
+
"""User who originally created the entity"""
|
|
41
|
+
|
|
42
|
+
name: str
|
|
43
|
+
|
|
44
|
+
prompt: str
|
|
45
|
+
"""user-facing question prompt"""
|
|
46
|
+
|
|
47
|
+
object: Optional[Literal["question"]] = None
|
|
48
|
+
|
|
49
|
+
question_type: Optional[Literal["categorical"]] = None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class RatingQuestionConfiguration(BaseModel):
|
|
53
|
+
max_label: str
|
|
54
|
+
"""Label shown for the maximum rating"""
|
|
55
|
+
|
|
56
|
+
min_label: str
|
|
57
|
+
"""Label shown for the minimum rating"""
|
|
58
|
+
|
|
59
|
+
steps: int
|
|
60
|
+
"""Number of discrete points on the scale (e.g., 5 for a 1–5 scale)"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class RatingQuestion(BaseModel):
|
|
64
|
+
id: str
|
|
65
|
+
"""Unique identifier of the entity"""
|
|
66
|
+
|
|
67
|
+
configuration: RatingQuestionConfiguration
|
|
68
|
+
|
|
69
|
+
created_at: datetime
|
|
70
|
+
"""ISO-timestamp when the entity was created"""
|
|
71
|
+
|
|
72
|
+
created_by_user_id: str
|
|
73
|
+
"""User who originally created the entity"""
|
|
74
|
+
|
|
75
|
+
name: str
|
|
76
|
+
|
|
77
|
+
prompt: str
|
|
78
|
+
"""user-facing question prompt"""
|
|
79
|
+
|
|
80
|
+
object: Optional[Literal["question"]] = None
|
|
81
|
+
|
|
82
|
+
question_type: Optional[Literal["rating"]] = None
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class NumberQuestionConfiguration(BaseModel):
|
|
86
|
+
max: Optional[float] = None
|
|
87
|
+
"""Maximum value for the number"""
|
|
88
|
+
|
|
89
|
+
min: Optional[float] = None
|
|
90
|
+
"""Minimum value for the number"""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class NumberQuestion(BaseModel):
|
|
94
|
+
id: str
|
|
95
|
+
"""Unique identifier of the entity"""
|
|
96
|
+
|
|
97
|
+
created_at: datetime
|
|
98
|
+
"""ISO-timestamp when the entity was created"""
|
|
99
|
+
|
|
100
|
+
created_by_user_id: str
|
|
101
|
+
"""User who originally created the entity"""
|
|
102
|
+
|
|
103
|
+
name: str
|
|
104
|
+
|
|
105
|
+
prompt: str
|
|
106
|
+
"""user-facing question prompt"""
|
|
107
|
+
|
|
108
|
+
configuration: Optional[NumberQuestionConfiguration] = None
|
|
109
|
+
|
|
110
|
+
object: Optional[Literal["question"]] = None
|
|
111
|
+
|
|
112
|
+
question_type: Optional[Literal["number"]] = None
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class FreeTextQuestionConfiguration(BaseModel):
|
|
116
|
+
max_length: Optional[int] = None
|
|
117
|
+
"""Maximum characters allowed"""
|
|
118
|
+
|
|
119
|
+
min_length: Optional[int] = None
|
|
120
|
+
"""Minimum characters required"""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class FreeTextQuestion(BaseModel):
|
|
124
|
+
id: str
|
|
125
|
+
"""Unique identifier of the entity"""
|
|
126
|
+
|
|
127
|
+
created_at: datetime
|
|
128
|
+
"""ISO-timestamp when the entity was created"""
|
|
129
|
+
|
|
130
|
+
created_by_user_id: str
|
|
131
|
+
"""User who originally created the entity"""
|
|
132
|
+
|
|
133
|
+
name: str
|
|
134
|
+
|
|
135
|
+
prompt: str
|
|
136
|
+
"""user-facing question prompt"""
|
|
137
|
+
|
|
138
|
+
configuration: Optional[FreeTextQuestionConfiguration] = None
|
|
139
|
+
|
|
140
|
+
object: Optional[Literal["question"]] = None
|
|
141
|
+
|
|
142
|
+
question_type: Optional[Literal["free_text"]] = None
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class FormQuestionConfiguration(BaseModel):
|
|
146
|
+
form_schema: Dict[str, object]
|
|
147
|
+
"""The JSON schema of the desired form object"""
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class FormQuestion(BaseModel):
|
|
151
|
+
id: str
|
|
152
|
+
"""Unique identifier of the entity"""
|
|
153
|
+
|
|
154
|
+
configuration: FormQuestionConfiguration
|
|
155
|
+
|
|
156
|
+
created_at: datetime
|
|
157
|
+
"""ISO-timestamp when the entity was created"""
|
|
158
|
+
|
|
159
|
+
created_by_user_id: str
|
|
160
|
+
"""User who originally created the entity"""
|
|
161
|
+
|
|
162
|
+
name: str
|
|
163
|
+
|
|
164
|
+
prompt: str
|
|
165
|
+
"""user-facing question prompt"""
|
|
166
|
+
|
|
167
|
+
object: Optional[Literal["question"]] = None
|
|
168
|
+
|
|
169
|
+
question_type: Optional[Literal["form"]] = None
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
Question: TypeAlias = Annotated[
|
|
173
|
+
Union[CategoricalQuestion, RatingQuestion, NumberQuestion, FreeTextQuestion, FormQuestion],
|
|
174
|
+
PropertyInfo(discriminator="question_type"),
|
|
175
|
+
]
|