scale-gp-beta 0.1.0a39__py3-none-any.whl → 0.1.0a41__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/_base_client.py +140 -11
- scale_gp_beta/_client.py +602 -143
- scale_gp_beta/_models.py +16 -1
- scale_gp_beta/_streaming.py +12 -10
- scale_gp_beta/_types.py +12 -2
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/resources/__init__.py +14 -0
- scale_gp_beta/resources/build.py +582 -0
- scale_gp_beta/resources/chat/completions.py +4 -0
- scale_gp_beta/resources/credentials.py +4 -0
- scale_gp_beta/resources/dataset_items.py +4 -0
- scale_gp_beta/resources/datasets.py +4 -0
- scale_gp_beta/resources/evaluation_items.py +4 -0
- scale_gp_beta/resources/evaluations.py +4 -0
- scale_gp_beta/resources/files/files.py +4 -0
- scale_gp_beta/resources/models.py +4 -0
- scale_gp_beta/resources/questions.py +4 -0
- scale_gp_beta/resources/spans.py +28 -0
- scale_gp_beta/types/__init__.py +6 -0
- scale_gp_beta/types/build_cancel_response.py +38 -0
- scale_gp_beta/types/build_create_params.py +26 -0
- scale_gp_beta/types/build_create_response.py +38 -0
- scale_gp_beta/types/build_list_params.py +19 -0
- scale_gp_beta/types/build_list_response.py +38 -0
- scale_gp_beta/types/build_retrieve_response.py +38 -0
- scale_gp_beta/types/chat/completion_models_params.py +2 -0
- scale_gp_beta/types/credential_list_params.py +2 -0
- scale_gp_beta/types/dataset_item_list_params.py +2 -0
- scale_gp_beta/types/dataset_list_params.py +2 -0
- scale_gp_beta/types/evaluation.py +2 -0
- scale_gp_beta/types/evaluation_create_params.py +2 -0
- scale_gp_beta/types/evaluation_item_list_params.py +2 -0
- scale_gp_beta/types/evaluation_list_params.py +2 -0
- scale_gp_beta/types/evaluation_task.py +5 -1
- scale_gp_beta/types/evaluation_task_param.py +5 -1
- scale_gp_beta/types/file_import_from_cloud_response.py +4 -0
- scale_gp_beta/types/file_list_params.py +2 -0
- scale_gp_beta/types/inference_create_params.py +2 -0
- scale_gp_beta/types/model_list_params.py +2 -0
- scale_gp_beta/types/question_list_params.py +2 -0
- scale_gp_beta/types/span_assessment.py +2 -0
- scale_gp_beta/types/span_search_params.py +11 -0
- {scale_gp_beta-0.1.0a39.dist-info → scale_gp_beta-0.1.0a41.dist-info}/METADATA +14 -42
- {scale_gp_beta-0.1.0a39.dist-info → scale_gp_beta-0.1.0a41.dist-info}/RECORD +46 -39
- {scale_gp_beta-0.1.0a39.dist-info → scale_gp_beta-0.1.0a41.dist-info}/licenses/LICENSE +1 -1
- {scale_gp_beta-0.1.0a39.dist-info → scale_gp_beta-0.1.0a41.dist-info}/WHEEL +0 -0
scale_gp_beta/_client.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any, Dict, Mapping, cast
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Dict, Mapping, cast
|
|
7
7
|
from typing_extensions import Self, Literal, override
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
@@ -20,21 +20,8 @@ from ._types import (
|
|
|
20
20
|
not_given,
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
|
+
from ._compat import cached_property
|
|
23
24
|
from ._version import __version__
|
|
24
|
-
from .resources import (
|
|
25
|
-
spans,
|
|
26
|
-
models,
|
|
27
|
-
datasets,
|
|
28
|
-
inference,
|
|
29
|
-
questions,
|
|
30
|
-
responses,
|
|
31
|
-
completions,
|
|
32
|
-
credentials,
|
|
33
|
-
evaluations,
|
|
34
|
-
dataset_items,
|
|
35
|
-
evaluation_items,
|
|
36
|
-
span_assessments,
|
|
37
|
-
)
|
|
38
25
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
39
26
|
from ._exceptions import APIStatusError, SGPClientError
|
|
40
27
|
from ._base_client import (
|
|
@@ -42,8 +29,40 @@ from ._base_client import (
|
|
|
42
29
|
SyncAPIClient,
|
|
43
30
|
AsyncAPIClient,
|
|
44
31
|
)
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
|
|
33
|
+
if TYPE_CHECKING:
|
|
34
|
+
from .resources import (
|
|
35
|
+
chat,
|
|
36
|
+
build,
|
|
37
|
+
files,
|
|
38
|
+
spans,
|
|
39
|
+
models,
|
|
40
|
+
datasets,
|
|
41
|
+
inference,
|
|
42
|
+
questions,
|
|
43
|
+
responses,
|
|
44
|
+
completions,
|
|
45
|
+
credentials,
|
|
46
|
+
evaluations,
|
|
47
|
+
dataset_items,
|
|
48
|
+
evaluation_items,
|
|
49
|
+
span_assessments,
|
|
50
|
+
)
|
|
51
|
+
from .resources.build import BuildResource, AsyncBuildResource
|
|
52
|
+
from .resources.spans import SpansResource, AsyncSpansResource
|
|
53
|
+
from .resources.models import ModelsResource, AsyncModelsResource
|
|
54
|
+
from .resources.datasets import DatasetsResource, AsyncDatasetsResource
|
|
55
|
+
from .resources.chat.chat import ChatResource, AsyncChatResource
|
|
56
|
+
from .resources.inference import InferenceResource, AsyncInferenceResource
|
|
57
|
+
from .resources.questions import QuestionsResource, AsyncQuestionsResource
|
|
58
|
+
from .resources.responses import ResponsesResource, AsyncResponsesResource
|
|
59
|
+
from .resources.completions import CompletionsResource, AsyncCompletionsResource
|
|
60
|
+
from .resources.credentials import CredentialsResource, AsyncCredentialsResource
|
|
61
|
+
from .resources.evaluations import EvaluationsResource, AsyncEvaluationsResource
|
|
62
|
+
from .resources.files.files import FilesResource, AsyncFilesResource
|
|
63
|
+
from .resources.dataset_items import DatasetItemsResource, AsyncDatasetItemsResource
|
|
64
|
+
from .resources.evaluation_items import EvaluationItemsResource, AsyncEvaluationItemsResource
|
|
65
|
+
from .resources.span_assessments import SpanAssessmentsResource, AsyncSpanAssessmentsResource
|
|
47
66
|
|
|
48
67
|
__all__ = [
|
|
49
68
|
"ENVIRONMENTS",
|
|
@@ -64,23 +83,6 @@ ENVIRONMENTS: Dict[str, str] = {
|
|
|
64
83
|
|
|
65
84
|
|
|
66
85
|
class SGPClient(SyncAPIClient):
|
|
67
|
-
responses: responses.ResponsesResource
|
|
68
|
-
completions: completions.CompletionsResource
|
|
69
|
-
chat: chat.ChatResource
|
|
70
|
-
inference: inference.InferenceResource
|
|
71
|
-
questions: questions.QuestionsResource
|
|
72
|
-
files: files.FilesResource
|
|
73
|
-
models: models.ModelsResource
|
|
74
|
-
datasets: datasets.DatasetsResource
|
|
75
|
-
dataset_items: dataset_items.DatasetItemsResource
|
|
76
|
-
evaluations: evaluations.EvaluationsResource
|
|
77
|
-
evaluation_items: evaluation_items.EvaluationItemsResource
|
|
78
|
-
spans: spans.SpansResource
|
|
79
|
-
span_assessments: span_assessments.SpanAssessmentsResource
|
|
80
|
-
credentials: credentials.CredentialsResource
|
|
81
|
-
with_raw_response: SGPClientWithRawResponse
|
|
82
|
-
with_streaming_response: SGPClientWithStreamedResponse
|
|
83
|
-
|
|
84
86
|
# client options
|
|
85
87
|
api_key: str
|
|
86
88
|
account_id: str
|
|
@@ -171,22 +173,103 @@ class SGPClient(SyncAPIClient):
|
|
|
171
173
|
_strict_response_validation=_strict_response_validation,
|
|
172
174
|
)
|
|
173
175
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
176
|
+
@cached_property
|
|
177
|
+
def responses(self) -> ResponsesResource:
|
|
178
|
+
from .resources.responses import ResponsesResource
|
|
179
|
+
|
|
180
|
+
return ResponsesResource(self)
|
|
181
|
+
|
|
182
|
+
@cached_property
|
|
183
|
+
def completions(self) -> CompletionsResource:
|
|
184
|
+
from .resources.completions import CompletionsResource
|
|
185
|
+
|
|
186
|
+
return CompletionsResource(self)
|
|
187
|
+
|
|
188
|
+
@cached_property
|
|
189
|
+
def chat(self) -> ChatResource:
|
|
190
|
+
from .resources.chat import ChatResource
|
|
191
|
+
|
|
192
|
+
return ChatResource(self)
|
|
193
|
+
|
|
194
|
+
@cached_property
|
|
195
|
+
def inference(self) -> InferenceResource:
|
|
196
|
+
from .resources.inference import InferenceResource
|
|
197
|
+
|
|
198
|
+
return InferenceResource(self)
|
|
199
|
+
|
|
200
|
+
@cached_property
|
|
201
|
+
def questions(self) -> QuestionsResource:
|
|
202
|
+
from .resources.questions import QuestionsResource
|
|
203
|
+
|
|
204
|
+
return QuestionsResource(self)
|
|
205
|
+
|
|
206
|
+
@cached_property
|
|
207
|
+
def files(self) -> FilesResource:
|
|
208
|
+
from .resources.files import FilesResource
|
|
209
|
+
|
|
210
|
+
return FilesResource(self)
|
|
211
|
+
|
|
212
|
+
@cached_property
|
|
213
|
+
def models(self) -> ModelsResource:
|
|
214
|
+
from .resources.models import ModelsResource
|
|
215
|
+
|
|
216
|
+
return ModelsResource(self)
|
|
217
|
+
|
|
218
|
+
@cached_property
|
|
219
|
+
def datasets(self) -> DatasetsResource:
|
|
220
|
+
from .resources.datasets import DatasetsResource
|
|
221
|
+
|
|
222
|
+
return DatasetsResource(self)
|
|
223
|
+
|
|
224
|
+
@cached_property
|
|
225
|
+
def dataset_items(self) -> DatasetItemsResource:
|
|
226
|
+
from .resources.dataset_items import DatasetItemsResource
|
|
227
|
+
|
|
228
|
+
return DatasetItemsResource(self)
|
|
229
|
+
|
|
230
|
+
@cached_property
|
|
231
|
+
def evaluations(self) -> EvaluationsResource:
|
|
232
|
+
from .resources.evaluations import EvaluationsResource
|
|
233
|
+
|
|
234
|
+
return EvaluationsResource(self)
|
|
235
|
+
|
|
236
|
+
@cached_property
|
|
237
|
+
def evaluation_items(self) -> EvaluationItemsResource:
|
|
238
|
+
from .resources.evaluation_items import EvaluationItemsResource
|
|
239
|
+
|
|
240
|
+
return EvaluationItemsResource(self)
|
|
241
|
+
|
|
242
|
+
@cached_property
|
|
243
|
+
def spans(self) -> SpansResource:
|
|
244
|
+
from .resources.spans import SpansResource
|
|
245
|
+
|
|
246
|
+
return SpansResource(self)
|
|
247
|
+
|
|
248
|
+
@cached_property
|
|
249
|
+
def span_assessments(self) -> SpanAssessmentsResource:
|
|
250
|
+
from .resources.span_assessments import SpanAssessmentsResource
|
|
251
|
+
|
|
252
|
+
return SpanAssessmentsResource(self)
|
|
253
|
+
|
|
254
|
+
@cached_property
|
|
255
|
+
def credentials(self) -> CredentialsResource:
|
|
256
|
+
from .resources.credentials import CredentialsResource
|
|
257
|
+
|
|
258
|
+
return CredentialsResource(self)
|
|
259
|
+
|
|
260
|
+
@cached_property
|
|
261
|
+
def build(self) -> BuildResource:
|
|
262
|
+
from .resources.build import BuildResource
|
|
263
|
+
|
|
264
|
+
return BuildResource(self)
|
|
265
|
+
|
|
266
|
+
@cached_property
|
|
267
|
+
def with_raw_response(self) -> SGPClientWithRawResponse:
|
|
268
|
+
return SGPClientWithRawResponse(self)
|
|
269
|
+
|
|
270
|
+
@cached_property
|
|
271
|
+
def with_streaming_response(self) -> SGPClientWithStreamedResponse:
|
|
272
|
+
return SGPClientWithStreamedResponse(self)
|
|
190
273
|
|
|
191
274
|
@property
|
|
192
275
|
@override
|
|
@@ -299,23 +382,6 @@ class SGPClient(SyncAPIClient):
|
|
|
299
382
|
|
|
300
383
|
|
|
301
384
|
class AsyncSGPClient(AsyncAPIClient):
|
|
302
|
-
responses: responses.AsyncResponsesResource
|
|
303
|
-
completions: completions.AsyncCompletionsResource
|
|
304
|
-
chat: chat.AsyncChatResource
|
|
305
|
-
inference: inference.AsyncInferenceResource
|
|
306
|
-
questions: questions.AsyncQuestionsResource
|
|
307
|
-
files: files.AsyncFilesResource
|
|
308
|
-
models: models.AsyncModelsResource
|
|
309
|
-
datasets: datasets.AsyncDatasetsResource
|
|
310
|
-
dataset_items: dataset_items.AsyncDatasetItemsResource
|
|
311
|
-
evaluations: evaluations.AsyncEvaluationsResource
|
|
312
|
-
evaluation_items: evaluation_items.AsyncEvaluationItemsResource
|
|
313
|
-
spans: spans.AsyncSpansResource
|
|
314
|
-
span_assessments: span_assessments.AsyncSpanAssessmentsResource
|
|
315
|
-
credentials: credentials.AsyncCredentialsResource
|
|
316
|
-
with_raw_response: AsyncSGPClientWithRawResponse
|
|
317
|
-
with_streaming_response: AsyncSGPClientWithStreamedResponse
|
|
318
|
-
|
|
319
385
|
# client options
|
|
320
386
|
api_key: str
|
|
321
387
|
account_id: str
|
|
@@ -406,22 +472,103 @@ class AsyncSGPClient(AsyncAPIClient):
|
|
|
406
472
|
_strict_response_validation=_strict_response_validation,
|
|
407
473
|
)
|
|
408
474
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
475
|
+
@cached_property
|
|
476
|
+
def responses(self) -> AsyncResponsesResource:
|
|
477
|
+
from .resources.responses import AsyncResponsesResource
|
|
478
|
+
|
|
479
|
+
return AsyncResponsesResource(self)
|
|
480
|
+
|
|
481
|
+
@cached_property
|
|
482
|
+
def completions(self) -> AsyncCompletionsResource:
|
|
483
|
+
from .resources.completions import AsyncCompletionsResource
|
|
484
|
+
|
|
485
|
+
return AsyncCompletionsResource(self)
|
|
486
|
+
|
|
487
|
+
@cached_property
|
|
488
|
+
def chat(self) -> AsyncChatResource:
|
|
489
|
+
from .resources.chat import AsyncChatResource
|
|
490
|
+
|
|
491
|
+
return AsyncChatResource(self)
|
|
492
|
+
|
|
493
|
+
@cached_property
|
|
494
|
+
def inference(self) -> AsyncInferenceResource:
|
|
495
|
+
from .resources.inference import AsyncInferenceResource
|
|
496
|
+
|
|
497
|
+
return AsyncInferenceResource(self)
|
|
498
|
+
|
|
499
|
+
@cached_property
|
|
500
|
+
def questions(self) -> AsyncQuestionsResource:
|
|
501
|
+
from .resources.questions import AsyncQuestionsResource
|
|
502
|
+
|
|
503
|
+
return AsyncQuestionsResource(self)
|
|
504
|
+
|
|
505
|
+
@cached_property
|
|
506
|
+
def files(self) -> AsyncFilesResource:
|
|
507
|
+
from .resources.files import AsyncFilesResource
|
|
508
|
+
|
|
509
|
+
return AsyncFilesResource(self)
|
|
510
|
+
|
|
511
|
+
@cached_property
|
|
512
|
+
def models(self) -> AsyncModelsResource:
|
|
513
|
+
from .resources.models import AsyncModelsResource
|
|
514
|
+
|
|
515
|
+
return AsyncModelsResource(self)
|
|
516
|
+
|
|
517
|
+
@cached_property
|
|
518
|
+
def datasets(self) -> AsyncDatasetsResource:
|
|
519
|
+
from .resources.datasets import AsyncDatasetsResource
|
|
520
|
+
|
|
521
|
+
return AsyncDatasetsResource(self)
|
|
522
|
+
|
|
523
|
+
@cached_property
|
|
524
|
+
def dataset_items(self) -> AsyncDatasetItemsResource:
|
|
525
|
+
from .resources.dataset_items import AsyncDatasetItemsResource
|
|
526
|
+
|
|
527
|
+
return AsyncDatasetItemsResource(self)
|
|
528
|
+
|
|
529
|
+
@cached_property
|
|
530
|
+
def evaluations(self) -> AsyncEvaluationsResource:
|
|
531
|
+
from .resources.evaluations import AsyncEvaluationsResource
|
|
532
|
+
|
|
533
|
+
return AsyncEvaluationsResource(self)
|
|
534
|
+
|
|
535
|
+
@cached_property
|
|
536
|
+
def evaluation_items(self) -> AsyncEvaluationItemsResource:
|
|
537
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResource
|
|
538
|
+
|
|
539
|
+
return AsyncEvaluationItemsResource(self)
|
|
540
|
+
|
|
541
|
+
@cached_property
|
|
542
|
+
def spans(self) -> AsyncSpansResource:
|
|
543
|
+
from .resources.spans import AsyncSpansResource
|
|
544
|
+
|
|
545
|
+
return AsyncSpansResource(self)
|
|
546
|
+
|
|
547
|
+
@cached_property
|
|
548
|
+
def span_assessments(self) -> AsyncSpanAssessmentsResource:
|
|
549
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResource
|
|
550
|
+
|
|
551
|
+
return AsyncSpanAssessmentsResource(self)
|
|
552
|
+
|
|
553
|
+
@cached_property
|
|
554
|
+
def credentials(self) -> AsyncCredentialsResource:
|
|
555
|
+
from .resources.credentials import AsyncCredentialsResource
|
|
556
|
+
|
|
557
|
+
return AsyncCredentialsResource(self)
|
|
558
|
+
|
|
559
|
+
@cached_property
|
|
560
|
+
def build(self) -> AsyncBuildResource:
|
|
561
|
+
from .resources.build import AsyncBuildResource
|
|
562
|
+
|
|
563
|
+
return AsyncBuildResource(self)
|
|
564
|
+
|
|
565
|
+
@cached_property
|
|
566
|
+
def with_raw_response(self) -> AsyncSGPClientWithRawResponse:
|
|
567
|
+
return AsyncSGPClientWithRawResponse(self)
|
|
568
|
+
|
|
569
|
+
@cached_property
|
|
570
|
+
def with_streaming_response(self) -> AsyncSGPClientWithStreamedResponse:
|
|
571
|
+
return AsyncSGPClientWithStreamedResponse(self)
|
|
425
572
|
|
|
426
573
|
@property
|
|
427
574
|
@override
|
|
@@ -534,79 +681,391 @@ class AsyncSGPClient(AsyncAPIClient):
|
|
|
534
681
|
|
|
535
682
|
|
|
536
683
|
class SGPClientWithRawResponse:
|
|
684
|
+
_client: SGPClient
|
|
685
|
+
|
|
537
686
|
def __init__(self, client: SGPClient) -> None:
|
|
538
|
-
self.
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
self.
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
self.
|
|
551
|
-
|
|
687
|
+
self._client = client
|
|
688
|
+
|
|
689
|
+
@cached_property
|
|
690
|
+
def responses(self) -> responses.ResponsesResourceWithRawResponse:
|
|
691
|
+
from .resources.responses import ResponsesResourceWithRawResponse
|
|
692
|
+
|
|
693
|
+
return ResponsesResourceWithRawResponse(self._client.responses)
|
|
694
|
+
|
|
695
|
+
@cached_property
|
|
696
|
+
def completions(self) -> completions.CompletionsResourceWithRawResponse:
|
|
697
|
+
from .resources.completions import CompletionsResourceWithRawResponse
|
|
698
|
+
|
|
699
|
+
return CompletionsResourceWithRawResponse(self._client.completions)
|
|
700
|
+
|
|
701
|
+
@cached_property
|
|
702
|
+
def chat(self) -> chat.ChatResourceWithRawResponse:
|
|
703
|
+
from .resources.chat import ChatResourceWithRawResponse
|
|
704
|
+
|
|
705
|
+
return ChatResourceWithRawResponse(self._client.chat)
|
|
706
|
+
|
|
707
|
+
@cached_property
|
|
708
|
+
def inference(self) -> inference.InferenceResourceWithRawResponse:
|
|
709
|
+
from .resources.inference import InferenceResourceWithRawResponse
|
|
710
|
+
|
|
711
|
+
return InferenceResourceWithRawResponse(self._client.inference)
|
|
712
|
+
|
|
713
|
+
@cached_property
|
|
714
|
+
def questions(self) -> questions.QuestionsResourceWithRawResponse:
|
|
715
|
+
from .resources.questions import QuestionsResourceWithRawResponse
|
|
716
|
+
|
|
717
|
+
return QuestionsResourceWithRawResponse(self._client.questions)
|
|
718
|
+
|
|
719
|
+
@cached_property
|
|
720
|
+
def files(self) -> files.FilesResourceWithRawResponse:
|
|
721
|
+
from .resources.files import FilesResourceWithRawResponse
|
|
722
|
+
|
|
723
|
+
return FilesResourceWithRawResponse(self._client.files)
|
|
724
|
+
|
|
725
|
+
@cached_property
|
|
726
|
+
def models(self) -> models.ModelsResourceWithRawResponse:
|
|
727
|
+
from .resources.models import ModelsResourceWithRawResponse
|
|
728
|
+
|
|
729
|
+
return ModelsResourceWithRawResponse(self._client.models)
|
|
730
|
+
|
|
731
|
+
@cached_property
|
|
732
|
+
def datasets(self) -> datasets.DatasetsResourceWithRawResponse:
|
|
733
|
+
from .resources.datasets import DatasetsResourceWithRawResponse
|
|
734
|
+
|
|
735
|
+
return DatasetsResourceWithRawResponse(self._client.datasets)
|
|
736
|
+
|
|
737
|
+
@cached_property
|
|
738
|
+
def dataset_items(self) -> dataset_items.DatasetItemsResourceWithRawResponse:
|
|
739
|
+
from .resources.dataset_items import DatasetItemsResourceWithRawResponse
|
|
740
|
+
|
|
741
|
+
return DatasetItemsResourceWithRawResponse(self._client.dataset_items)
|
|
742
|
+
|
|
743
|
+
@cached_property
|
|
744
|
+
def evaluations(self) -> evaluations.EvaluationsResourceWithRawResponse:
|
|
745
|
+
from .resources.evaluations import EvaluationsResourceWithRawResponse
|
|
746
|
+
|
|
747
|
+
return EvaluationsResourceWithRawResponse(self._client.evaluations)
|
|
748
|
+
|
|
749
|
+
@cached_property
|
|
750
|
+
def evaluation_items(self) -> evaluation_items.EvaluationItemsResourceWithRawResponse:
|
|
751
|
+
from .resources.evaluation_items import EvaluationItemsResourceWithRawResponse
|
|
752
|
+
|
|
753
|
+
return EvaluationItemsResourceWithRawResponse(self._client.evaluation_items)
|
|
754
|
+
|
|
755
|
+
@cached_property
|
|
756
|
+
def spans(self) -> spans.SpansResourceWithRawResponse:
|
|
757
|
+
from .resources.spans import SpansResourceWithRawResponse
|
|
758
|
+
|
|
759
|
+
return SpansResourceWithRawResponse(self._client.spans)
|
|
760
|
+
|
|
761
|
+
@cached_property
|
|
762
|
+
def span_assessments(self) -> span_assessments.SpanAssessmentsResourceWithRawResponse:
|
|
763
|
+
from .resources.span_assessments import SpanAssessmentsResourceWithRawResponse
|
|
764
|
+
|
|
765
|
+
return SpanAssessmentsResourceWithRawResponse(self._client.span_assessments)
|
|
766
|
+
|
|
767
|
+
@cached_property
|
|
768
|
+
def credentials(self) -> credentials.CredentialsResourceWithRawResponse:
|
|
769
|
+
from .resources.credentials import CredentialsResourceWithRawResponse
|
|
770
|
+
|
|
771
|
+
return CredentialsResourceWithRawResponse(self._client.credentials)
|
|
772
|
+
|
|
773
|
+
@cached_property
|
|
774
|
+
def build(self) -> build.BuildResourceWithRawResponse:
|
|
775
|
+
from .resources.build import BuildResourceWithRawResponse
|
|
776
|
+
|
|
777
|
+
return BuildResourceWithRawResponse(self._client.build)
|
|
552
778
|
|
|
553
779
|
|
|
554
780
|
class AsyncSGPClientWithRawResponse:
|
|
781
|
+
_client: AsyncSGPClient
|
|
782
|
+
|
|
555
783
|
def __init__(self, client: AsyncSGPClient) -> None:
|
|
556
|
-
self.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
self.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
self.
|
|
569
|
-
|
|
784
|
+
self._client = client
|
|
785
|
+
|
|
786
|
+
@cached_property
|
|
787
|
+
def responses(self) -> responses.AsyncResponsesResourceWithRawResponse:
|
|
788
|
+
from .resources.responses import AsyncResponsesResourceWithRawResponse
|
|
789
|
+
|
|
790
|
+
return AsyncResponsesResourceWithRawResponse(self._client.responses)
|
|
791
|
+
|
|
792
|
+
@cached_property
|
|
793
|
+
def completions(self) -> completions.AsyncCompletionsResourceWithRawResponse:
|
|
794
|
+
from .resources.completions import AsyncCompletionsResourceWithRawResponse
|
|
795
|
+
|
|
796
|
+
return AsyncCompletionsResourceWithRawResponse(self._client.completions)
|
|
797
|
+
|
|
798
|
+
@cached_property
|
|
799
|
+
def chat(self) -> chat.AsyncChatResourceWithRawResponse:
|
|
800
|
+
from .resources.chat import AsyncChatResourceWithRawResponse
|
|
801
|
+
|
|
802
|
+
return AsyncChatResourceWithRawResponse(self._client.chat)
|
|
803
|
+
|
|
804
|
+
@cached_property
|
|
805
|
+
def inference(self) -> inference.AsyncInferenceResourceWithRawResponse:
|
|
806
|
+
from .resources.inference import AsyncInferenceResourceWithRawResponse
|
|
807
|
+
|
|
808
|
+
return AsyncInferenceResourceWithRawResponse(self._client.inference)
|
|
809
|
+
|
|
810
|
+
@cached_property
|
|
811
|
+
def questions(self) -> questions.AsyncQuestionsResourceWithRawResponse:
|
|
812
|
+
from .resources.questions import AsyncQuestionsResourceWithRawResponse
|
|
813
|
+
|
|
814
|
+
return AsyncQuestionsResourceWithRawResponse(self._client.questions)
|
|
815
|
+
|
|
816
|
+
@cached_property
|
|
817
|
+
def files(self) -> files.AsyncFilesResourceWithRawResponse:
|
|
818
|
+
from .resources.files import AsyncFilesResourceWithRawResponse
|
|
819
|
+
|
|
820
|
+
return AsyncFilesResourceWithRawResponse(self._client.files)
|
|
821
|
+
|
|
822
|
+
@cached_property
|
|
823
|
+
def models(self) -> models.AsyncModelsResourceWithRawResponse:
|
|
824
|
+
from .resources.models import AsyncModelsResourceWithRawResponse
|
|
825
|
+
|
|
826
|
+
return AsyncModelsResourceWithRawResponse(self._client.models)
|
|
827
|
+
|
|
828
|
+
@cached_property
|
|
829
|
+
def datasets(self) -> datasets.AsyncDatasetsResourceWithRawResponse:
|
|
830
|
+
from .resources.datasets import AsyncDatasetsResourceWithRawResponse
|
|
831
|
+
|
|
832
|
+
return AsyncDatasetsResourceWithRawResponse(self._client.datasets)
|
|
833
|
+
|
|
834
|
+
@cached_property
|
|
835
|
+
def dataset_items(self) -> dataset_items.AsyncDatasetItemsResourceWithRawResponse:
|
|
836
|
+
from .resources.dataset_items import AsyncDatasetItemsResourceWithRawResponse
|
|
837
|
+
|
|
838
|
+
return AsyncDatasetItemsResourceWithRawResponse(self._client.dataset_items)
|
|
839
|
+
|
|
840
|
+
@cached_property
|
|
841
|
+
def evaluations(self) -> evaluations.AsyncEvaluationsResourceWithRawResponse:
|
|
842
|
+
from .resources.evaluations import AsyncEvaluationsResourceWithRawResponse
|
|
843
|
+
|
|
844
|
+
return AsyncEvaluationsResourceWithRawResponse(self._client.evaluations)
|
|
845
|
+
|
|
846
|
+
@cached_property
|
|
847
|
+
def evaluation_items(self) -> evaluation_items.AsyncEvaluationItemsResourceWithRawResponse:
|
|
848
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResourceWithRawResponse
|
|
849
|
+
|
|
850
|
+
return AsyncEvaluationItemsResourceWithRawResponse(self._client.evaluation_items)
|
|
851
|
+
|
|
852
|
+
@cached_property
|
|
853
|
+
def spans(self) -> spans.AsyncSpansResourceWithRawResponse:
|
|
854
|
+
from .resources.spans import AsyncSpansResourceWithRawResponse
|
|
855
|
+
|
|
856
|
+
return AsyncSpansResourceWithRawResponse(self._client.spans)
|
|
857
|
+
|
|
858
|
+
@cached_property
|
|
859
|
+
def span_assessments(self) -> span_assessments.AsyncSpanAssessmentsResourceWithRawResponse:
|
|
860
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResourceWithRawResponse
|
|
861
|
+
|
|
862
|
+
return AsyncSpanAssessmentsResourceWithRawResponse(self._client.span_assessments)
|
|
863
|
+
|
|
864
|
+
@cached_property
|
|
865
|
+
def credentials(self) -> credentials.AsyncCredentialsResourceWithRawResponse:
|
|
866
|
+
from .resources.credentials import AsyncCredentialsResourceWithRawResponse
|
|
867
|
+
|
|
868
|
+
return AsyncCredentialsResourceWithRawResponse(self._client.credentials)
|
|
869
|
+
|
|
870
|
+
@cached_property
|
|
871
|
+
def build(self) -> build.AsyncBuildResourceWithRawResponse:
|
|
872
|
+
from .resources.build import AsyncBuildResourceWithRawResponse
|
|
873
|
+
|
|
874
|
+
return AsyncBuildResourceWithRawResponse(self._client.build)
|
|
570
875
|
|
|
571
876
|
|
|
572
877
|
class SGPClientWithStreamedResponse:
|
|
878
|
+
_client: SGPClient
|
|
879
|
+
|
|
573
880
|
def __init__(self, client: SGPClient) -> None:
|
|
574
|
-
self.
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
self.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
self.
|
|
587
|
-
|
|
881
|
+
self._client = client
|
|
882
|
+
|
|
883
|
+
@cached_property
|
|
884
|
+
def responses(self) -> responses.ResponsesResourceWithStreamingResponse:
|
|
885
|
+
from .resources.responses import ResponsesResourceWithStreamingResponse
|
|
886
|
+
|
|
887
|
+
return ResponsesResourceWithStreamingResponse(self._client.responses)
|
|
888
|
+
|
|
889
|
+
@cached_property
|
|
890
|
+
def completions(self) -> completions.CompletionsResourceWithStreamingResponse:
|
|
891
|
+
from .resources.completions import CompletionsResourceWithStreamingResponse
|
|
892
|
+
|
|
893
|
+
return CompletionsResourceWithStreamingResponse(self._client.completions)
|
|
894
|
+
|
|
895
|
+
@cached_property
|
|
896
|
+
def chat(self) -> chat.ChatResourceWithStreamingResponse:
|
|
897
|
+
from .resources.chat import ChatResourceWithStreamingResponse
|
|
898
|
+
|
|
899
|
+
return ChatResourceWithStreamingResponse(self._client.chat)
|
|
900
|
+
|
|
901
|
+
@cached_property
|
|
902
|
+
def inference(self) -> inference.InferenceResourceWithStreamingResponse:
|
|
903
|
+
from .resources.inference import InferenceResourceWithStreamingResponse
|
|
904
|
+
|
|
905
|
+
return InferenceResourceWithStreamingResponse(self._client.inference)
|
|
906
|
+
|
|
907
|
+
@cached_property
|
|
908
|
+
def questions(self) -> questions.QuestionsResourceWithStreamingResponse:
|
|
909
|
+
from .resources.questions import QuestionsResourceWithStreamingResponse
|
|
910
|
+
|
|
911
|
+
return QuestionsResourceWithStreamingResponse(self._client.questions)
|
|
912
|
+
|
|
913
|
+
@cached_property
|
|
914
|
+
def files(self) -> files.FilesResourceWithStreamingResponse:
|
|
915
|
+
from .resources.files import FilesResourceWithStreamingResponse
|
|
916
|
+
|
|
917
|
+
return FilesResourceWithStreamingResponse(self._client.files)
|
|
918
|
+
|
|
919
|
+
@cached_property
|
|
920
|
+
def models(self) -> models.ModelsResourceWithStreamingResponse:
|
|
921
|
+
from .resources.models import ModelsResourceWithStreamingResponse
|
|
922
|
+
|
|
923
|
+
return ModelsResourceWithStreamingResponse(self._client.models)
|
|
924
|
+
|
|
925
|
+
@cached_property
|
|
926
|
+
def datasets(self) -> datasets.DatasetsResourceWithStreamingResponse:
|
|
927
|
+
from .resources.datasets import DatasetsResourceWithStreamingResponse
|
|
928
|
+
|
|
929
|
+
return DatasetsResourceWithStreamingResponse(self._client.datasets)
|
|
930
|
+
|
|
931
|
+
@cached_property
|
|
932
|
+
def dataset_items(self) -> dataset_items.DatasetItemsResourceWithStreamingResponse:
|
|
933
|
+
from .resources.dataset_items import DatasetItemsResourceWithStreamingResponse
|
|
934
|
+
|
|
935
|
+
return DatasetItemsResourceWithStreamingResponse(self._client.dataset_items)
|
|
936
|
+
|
|
937
|
+
@cached_property
|
|
938
|
+
def evaluations(self) -> evaluations.EvaluationsResourceWithStreamingResponse:
|
|
939
|
+
from .resources.evaluations import EvaluationsResourceWithStreamingResponse
|
|
940
|
+
|
|
941
|
+
return EvaluationsResourceWithStreamingResponse(self._client.evaluations)
|
|
942
|
+
|
|
943
|
+
@cached_property
|
|
944
|
+
def evaluation_items(self) -> evaluation_items.EvaluationItemsResourceWithStreamingResponse:
|
|
945
|
+
from .resources.evaluation_items import EvaluationItemsResourceWithStreamingResponse
|
|
946
|
+
|
|
947
|
+
return EvaluationItemsResourceWithStreamingResponse(self._client.evaluation_items)
|
|
948
|
+
|
|
949
|
+
@cached_property
|
|
950
|
+
def spans(self) -> spans.SpansResourceWithStreamingResponse:
|
|
951
|
+
from .resources.spans import SpansResourceWithStreamingResponse
|
|
952
|
+
|
|
953
|
+
return SpansResourceWithStreamingResponse(self._client.spans)
|
|
954
|
+
|
|
955
|
+
@cached_property
|
|
956
|
+
def span_assessments(self) -> span_assessments.SpanAssessmentsResourceWithStreamingResponse:
|
|
957
|
+
from .resources.span_assessments import SpanAssessmentsResourceWithStreamingResponse
|
|
958
|
+
|
|
959
|
+
return SpanAssessmentsResourceWithStreamingResponse(self._client.span_assessments)
|
|
960
|
+
|
|
961
|
+
@cached_property
|
|
962
|
+
def credentials(self) -> credentials.CredentialsResourceWithStreamingResponse:
|
|
963
|
+
from .resources.credentials import CredentialsResourceWithStreamingResponse
|
|
964
|
+
|
|
965
|
+
return CredentialsResourceWithStreamingResponse(self._client.credentials)
|
|
966
|
+
|
|
967
|
+
@cached_property
|
|
968
|
+
def build(self) -> build.BuildResourceWithStreamingResponse:
|
|
969
|
+
from .resources.build import BuildResourceWithStreamingResponse
|
|
970
|
+
|
|
971
|
+
return BuildResourceWithStreamingResponse(self._client.build)
|
|
588
972
|
|
|
589
973
|
|
|
590
974
|
class AsyncSGPClientWithStreamedResponse:
|
|
975
|
+
_client: AsyncSGPClient
|
|
976
|
+
|
|
591
977
|
def __init__(self, client: AsyncSGPClient) -> None:
|
|
592
|
-
self.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
self.
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
)
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
978
|
+
self._client = client
|
|
979
|
+
|
|
980
|
+
@cached_property
|
|
981
|
+
def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse:
|
|
982
|
+
from .resources.responses import AsyncResponsesResourceWithStreamingResponse
|
|
983
|
+
|
|
984
|
+
return AsyncResponsesResourceWithStreamingResponse(self._client.responses)
|
|
985
|
+
|
|
986
|
+
@cached_property
|
|
987
|
+
def completions(self) -> completions.AsyncCompletionsResourceWithStreamingResponse:
|
|
988
|
+
from .resources.completions import AsyncCompletionsResourceWithStreamingResponse
|
|
989
|
+
|
|
990
|
+
return AsyncCompletionsResourceWithStreamingResponse(self._client.completions)
|
|
991
|
+
|
|
992
|
+
@cached_property
|
|
993
|
+
def chat(self) -> chat.AsyncChatResourceWithStreamingResponse:
|
|
994
|
+
from .resources.chat import AsyncChatResourceWithStreamingResponse
|
|
995
|
+
|
|
996
|
+
return AsyncChatResourceWithStreamingResponse(self._client.chat)
|
|
997
|
+
|
|
998
|
+
@cached_property
|
|
999
|
+
def inference(self) -> inference.AsyncInferenceResourceWithStreamingResponse:
|
|
1000
|
+
from .resources.inference import AsyncInferenceResourceWithStreamingResponse
|
|
1001
|
+
|
|
1002
|
+
return AsyncInferenceResourceWithStreamingResponse(self._client.inference)
|
|
1003
|
+
|
|
1004
|
+
@cached_property
|
|
1005
|
+
def questions(self) -> questions.AsyncQuestionsResourceWithStreamingResponse:
|
|
1006
|
+
from .resources.questions import AsyncQuestionsResourceWithStreamingResponse
|
|
1007
|
+
|
|
1008
|
+
return AsyncQuestionsResourceWithStreamingResponse(self._client.questions)
|
|
1009
|
+
|
|
1010
|
+
@cached_property
|
|
1011
|
+
def files(self) -> files.AsyncFilesResourceWithStreamingResponse:
|
|
1012
|
+
from .resources.files import AsyncFilesResourceWithStreamingResponse
|
|
1013
|
+
|
|
1014
|
+
return AsyncFilesResourceWithStreamingResponse(self._client.files)
|
|
1015
|
+
|
|
1016
|
+
@cached_property
|
|
1017
|
+
def models(self) -> models.AsyncModelsResourceWithStreamingResponse:
|
|
1018
|
+
from .resources.models import AsyncModelsResourceWithStreamingResponse
|
|
1019
|
+
|
|
1020
|
+
return AsyncModelsResourceWithStreamingResponse(self._client.models)
|
|
1021
|
+
|
|
1022
|
+
@cached_property
|
|
1023
|
+
def datasets(self) -> datasets.AsyncDatasetsResourceWithStreamingResponse:
|
|
1024
|
+
from .resources.datasets import AsyncDatasetsResourceWithStreamingResponse
|
|
1025
|
+
|
|
1026
|
+
return AsyncDatasetsResourceWithStreamingResponse(self._client.datasets)
|
|
1027
|
+
|
|
1028
|
+
@cached_property
|
|
1029
|
+
def dataset_items(self) -> dataset_items.AsyncDatasetItemsResourceWithStreamingResponse:
|
|
1030
|
+
from .resources.dataset_items import AsyncDatasetItemsResourceWithStreamingResponse
|
|
1031
|
+
|
|
1032
|
+
return AsyncDatasetItemsResourceWithStreamingResponse(self._client.dataset_items)
|
|
1033
|
+
|
|
1034
|
+
@cached_property
|
|
1035
|
+
def evaluations(self) -> evaluations.AsyncEvaluationsResourceWithStreamingResponse:
|
|
1036
|
+
from .resources.evaluations import AsyncEvaluationsResourceWithStreamingResponse
|
|
1037
|
+
|
|
1038
|
+
return AsyncEvaluationsResourceWithStreamingResponse(self._client.evaluations)
|
|
1039
|
+
|
|
1040
|
+
@cached_property
|
|
1041
|
+
def evaluation_items(self) -> evaluation_items.AsyncEvaluationItemsResourceWithStreamingResponse:
|
|
1042
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResourceWithStreamingResponse
|
|
1043
|
+
|
|
1044
|
+
return AsyncEvaluationItemsResourceWithStreamingResponse(self._client.evaluation_items)
|
|
1045
|
+
|
|
1046
|
+
@cached_property
|
|
1047
|
+
def spans(self) -> spans.AsyncSpansResourceWithStreamingResponse:
|
|
1048
|
+
from .resources.spans import AsyncSpansResourceWithStreamingResponse
|
|
1049
|
+
|
|
1050
|
+
return AsyncSpansResourceWithStreamingResponse(self._client.spans)
|
|
1051
|
+
|
|
1052
|
+
@cached_property
|
|
1053
|
+
def span_assessments(self) -> span_assessments.AsyncSpanAssessmentsResourceWithStreamingResponse:
|
|
1054
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResourceWithStreamingResponse
|
|
1055
|
+
|
|
1056
|
+
return AsyncSpanAssessmentsResourceWithStreamingResponse(self._client.span_assessments)
|
|
1057
|
+
|
|
1058
|
+
@cached_property
|
|
1059
|
+
def credentials(self) -> credentials.AsyncCredentialsResourceWithStreamingResponse:
|
|
1060
|
+
from .resources.credentials import AsyncCredentialsResourceWithStreamingResponse
|
|
1061
|
+
|
|
1062
|
+
return AsyncCredentialsResourceWithStreamingResponse(self._client.credentials)
|
|
1063
|
+
|
|
1064
|
+
@cached_property
|
|
1065
|
+
def build(self) -> build.AsyncBuildResourceWithStreamingResponse:
|
|
1066
|
+
from .resources.build import AsyncBuildResourceWithStreamingResponse
|
|
1067
|
+
|
|
1068
|
+
return AsyncBuildResourceWithStreamingResponse(self._client.build)
|
|
610
1069
|
|
|
611
1070
|
|
|
612
1071
|
Client = SGPClient
|