agenta 0.24.1__py3-none-any.whl → 0.24.2__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.
Potentially problematic release.
This version of agenta might be problematic. Click here for more details.
- agenta/cli/variant_commands.py +15 -10
- agenta/client/Readme.md +72 -64
- agenta/client/api.py +1 -1
- agenta/client/backend/__init__.py +14 -9
- agenta/client/backend/apps/client.py +1669 -0
- agenta/client/backend/bases/client.py +190 -0
- agenta/client/backend/client.py +2102 -868
- agenta/client/backend/configs/client.py +598 -0
- agenta/client/backend/containers/client.py +638 -0
- agenta/client/backend/{resources/containers → containers}/types/container_templates_response.py +1 -2
- agenta/client/backend/core/__init__.py +29 -0
- agenta/client/backend/core/client_wrapper.py +42 -9
- agenta/client/backend/core/datetime_utils.py +1 -1
- agenta/client/backend/core/file.py +43 -0
- agenta/client/backend/core/http_client.py +553 -0
- agenta/client/backend/core/jsonable_encoder.py +33 -39
- agenta/client/backend/core/pydantic_utilities.py +212 -0
- agenta/client/backend/core/query_encoder.py +60 -0
- agenta/client/backend/core/remove_none_from_dict.py +2 -2
- agenta/client/backend/core/request_options.py +32 -0
- agenta/client/backend/core/serialization.py +179 -0
- agenta/client/backend/environments/client.py +190 -0
- agenta/client/backend/evaluations/client.py +1462 -0
- agenta/client/backend/evaluators/client.py +911 -0
- agenta/client/backend/observability/client.py +1271 -0
- agenta/client/backend/testsets/client.py +1132 -0
- agenta/client/backend/types/__init__.py +8 -6
- agenta/client/backend/types/aggregated_result.py +14 -29
- agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -2
- agenta/client/backend/types/app.py +13 -28
- agenta/client/backend/types/app_variant_response.py +21 -37
- agenta/client/backend/types/app_variant_revision.py +17 -32
- agenta/client/backend/types/base_output.py +13 -28
- agenta/client/backend/types/body_import_testset.py +16 -31
- agenta/client/backend/types/config_db.py +16 -31
- agenta/client/backend/types/correct_answer.py +22 -0
- agenta/client/backend/types/create_app_output.py +13 -28
- agenta/client/backend/types/create_span.py +33 -50
- agenta/client/backend/types/create_trace_response.py +16 -31
- agenta/client/backend/types/docker_env_vars.py +13 -28
- agenta/client/backend/types/environment_output.py +21 -36
- agenta/client/backend/types/environment_output_extended.py +21 -36
- agenta/client/backend/types/environment_revision.py +18 -33
- agenta/client/backend/types/error.py +16 -31
- agenta/client/backend/types/evaluation.py +20 -34
- agenta/client/backend/types/evaluation_scenario.py +18 -33
- agenta/client/backend/types/evaluation_scenario_input.py +16 -31
- agenta/client/backend/types/evaluation_scenario_output.py +18 -33
- agenta/client/backend/types/evaluation_scenario_result.py +14 -29
- agenta/client/backend/types/evaluation_scenario_score_update.py +13 -28
- agenta/client/backend/types/evaluation_status_enum.py +11 -33
- agenta/client/backend/types/evaluation_type.py +3 -21
- agenta/client/backend/types/evaluator.py +18 -32
- agenta/client/backend/types/evaluator_config.py +20 -33
- agenta/client/backend/types/get_config_response.py +16 -31
- agenta/client/backend/types/http_validation_error.py +14 -29
- agenta/client/backend/types/human_evaluation.py +17 -32
- agenta/client/backend/types/human_evaluation_scenario.py +21 -37
- agenta/client/backend/types/human_evaluation_scenario_input.py +13 -28
- agenta/client/backend/types/human_evaluation_scenario_output.py +13 -28
- agenta/client/backend/types/human_evaluation_scenario_update.py +26 -41
- agenta/client/backend/types/human_evaluation_update.py +14 -29
- agenta/client/backend/types/image.py +18 -33
- agenta/client/backend/types/invite_request.py +13 -28
- agenta/client/backend/types/list_api_keys_response.py +18 -33
- agenta/client/backend/types/llm_run_rate_limit.py +13 -28
- agenta/client/backend/types/llm_tokens.py +16 -31
- agenta/client/backend/types/lm_providers_enum.py +21 -0
- agenta/client/backend/types/new_human_evaluation.py +13 -28
- agenta/client/backend/types/new_testset.py +16 -31
- agenta/client/backend/types/organization.py +22 -36
- agenta/client/backend/types/organization_output.py +13 -28
- agenta/client/backend/types/outputs.py +5 -0
- agenta/client/backend/types/permission.py +36 -137
- agenta/client/backend/types/result.py +17 -32
- agenta/client/backend/types/simple_evaluation_output.py +13 -28
- agenta/client/backend/types/span.py +23 -38
- agenta/client/backend/types/span_detail.py +26 -40
- agenta/client/backend/types/span_status_code.py +1 -25
- agenta/client/backend/types/span_variant.py +16 -31
- agenta/client/backend/types/template.py +14 -29
- agenta/client/backend/types/template_image_info.py +21 -35
- agenta/client/backend/types/test_set_output_response.py +16 -32
- agenta/client/backend/types/test_set_simple_response.py +13 -28
- agenta/client/backend/types/trace_detail.py +26 -40
- agenta/client/backend/types/update_app_output.py +22 -0
- agenta/client/backend/types/uri.py +13 -28
- agenta/client/backend/types/validation_error.py +13 -28
- agenta/client/backend/types/variant_action.py +14 -29
- agenta/client/backend/types/variant_action_enum.py +1 -19
- agenta/client/backend/types/with_pagination.py +14 -30
- agenta/client/backend/types/workspace_member_response.py +14 -29
- agenta/client/backend/types/workspace_permission.py +18 -33
- agenta/client/backend/types/workspace_response.py +20 -35
- agenta/client/backend/types/workspace_role.py +11 -37
- agenta/client/backend/types/workspace_role_response.py +17 -32
- agenta/client/backend/variants/client.py +1447 -0
- agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +8 -0
- agenta/sdk/tracing/llm_tracing.py +10 -12
- {agenta-0.24.1.dist-info → agenta-0.24.2.dist-info}/METADATA +1 -1
- agenta-0.24.2.dist-info/RECORD +175 -0
- agenta/client/backend/resources/__init__.py +0 -31
- agenta/client/backend/resources/apps/client.py +0 -977
- agenta/client/backend/resources/bases/client.py +0 -127
- agenta/client/backend/resources/configs/client.py +0 -377
- agenta/client/backend/resources/containers/client.py +0 -383
- agenta/client/backend/resources/environments/client.py +0 -131
- agenta/client/backend/resources/evaluations/client.py +0 -1008
- agenta/client/backend/resources/evaluators/client.py +0 -594
- agenta/client/backend/resources/observability/client.py +0 -1187
- agenta/client/backend/resources/testsets/client.py +0 -689
- agenta/client/backend/resources/variants/client.py +0 -796
- agenta/client/backend/resources/variants/types/add_variant_from_base_and_config_response.py +0 -7
- agenta/client/backend/types/evaluation_webhook.py +0 -36
- agenta/client/backend/types/feedback.py +0 -40
- agenta/client/backend/types/span_kind.py +0 -49
- agenta-0.24.1.dist-info/RECORD +0 -169
- /agenta/client/backend/{resources/apps → apps}/__init__.py +0 -0
- /agenta/client/backend/{resources/bases → bases}/__init__.py +0 -0
- /agenta/client/backend/{resources/configs → configs}/__init__.py +0 -0
- /agenta/client/backend/{resources/containers → containers}/__init__.py +0 -0
- /agenta/client/backend/{resources/containers → containers}/types/__init__.py +0 -0
- /agenta/client/backend/{resources/environments → environments}/__init__.py +0 -0
- /agenta/client/backend/{resources/evaluations → evaluations}/__init__.py +0 -0
- /agenta/client/backend/{resources/evaluators → evaluators}/__init__.py +0 -0
- /agenta/client/backend/{resources/observability → observability}/__init__.py +0 -0
- /agenta/client/backend/{resources/testsets → testsets}/__init__.py +0 -0
- /agenta/client/backend/{resources/variants → variants}/__init__.py +0 -0
- /agenta/client/backend/{resources/variants → variants}/types/__init__.py +0 -0
- {agenta-0.24.1.dist-info → agenta-0.24.2.dist-info}/WHEEL +0 -0
- {agenta-0.24.1.dist-info → agenta-0.24.2.dist-info}/entry_points.txt +0 -0
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
4
5
|
import typing
|
|
6
|
+
import pydantic
|
|
5
7
|
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
10
|
-
except ImportError:
|
|
11
|
-
import pydantic # type: ignore
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class OrganizationOutput(pydantic.BaseModel):
|
|
9
|
+
class OrganizationOutput(UniversalBaseModel):
|
|
15
10
|
id: str
|
|
16
11
|
name: str
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return super().json(**kwargs_with_defaults)
|
|
25
|
-
|
|
26
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
27
|
-
kwargs_with_defaults: typing.Any = {
|
|
28
|
-
"by_alias": True,
|
|
29
|
-
"exclude_unset": True,
|
|
30
|
-
**kwargs,
|
|
31
|
-
}
|
|
32
|
-
return super().dict(**kwargs_with_defaults)
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
15
|
+
extra="allow", frozen=True
|
|
16
|
+
) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,141 +1,40 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import enum
|
|
4
3
|
import typing
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
EDIT_ORGANIZATION = "edit_organization"
|
|
43
|
-
DELETE_ORGANIZATION = "delete_organization"
|
|
44
|
-
ADD_NEW_USER_TO_ORGANIZATION = "add_new_user_to_organization"
|
|
45
|
-
|
|
46
|
-
def visit(
|
|
47
|
-
self,
|
|
48
|
-
read_system: typing.Callable[[], T_Result],
|
|
49
|
-
view_application: typing.Callable[[], T_Result],
|
|
50
|
-
edit_application: typing.Callable[[], T_Result],
|
|
51
|
-
create_application: typing.Callable[[], T_Result],
|
|
52
|
-
delete_application: typing.Callable[[], T_Result],
|
|
53
|
-
create_app_variant: typing.Callable[[], T_Result],
|
|
54
|
-
delete_app_variant: typing.Callable[[], T_Result],
|
|
55
|
-
modify_variant_configurations: typing.Callable[[], T_Result],
|
|
56
|
-
delete_application_variant: typing.Callable[[], T_Result],
|
|
57
|
-
view_app_environment_deployment: typing.Callable[[], T_Result],
|
|
58
|
-
edit_app_environment_deployment: typing.Callable[[], T_Result],
|
|
59
|
-
create_app_environment_deployment: typing.Callable[[], T_Result],
|
|
60
|
-
view_testset: typing.Callable[[], T_Result],
|
|
61
|
-
edit_testset: typing.Callable[[], T_Result],
|
|
62
|
-
create_testset: typing.Callable[[], T_Result],
|
|
63
|
-
delete_testset: typing.Callable[[], T_Result],
|
|
64
|
-
view_evaluation: typing.Callable[[], T_Result],
|
|
65
|
-
run_evaluations: typing.Callable[[], T_Result],
|
|
66
|
-
edit_evaluation: typing.Callable[[], T_Result],
|
|
67
|
-
create_evaluation: typing.Callable[[], T_Result],
|
|
68
|
-
delete_evaluation: typing.Callable[[], T_Result],
|
|
69
|
-
deploy_application: typing.Callable[[], T_Result],
|
|
70
|
-
view_workspace: typing.Callable[[], T_Result],
|
|
71
|
-
edit_workspace: typing.Callable[[], T_Result],
|
|
72
|
-
create_workspace: typing.Callable[[], T_Result],
|
|
73
|
-
delete_workspace: typing.Callable[[], T_Result],
|
|
74
|
-
modify_user_roles: typing.Callable[[], T_Result],
|
|
75
|
-
add_new_user_to_workspace: typing.Callable[[], T_Result],
|
|
76
|
-
edit_organization: typing.Callable[[], T_Result],
|
|
77
|
-
delete_organization: typing.Callable[[], T_Result],
|
|
78
|
-
add_new_user_to_organization: typing.Callable[[], T_Result],
|
|
79
|
-
) -> T_Result:
|
|
80
|
-
if self is Permission.READ_SYSTEM:
|
|
81
|
-
return read_system()
|
|
82
|
-
if self is Permission.VIEW_APPLICATION:
|
|
83
|
-
return view_application()
|
|
84
|
-
if self is Permission.EDIT_APPLICATION:
|
|
85
|
-
return edit_application()
|
|
86
|
-
if self is Permission.CREATE_APPLICATION:
|
|
87
|
-
return create_application()
|
|
88
|
-
if self is Permission.DELETE_APPLICATION:
|
|
89
|
-
return delete_application()
|
|
90
|
-
if self is Permission.CREATE_APP_VARIANT:
|
|
91
|
-
return create_app_variant()
|
|
92
|
-
if self is Permission.DELETE_APP_VARIANT:
|
|
93
|
-
return delete_app_variant()
|
|
94
|
-
if self is Permission.MODIFY_VARIANT_CONFIGURATIONS:
|
|
95
|
-
return modify_variant_configurations()
|
|
96
|
-
if self is Permission.DELETE_APPLICATION_VARIANT:
|
|
97
|
-
return delete_application_variant()
|
|
98
|
-
if self is Permission.VIEW_APP_ENVIRONMENT_DEPLOYMENT:
|
|
99
|
-
return view_app_environment_deployment()
|
|
100
|
-
if self is Permission.EDIT_APP_ENVIRONMENT_DEPLOYMENT:
|
|
101
|
-
return edit_app_environment_deployment()
|
|
102
|
-
if self is Permission.CREATE_APP_ENVIRONMENT_DEPLOYMENT:
|
|
103
|
-
return create_app_environment_deployment()
|
|
104
|
-
if self is Permission.VIEW_TESTSET:
|
|
105
|
-
return view_testset()
|
|
106
|
-
if self is Permission.EDIT_TESTSET:
|
|
107
|
-
return edit_testset()
|
|
108
|
-
if self is Permission.CREATE_TESTSET:
|
|
109
|
-
return create_testset()
|
|
110
|
-
if self is Permission.DELETE_TESTSET:
|
|
111
|
-
return delete_testset()
|
|
112
|
-
if self is Permission.VIEW_EVALUATION:
|
|
113
|
-
return view_evaluation()
|
|
114
|
-
if self is Permission.RUN_EVALUATIONS:
|
|
115
|
-
return run_evaluations()
|
|
116
|
-
if self is Permission.EDIT_EVALUATION:
|
|
117
|
-
return edit_evaluation()
|
|
118
|
-
if self is Permission.CREATE_EVALUATION:
|
|
119
|
-
return create_evaluation()
|
|
120
|
-
if self is Permission.DELETE_EVALUATION:
|
|
121
|
-
return delete_evaluation()
|
|
122
|
-
if self is Permission.DEPLOY_APPLICATION:
|
|
123
|
-
return deploy_application()
|
|
124
|
-
if self is Permission.VIEW_WORKSPACE:
|
|
125
|
-
return view_workspace()
|
|
126
|
-
if self is Permission.EDIT_WORKSPACE:
|
|
127
|
-
return edit_workspace()
|
|
128
|
-
if self is Permission.CREATE_WORKSPACE:
|
|
129
|
-
return create_workspace()
|
|
130
|
-
if self is Permission.DELETE_WORKSPACE:
|
|
131
|
-
return delete_workspace()
|
|
132
|
-
if self is Permission.MODIFY_USER_ROLES:
|
|
133
|
-
return modify_user_roles()
|
|
134
|
-
if self is Permission.ADD_NEW_USER_TO_WORKSPACE:
|
|
135
|
-
return add_new_user_to_workspace()
|
|
136
|
-
if self is Permission.EDIT_ORGANIZATION:
|
|
137
|
-
return edit_organization()
|
|
138
|
-
if self is Permission.DELETE_ORGANIZATION:
|
|
139
|
-
return delete_organization()
|
|
140
|
-
if self is Permission.ADD_NEW_USER_TO_ORGANIZATION:
|
|
141
|
-
return add_new_user_to_organization()
|
|
5
|
+
Permission = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"read_system",
|
|
8
|
+
"view_application",
|
|
9
|
+
"edit_application",
|
|
10
|
+
"create_application",
|
|
11
|
+
"delete_application",
|
|
12
|
+
"create_app_variant",
|
|
13
|
+
"delete_app_variant",
|
|
14
|
+
"modify_variant_configurations",
|
|
15
|
+
"delete_application_variant",
|
|
16
|
+
"view_app_environment_deployment",
|
|
17
|
+
"edit_app_environment_deployment",
|
|
18
|
+
"create_app_environment_deployment",
|
|
19
|
+
"view_testset",
|
|
20
|
+
"edit_testset",
|
|
21
|
+
"create_testset",
|
|
22
|
+
"delete_testset",
|
|
23
|
+
"view_evaluation",
|
|
24
|
+
"run_evaluations",
|
|
25
|
+
"edit_evaluation",
|
|
26
|
+
"create_evaluation",
|
|
27
|
+
"delete_evaluation",
|
|
28
|
+
"deploy_application",
|
|
29
|
+
"view_workspace",
|
|
30
|
+
"edit_workspace",
|
|
31
|
+
"create_workspace",
|
|
32
|
+
"delete_workspace",
|
|
33
|
+
"modify_user_roles",
|
|
34
|
+
"add_new_user_to_workspace",
|
|
35
|
+
"edit_organization",
|
|
36
|
+
"delete_organization",
|
|
37
|
+
"add_new_user_to_organization",
|
|
38
|
+
],
|
|
39
|
+
typing.Any,
|
|
40
|
+
]
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
5
|
from .error import Error
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
11
|
-
except ImportError:
|
|
12
|
-
import pydantic # type: ignore
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
13
8
|
|
|
14
9
|
|
|
15
|
-
class Result(
|
|
10
|
+
class Result(UniversalBaseModel):
|
|
16
11
|
type: str
|
|
17
|
-
value: typing.Optional[typing.Any]
|
|
18
|
-
error: typing.Optional[Error]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"by_alias": True,
|
|
31
|
-
"exclude_unset": True,
|
|
32
|
-
**kwargs,
|
|
33
|
-
}
|
|
34
|
-
return super().dict(**kwargs_with_defaults)
|
|
35
|
-
|
|
36
|
-
class Config:
|
|
37
|
-
frozen = True
|
|
38
|
-
smart_union = True
|
|
39
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
12
|
+
value: typing.Optional[typing.Optional[typing.Any]] = None
|
|
13
|
+
error: typing.Optional[Error] = None
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
17
|
+
extra="allow", frozen=True
|
|
18
|
+
) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,41 +1,26 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
5
|
from .evaluation_type import EvaluationType
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
|
11
|
-
except ImportError:
|
|
12
|
-
import pydantic # type: ignore
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
13
8
|
|
|
14
9
|
|
|
15
|
-
class SimpleEvaluationOutput(
|
|
10
|
+
class SimpleEvaluationOutput(UniversalBaseModel):
|
|
16
11
|
id: str
|
|
17
12
|
variant_ids: typing.List[str]
|
|
18
13
|
app_id: str
|
|
19
14
|
status: str
|
|
20
15
|
evaluation_type: EvaluationType
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return super().json(**kwargs_with_defaults)
|
|
29
|
-
|
|
30
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
31
|
-
kwargs_with_defaults: typing.Any = {
|
|
32
|
-
"by_alias": True,
|
|
33
|
-
"exclude_unset": True,
|
|
34
|
-
**kwargs,
|
|
35
|
-
}
|
|
36
|
-
return super().dict(**kwargs_with_defaults)
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
19
|
+
extra="allow", frozen=True
|
|
20
|
+
) # type: ignore # Pydantic v2
|
|
21
|
+
else:
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
class Config:
|
|
24
|
+
frozen = True
|
|
25
|
+
smart_union = True
|
|
26
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,56 +1,41 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import datetime as dt
|
|
4
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
6
5
|
import typing
|
|
7
|
-
|
|
8
|
-
from ..core.datetime_utils import serialize_datetime
|
|
9
|
-
from .span_kind import SpanKind
|
|
10
|
-
from .span_status_code import SpanStatusCode
|
|
6
|
+
import datetime as dt
|
|
11
7
|
from .span_variant import SpanVariant
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import pydantic # type: ignore
|
|
8
|
+
from .span_status_code import SpanStatusCode
|
|
9
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
|
+
import pydantic
|
|
11
|
+
from ..core.pydantic_utilities import update_forward_refs
|
|
17
12
|
|
|
18
13
|
|
|
19
|
-
class Span(
|
|
14
|
+
class Span(UniversalBaseModel):
|
|
20
15
|
id: str
|
|
21
16
|
name: str
|
|
22
|
-
parent_span_id: typing.Optional[str]
|
|
17
|
+
parent_span_id: typing.Optional[str] = None
|
|
23
18
|
created_at: dt.datetime
|
|
24
19
|
variant: SpanVariant
|
|
25
|
-
environment: typing.Optional[str]
|
|
20
|
+
environment: typing.Optional[str] = None
|
|
26
21
|
spankind: str
|
|
27
22
|
status: SpanStatusCode
|
|
28
|
-
metadata: typing.Dict[str, typing.Any]
|
|
23
|
+
metadata: typing.Dict[str, typing.Optional[typing.Any]]
|
|
29
24
|
trace_id: str
|
|
30
|
-
user_id: typing.Optional[str]
|
|
31
|
-
content: typing.Dict[str, typing.Any]
|
|
32
|
-
children: typing.Optional[typing.List[Span]]
|
|
33
|
-
|
|
34
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
35
|
-
kwargs_with_defaults: typing.Any = {
|
|
36
|
-
"by_alias": True,
|
|
37
|
-
"exclude_unset": True,
|
|
38
|
-
**kwargs,
|
|
39
|
-
}
|
|
40
|
-
return super().json(**kwargs_with_defaults)
|
|
25
|
+
user_id: typing.Optional[str] = None
|
|
26
|
+
content: typing.Dict[str, typing.Optional[typing.Any]]
|
|
27
|
+
children: typing.Optional[typing.List["Span"]] = None
|
|
41
28
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
return super().dict(**kwargs_with_defaults)
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
31
|
+
extra="allow", frozen=True
|
|
32
|
+
) # type: ignore # Pydantic v2
|
|
33
|
+
else:
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
class Config:
|
|
36
|
+
frozen = True
|
|
37
|
+
smart_union = True
|
|
38
|
+
extra = pydantic.Extra.allow
|
|
54
39
|
|
|
55
40
|
|
|
56
|
-
|
|
41
|
+
update_forward_refs(Span)
|
|
@@ -1,52 +1,38 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
|
-
from .span import Span
|
|
8
|
-
from .span_kind import SpanKind
|
|
9
|
-
from .span_status_code import SpanStatusCode
|
|
5
|
+
import datetime as dt
|
|
10
6
|
from .span_variant import SpanVariant
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import pydantic # type: ignore
|
|
7
|
+
from .span_status_code import SpanStatusCode
|
|
8
|
+
from .span import Span
|
|
9
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
|
+
import pydantic
|
|
16
11
|
|
|
17
12
|
|
|
18
|
-
class SpanDetail(
|
|
13
|
+
class SpanDetail(UniversalBaseModel):
|
|
19
14
|
id: str
|
|
20
15
|
name: str
|
|
21
|
-
parent_span_id: typing.Optional[str]
|
|
16
|
+
parent_span_id: typing.Optional[str] = None
|
|
22
17
|
created_at: dt.datetime
|
|
23
18
|
variant: SpanVariant
|
|
24
|
-
environment: typing.Optional[str]
|
|
19
|
+
environment: typing.Optional[str] = None
|
|
25
20
|
spankind: str
|
|
26
21
|
status: SpanStatusCode
|
|
27
|
-
metadata: typing.Dict[str, typing.Any]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
content: typing.Dict[str, typing.Any]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"exclude_unset": True,
|
|
45
|
-
**kwargs,
|
|
46
|
-
}
|
|
47
|
-
return super().dict(**kwargs_with_defaults)
|
|
48
|
-
|
|
49
|
-
class Config:
|
|
50
|
-
frozen = True
|
|
51
|
-
smart_union = True
|
|
52
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
22
|
+
metadata: typing.Dict[str, typing.Optional[typing.Any]]
|
|
23
|
+
trace_id: str
|
|
24
|
+
user_id: typing.Optional[str] = None
|
|
25
|
+
content: typing.Dict[str, typing.Optional[typing.Any]]
|
|
26
|
+
children: typing.Optional[typing.List[Span]] = None
|
|
27
|
+
config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
28
|
+
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
31
|
+
extra="allow", frozen=True
|
|
32
|
+
) # type: ignore # Pydantic v2
|
|
33
|
+
else:
|
|
34
|
+
|
|
35
|
+
class Config:
|
|
36
|
+
frozen = True
|
|
37
|
+
smart_union = True
|
|
38
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import enum
|
|
4
3
|
import typing
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class SpanStatusCode(str, enum.Enum):
|
|
10
|
-
"""
|
|
11
|
-
An enumeration.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
UNSET = "UNSET"
|
|
15
|
-
OK = "OK"
|
|
16
|
-
ERROR = "ERROR"
|
|
17
|
-
|
|
18
|
-
def visit(
|
|
19
|
-
self,
|
|
20
|
-
unset: typing.Callable[[], T_Result],
|
|
21
|
-
ok: typing.Callable[[], T_Result],
|
|
22
|
-
error: typing.Callable[[], T_Result],
|
|
23
|
-
) -> T_Result:
|
|
24
|
-
if self is SpanStatusCode.UNSET:
|
|
25
|
-
return unset()
|
|
26
|
-
if self is SpanStatusCode.OK:
|
|
27
|
-
return ok()
|
|
28
|
-
if self is SpanStatusCode.ERROR:
|
|
29
|
-
return error()
|
|
5
|
+
SpanStatusCode = typing.Union[typing.Literal["UNSET", "OK", "ERROR"], typing.Any]
|
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
5
7
|
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
class SpanVariant(UniversalBaseModel):
|
|
10
|
+
variant_id: typing.Optional[str] = None
|
|
11
|
+
variant_name: typing.Optional[str] = None
|
|
12
|
+
revision: typing.Optional[int] = None
|
|
12
13
|
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
13
19
|
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def json(self, **kwargs: typing.Any) -> str:
|
|
20
|
-
kwargs_with_defaults: typing.Any = {
|
|
21
|
-
"by_alias": True,
|
|
22
|
-
"exclude_unset": True,
|
|
23
|
-
**kwargs,
|
|
24
|
-
}
|
|
25
|
-
return super().json(**kwargs_with_defaults)
|
|
26
|
-
|
|
27
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
28
|
-
kwargs_with_defaults: typing.Any = {
|
|
29
|
-
"by_alias": True,
|
|
30
|
-
"exclude_unset": True,
|
|
31
|
-
**kwargs,
|
|
32
|
-
}
|
|
33
|
-
return super().dict(**kwargs_with_defaults)
|
|
34
|
-
|
|
35
|
-
class Config:
|
|
36
|
-
frozen = True
|
|
37
|
-
smart_union = True
|
|
38
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import typing
|
|
5
|
-
|
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
7
4
|
from .template_image_info import TemplateImageInfo
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
except ImportError:
|
|
12
|
-
import pydantic # type: ignore
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
7
|
+
import pydantic
|
|
13
8
|
|
|
14
9
|
|
|
15
|
-
class Template(
|
|
10
|
+
class Template(UniversalBaseModel):
|
|
16
11
|
id: str
|
|
17
12
|
image: TemplateImageInfo
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
return super().json(**kwargs_with_defaults)
|
|
26
|
-
|
|
27
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
28
|
-
kwargs_with_defaults: typing.Any = {
|
|
29
|
-
"by_alias": True,
|
|
30
|
-
"exclude_unset": True,
|
|
31
|
-
**kwargs,
|
|
32
|
-
}
|
|
33
|
-
return super().dict(**kwargs_with_defaults)
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
34
19
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|