agenta 0.12.7__py3-none-any.whl → 0.13.0a0__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/__init__.py +3 -2
- agenta/cli/helper.py +1 -1
- agenta/cli/main.py +1 -1
- agenta/cli/variant_commands.py +7 -5
- agenta/client/api.py +1 -1
- agenta/client/backend/__init__.py +78 -18
- agenta/client/backend/client.py +961 -5575
- agenta/client/backend/core/api_error.py +1 -3
- agenta/client/backend/core/datetime_utils.py +1 -3
- agenta/client/backend/core/jsonable_encoder.py +3 -9
- agenta/client/backend/resources/__init__.py +20 -0
- agenta/client/backend/resources/apps/__init__.py +2 -0
- agenta/client/backend/resources/apps/client.py +915 -0
- agenta/client/backend/resources/bases/__init__.py +2 -0
- agenta/client/backend/resources/bases/client.py +121 -0
- agenta/client/backend/resources/configs/__init__.py +2 -0
- agenta/client/backend/resources/configs/client.py +333 -0
- agenta/client/backend/resources/containers/__init__.py +5 -0
- agenta/client/backend/resources/containers/client.py +351 -0
- agenta/client/backend/resources/containers/types/__init__.py +5 -0
- agenta/client/backend/{types → resources/containers/types}/container_templates_response.py +1 -1
- agenta/client/backend/resources/environments/__init__.py +2 -0
- agenta/client/backend/resources/environments/client.py +119 -0
- agenta/client/backend/resources/evaluations/__init__.py +2 -0
- agenta/client/backend/resources/evaluations/client.py +948 -0
- agenta/client/backend/resources/evaluators/__init__.py +2 -0
- agenta/client/backend/resources/evaluators/client.py +554 -0
- agenta/client/backend/resources/observability/__init__.py +2 -0
- agenta/client/backend/resources/observability/client.py +1114 -0
- agenta/client/backend/resources/testsets/__init__.py +2 -0
- agenta/client/backend/resources/testsets/client.py +649 -0
- agenta/client/backend/resources/variants/__init__.py +5 -0
- agenta/client/backend/resources/variants/client.py +730 -0
- agenta/client/backend/resources/variants/types/__init__.py +5 -0
- agenta/client/backend/resources/variants/types/add_variant_from_base_and_config_response.py +7 -0
- agenta/client/backend/types/__init__.py +54 -22
- agenta/client/backend/types/aggregated_result.py +4 -12
- agenta/client/backend/types/aggregated_result_evaluator_config.py +7 -0
- agenta/client/backend/types/app.py +2 -10
- agenta/client/backend/types/{app_variant_output.py → app_variant_response.py} +6 -12
- agenta/client/backend/types/app_variant_revision.py +2 -10
- agenta/client/backend/types/base_output.py +2 -10
- agenta/client/backend/types/body_import_testset.py +2 -10
- agenta/client/backend/types/config_db.py +2 -10
- agenta/client/backend/types/create_app_output.py +2 -10
- agenta/client/backend/types/{trace.py → create_span.py} +21 -20
- agenta/client/backend/types/{delete_evaluation.py → create_trace_response.py} +5 -12
- agenta/client/backend/types/docker_env_vars.py +2 -10
- agenta/client/backend/types/environment_output.py +5 -11
- agenta/client/backend/types/environment_output_extended.py +37 -0
- agenta/client/backend/types/environment_revision.py +33 -0
- agenta/client/backend/types/error.py +29 -0
- agenta/client/backend/types/evaluation.py +8 -13
- agenta/client/backend/types/evaluation_scenario.py +2 -10
- agenta/client/backend/types/evaluation_scenario_input.py +2 -10
- agenta/client/backend/types/evaluation_scenario_output.py +6 -12
- agenta/client/backend/types/evaluation_scenario_result.py +2 -10
- agenta/client/backend/types/evaluation_scenario_score_update.py +28 -0
- agenta/client/backend/types/evaluation_status_enum.py +4 -0
- agenta/client/backend/types/evaluation_type.py +1 -3
- agenta/client/backend/types/evaluation_webhook.py +2 -10
- agenta/client/backend/types/evaluator.py +3 -10
- agenta/client/backend/types/evaluator_config.py +2 -10
- agenta/client/backend/types/feedback.py +2 -10
- agenta/client/backend/types/{get_config_reponse.py → get_config_response.py} +4 -12
- agenta/client/backend/types/http_validation_error.py +2 -10
- agenta/client/backend/types/human_evaluation.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario.py +4 -12
- agenta/client/backend/types/human_evaluation_scenario_input.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario_output.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario_update.py +37 -0
- agenta/client/backend/types/human_evaluation_update.py +29 -0
- agenta/client/backend/types/image.py +3 -10
- agenta/client/backend/types/invite_request.py +3 -10
- agenta/client/backend/types/{list_api_keys_output.py → list_api_keys_response.py} +3 -11
- agenta/client/backend/types/llm_run_rate_limit.py +2 -10
- agenta/client/backend/types/llm_tokens.py +30 -0
- agenta/client/backend/types/new_human_evaluation.py +34 -0
- agenta/client/backend/types/new_testset.py +2 -10
- agenta/client/backend/types/organization.py +3 -10
- agenta/client/backend/types/organization_output.py +2 -10
- agenta/client/backend/types/permission.py +141 -0
- agenta/client/backend/types/result.py +4 -10
- agenta/client/backend/types/{human_evaluation_scenario_score.py → score.py} +1 -1
- agenta/client/backend/types/simple_evaluation_output.py +2 -10
- agenta/client/backend/types/span.py +20 -26
- agenta/client/backend/types/span_detail.py +44 -0
- agenta/client/backend/types/span_kind.py +49 -0
- agenta/client/backend/types/span_status_code.py +29 -0
- agenta/client/backend/types/span_variant.py +30 -0
- agenta/client/backend/types/template.py +2 -10
- agenta/client/backend/types/template_image_info.py +2 -10
- agenta/client/backend/types/test_set_output_response.py +2 -10
- agenta/client/backend/types/test_set_simple_response.py +2 -10
- agenta/client/backend/types/trace_detail.py +44 -0
- agenta/client/backend/types/uri.py +2 -10
- agenta/client/backend/types/validation_error.py +2 -10
- agenta/client/backend/types/variant_action.py +2 -10
- agenta/client/backend/types/variant_action_enum.py +1 -3
- agenta/client/backend/types/with_pagination.py +32 -0
- agenta/client/backend/types/workspace_member_response.py +30 -0
- agenta/client/backend/types/workspace_permission.py +32 -0
- agenta/client/backend/types/workspace_response.py +36 -0
- agenta/client/backend/types/workspace_role.py +41 -0
- agenta/client/backend/types/workspace_role_response.py +30 -0
- agenta/docker/docker_utils.py +1 -5
- agenta/sdk/__init__.py +3 -2
- agenta/sdk/agenta_decorator.py +68 -26
- agenta/sdk/agenta_init.py +50 -20
- agenta/sdk/tracing/context_manager.py +13 -0
- agenta/sdk/tracing/decorators.py +41 -0
- agenta/sdk/tracing/llm_tracing.py +203 -0
- agenta/sdk/tracing/logger.py +19 -0
- agenta/sdk/tracing/tasks_manager.py +130 -0
- agenta/sdk/types.py +0 -38
- {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/METADATA +2 -1
- agenta-0.13.0a0.dist-info/RECORD +161 -0
- agenta/client/backend/types/add_variant_from_base_and_config_response.py +0 -7
- agenta/client/backend/types/app_variant_output_extended.py +0 -50
- agenta/client/backend/types/human_evaluation_scenario_update_score.py +0 -5
- agenta-0.12.7.dist-info/RECORD +0 -114
- {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/WHEEL +0 -0
- {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
10
|
+
except ImportError:
|
|
11
|
+
import pydantic # type: ignore
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class LlmTokens(pydantic.BaseModel):
|
|
15
|
+
prompt_tokens: typing.Optional[int]
|
|
16
|
+
completion_tokens: typing.Optional[int]
|
|
17
|
+
total_tokens: typing.Optional[int]
|
|
18
|
+
|
|
19
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
20
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
21
|
+
return super().json(**kwargs_with_defaults)
|
|
22
|
+
|
|
23
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
|
+
return super().dict(**kwargs_with_defaults)
|
|
26
|
+
|
|
27
|
+
class Config:
|
|
28
|
+
frozen = True
|
|
29
|
+
smart_union = True
|
|
30
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .evaluation_type import EvaluationType
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
11
|
+
except ImportError:
|
|
12
|
+
import pydantic # type: ignore
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class NewHumanEvaluation(pydantic.BaseModel):
|
|
16
|
+
app_id: str
|
|
17
|
+
variant_ids: typing.List[str]
|
|
18
|
+
evaluation_type: EvaluationType
|
|
19
|
+
inputs: typing.List[str]
|
|
20
|
+
testset_id: str
|
|
21
|
+
status: str
|
|
22
|
+
|
|
23
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
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 = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
29
|
+
return super().dict(**kwargs_with_defaults)
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -16,19 +16,11 @@ class NewTestset(pydantic.BaseModel):
|
|
|
16
16
|
csvdata: typing.List[typing.Dict[str, str]]
|
|
17
17
|
|
|
18
18
|
def json(self, **kwargs: typing.Any) -> str:
|
|
19
|
-
kwargs_with_defaults: typing.Any = {
|
|
20
|
-
"by_alias": True,
|
|
21
|
-
"exclude_unset": True,
|
|
22
|
-
**kwargs,
|
|
23
|
-
}
|
|
19
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
24
20
|
return super().json(**kwargs_with_defaults)
|
|
25
21
|
|
|
26
22
|
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
|
-
}
|
|
23
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
32
24
|
return super().dict(**kwargs_with_defaults)
|
|
33
25
|
|
|
34
26
|
class Config:
|
|
@@ -19,21 +19,14 @@ class Organization(pydantic.BaseModel):
|
|
|
19
19
|
owner: str
|
|
20
20
|
members: typing.Optional[typing.List[str]]
|
|
21
21
|
invitations: typing.Optional[typing.List[typing.Any]]
|
|
22
|
+
is_paying: typing.Optional[bool]
|
|
22
23
|
|
|
23
24
|
def json(self, **kwargs: typing.Any) -> str:
|
|
24
|
-
kwargs_with_defaults: typing.Any = {
|
|
25
|
-
"by_alias": True,
|
|
26
|
-
"exclude_unset": True,
|
|
27
|
-
**kwargs,
|
|
28
|
-
}
|
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
29
26
|
return super().json(**kwargs_with_defaults)
|
|
30
27
|
|
|
31
28
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
32
|
-
kwargs_with_defaults: typing.Any = {
|
|
33
|
-
"by_alias": True,
|
|
34
|
-
"exclude_unset": True,
|
|
35
|
-
**kwargs,
|
|
36
|
-
}
|
|
29
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
37
30
|
return super().dict(**kwargs_with_defaults)
|
|
38
31
|
|
|
39
32
|
class Config:
|
|
@@ -16,19 +16,11 @@ class OrganizationOutput(pydantic.BaseModel):
|
|
|
16
16
|
name: str
|
|
17
17
|
|
|
18
18
|
def json(self, **kwargs: typing.Any) -> str:
|
|
19
|
-
kwargs_with_defaults: typing.Any = {
|
|
20
|
-
"by_alias": True,
|
|
21
|
-
"exclude_unset": True,
|
|
22
|
-
**kwargs,
|
|
23
|
-
}
|
|
19
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
24
20
|
return super().json(**kwargs_with_defaults)
|
|
25
21
|
|
|
26
22
|
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
|
-
}
|
|
23
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
32
24
|
return super().dict(**kwargs_with_defaults)
|
|
33
25
|
|
|
34
26
|
class Config:
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
T_Result = typing.TypeVar("T_Result")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Permission(str, enum.Enum):
|
|
10
|
+
"""
|
|
11
|
+
An enumeration.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
READ_SYSTEM = "read_system"
|
|
15
|
+
VIEW_APPLICATION = "view_application"
|
|
16
|
+
EDIT_APPLICATION = "edit_application"
|
|
17
|
+
CREATE_APPLICATION = "create_application"
|
|
18
|
+
DELETE_APPLICATION = "delete_application"
|
|
19
|
+
CREATE_APP_VARIANT = "create_app_variant"
|
|
20
|
+
DELETE_APP_VARIANT = "delete_app_variant"
|
|
21
|
+
MODIFY_VARIANT_CONFIGURATIONS = "modify_variant_configurations"
|
|
22
|
+
DELETE_APPLICATION_VARIANT = "delete_application_variant"
|
|
23
|
+
VIEW_APP_ENVIRONMENT_DEPLOYMENT = "view_app_environment_deployment"
|
|
24
|
+
EDIT_APP_ENVIRONMENT_DEPLOYMENT = "edit_app_environment_deployment"
|
|
25
|
+
CREATE_APP_ENVIRONMENT_DEPLOYMENT = "create_app_environment_deployment"
|
|
26
|
+
VIEW_TESTSET = "view_testset"
|
|
27
|
+
EDIT_TESTSET = "edit_testset"
|
|
28
|
+
CREATE_TESTSET = "create_testset"
|
|
29
|
+
DELETE_TESTSET = "delete_testset"
|
|
30
|
+
VIEW_EVALUATION = "view_evaluation"
|
|
31
|
+
RUN_EVALUATIONS = "run_evaluations"
|
|
32
|
+
EDIT_EVALUATION = "edit_evaluation"
|
|
33
|
+
CREATE_EVALUATION = "create_evaluation"
|
|
34
|
+
DELETE_EVALUATION = "delete_evaluation"
|
|
35
|
+
DEPLOY_APPLICATION = "deploy_application"
|
|
36
|
+
VIEW_WORKSPACE = "view_workspace"
|
|
37
|
+
EDIT_WORKSPACE = "edit_workspace"
|
|
38
|
+
CREATE_WORKSPACE = "create_workspace"
|
|
39
|
+
DELETE_WORKSPACE = "delete_workspace"
|
|
40
|
+
MODIFY_USER_ROLES = "modify_user_roles"
|
|
41
|
+
ADD_NEW_USER_TO_WORKSPACE = "add_new_user_to_workspace"
|
|
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()
|
|
@@ -4,6 +4,7 @@ import datetime as dt
|
|
|
4
4
|
import typing
|
|
5
5
|
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
from .error import Error
|
|
7
8
|
|
|
8
9
|
try:
|
|
9
10
|
import pydantic.v1 as pydantic # type: ignore
|
|
@@ -14,21 +15,14 @@ except ImportError:
|
|
|
14
15
|
class Result(pydantic.BaseModel):
|
|
15
16
|
type: str
|
|
16
17
|
value: typing.Optional[typing.Any]
|
|
18
|
+
error: typing.Optional[Error]
|
|
17
19
|
|
|
18
20
|
def json(self, **kwargs: typing.Any) -> str:
|
|
19
|
-
kwargs_with_defaults: typing.Any = {
|
|
20
|
-
"by_alias": True,
|
|
21
|
-
"exclude_unset": True,
|
|
22
|
-
**kwargs,
|
|
23
|
-
}
|
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
24
22
|
return super().json(**kwargs_with_defaults)
|
|
25
23
|
|
|
26
24
|
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
|
-
}
|
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
32
26
|
return super().dict(**kwargs_with_defaults)
|
|
33
27
|
|
|
34
28
|
class Config:
|
|
@@ -20,19 +20,11 @@ class SimpleEvaluationOutput(pydantic.BaseModel):
|
|
|
20
20
|
evaluation_type: EvaluationType
|
|
21
21
|
|
|
22
22
|
def json(self, **kwargs: typing.Any) -> str:
|
|
23
|
-
kwargs_with_defaults: typing.Any = {
|
|
24
|
-
"by_alias": True,
|
|
25
|
-
"exclude_unset": True,
|
|
26
|
-
**kwargs,
|
|
27
|
-
}
|
|
23
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
28
24
|
return super().json(**kwargs_with_defaults)
|
|
29
25
|
|
|
30
26
|
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
|
-
}
|
|
27
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
36
28
|
return super().dict(**kwargs_with_defaults)
|
|
37
29
|
|
|
38
30
|
class Config:
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
import datetime as dt
|
|
4
6
|
import typing
|
|
5
7
|
|
|
6
8
|
from ..core.datetime_utils import serialize_datetime
|
|
9
|
+
from .span_kind import SpanKind
|
|
10
|
+
from .span_status_code import SpanStatusCode
|
|
11
|
+
from .span_variant import SpanVariant
|
|
7
12
|
|
|
8
13
|
try:
|
|
9
14
|
import pydantic.v1 as pydantic # type: ignore
|
|
@@ -12,41 +17,30 @@ except ImportError:
|
|
|
12
17
|
|
|
13
18
|
|
|
14
19
|
class Span(pydantic.BaseModel):
|
|
20
|
+
id: str
|
|
21
|
+
name: str
|
|
15
22
|
parent_span_id: typing.Optional[str]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
outputs: typing.Optional[typing.List[str]]
|
|
25
|
-
prompt_template: typing.Optional[str]
|
|
26
|
-
tokens_input: typing.Optional[int]
|
|
27
|
-
tokens_output: typing.Optional[int]
|
|
28
|
-
token_total: typing.Optional[int]
|
|
29
|
-
cost: typing.Optional[float]
|
|
30
|
-
tags: typing.Optional[typing.List[str]]
|
|
31
|
-
span_id: str
|
|
23
|
+
created_at: dt.datetime
|
|
24
|
+
variant: SpanVariant
|
|
25
|
+
environment: typing.Optional[str]
|
|
26
|
+
spankind: SpanKind
|
|
27
|
+
status: SpanStatusCode
|
|
28
|
+
metadata: typing.Dict[str, typing.Any]
|
|
29
|
+
user_id: typing.Optional[str]
|
|
30
|
+
children: typing.Optional[typing.List[Span]]
|
|
32
31
|
|
|
33
32
|
def json(self, **kwargs: typing.Any) -> str:
|
|
34
|
-
kwargs_with_defaults: typing.Any = {
|
|
35
|
-
"by_alias": True,
|
|
36
|
-
"exclude_unset": True,
|
|
37
|
-
**kwargs,
|
|
38
|
-
}
|
|
33
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
39
34
|
return super().json(**kwargs_with_defaults)
|
|
40
35
|
|
|
41
36
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
42
|
-
kwargs_with_defaults: typing.Any = {
|
|
43
|
-
"by_alias": True,
|
|
44
|
-
"exclude_unset": True,
|
|
45
|
-
**kwargs,
|
|
46
|
-
}
|
|
37
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
47
38
|
return super().dict(**kwargs_with_defaults)
|
|
48
39
|
|
|
49
40
|
class Config:
|
|
50
41
|
frozen = True
|
|
51
42
|
smart_union = True
|
|
52
43
|
json_encoders = {dt.datetime: serialize_datetime}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Span.update_forward_refs()
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
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
|
|
10
|
+
from .span_variant import SpanVariant
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
14
|
+
except ImportError:
|
|
15
|
+
import pydantic # type: ignore
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SpanDetail(pydantic.BaseModel):
|
|
19
|
+
id: str
|
|
20
|
+
name: str
|
|
21
|
+
parent_span_id: typing.Optional[str]
|
|
22
|
+
created_at: dt.datetime
|
|
23
|
+
variant: SpanVariant
|
|
24
|
+
environment: typing.Optional[str]
|
|
25
|
+
spankind: SpanKind
|
|
26
|
+
status: SpanStatusCode
|
|
27
|
+
metadata: typing.Dict[str, typing.Any]
|
|
28
|
+
user_id: typing.Optional[str]
|
|
29
|
+
children: typing.Optional[typing.List[Span]]
|
|
30
|
+
content: typing.Dict[str, typing.Any]
|
|
31
|
+
config: typing.Optional[typing.Dict[str, typing.Any]]
|
|
32
|
+
|
|
33
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
34
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
35
|
+
return super().json(**kwargs_with_defaults)
|
|
36
|
+
|
|
37
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
38
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
39
|
+
return super().dict(**kwargs_with_defaults)
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
frozen = True
|
|
43
|
+
smart_union = True
|
|
44
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
T_Result = typing.TypeVar("T_Result")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SpanKind(str, enum.Enum):
|
|
10
|
+
"""
|
|
11
|
+
An enumeration.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
TOOL = "TOOL"
|
|
15
|
+
CHAIN = "CHAIN"
|
|
16
|
+
LLM = "LLM"
|
|
17
|
+
WORKFLOW = "WORKFLOW"
|
|
18
|
+
RETRIEVER = "RETRIEVER"
|
|
19
|
+
EMBEDDING = "EMBEDDING"
|
|
20
|
+
AGENT = "AGENT"
|
|
21
|
+
UNKNOWN = "UNKNOWN"
|
|
22
|
+
|
|
23
|
+
def visit(
|
|
24
|
+
self,
|
|
25
|
+
tool: typing.Callable[[], T_Result],
|
|
26
|
+
chain: typing.Callable[[], T_Result],
|
|
27
|
+
llm: typing.Callable[[], T_Result],
|
|
28
|
+
workflow: typing.Callable[[], T_Result],
|
|
29
|
+
retriever: typing.Callable[[], T_Result],
|
|
30
|
+
embedding: typing.Callable[[], T_Result],
|
|
31
|
+
agent: typing.Callable[[], T_Result],
|
|
32
|
+
unknown: typing.Callable[[], T_Result],
|
|
33
|
+
) -> T_Result:
|
|
34
|
+
if self is SpanKind.TOOL:
|
|
35
|
+
return tool()
|
|
36
|
+
if self is SpanKind.CHAIN:
|
|
37
|
+
return chain()
|
|
38
|
+
if self is SpanKind.LLM:
|
|
39
|
+
return llm()
|
|
40
|
+
if self is SpanKind.WORKFLOW:
|
|
41
|
+
return workflow()
|
|
42
|
+
if self is SpanKind.RETRIEVER:
|
|
43
|
+
return retriever()
|
|
44
|
+
if self is SpanKind.EMBEDDING:
|
|
45
|
+
return embedding()
|
|
46
|
+
if self is SpanKind.AGENT:
|
|
47
|
+
return agent()
|
|
48
|
+
if self is SpanKind.UNKNOWN:
|
|
49
|
+
return unknown()
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
T_Result = typing.TypeVar("T_Result")
|
|
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()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
|
10
|
+
except ImportError:
|
|
11
|
+
import pydantic # type: ignore
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SpanVariant(pydantic.BaseModel):
|
|
15
|
+
variant_id: str
|
|
16
|
+
variant_name: str
|
|
17
|
+
revision: int
|
|
18
|
+
|
|
19
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
20
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
21
|
+
return super().json(**kwargs_with_defaults)
|
|
22
|
+
|
|
23
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
|
+
return super().dict(**kwargs_with_defaults)
|
|
26
|
+
|
|
27
|
+
class Config:
|
|
28
|
+
frozen = True
|
|
29
|
+
smart_union = True
|
|
30
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -17,19 +17,11 @@ class Template(pydantic.BaseModel):
|
|
|
17
17
|
image: TemplateImageInfo
|
|
18
18
|
|
|
19
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
|
-
}
|
|
20
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
21
|
return super().json(**kwargs_with_defaults)
|
|
26
22
|
|
|
27
23
|
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
|
-
}
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
25
|
return super().dict(**kwargs_with_defaults)
|
|
34
26
|
|
|
35
27
|
class Config:
|
|
@@ -22,19 +22,11 @@ class TemplateImageInfo(pydantic.BaseModel):
|
|
|
22
22
|
template_uri: typing.Optional[str]
|
|
23
23
|
|
|
24
24
|
def json(self, **kwargs: typing.Any) -> str:
|
|
25
|
-
kwargs_with_defaults: typing.Any = {
|
|
26
|
-
"by_alias": True,
|
|
27
|
-
"exclude_unset": True,
|
|
28
|
-
**kwargs,
|
|
29
|
-
}
|
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
30
26
|
return super().json(**kwargs_with_defaults)
|
|
31
27
|
|
|
32
28
|
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
33
|
-
kwargs_with_defaults: typing.Any = {
|
|
34
|
-
"by_alias": True,
|
|
35
|
-
"exclude_unset": True,
|
|
36
|
-
**kwargs,
|
|
37
|
-
}
|
|
29
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
38
30
|
return super().dict(**kwargs_with_defaults)
|
|
39
31
|
|
|
40
32
|
class Config:
|
|
@@ -17,19 +17,11 @@ class TestSetOutputResponse(pydantic.BaseModel):
|
|
|
17
17
|
created_at: dt.datetime
|
|
18
18
|
|
|
19
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
|
-
}
|
|
20
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
21
|
return super().json(**kwargs_with_defaults)
|
|
26
22
|
|
|
27
23
|
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
|
-
}
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
25
|
return super().dict(**kwargs_with_defaults)
|
|
34
26
|
|
|
35
27
|
class Config:
|
|
@@ -17,19 +17,11 @@ class TestSetSimpleResponse(pydantic.BaseModel):
|
|
|
17
17
|
created_at: str
|
|
18
18
|
|
|
19
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
|
-
}
|
|
20
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
25
21
|
return super().json(**kwargs_with_defaults)
|
|
26
22
|
|
|
27
23
|
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
|
-
}
|
|
24
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
33
25
|
return super().dict(**kwargs_with_defaults)
|
|
34
26
|
|
|
35
27
|
class Config:
|