scale-gp-beta 0.1.0a12__py3-none-any.whl → 0.1.0a14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scale_gp_beta/__init__.py +5 -0
- scale_gp_beta/_utils/_proxy.py +4 -1
- scale_gp_beta/_utils/_resources_proxy.py +24 -0
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/pagination.py +39 -1
- scale_gp_beta/resources/chat/completions.py +136 -1
- scale_gp_beta/resources/dataset_items.py +29 -21
- scale_gp_beta/resources/datasets.py +18 -5
- scale_gp_beta/resources/evaluation_items.py +11 -7
- scale_gp_beta/resources/evaluations.py +142 -21
- scale_gp_beta/resources/files/files.py +10 -5
- scale_gp_beta/resources/models.py +35 -35
- scale_gp_beta/resources/spans.py +312 -24
- scale_gp_beta/types/__init__.py +9 -2
- scale_gp_beta/types/chat/__init__.py +3 -0
- scale_gp_beta/types/chat/completion_models_params.py +31 -0
- scale_gp_beta/types/{dataset_item_batch_create_response.py → chat/completion_models_response.py} +5 -5
- scale_gp_beta/types/chat/model_definition.py +32 -0
- scale_gp_beta/types/component.py +18 -0
- scale_gp_beta/types/component_param.py +19 -0
- scale_gp_beta/types/container.py +35 -0
- scale_gp_beta/types/container_param.py +28 -0
- scale_gp_beta/types/dataset_item.py +2 -0
- scale_gp_beta/types/dataset_item_list_params.py +7 -6
- scale_gp_beta/types/dataset_item_retrieve_params.py +1 -2
- scale_gp_beta/types/dataset_list_params.py +10 -4
- scale_gp_beta/types/evaluation.py +12 -2
- scale_gp_beta/types/evaluation_create_params.py +5 -5
- scale_gp_beta/types/{evaluation_archive_response.py → evaluation_delete_response.py} +2 -2
- scale_gp_beta/types/evaluation_item_list_params.py +6 -5
- scale_gp_beta/types/evaluation_list_params.py +9 -3
- scale_gp_beta/types/evaluation_task.py +139 -33
- scale_gp_beta/types/evaluation_task_param.py +88 -33
- scale_gp_beta/types/evaluation_update_params.py +17 -0
- scale_gp_beta/types/file_list_params.py +5 -4
- scale_gp_beta/types/inference_model.py +0 -4
- scale_gp_beta/types/item_locator.py +7 -0
- scale_gp_beta/types/item_locator_template.py +7 -0
- scale_gp_beta/types/model_list_params.py +17 -18
- scale_gp_beta/types/span.py +40 -1
- scale_gp_beta/types/span_batch_params.py +130 -0
- scale_gp_beta/types/span_create_params.py +71 -3
- scale_gp_beta/types/span_list_params.py +7 -6
- scale_gp_beta/types/span_update_params.py +5 -3
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/METADATA +1 -1
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/RECORD +48 -37
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/licenses/LICENSE +0 -0
|
@@ -5,6 +5,8 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Dict, List, Union, Iterable
|
|
6
6
|
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
7
|
|
|
8
|
+
from .item_locator import ItemLocator
|
|
9
|
+
|
|
8
10
|
__all__ = [
|
|
9
11
|
"EvaluationTaskParam",
|
|
10
12
|
"ChatCompletionEvaluationTask",
|
|
@@ -29,63 +31,67 @@ __all__ = [
|
|
|
29
31
|
"MetricEvaluationTaskConfigurationRougeScorer1ConfigWithItemLocator",
|
|
30
32
|
"MetricEvaluationTaskConfigurationRougeScorer2ConfigWithItemLocator",
|
|
31
33
|
"MetricEvaluationTaskConfigurationRougeScorerLConfigWithItemLocator",
|
|
34
|
+
"AutoEvaluationQuestionTask",
|
|
35
|
+
"AutoEvaluationQuestionTaskConfiguration",
|
|
36
|
+
"ContributorEvaluationQuestionTask",
|
|
37
|
+
"ContributorEvaluationQuestionTaskConfiguration",
|
|
32
38
|
]
|
|
33
39
|
|
|
34
40
|
|
|
35
41
|
class ChatCompletionEvaluationTaskConfigurationTyped(TypedDict, total=False):
|
|
36
|
-
messages: Required[Union[Iterable[Dict[str, object]],
|
|
42
|
+
messages: Required[Union[Iterable[Dict[str, object]], ItemLocator]]
|
|
37
43
|
|
|
38
44
|
model: Required[str]
|
|
39
45
|
|
|
40
|
-
audio: Union[Dict[str, object],
|
|
46
|
+
audio: Union[Dict[str, object], ItemLocator]
|
|
41
47
|
|
|
42
|
-
frequency_penalty: Union[float,
|
|
48
|
+
frequency_penalty: Union[float, ItemLocator]
|
|
43
49
|
|
|
44
|
-
function_call: Union[Dict[str, object],
|
|
50
|
+
function_call: Union[Dict[str, object], ItemLocator]
|
|
45
51
|
|
|
46
|
-
functions: Union[Iterable[Dict[str, object]],
|
|
52
|
+
functions: Union[Iterable[Dict[str, object]], ItemLocator]
|
|
47
53
|
|
|
48
|
-
logit_bias: Union[Dict[str, int],
|
|
54
|
+
logit_bias: Union[Dict[str, int], ItemLocator]
|
|
49
55
|
|
|
50
|
-
logprobs: Union[bool,
|
|
56
|
+
logprobs: Union[bool, ItemLocator]
|
|
51
57
|
|
|
52
|
-
max_completion_tokens: Union[int,
|
|
58
|
+
max_completion_tokens: Union[int, ItemLocator]
|
|
53
59
|
|
|
54
|
-
max_tokens: Union[int,
|
|
60
|
+
max_tokens: Union[int, ItemLocator]
|
|
55
61
|
|
|
56
|
-
metadata: Union[Dict[str, str],
|
|
62
|
+
metadata: Union[Dict[str, str], ItemLocator]
|
|
57
63
|
|
|
58
|
-
modalities: Union[List[str],
|
|
64
|
+
modalities: Union[List[str], ItemLocator]
|
|
59
65
|
|
|
60
|
-
n: Union[int,
|
|
66
|
+
n: Union[int, ItemLocator]
|
|
61
67
|
|
|
62
|
-
parallel_tool_calls: Union[bool,
|
|
68
|
+
parallel_tool_calls: Union[bool, ItemLocator]
|
|
63
69
|
|
|
64
|
-
prediction: Union[Dict[str, object],
|
|
70
|
+
prediction: Union[Dict[str, object], ItemLocator]
|
|
65
71
|
|
|
66
|
-
presence_penalty: Union[float,
|
|
72
|
+
presence_penalty: Union[float, ItemLocator]
|
|
67
73
|
|
|
68
74
|
reasoning_effort: str
|
|
69
75
|
|
|
70
|
-
response_format: Union[Dict[str, object],
|
|
76
|
+
response_format: Union[Dict[str, object], ItemLocator]
|
|
71
77
|
|
|
72
|
-
seed: Union[int,
|
|
78
|
+
seed: Union[int, ItemLocator]
|
|
73
79
|
|
|
74
80
|
stop: str
|
|
75
81
|
|
|
76
|
-
store: Union[bool,
|
|
82
|
+
store: Union[bool, ItemLocator]
|
|
77
83
|
|
|
78
|
-
temperature: Union[float,
|
|
84
|
+
temperature: Union[float, ItemLocator]
|
|
79
85
|
|
|
80
86
|
tool_choice: str
|
|
81
87
|
|
|
82
|
-
tools: Union[Iterable[Dict[str, object]],
|
|
88
|
+
tools: Union[Iterable[Dict[str, object]], ItemLocator]
|
|
83
89
|
|
|
84
|
-
top_k: Union[int,
|
|
90
|
+
top_k: Union[int, ItemLocator]
|
|
85
91
|
|
|
86
|
-
top_logprobs: Union[int,
|
|
92
|
+
top_logprobs: Union[int, ItemLocator]
|
|
87
93
|
|
|
88
|
-
top_p: Union[float,
|
|
94
|
+
top_p: Union[float, ItemLocator]
|
|
89
95
|
|
|
90
96
|
|
|
91
97
|
ChatCompletionEvaluationTaskConfiguration: TypeAlias = Union[
|
|
@@ -97,7 +103,7 @@ class ChatCompletionEvaluationTask(TypedDict, total=False):
|
|
|
97
103
|
configuration: Required[ChatCompletionEvaluationTaskConfiguration]
|
|
98
104
|
|
|
99
105
|
alias: str
|
|
100
|
-
"""Alias to title the results column. Defaults to the `
|
|
106
|
+
"""Alias to title the results column. Defaults to the `chat_completion`"""
|
|
101
107
|
|
|
102
108
|
task_type: Literal["chat_completion"]
|
|
103
109
|
|
|
@@ -111,14 +117,14 @@ class GenericInferenceEvaluationTaskConfigurationInferenceConfigurationLaunchInf
|
|
|
111
117
|
|
|
112
118
|
|
|
113
119
|
GenericInferenceEvaluationTaskConfigurationInferenceConfiguration: TypeAlias = Union[
|
|
114
|
-
GenericInferenceEvaluationTaskConfigurationInferenceConfigurationLaunchInferenceConfiguration,
|
|
120
|
+
GenericInferenceEvaluationTaskConfigurationInferenceConfigurationLaunchInferenceConfiguration, ItemLocator
|
|
115
121
|
]
|
|
116
122
|
|
|
117
123
|
|
|
118
124
|
class GenericInferenceEvaluationTaskConfiguration(TypedDict, total=False):
|
|
119
125
|
model: Required[str]
|
|
120
126
|
|
|
121
|
-
args: Union[Dict[str, object],
|
|
127
|
+
args: Union[Dict[str, object], ItemLocator]
|
|
122
128
|
|
|
123
129
|
inference_configuration: GenericInferenceEvaluationTaskConfigurationInferenceConfiguration
|
|
124
130
|
|
|
@@ -127,7 +133,7 @@ class GenericInferenceEvaluationTask(TypedDict, total=False):
|
|
|
127
133
|
configuration: Required[GenericInferenceEvaluationTaskConfiguration]
|
|
128
134
|
|
|
129
135
|
alias: str
|
|
130
|
-
"""Alias to title the results column. Defaults to the `
|
|
136
|
+
"""Alias to title the results column. Defaults to the `inference`"""
|
|
131
137
|
|
|
132
138
|
task_type: Literal["inference"]
|
|
133
139
|
|
|
@@ -180,22 +186,24 @@ class ApplicationVariantV1EvaluationTaskConfigurationOverridesAgenticApplication
|
|
|
180
186
|
ApplicationVariantV1EvaluationTaskConfigurationOverridesAgenticApplicationOverridesPartialTrace
|
|
181
187
|
]
|
|
182
188
|
|
|
189
|
+
return_span: bool
|
|
190
|
+
|
|
183
191
|
use_channels: bool
|
|
184
192
|
|
|
185
193
|
|
|
186
194
|
ApplicationVariantV1EvaluationTaskConfigurationOverrides: TypeAlias = Union[
|
|
187
|
-
ApplicationVariantV1EvaluationTaskConfigurationOverridesAgenticApplicationOverrides,
|
|
195
|
+
ApplicationVariantV1EvaluationTaskConfigurationOverridesAgenticApplicationOverrides, ItemLocator
|
|
188
196
|
]
|
|
189
197
|
|
|
190
198
|
|
|
191
199
|
class ApplicationVariantV1EvaluationTaskConfiguration(TypedDict, total=False):
|
|
192
200
|
application_variant_id: Required[str]
|
|
193
201
|
|
|
194
|
-
inputs: Required[Union[Dict[str, object],
|
|
202
|
+
inputs: Required[Union[Dict[str, object], ItemLocator]]
|
|
195
203
|
|
|
196
|
-
history: Union[Iterable[ApplicationVariantV1EvaluationTaskConfigurationHistoryUnionMember0],
|
|
204
|
+
history: Union[Iterable[ApplicationVariantV1EvaluationTaskConfigurationHistoryUnionMember0], ItemLocator]
|
|
197
205
|
|
|
198
|
-
operation_metadata: Union[Dict[str, object],
|
|
206
|
+
operation_metadata: Union[Dict[str, object], ItemLocator]
|
|
199
207
|
|
|
200
208
|
overrides: ApplicationVariantV1EvaluationTaskConfigurationOverrides
|
|
201
209
|
"""Execution override options for agentic applications"""
|
|
@@ -205,7 +213,7 @@ class ApplicationVariantV1EvaluationTask(TypedDict, total=False):
|
|
|
205
213
|
configuration: Required[ApplicationVariantV1EvaluationTaskConfiguration]
|
|
206
214
|
|
|
207
215
|
alias: str
|
|
208
|
-
"""Alias to title the results column. Defaults to the `
|
|
216
|
+
"""Alias to title the results column. Defaults to the `application_variant`"""
|
|
209
217
|
|
|
210
218
|
task_type: Literal["application_variant"]
|
|
211
219
|
|
|
@@ -281,14 +289,61 @@ class MetricEvaluationTask(TypedDict, total=False):
|
|
|
281
289
|
configuration: Required[MetricEvaluationTaskConfiguration]
|
|
282
290
|
|
|
283
291
|
alias: str
|
|
284
|
-
"""Alias to title the results column.
|
|
292
|
+
"""Alias to title the results column.
|
|
293
|
+
|
|
294
|
+
Defaults to the metric type specified in the configuration
|
|
295
|
+
"""
|
|
285
296
|
|
|
286
297
|
task_type: Literal["metric"]
|
|
287
298
|
|
|
288
299
|
|
|
300
|
+
class AutoEvaluationQuestionTaskConfiguration(TypedDict, total=False):
|
|
301
|
+
model: Required[str]
|
|
302
|
+
"""model specified as `model_vendor/model_name`"""
|
|
303
|
+
|
|
304
|
+
prompt: Required[str]
|
|
305
|
+
|
|
306
|
+
question_id: Required[str]
|
|
307
|
+
"""question to be evaluated"""
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class AutoEvaluationQuestionTask(TypedDict, total=False):
|
|
311
|
+
configuration: Required[AutoEvaluationQuestionTaskConfiguration]
|
|
312
|
+
|
|
313
|
+
alias: str
|
|
314
|
+
"""Alias to title the results column. Defaults to the `auto_evaluation_question`"""
|
|
315
|
+
|
|
316
|
+
task_type: Literal["auto_evaluation.question"]
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
class ContributorEvaluationQuestionTaskConfiguration(TypedDict, total=False):
|
|
320
|
+
layout: Required["ContainerParam"]
|
|
321
|
+
|
|
322
|
+
question_id: Required[str]
|
|
323
|
+
|
|
324
|
+
queue_id: str
|
|
325
|
+
"""The contributor annotation queue to include this task in. Defaults to `default`"""
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
class ContributorEvaluationQuestionTask(TypedDict, total=False):
|
|
329
|
+
configuration: Required[ContributorEvaluationQuestionTaskConfiguration]
|
|
330
|
+
|
|
331
|
+
alias: str
|
|
332
|
+
"""Alias to title the results column.
|
|
333
|
+
|
|
334
|
+
Defaults to the `contributor_evaluation_question`
|
|
335
|
+
"""
|
|
336
|
+
|
|
337
|
+
task_type: Literal["contributor_evaluation.question"]
|
|
338
|
+
|
|
339
|
+
|
|
289
340
|
EvaluationTaskParam: TypeAlias = Union[
|
|
290
341
|
ChatCompletionEvaluationTask,
|
|
291
342
|
GenericInferenceEvaluationTask,
|
|
292
343
|
ApplicationVariantV1EvaluationTask,
|
|
293
344
|
MetricEvaluationTask,
|
|
345
|
+
AutoEvaluationQuestionTask,
|
|
346
|
+
ContributorEvaluationQuestionTask,
|
|
294
347
|
]
|
|
348
|
+
|
|
349
|
+
from .container_param import ContainerParam
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["EvaluationUpdateParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EvaluationUpdateParams(TypedDict, total=False):
|
|
12
|
+
description: str
|
|
13
|
+
|
|
14
|
+
name: str
|
|
15
|
+
|
|
16
|
+
tags: List[str]
|
|
17
|
+
"""The tags associated with the entity"""
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from typing_extensions import TypedDict
|
|
5
|
+
from typing_extensions import Literal, TypedDict
|
|
7
6
|
|
|
8
7
|
__all__ = ["FileListParams"]
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class FileListParams(TypedDict, total=False):
|
|
12
|
-
ending_before:
|
|
11
|
+
ending_before: str
|
|
13
12
|
|
|
14
13
|
limit: int
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
sort_order: Literal["asc", "desc"]
|
|
16
|
+
|
|
17
|
+
starting_after: str
|
|
@@ -170,10 +170,6 @@ class InferenceModel(BaseModel):
|
|
|
170
170
|
|
|
171
171
|
status: Literal["failed", "ready", "deploying"]
|
|
172
172
|
|
|
173
|
-
description: Optional[str] = None
|
|
174
|
-
|
|
175
|
-
display_name: Optional[str] = None
|
|
176
|
-
|
|
177
173
|
api_model_metadata: Optional[Dict[str, object]] = FieldInfo(alias="model_metadata", default=None)
|
|
178
174
|
|
|
179
175
|
object: Optional[Literal["model"]] = None
|
|
@@ -2,33 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
6
5
|
from typing_extensions import Literal, TypedDict
|
|
7
6
|
|
|
8
7
|
__all__ = ["ModelListParams"]
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class ModelListParams(TypedDict, total=False):
|
|
12
|
-
ending_before:
|
|
11
|
+
ending_before: str
|
|
13
12
|
|
|
14
13
|
limit: int
|
|
15
14
|
|
|
16
|
-
model_vendor:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"xai",
|
|
29
|
-
]
|
|
15
|
+
model_vendor: Literal[
|
|
16
|
+
"openai",
|
|
17
|
+
"cohere",
|
|
18
|
+
"vertex_ai",
|
|
19
|
+
"anthropic",
|
|
20
|
+
"azure",
|
|
21
|
+
"gemini",
|
|
22
|
+
"launch",
|
|
23
|
+
"llmengine",
|
|
24
|
+
"model_zoo",
|
|
25
|
+
"bedrock",
|
|
26
|
+
"xai",
|
|
30
27
|
]
|
|
31
28
|
|
|
32
|
-
name:
|
|
29
|
+
name: str
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
sort_order: Literal["asc", "desc"]
|
|
32
|
+
|
|
33
|
+
starting_after: str
|
scale_gp_beta/types/span.py
CHANGED
|
@@ -24,15 +24,54 @@ class Span(BaseModel):
|
|
|
24
24
|
trace_id: str
|
|
25
25
|
"""id for grouping traces together, uuid is recommended"""
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
application_interaction_id: Optional[str] = None
|
|
28
|
+
"""The interaction ID this span belongs to"""
|
|
29
|
+
|
|
30
|
+
application_variant_id: Optional[str] = None
|
|
31
|
+
"""The id of the application variant this span belongs to"""
|
|
28
32
|
|
|
29
33
|
end_timestamp: Optional[datetime] = None
|
|
30
34
|
|
|
31
35
|
input: Optional[Dict[str, object]] = None
|
|
32
36
|
|
|
37
|
+
metadata: Optional[Dict[str, object]] = None
|
|
38
|
+
|
|
33
39
|
object: Optional[Literal["span"]] = None
|
|
34
40
|
|
|
35
41
|
output: Optional[Dict[str, builtins.object]] = None
|
|
36
42
|
|
|
37
43
|
parent_id: Optional[str] = None
|
|
38
44
|
"""Reference to a parent span_id"""
|
|
45
|
+
|
|
46
|
+
status: Optional[Literal["SUCCESS", "ERROR"]] = None
|
|
47
|
+
|
|
48
|
+
type: Optional[
|
|
49
|
+
Literal[
|
|
50
|
+
"TEXT_INPUT",
|
|
51
|
+
"TEXT_OUTPUT",
|
|
52
|
+
"COMPLETION_INPUT",
|
|
53
|
+
"COMPLETION",
|
|
54
|
+
"KB_RETRIEVAL",
|
|
55
|
+
"KB_INPUT",
|
|
56
|
+
"RERANKING",
|
|
57
|
+
"EXTERNAL_ENDPOINT",
|
|
58
|
+
"PROMPT_ENGINEERING",
|
|
59
|
+
"DOCUMENT_INPUT",
|
|
60
|
+
"MAP_REDUCE",
|
|
61
|
+
"DOCUMENT_SEARCH",
|
|
62
|
+
"DOCUMENT_PROMPT",
|
|
63
|
+
"CUSTOM",
|
|
64
|
+
"INPUT_GUARDRAIL",
|
|
65
|
+
"OUTPUT_GUARDRAIL",
|
|
66
|
+
"CODE_EXECUTION",
|
|
67
|
+
"DATA_MANIPULATION",
|
|
68
|
+
"EVALUATION",
|
|
69
|
+
"FILE_RETRIEVAL",
|
|
70
|
+
"KB_ADD_CHUNK",
|
|
71
|
+
"KB_MANAGEMENT",
|
|
72
|
+
"TRACER",
|
|
73
|
+
"AGENT_TRACER",
|
|
74
|
+
"AGENT_WORKFLOW",
|
|
75
|
+
"STANDALONE",
|
|
76
|
+
]
|
|
77
|
+
] = None
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
8
|
+
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["SpanBatchParams", "Item", "ItemBaseSpanCreateRequest", "ItemLegacyApplicationSpanCreateRequest"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SpanBatchParams(TypedDict, total=False):
|
|
15
|
+
items: Required[Iterable[Item]]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ItemBaseSpanCreateRequest(TypedDict, total=False):
|
|
19
|
+
name: Required[str]
|
|
20
|
+
|
|
21
|
+
start_timestamp: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
|
|
22
|
+
|
|
23
|
+
trace_id: Required[str]
|
|
24
|
+
"""id for grouping traces together, uuid is recommended"""
|
|
25
|
+
|
|
26
|
+
id: str
|
|
27
|
+
"""The id of the span"""
|
|
28
|
+
|
|
29
|
+
end_timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
|
30
|
+
|
|
31
|
+
input: Dict[str, object]
|
|
32
|
+
|
|
33
|
+
metadata: Dict[str, object]
|
|
34
|
+
|
|
35
|
+
output: Dict[str, object]
|
|
36
|
+
|
|
37
|
+
parent_id: str
|
|
38
|
+
"""Reference to a parent span_id"""
|
|
39
|
+
|
|
40
|
+
status: Literal["SUCCESS", "ERROR"]
|
|
41
|
+
|
|
42
|
+
type: Literal[
|
|
43
|
+
"TEXT_INPUT",
|
|
44
|
+
"TEXT_OUTPUT",
|
|
45
|
+
"COMPLETION_INPUT",
|
|
46
|
+
"COMPLETION",
|
|
47
|
+
"KB_RETRIEVAL",
|
|
48
|
+
"KB_INPUT",
|
|
49
|
+
"RERANKING",
|
|
50
|
+
"EXTERNAL_ENDPOINT",
|
|
51
|
+
"PROMPT_ENGINEERING",
|
|
52
|
+
"DOCUMENT_INPUT",
|
|
53
|
+
"MAP_REDUCE",
|
|
54
|
+
"DOCUMENT_SEARCH",
|
|
55
|
+
"DOCUMENT_PROMPT",
|
|
56
|
+
"CUSTOM",
|
|
57
|
+
"INPUT_GUARDRAIL",
|
|
58
|
+
"OUTPUT_GUARDRAIL",
|
|
59
|
+
"CODE_EXECUTION",
|
|
60
|
+
"DATA_MANIPULATION",
|
|
61
|
+
"EVALUATION",
|
|
62
|
+
"FILE_RETRIEVAL",
|
|
63
|
+
"KB_ADD_CHUNK",
|
|
64
|
+
"KB_MANAGEMENT",
|
|
65
|
+
"TRACER",
|
|
66
|
+
"AGENT_TRACER",
|
|
67
|
+
"AGENT_WORKFLOW",
|
|
68
|
+
"STANDALONE",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class ItemLegacyApplicationSpanCreateRequest(TypedDict, total=False):
|
|
73
|
+
application_interaction_id: Required[str]
|
|
74
|
+
|
|
75
|
+
application_variant_id: Required[str]
|
|
76
|
+
|
|
77
|
+
name: Required[str]
|
|
78
|
+
|
|
79
|
+
start_timestamp: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
|
|
80
|
+
|
|
81
|
+
trace_id: Required[str]
|
|
82
|
+
"""id for grouping traces together, uuid is recommended"""
|
|
83
|
+
|
|
84
|
+
id: str
|
|
85
|
+
"""The id of the span"""
|
|
86
|
+
|
|
87
|
+
end_timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
|
88
|
+
|
|
89
|
+
input: Dict[str, object]
|
|
90
|
+
|
|
91
|
+
metadata: Dict[str, object]
|
|
92
|
+
|
|
93
|
+
output: Dict[str, object]
|
|
94
|
+
|
|
95
|
+
parent_id: str
|
|
96
|
+
"""Reference to a parent span_id"""
|
|
97
|
+
|
|
98
|
+
status: Literal["SUCCESS", "ERROR"]
|
|
99
|
+
|
|
100
|
+
type: Literal[
|
|
101
|
+
"TEXT_INPUT",
|
|
102
|
+
"TEXT_OUTPUT",
|
|
103
|
+
"COMPLETION_INPUT",
|
|
104
|
+
"COMPLETION",
|
|
105
|
+
"KB_RETRIEVAL",
|
|
106
|
+
"KB_INPUT",
|
|
107
|
+
"RERANKING",
|
|
108
|
+
"EXTERNAL_ENDPOINT",
|
|
109
|
+
"PROMPT_ENGINEERING",
|
|
110
|
+
"DOCUMENT_INPUT",
|
|
111
|
+
"MAP_REDUCE",
|
|
112
|
+
"DOCUMENT_SEARCH",
|
|
113
|
+
"DOCUMENT_PROMPT",
|
|
114
|
+
"CUSTOM",
|
|
115
|
+
"INPUT_GUARDRAIL",
|
|
116
|
+
"OUTPUT_GUARDRAIL",
|
|
117
|
+
"CODE_EXECUTION",
|
|
118
|
+
"DATA_MANIPULATION",
|
|
119
|
+
"EVALUATION",
|
|
120
|
+
"FILE_RETRIEVAL",
|
|
121
|
+
"KB_ADD_CHUNK",
|
|
122
|
+
"KB_MANAGEMENT",
|
|
123
|
+
"TRACER",
|
|
124
|
+
"AGENT_TRACER",
|
|
125
|
+
"AGENT_WORKFLOW",
|
|
126
|
+
"STANDALONE",
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
Item: TypeAlias = Union[ItemBaseSpanCreateRequest, ItemLegacyApplicationSpanCreateRequest]
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Dict, Union
|
|
6
6
|
from datetime import datetime
|
|
7
|
-
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
|
8
8
|
|
|
9
9
|
from .._utils import PropertyInfo
|
|
10
10
|
|
|
@@ -19,17 +19,51 @@ class BaseSpanCreateRequest(TypedDict, total=False):
|
|
|
19
19
|
trace_id: Required[str]
|
|
20
20
|
"""id for grouping traces together, uuid is recommended"""
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
id: str
|
|
23
|
+
"""The id of the span"""
|
|
23
24
|
|
|
24
25
|
end_timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
|
25
26
|
|
|
26
27
|
input: Dict[str, object]
|
|
27
28
|
|
|
29
|
+
metadata: Dict[str, object]
|
|
30
|
+
|
|
28
31
|
output: Dict[str, object]
|
|
29
32
|
|
|
30
33
|
parent_id: str
|
|
31
34
|
"""Reference to a parent span_id"""
|
|
32
35
|
|
|
36
|
+
status: Literal["SUCCESS", "ERROR"]
|
|
37
|
+
|
|
38
|
+
type: Literal[
|
|
39
|
+
"TEXT_INPUT",
|
|
40
|
+
"TEXT_OUTPUT",
|
|
41
|
+
"COMPLETION_INPUT",
|
|
42
|
+
"COMPLETION",
|
|
43
|
+
"KB_RETRIEVAL",
|
|
44
|
+
"KB_INPUT",
|
|
45
|
+
"RERANKING",
|
|
46
|
+
"EXTERNAL_ENDPOINT",
|
|
47
|
+
"PROMPT_ENGINEERING",
|
|
48
|
+
"DOCUMENT_INPUT",
|
|
49
|
+
"MAP_REDUCE",
|
|
50
|
+
"DOCUMENT_SEARCH",
|
|
51
|
+
"DOCUMENT_PROMPT",
|
|
52
|
+
"CUSTOM",
|
|
53
|
+
"INPUT_GUARDRAIL",
|
|
54
|
+
"OUTPUT_GUARDRAIL",
|
|
55
|
+
"CODE_EXECUTION",
|
|
56
|
+
"DATA_MANIPULATION",
|
|
57
|
+
"EVALUATION",
|
|
58
|
+
"FILE_RETRIEVAL",
|
|
59
|
+
"KB_ADD_CHUNK",
|
|
60
|
+
"KB_MANAGEMENT",
|
|
61
|
+
"TRACER",
|
|
62
|
+
"AGENT_TRACER",
|
|
63
|
+
"AGENT_WORKFLOW",
|
|
64
|
+
"STANDALONE",
|
|
65
|
+
]
|
|
66
|
+
|
|
33
67
|
|
|
34
68
|
class LegacyApplicationSpanCreateRequest(TypedDict, total=False):
|
|
35
69
|
application_interaction_id: Required[str]
|
|
@@ -43,16 +77,50 @@ class LegacyApplicationSpanCreateRequest(TypedDict, total=False):
|
|
|
43
77
|
trace_id: Required[str]
|
|
44
78
|
"""id for grouping traces together, uuid is recommended"""
|
|
45
79
|
|
|
46
|
-
|
|
80
|
+
id: str
|
|
81
|
+
"""The id of the span"""
|
|
47
82
|
|
|
48
83
|
end_timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
|
|
49
84
|
|
|
50
85
|
input: Dict[str, object]
|
|
51
86
|
|
|
87
|
+
metadata: Dict[str, object]
|
|
88
|
+
|
|
52
89
|
output: Dict[str, object]
|
|
53
90
|
|
|
54
91
|
parent_id: str
|
|
55
92
|
"""Reference to a parent span_id"""
|
|
56
93
|
|
|
94
|
+
status: Literal["SUCCESS", "ERROR"]
|
|
95
|
+
|
|
96
|
+
type: Literal[
|
|
97
|
+
"TEXT_INPUT",
|
|
98
|
+
"TEXT_OUTPUT",
|
|
99
|
+
"COMPLETION_INPUT",
|
|
100
|
+
"COMPLETION",
|
|
101
|
+
"KB_RETRIEVAL",
|
|
102
|
+
"KB_INPUT",
|
|
103
|
+
"RERANKING",
|
|
104
|
+
"EXTERNAL_ENDPOINT",
|
|
105
|
+
"PROMPT_ENGINEERING",
|
|
106
|
+
"DOCUMENT_INPUT",
|
|
107
|
+
"MAP_REDUCE",
|
|
108
|
+
"DOCUMENT_SEARCH",
|
|
109
|
+
"DOCUMENT_PROMPT",
|
|
110
|
+
"CUSTOM",
|
|
111
|
+
"INPUT_GUARDRAIL",
|
|
112
|
+
"OUTPUT_GUARDRAIL",
|
|
113
|
+
"CODE_EXECUTION",
|
|
114
|
+
"DATA_MANIPULATION",
|
|
115
|
+
"EVALUATION",
|
|
116
|
+
"FILE_RETRIEVAL",
|
|
117
|
+
"KB_ADD_CHUNK",
|
|
118
|
+
"KB_MANAGEMENT",
|
|
119
|
+
"TRACER",
|
|
120
|
+
"AGENT_TRACER",
|
|
121
|
+
"AGENT_WORKFLOW",
|
|
122
|
+
"STANDALONE",
|
|
123
|
+
]
|
|
124
|
+
|
|
57
125
|
|
|
58
126
|
SpanCreateParams: TypeAlias = Union[BaseSpanCreateRequest, LegacyApplicationSpanCreateRequest]
|
|
@@ -2,25 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from typing_extensions import TypedDict
|
|
5
|
+
from typing_extensions import Literal, TypedDict
|
|
7
6
|
|
|
8
7
|
__all__ = ["SpanListParams"]
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class SpanListParams(TypedDict, total=False):
|
|
12
|
-
ending_before:
|
|
11
|
+
ending_before: str
|
|
13
12
|
|
|
14
13
|
from_ts: int
|
|
15
14
|
"""The starting (oldest) timestamp window in seconds."""
|
|
16
15
|
|
|
17
16
|
limit: int
|
|
18
17
|
|
|
19
|
-
parents_only:
|
|
18
|
+
parents_only: bool
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
sort_order: Literal["asc", "desc"]
|
|
21
|
+
|
|
22
|
+
starting_after: str
|
|
22
23
|
|
|
23
24
|
to_ts: int
|
|
24
25
|
"""The ending (most recent) timestamp in seconds."""
|
|
25
26
|
|
|
26
|
-
trace_id:
|
|
27
|
+
trace_id: str
|