scale-gp-beta 0.1.0a38__py3-none-any.whl → 0.1.0a40__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 +8 -2
- scale_gp_beta/_client.py +564 -143
- scale_gp_beta/_streaming.py +12 -10
- scale_gp_beta/_types.py +3 -2
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/lib/tracing/integrations/openai/utils.py +3 -1
- 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/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.0a38.dist-info → scale_gp_beta-0.1.0a40.dist-info}/METADATA +4 -40
- {scale_gp_beta-0.1.0a38.dist-info → scale_gp_beta-0.1.0a40.dist-info}/RECORD +37 -37
- {scale_gp_beta-0.1.0a38.dist-info → scale_gp_beta-0.1.0a40.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a38.dist-info → scale_gp_beta-0.1.0a40.dist-info}/licenses/LICENSE +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,38 @@ 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
|
+
files,
|
|
37
|
+
spans,
|
|
38
|
+
models,
|
|
39
|
+
datasets,
|
|
40
|
+
inference,
|
|
41
|
+
questions,
|
|
42
|
+
responses,
|
|
43
|
+
completions,
|
|
44
|
+
credentials,
|
|
45
|
+
evaluations,
|
|
46
|
+
dataset_items,
|
|
47
|
+
evaluation_items,
|
|
48
|
+
span_assessments,
|
|
49
|
+
)
|
|
50
|
+
from .resources.spans import SpansResource, AsyncSpansResource
|
|
51
|
+
from .resources.models import ModelsResource, AsyncModelsResource
|
|
52
|
+
from .resources.datasets import DatasetsResource, AsyncDatasetsResource
|
|
53
|
+
from .resources.chat.chat import ChatResource, AsyncChatResource
|
|
54
|
+
from .resources.inference import InferenceResource, AsyncInferenceResource
|
|
55
|
+
from .resources.questions import QuestionsResource, AsyncQuestionsResource
|
|
56
|
+
from .resources.responses import ResponsesResource, AsyncResponsesResource
|
|
57
|
+
from .resources.completions import CompletionsResource, AsyncCompletionsResource
|
|
58
|
+
from .resources.credentials import CredentialsResource, AsyncCredentialsResource
|
|
59
|
+
from .resources.evaluations import EvaluationsResource, AsyncEvaluationsResource
|
|
60
|
+
from .resources.files.files import FilesResource, AsyncFilesResource
|
|
61
|
+
from .resources.dataset_items import DatasetItemsResource, AsyncDatasetItemsResource
|
|
62
|
+
from .resources.evaluation_items import EvaluationItemsResource, AsyncEvaluationItemsResource
|
|
63
|
+
from .resources.span_assessments import SpanAssessmentsResource, AsyncSpanAssessmentsResource
|
|
47
64
|
|
|
48
65
|
__all__ = [
|
|
49
66
|
"ENVIRONMENTS",
|
|
@@ -64,23 +81,6 @@ ENVIRONMENTS: Dict[str, str] = {
|
|
|
64
81
|
|
|
65
82
|
|
|
66
83
|
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
84
|
# client options
|
|
85
85
|
api_key: str
|
|
86
86
|
account_id: str
|
|
@@ -171,22 +171,97 @@ class SGPClient(SyncAPIClient):
|
|
|
171
171
|
_strict_response_validation=_strict_response_validation,
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
174
|
+
@cached_property
|
|
175
|
+
def responses(self) -> ResponsesResource:
|
|
176
|
+
from .resources.responses import ResponsesResource
|
|
177
|
+
|
|
178
|
+
return ResponsesResource(self)
|
|
179
|
+
|
|
180
|
+
@cached_property
|
|
181
|
+
def completions(self) -> CompletionsResource:
|
|
182
|
+
from .resources.completions import CompletionsResource
|
|
183
|
+
|
|
184
|
+
return CompletionsResource(self)
|
|
185
|
+
|
|
186
|
+
@cached_property
|
|
187
|
+
def chat(self) -> ChatResource:
|
|
188
|
+
from .resources.chat import ChatResource
|
|
189
|
+
|
|
190
|
+
return ChatResource(self)
|
|
191
|
+
|
|
192
|
+
@cached_property
|
|
193
|
+
def inference(self) -> InferenceResource:
|
|
194
|
+
from .resources.inference import InferenceResource
|
|
195
|
+
|
|
196
|
+
return InferenceResource(self)
|
|
197
|
+
|
|
198
|
+
@cached_property
|
|
199
|
+
def questions(self) -> QuestionsResource:
|
|
200
|
+
from .resources.questions import QuestionsResource
|
|
201
|
+
|
|
202
|
+
return QuestionsResource(self)
|
|
203
|
+
|
|
204
|
+
@cached_property
|
|
205
|
+
def files(self) -> FilesResource:
|
|
206
|
+
from .resources.files import FilesResource
|
|
207
|
+
|
|
208
|
+
return FilesResource(self)
|
|
209
|
+
|
|
210
|
+
@cached_property
|
|
211
|
+
def models(self) -> ModelsResource:
|
|
212
|
+
from .resources.models import ModelsResource
|
|
213
|
+
|
|
214
|
+
return ModelsResource(self)
|
|
215
|
+
|
|
216
|
+
@cached_property
|
|
217
|
+
def datasets(self) -> DatasetsResource:
|
|
218
|
+
from .resources.datasets import DatasetsResource
|
|
219
|
+
|
|
220
|
+
return DatasetsResource(self)
|
|
221
|
+
|
|
222
|
+
@cached_property
|
|
223
|
+
def dataset_items(self) -> DatasetItemsResource:
|
|
224
|
+
from .resources.dataset_items import DatasetItemsResource
|
|
225
|
+
|
|
226
|
+
return DatasetItemsResource(self)
|
|
227
|
+
|
|
228
|
+
@cached_property
|
|
229
|
+
def evaluations(self) -> EvaluationsResource:
|
|
230
|
+
from .resources.evaluations import EvaluationsResource
|
|
231
|
+
|
|
232
|
+
return EvaluationsResource(self)
|
|
233
|
+
|
|
234
|
+
@cached_property
|
|
235
|
+
def evaluation_items(self) -> EvaluationItemsResource:
|
|
236
|
+
from .resources.evaluation_items import EvaluationItemsResource
|
|
237
|
+
|
|
238
|
+
return EvaluationItemsResource(self)
|
|
239
|
+
|
|
240
|
+
@cached_property
|
|
241
|
+
def spans(self) -> SpansResource:
|
|
242
|
+
from .resources.spans import SpansResource
|
|
243
|
+
|
|
244
|
+
return SpansResource(self)
|
|
245
|
+
|
|
246
|
+
@cached_property
|
|
247
|
+
def span_assessments(self) -> SpanAssessmentsResource:
|
|
248
|
+
from .resources.span_assessments import SpanAssessmentsResource
|
|
249
|
+
|
|
250
|
+
return SpanAssessmentsResource(self)
|
|
251
|
+
|
|
252
|
+
@cached_property
|
|
253
|
+
def credentials(self) -> CredentialsResource:
|
|
254
|
+
from .resources.credentials import CredentialsResource
|
|
255
|
+
|
|
256
|
+
return CredentialsResource(self)
|
|
257
|
+
|
|
258
|
+
@cached_property
|
|
259
|
+
def with_raw_response(self) -> SGPClientWithRawResponse:
|
|
260
|
+
return SGPClientWithRawResponse(self)
|
|
261
|
+
|
|
262
|
+
@cached_property
|
|
263
|
+
def with_streaming_response(self) -> SGPClientWithStreamedResponse:
|
|
264
|
+
return SGPClientWithStreamedResponse(self)
|
|
190
265
|
|
|
191
266
|
@property
|
|
192
267
|
@override
|
|
@@ -299,23 +374,6 @@ class SGPClient(SyncAPIClient):
|
|
|
299
374
|
|
|
300
375
|
|
|
301
376
|
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
377
|
# client options
|
|
320
378
|
api_key: str
|
|
321
379
|
account_id: str
|
|
@@ -406,22 +464,97 @@ class AsyncSGPClient(AsyncAPIClient):
|
|
|
406
464
|
_strict_response_validation=_strict_response_validation,
|
|
407
465
|
)
|
|
408
466
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
467
|
+
@cached_property
|
|
468
|
+
def responses(self) -> AsyncResponsesResource:
|
|
469
|
+
from .resources.responses import AsyncResponsesResource
|
|
470
|
+
|
|
471
|
+
return AsyncResponsesResource(self)
|
|
472
|
+
|
|
473
|
+
@cached_property
|
|
474
|
+
def completions(self) -> AsyncCompletionsResource:
|
|
475
|
+
from .resources.completions import AsyncCompletionsResource
|
|
476
|
+
|
|
477
|
+
return AsyncCompletionsResource(self)
|
|
478
|
+
|
|
479
|
+
@cached_property
|
|
480
|
+
def chat(self) -> AsyncChatResource:
|
|
481
|
+
from .resources.chat import AsyncChatResource
|
|
482
|
+
|
|
483
|
+
return AsyncChatResource(self)
|
|
484
|
+
|
|
485
|
+
@cached_property
|
|
486
|
+
def inference(self) -> AsyncInferenceResource:
|
|
487
|
+
from .resources.inference import AsyncInferenceResource
|
|
488
|
+
|
|
489
|
+
return AsyncInferenceResource(self)
|
|
490
|
+
|
|
491
|
+
@cached_property
|
|
492
|
+
def questions(self) -> AsyncQuestionsResource:
|
|
493
|
+
from .resources.questions import AsyncQuestionsResource
|
|
494
|
+
|
|
495
|
+
return AsyncQuestionsResource(self)
|
|
496
|
+
|
|
497
|
+
@cached_property
|
|
498
|
+
def files(self) -> AsyncFilesResource:
|
|
499
|
+
from .resources.files import AsyncFilesResource
|
|
500
|
+
|
|
501
|
+
return AsyncFilesResource(self)
|
|
502
|
+
|
|
503
|
+
@cached_property
|
|
504
|
+
def models(self) -> AsyncModelsResource:
|
|
505
|
+
from .resources.models import AsyncModelsResource
|
|
506
|
+
|
|
507
|
+
return AsyncModelsResource(self)
|
|
508
|
+
|
|
509
|
+
@cached_property
|
|
510
|
+
def datasets(self) -> AsyncDatasetsResource:
|
|
511
|
+
from .resources.datasets import AsyncDatasetsResource
|
|
512
|
+
|
|
513
|
+
return AsyncDatasetsResource(self)
|
|
514
|
+
|
|
515
|
+
@cached_property
|
|
516
|
+
def dataset_items(self) -> AsyncDatasetItemsResource:
|
|
517
|
+
from .resources.dataset_items import AsyncDatasetItemsResource
|
|
518
|
+
|
|
519
|
+
return AsyncDatasetItemsResource(self)
|
|
520
|
+
|
|
521
|
+
@cached_property
|
|
522
|
+
def evaluations(self) -> AsyncEvaluationsResource:
|
|
523
|
+
from .resources.evaluations import AsyncEvaluationsResource
|
|
524
|
+
|
|
525
|
+
return AsyncEvaluationsResource(self)
|
|
526
|
+
|
|
527
|
+
@cached_property
|
|
528
|
+
def evaluation_items(self) -> AsyncEvaluationItemsResource:
|
|
529
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResource
|
|
530
|
+
|
|
531
|
+
return AsyncEvaluationItemsResource(self)
|
|
532
|
+
|
|
533
|
+
@cached_property
|
|
534
|
+
def spans(self) -> AsyncSpansResource:
|
|
535
|
+
from .resources.spans import AsyncSpansResource
|
|
536
|
+
|
|
537
|
+
return AsyncSpansResource(self)
|
|
538
|
+
|
|
539
|
+
@cached_property
|
|
540
|
+
def span_assessments(self) -> AsyncSpanAssessmentsResource:
|
|
541
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResource
|
|
542
|
+
|
|
543
|
+
return AsyncSpanAssessmentsResource(self)
|
|
544
|
+
|
|
545
|
+
@cached_property
|
|
546
|
+
def credentials(self) -> AsyncCredentialsResource:
|
|
547
|
+
from .resources.credentials import AsyncCredentialsResource
|
|
548
|
+
|
|
549
|
+
return AsyncCredentialsResource(self)
|
|
550
|
+
|
|
551
|
+
@cached_property
|
|
552
|
+
def with_raw_response(self) -> AsyncSGPClientWithRawResponse:
|
|
553
|
+
return AsyncSGPClientWithRawResponse(self)
|
|
554
|
+
|
|
555
|
+
@cached_property
|
|
556
|
+
def with_streaming_response(self) -> AsyncSGPClientWithStreamedResponse:
|
|
557
|
+
return AsyncSGPClientWithStreamedResponse(self)
|
|
425
558
|
|
|
426
559
|
@property
|
|
427
560
|
@override
|
|
@@ -534,79 +667,367 @@ class AsyncSGPClient(AsyncAPIClient):
|
|
|
534
667
|
|
|
535
668
|
|
|
536
669
|
class SGPClientWithRawResponse:
|
|
670
|
+
_client: SGPClient
|
|
671
|
+
|
|
537
672
|
def __init__(self, client: SGPClient) -> None:
|
|
538
|
-
self.
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
self.
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
self.
|
|
551
|
-
|
|
673
|
+
self._client = client
|
|
674
|
+
|
|
675
|
+
@cached_property
|
|
676
|
+
def responses(self) -> responses.ResponsesResourceWithRawResponse:
|
|
677
|
+
from .resources.responses import ResponsesResourceWithRawResponse
|
|
678
|
+
|
|
679
|
+
return ResponsesResourceWithRawResponse(self._client.responses)
|
|
680
|
+
|
|
681
|
+
@cached_property
|
|
682
|
+
def completions(self) -> completions.CompletionsResourceWithRawResponse:
|
|
683
|
+
from .resources.completions import CompletionsResourceWithRawResponse
|
|
684
|
+
|
|
685
|
+
return CompletionsResourceWithRawResponse(self._client.completions)
|
|
686
|
+
|
|
687
|
+
@cached_property
|
|
688
|
+
def chat(self) -> chat.ChatResourceWithRawResponse:
|
|
689
|
+
from .resources.chat import ChatResourceWithRawResponse
|
|
690
|
+
|
|
691
|
+
return ChatResourceWithRawResponse(self._client.chat)
|
|
692
|
+
|
|
693
|
+
@cached_property
|
|
694
|
+
def inference(self) -> inference.InferenceResourceWithRawResponse:
|
|
695
|
+
from .resources.inference import InferenceResourceWithRawResponse
|
|
696
|
+
|
|
697
|
+
return InferenceResourceWithRawResponse(self._client.inference)
|
|
698
|
+
|
|
699
|
+
@cached_property
|
|
700
|
+
def questions(self) -> questions.QuestionsResourceWithRawResponse:
|
|
701
|
+
from .resources.questions import QuestionsResourceWithRawResponse
|
|
702
|
+
|
|
703
|
+
return QuestionsResourceWithRawResponse(self._client.questions)
|
|
704
|
+
|
|
705
|
+
@cached_property
|
|
706
|
+
def files(self) -> files.FilesResourceWithRawResponse:
|
|
707
|
+
from .resources.files import FilesResourceWithRawResponse
|
|
708
|
+
|
|
709
|
+
return FilesResourceWithRawResponse(self._client.files)
|
|
710
|
+
|
|
711
|
+
@cached_property
|
|
712
|
+
def models(self) -> models.ModelsResourceWithRawResponse:
|
|
713
|
+
from .resources.models import ModelsResourceWithRawResponse
|
|
714
|
+
|
|
715
|
+
return ModelsResourceWithRawResponse(self._client.models)
|
|
716
|
+
|
|
717
|
+
@cached_property
|
|
718
|
+
def datasets(self) -> datasets.DatasetsResourceWithRawResponse:
|
|
719
|
+
from .resources.datasets import DatasetsResourceWithRawResponse
|
|
720
|
+
|
|
721
|
+
return DatasetsResourceWithRawResponse(self._client.datasets)
|
|
722
|
+
|
|
723
|
+
@cached_property
|
|
724
|
+
def dataset_items(self) -> dataset_items.DatasetItemsResourceWithRawResponse:
|
|
725
|
+
from .resources.dataset_items import DatasetItemsResourceWithRawResponse
|
|
726
|
+
|
|
727
|
+
return DatasetItemsResourceWithRawResponse(self._client.dataset_items)
|
|
728
|
+
|
|
729
|
+
@cached_property
|
|
730
|
+
def evaluations(self) -> evaluations.EvaluationsResourceWithRawResponse:
|
|
731
|
+
from .resources.evaluations import EvaluationsResourceWithRawResponse
|
|
732
|
+
|
|
733
|
+
return EvaluationsResourceWithRawResponse(self._client.evaluations)
|
|
734
|
+
|
|
735
|
+
@cached_property
|
|
736
|
+
def evaluation_items(self) -> evaluation_items.EvaluationItemsResourceWithRawResponse:
|
|
737
|
+
from .resources.evaluation_items import EvaluationItemsResourceWithRawResponse
|
|
738
|
+
|
|
739
|
+
return EvaluationItemsResourceWithRawResponse(self._client.evaluation_items)
|
|
740
|
+
|
|
741
|
+
@cached_property
|
|
742
|
+
def spans(self) -> spans.SpansResourceWithRawResponse:
|
|
743
|
+
from .resources.spans import SpansResourceWithRawResponse
|
|
744
|
+
|
|
745
|
+
return SpansResourceWithRawResponse(self._client.spans)
|
|
746
|
+
|
|
747
|
+
@cached_property
|
|
748
|
+
def span_assessments(self) -> span_assessments.SpanAssessmentsResourceWithRawResponse:
|
|
749
|
+
from .resources.span_assessments import SpanAssessmentsResourceWithRawResponse
|
|
750
|
+
|
|
751
|
+
return SpanAssessmentsResourceWithRawResponse(self._client.span_assessments)
|
|
752
|
+
|
|
753
|
+
@cached_property
|
|
754
|
+
def credentials(self) -> credentials.CredentialsResourceWithRawResponse:
|
|
755
|
+
from .resources.credentials import CredentialsResourceWithRawResponse
|
|
756
|
+
|
|
757
|
+
return CredentialsResourceWithRawResponse(self._client.credentials)
|
|
552
758
|
|
|
553
759
|
|
|
554
760
|
class AsyncSGPClientWithRawResponse:
|
|
761
|
+
_client: AsyncSGPClient
|
|
762
|
+
|
|
555
763
|
def __init__(self, client: AsyncSGPClient) -> None:
|
|
556
|
-
self.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
self.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
self.
|
|
569
|
-
|
|
764
|
+
self._client = client
|
|
765
|
+
|
|
766
|
+
@cached_property
|
|
767
|
+
def responses(self) -> responses.AsyncResponsesResourceWithRawResponse:
|
|
768
|
+
from .resources.responses import AsyncResponsesResourceWithRawResponse
|
|
769
|
+
|
|
770
|
+
return AsyncResponsesResourceWithRawResponse(self._client.responses)
|
|
771
|
+
|
|
772
|
+
@cached_property
|
|
773
|
+
def completions(self) -> completions.AsyncCompletionsResourceWithRawResponse:
|
|
774
|
+
from .resources.completions import AsyncCompletionsResourceWithRawResponse
|
|
775
|
+
|
|
776
|
+
return AsyncCompletionsResourceWithRawResponse(self._client.completions)
|
|
777
|
+
|
|
778
|
+
@cached_property
|
|
779
|
+
def chat(self) -> chat.AsyncChatResourceWithRawResponse:
|
|
780
|
+
from .resources.chat import AsyncChatResourceWithRawResponse
|
|
781
|
+
|
|
782
|
+
return AsyncChatResourceWithRawResponse(self._client.chat)
|
|
783
|
+
|
|
784
|
+
@cached_property
|
|
785
|
+
def inference(self) -> inference.AsyncInferenceResourceWithRawResponse:
|
|
786
|
+
from .resources.inference import AsyncInferenceResourceWithRawResponse
|
|
787
|
+
|
|
788
|
+
return AsyncInferenceResourceWithRawResponse(self._client.inference)
|
|
789
|
+
|
|
790
|
+
@cached_property
|
|
791
|
+
def questions(self) -> questions.AsyncQuestionsResourceWithRawResponse:
|
|
792
|
+
from .resources.questions import AsyncQuestionsResourceWithRawResponse
|
|
793
|
+
|
|
794
|
+
return AsyncQuestionsResourceWithRawResponse(self._client.questions)
|
|
795
|
+
|
|
796
|
+
@cached_property
|
|
797
|
+
def files(self) -> files.AsyncFilesResourceWithRawResponse:
|
|
798
|
+
from .resources.files import AsyncFilesResourceWithRawResponse
|
|
799
|
+
|
|
800
|
+
return AsyncFilesResourceWithRawResponse(self._client.files)
|
|
801
|
+
|
|
802
|
+
@cached_property
|
|
803
|
+
def models(self) -> models.AsyncModelsResourceWithRawResponse:
|
|
804
|
+
from .resources.models import AsyncModelsResourceWithRawResponse
|
|
805
|
+
|
|
806
|
+
return AsyncModelsResourceWithRawResponse(self._client.models)
|
|
807
|
+
|
|
808
|
+
@cached_property
|
|
809
|
+
def datasets(self) -> datasets.AsyncDatasetsResourceWithRawResponse:
|
|
810
|
+
from .resources.datasets import AsyncDatasetsResourceWithRawResponse
|
|
811
|
+
|
|
812
|
+
return AsyncDatasetsResourceWithRawResponse(self._client.datasets)
|
|
813
|
+
|
|
814
|
+
@cached_property
|
|
815
|
+
def dataset_items(self) -> dataset_items.AsyncDatasetItemsResourceWithRawResponse:
|
|
816
|
+
from .resources.dataset_items import AsyncDatasetItemsResourceWithRawResponse
|
|
817
|
+
|
|
818
|
+
return AsyncDatasetItemsResourceWithRawResponse(self._client.dataset_items)
|
|
819
|
+
|
|
820
|
+
@cached_property
|
|
821
|
+
def evaluations(self) -> evaluations.AsyncEvaluationsResourceWithRawResponse:
|
|
822
|
+
from .resources.evaluations import AsyncEvaluationsResourceWithRawResponse
|
|
823
|
+
|
|
824
|
+
return AsyncEvaluationsResourceWithRawResponse(self._client.evaluations)
|
|
825
|
+
|
|
826
|
+
@cached_property
|
|
827
|
+
def evaluation_items(self) -> evaluation_items.AsyncEvaluationItemsResourceWithRawResponse:
|
|
828
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResourceWithRawResponse
|
|
829
|
+
|
|
830
|
+
return AsyncEvaluationItemsResourceWithRawResponse(self._client.evaluation_items)
|
|
831
|
+
|
|
832
|
+
@cached_property
|
|
833
|
+
def spans(self) -> spans.AsyncSpansResourceWithRawResponse:
|
|
834
|
+
from .resources.spans import AsyncSpansResourceWithRawResponse
|
|
835
|
+
|
|
836
|
+
return AsyncSpansResourceWithRawResponse(self._client.spans)
|
|
837
|
+
|
|
838
|
+
@cached_property
|
|
839
|
+
def span_assessments(self) -> span_assessments.AsyncSpanAssessmentsResourceWithRawResponse:
|
|
840
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResourceWithRawResponse
|
|
841
|
+
|
|
842
|
+
return AsyncSpanAssessmentsResourceWithRawResponse(self._client.span_assessments)
|
|
843
|
+
|
|
844
|
+
@cached_property
|
|
845
|
+
def credentials(self) -> credentials.AsyncCredentialsResourceWithRawResponse:
|
|
846
|
+
from .resources.credentials import AsyncCredentialsResourceWithRawResponse
|
|
847
|
+
|
|
848
|
+
return AsyncCredentialsResourceWithRawResponse(self._client.credentials)
|
|
570
849
|
|
|
571
850
|
|
|
572
851
|
class SGPClientWithStreamedResponse:
|
|
852
|
+
_client: SGPClient
|
|
853
|
+
|
|
573
854
|
def __init__(self, client: SGPClient) -> None:
|
|
574
|
-
self.
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
self.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
self.
|
|
587
|
-
|
|
855
|
+
self._client = client
|
|
856
|
+
|
|
857
|
+
@cached_property
|
|
858
|
+
def responses(self) -> responses.ResponsesResourceWithStreamingResponse:
|
|
859
|
+
from .resources.responses import ResponsesResourceWithStreamingResponse
|
|
860
|
+
|
|
861
|
+
return ResponsesResourceWithStreamingResponse(self._client.responses)
|
|
862
|
+
|
|
863
|
+
@cached_property
|
|
864
|
+
def completions(self) -> completions.CompletionsResourceWithStreamingResponse:
|
|
865
|
+
from .resources.completions import CompletionsResourceWithStreamingResponse
|
|
866
|
+
|
|
867
|
+
return CompletionsResourceWithStreamingResponse(self._client.completions)
|
|
868
|
+
|
|
869
|
+
@cached_property
|
|
870
|
+
def chat(self) -> chat.ChatResourceWithStreamingResponse:
|
|
871
|
+
from .resources.chat import ChatResourceWithStreamingResponse
|
|
872
|
+
|
|
873
|
+
return ChatResourceWithStreamingResponse(self._client.chat)
|
|
874
|
+
|
|
875
|
+
@cached_property
|
|
876
|
+
def inference(self) -> inference.InferenceResourceWithStreamingResponse:
|
|
877
|
+
from .resources.inference import InferenceResourceWithStreamingResponse
|
|
878
|
+
|
|
879
|
+
return InferenceResourceWithStreamingResponse(self._client.inference)
|
|
880
|
+
|
|
881
|
+
@cached_property
|
|
882
|
+
def questions(self) -> questions.QuestionsResourceWithStreamingResponse:
|
|
883
|
+
from .resources.questions import QuestionsResourceWithStreamingResponse
|
|
884
|
+
|
|
885
|
+
return QuestionsResourceWithStreamingResponse(self._client.questions)
|
|
886
|
+
|
|
887
|
+
@cached_property
|
|
888
|
+
def files(self) -> files.FilesResourceWithStreamingResponse:
|
|
889
|
+
from .resources.files import FilesResourceWithStreamingResponse
|
|
890
|
+
|
|
891
|
+
return FilesResourceWithStreamingResponse(self._client.files)
|
|
892
|
+
|
|
893
|
+
@cached_property
|
|
894
|
+
def models(self) -> models.ModelsResourceWithStreamingResponse:
|
|
895
|
+
from .resources.models import ModelsResourceWithStreamingResponse
|
|
896
|
+
|
|
897
|
+
return ModelsResourceWithStreamingResponse(self._client.models)
|
|
898
|
+
|
|
899
|
+
@cached_property
|
|
900
|
+
def datasets(self) -> datasets.DatasetsResourceWithStreamingResponse:
|
|
901
|
+
from .resources.datasets import DatasetsResourceWithStreamingResponse
|
|
902
|
+
|
|
903
|
+
return DatasetsResourceWithStreamingResponse(self._client.datasets)
|
|
904
|
+
|
|
905
|
+
@cached_property
|
|
906
|
+
def dataset_items(self) -> dataset_items.DatasetItemsResourceWithStreamingResponse:
|
|
907
|
+
from .resources.dataset_items import DatasetItemsResourceWithStreamingResponse
|
|
908
|
+
|
|
909
|
+
return DatasetItemsResourceWithStreamingResponse(self._client.dataset_items)
|
|
910
|
+
|
|
911
|
+
@cached_property
|
|
912
|
+
def evaluations(self) -> evaluations.EvaluationsResourceWithStreamingResponse:
|
|
913
|
+
from .resources.evaluations import EvaluationsResourceWithStreamingResponse
|
|
914
|
+
|
|
915
|
+
return EvaluationsResourceWithStreamingResponse(self._client.evaluations)
|
|
916
|
+
|
|
917
|
+
@cached_property
|
|
918
|
+
def evaluation_items(self) -> evaluation_items.EvaluationItemsResourceWithStreamingResponse:
|
|
919
|
+
from .resources.evaluation_items import EvaluationItemsResourceWithStreamingResponse
|
|
920
|
+
|
|
921
|
+
return EvaluationItemsResourceWithStreamingResponse(self._client.evaluation_items)
|
|
922
|
+
|
|
923
|
+
@cached_property
|
|
924
|
+
def spans(self) -> spans.SpansResourceWithStreamingResponse:
|
|
925
|
+
from .resources.spans import SpansResourceWithStreamingResponse
|
|
926
|
+
|
|
927
|
+
return SpansResourceWithStreamingResponse(self._client.spans)
|
|
928
|
+
|
|
929
|
+
@cached_property
|
|
930
|
+
def span_assessments(self) -> span_assessments.SpanAssessmentsResourceWithStreamingResponse:
|
|
931
|
+
from .resources.span_assessments import SpanAssessmentsResourceWithStreamingResponse
|
|
932
|
+
|
|
933
|
+
return SpanAssessmentsResourceWithStreamingResponse(self._client.span_assessments)
|
|
934
|
+
|
|
935
|
+
@cached_property
|
|
936
|
+
def credentials(self) -> credentials.CredentialsResourceWithStreamingResponse:
|
|
937
|
+
from .resources.credentials import CredentialsResourceWithStreamingResponse
|
|
938
|
+
|
|
939
|
+
return CredentialsResourceWithStreamingResponse(self._client.credentials)
|
|
588
940
|
|
|
589
941
|
|
|
590
942
|
class AsyncSGPClientWithStreamedResponse:
|
|
943
|
+
_client: AsyncSGPClient
|
|
944
|
+
|
|
591
945
|
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
|
-
|
|
946
|
+
self._client = client
|
|
947
|
+
|
|
948
|
+
@cached_property
|
|
949
|
+
def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse:
|
|
950
|
+
from .resources.responses import AsyncResponsesResourceWithStreamingResponse
|
|
951
|
+
|
|
952
|
+
return AsyncResponsesResourceWithStreamingResponse(self._client.responses)
|
|
953
|
+
|
|
954
|
+
@cached_property
|
|
955
|
+
def completions(self) -> completions.AsyncCompletionsResourceWithStreamingResponse:
|
|
956
|
+
from .resources.completions import AsyncCompletionsResourceWithStreamingResponse
|
|
957
|
+
|
|
958
|
+
return AsyncCompletionsResourceWithStreamingResponse(self._client.completions)
|
|
959
|
+
|
|
960
|
+
@cached_property
|
|
961
|
+
def chat(self) -> chat.AsyncChatResourceWithStreamingResponse:
|
|
962
|
+
from .resources.chat import AsyncChatResourceWithStreamingResponse
|
|
963
|
+
|
|
964
|
+
return AsyncChatResourceWithStreamingResponse(self._client.chat)
|
|
965
|
+
|
|
966
|
+
@cached_property
|
|
967
|
+
def inference(self) -> inference.AsyncInferenceResourceWithStreamingResponse:
|
|
968
|
+
from .resources.inference import AsyncInferenceResourceWithStreamingResponse
|
|
969
|
+
|
|
970
|
+
return AsyncInferenceResourceWithStreamingResponse(self._client.inference)
|
|
971
|
+
|
|
972
|
+
@cached_property
|
|
973
|
+
def questions(self) -> questions.AsyncQuestionsResourceWithStreamingResponse:
|
|
974
|
+
from .resources.questions import AsyncQuestionsResourceWithStreamingResponse
|
|
975
|
+
|
|
976
|
+
return AsyncQuestionsResourceWithStreamingResponse(self._client.questions)
|
|
977
|
+
|
|
978
|
+
@cached_property
|
|
979
|
+
def files(self) -> files.AsyncFilesResourceWithStreamingResponse:
|
|
980
|
+
from .resources.files import AsyncFilesResourceWithStreamingResponse
|
|
981
|
+
|
|
982
|
+
return AsyncFilesResourceWithStreamingResponse(self._client.files)
|
|
983
|
+
|
|
984
|
+
@cached_property
|
|
985
|
+
def models(self) -> models.AsyncModelsResourceWithStreamingResponse:
|
|
986
|
+
from .resources.models import AsyncModelsResourceWithStreamingResponse
|
|
987
|
+
|
|
988
|
+
return AsyncModelsResourceWithStreamingResponse(self._client.models)
|
|
989
|
+
|
|
990
|
+
@cached_property
|
|
991
|
+
def datasets(self) -> datasets.AsyncDatasetsResourceWithStreamingResponse:
|
|
992
|
+
from .resources.datasets import AsyncDatasetsResourceWithStreamingResponse
|
|
993
|
+
|
|
994
|
+
return AsyncDatasetsResourceWithStreamingResponse(self._client.datasets)
|
|
995
|
+
|
|
996
|
+
@cached_property
|
|
997
|
+
def dataset_items(self) -> dataset_items.AsyncDatasetItemsResourceWithStreamingResponse:
|
|
998
|
+
from .resources.dataset_items import AsyncDatasetItemsResourceWithStreamingResponse
|
|
999
|
+
|
|
1000
|
+
return AsyncDatasetItemsResourceWithStreamingResponse(self._client.dataset_items)
|
|
1001
|
+
|
|
1002
|
+
@cached_property
|
|
1003
|
+
def evaluations(self) -> evaluations.AsyncEvaluationsResourceWithStreamingResponse:
|
|
1004
|
+
from .resources.evaluations import AsyncEvaluationsResourceWithStreamingResponse
|
|
1005
|
+
|
|
1006
|
+
return AsyncEvaluationsResourceWithStreamingResponse(self._client.evaluations)
|
|
1007
|
+
|
|
1008
|
+
@cached_property
|
|
1009
|
+
def evaluation_items(self) -> evaluation_items.AsyncEvaluationItemsResourceWithStreamingResponse:
|
|
1010
|
+
from .resources.evaluation_items import AsyncEvaluationItemsResourceWithStreamingResponse
|
|
1011
|
+
|
|
1012
|
+
return AsyncEvaluationItemsResourceWithStreamingResponse(self._client.evaluation_items)
|
|
1013
|
+
|
|
1014
|
+
@cached_property
|
|
1015
|
+
def spans(self) -> spans.AsyncSpansResourceWithStreamingResponse:
|
|
1016
|
+
from .resources.spans import AsyncSpansResourceWithStreamingResponse
|
|
1017
|
+
|
|
1018
|
+
return AsyncSpansResourceWithStreamingResponse(self._client.spans)
|
|
1019
|
+
|
|
1020
|
+
@cached_property
|
|
1021
|
+
def span_assessments(self) -> span_assessments.AsyncSpanAssessmentsResourceWithStreamingResponse:
|
|
1022
|
+
from .resources.span_assessments import AsyncSpanAssessmentsResourceWithStreamingResponse
|
|
1023
|
+
|
|
1024
|
+
return AsyncSpanAssessmentsResourceWithStreamingResponse(self._client.span_assessments)
|
|
1025
|
+
|
|
1026
|
+
@cached_property
|
|
1027
|
+
def credentials(self) -> credentials.AsyncCredentialsResourceWithStreamingResponse:
|
|
1028
|
+
from .resources.credentials import AsyncCredentialsResourceWithStreamingResponse
|
|
1029
|
+
|
|
1030
|
+
return AsyncCredentialsResourceWithStreamingResponse(self._client.credentials)
|
|
610
1031
|
|
|
611
1032
|
|
|
612
1033
|
Client = SGPClient
|