agenta 0.12.7__py3-none-any.whl → 0.13.0__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.

Files changed (88) hide show
  1. agenta/__init__.py +3 -1
  2. agenta/cli/helper.py +1 -1
  3. agenta/cli/main.py +1 -1
  4. agenta/cli/variant_commands.py +7 -5
  5. agenta/client/api.py +1 -1
  6. agenta/client/backend/__init__.py +78 -18
  7. agenta/client/backend/client.py +1031 -5526
  8. agenta/client/backend/resources/__init__.py +31 -0
  9. agenta/client/backend/resources/apps/__init__.py +1 -0
  10. agenta/client/backend/resources/apps/client.py +977 -0
  11. agenta/client/backend/resources/bases/__init__.py +1 -0
  12. agenta/client/backend/resources/bases/client.py +127 -0
  13. agenta/client/backend/resources/configs/__init__.py +1 -0
  14. agenta/client/backend/resources/configs/client.py +377 -0
  15. agenta/client/backend/resources/containers/__init__.py +5 -0
  16. agenta/client/backend/resources/containers/client.py +383 -0
  17. agenta/client/backend/resources/containers/types/__init__.py +5 -0
  18. agenta/client/backend/{types → resources/containers/types}/container_templates_response.py +1 -1
  19. agenta/client/backend/resources/environments/__init__.py +1 -0
  20. agenta/client/backend/resources/environments/client.py +131 -0
  21. agenta/client/backend/resources/evaluations/__init__.py +1 -0
  22. agenta/client/backend/resources/evaluations/client.py +1008 -0
  23. agenta/client/backend/resources/evaluators/__init__.py +1 -0
  24. agenta/client/backend/resources/evaluators/client.py +594 -0
  25. agenta/client/backend/resources/observability/__init__.py +1 -0
  26. agenta/client/backend/resources/observability/client.py +1184 -0
  27. agenta/client/backend/resources/testsets/__init__.py +1 -0
  28. agenta/client/backend/resources/testsets/client.py +689 -0
  29. agenta/client/backend/resources/variants/__init__.py +5 -0
  30. agenta/client/backend/resources/variants/client.py +796 -0
  31. agenta/client/backend/resources/variants/types/__init__.py +7 -0
  32. agenta/client/backend/resources/variants/types/add_variant_from_base_and_config_response.py +7 -0
  33. agenta/client/backend/types/__init__.py +54 -22
  34. agenta/client/backend/types/aggregated_result.py +2 -2
  35. agenta/client/backend/types/aggregated_result_evaluator_config.py +9 -0
  36. agenta/client/backend/types/{app_variant_output.py → app_variant_response.py} +4 -2
  37. agenta/client/backend/types/{trace.py → create_span.py} +20 -10
  38. agenta/client/backend/types/create_trace_response.py +37 -0
  39. agenta/client/backend/types/environment_output.py +3 -1
  40. agenta/client/backend/types/environment_output_extended.py +45 -0
  41. agenta/client/backend/types/environment_revision.py +41 -0
  42. agenta/client/backend/types/error.py +37 -0
  43. agenta/client/backend/types/evaluation.py +6 -3
  44. agenta/client/backend/types/evaluation_scenario_output.py +4 -2
  45. agenta/client/backend/types/{delete_evaluation.py → evaluation_scenario_score_update.py} +2 -2
  46. agenta/client/backend/types/evaluation_status_enum.py +4 -0
  47. agenta/client/backend/types/evaluator.py +1 -0
  48. agenta/client/backend/types/{get_config_reponse.py → get_config_response.py} +1 -2
  49. agenta/client/backend/types/human_evaluation_scenario.py +2 -2
  50. agenta/client/backend/types/{app_variant_output_extended.py → human_evaluation_scenario_update.py} +11 -16
  51. agenta/client/backend/types/human_evaluation_update.py +37 -0
  52. agenta/client/backend/types/image.py +1 -0
  53. agenta/client/backend/types/invite_request.py +1 -0
  54. agenta/client/backend/types/{list_api_keys_output.py → list_api_keys_response.py} +1 -1
  55. agenta/client/backend/types/llm_tokens.py +38 -0
  56. agenta/client/backend/types/new_human_evaluation.py +42 -0
  57. agenta/client/backend/types/organization.py +1 -0
  58. agenta/client/backend/types/permission.py +141 -0
  59. agenta/client/backend/types/result.py +2 -0
  60. agenta/client/backend/types/{human_evaluation_scenario_score.py → score.py} +1 -1
  61. agenta/client/backend/types/span.py +18 -16
  62. agenta/client/backend/types/span_detail.py +52 -0
  63. agenta/client/backend/types/span_kind.py +49 -0
  64. agenta/client/backend/types/span_status_code.py +29 -0
  65. agenta/client/backend/types/span_variant.py +38 -0
  66. agenta/client/backend/types/trace_detail.py +52 -0
  67. agenta/client/backend/types/with_pagination.py +40 -0
  68. agenta/client/backend/types/workspace_member_response.py +38 -0
  69. agenta/client/backend/types/workspace_permission.py +40 -0
  70. agenta/client/backend/types/workspace_response.py +44 -0
  71. agenta/client/backend/types/workspace_role.py +41 -0
  72. agenta/client/backend/types/workspace_role_response.py +38 -0
  73. agenta/docker/docker_utils.py +1 -5
  74. agenta/sdk/__init__.py +3 -1
  75. agenta/sdk/agenta_decorator.py +68 -18
  76. agenta/sdk/agenta_init.py +53 -21
  77. agenta/sdk/tracing/context_manager.py +13 -0
  78. agenta/sdk/tracing/decorators.py +41 -0
  79. agenta/sdk/tracing/llm_tracing.py +220 -0
  80. agenta/sdk/tracing/logger.py +19 -0
  81. agenta/sdk/tracing/tasks_manager.py +130 -0
  82. {agenta-0.12.7.dist-info → agenta-0.13.0.dist-info}/METADATA +47 -96
  83. agenta-0.13.0.dist-info/RECORD +161 -0
  84. agenta/client/backend/types/add_variant_from_base_and_config_response.py +0 -7
  85. agenta/client/backend/types/human_evaluation_scenario_update_score.py +0 -5
  86. agenta-0.12.7.dist-info/RECORD +0 -114
  87. {agenta-0.12.7.dist-info → agenta-0.13.0.dist-info}/WHEEL +0 -0
  88. {agenta-0.12.7.dist-info → agenta-0.13.0.dist-info}/entry_points.txt +0 -0
@@ -13,6 +13,7 @@ except ImportError:
13
13
 
14
14
  class InviteRequest(pydantic.BaseModel):
15
15
  email: str
16
+ roles: typing.List[str]
16
17
 
17
18
  def json(self, **kwargs: typing.Any) -> str:
18
19
  kwargs_with_defaults: typing.Any = {
@@ -11,7 +11,7 @@ except ImportError:
11
11
  import pydantic # type: ignore
12
12
 
13
13
 
14
- class ListApiKeysOutput(pydantic.BaseModel):
14
+ class ListApiKeysResponse(pydantic.BaseModel):
15
15
  prefix: str
16
16
  created_at: dt.datetime
17
17
  last_used_at: typing.Optional[dt.datetime]
@@ -0,0 +1,38 @@
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 = {
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}
@@ -0,0 +1,42 @@
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 = {
25
+ "by_alias": True,
26
+ "exclude_unset": True,
27
+ **kwargs,
28
+ }
29
+ return super().json(**kwargs_with_defaults)
30
+
31
+ 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
+ }
37
+ return super().dict(**kwargs_with_defaults)
38
+
39
+ class Config:
40
+ frozen = True
41
+ smart_union = True
42
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -19,6 +19,7 @@ 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
25
  kwargs_with_defaults: typing.Any = {
@@ -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,6 +15,7 @@ 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
21
  kwargs_with_defaults: typing.Any = {
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- HumanEvaluationScenarioScore = typing.Union[str, int]
5
+ Score = typing.Union[str, int]
@@ -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,23 +17,17 @@ 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
- meta: typing.Optional[typing.Dict[str, typing.Any]]
17
- event_name: str
18
- event_type: typing.Optional[str]
19
- start_time: dt.datetime
20
- duration: typing.Optional[int]
21
- status: str
22
- end_time: dt.datetime
23
- inputs: typing.Optional[typing.List[str]]
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
33
  kwargs_with_defaults: typing.Any = {
@@ -50,3 +49,6 @@ class Span(pydantic.BaseModel):
50
49
  frozen = True
51
50
  smart_union = True
52
51
  json_encoders = {dt.datetime: serialize_datetime}
52
+
53
+
54
+ Span.update_forward_refs()
@@ -0,0 +1,52 @@
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 = {
35
+ "by_alias": True,
36
+ "exclude_unset": True,
37
+ **kwargs,
38
+ }
39
+ return super().json(**kwargs_with_defaults)
40
+
41
+ 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
+ }
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}
@@ -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,38 @@
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 = {
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}
@@ -0,0 +1,52 @@
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 TraceDetail(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.Dict[str, typing.Any]
32
+
33
+ def json(self, **kwargs: typing.Any) -> str:
34
+ kwargs_with_defaults: typing.Any = {
35
+ "by_alias": True,
36
+ "exclude_unset": True,
37
+ **kwargs,
38
+ }
39
+ return super().json(**kwargs_with_defaults)
40
+
41
+ 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
+ }
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}
@@ -0,0 +1,40 @@
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 WithPagination(pydantic.BaseModel):
15
+ data: typing.List[typing.Any]
16
+ total: int
17
+ page: int
18
+ page_size: int = pydantic.Field(alias="pageSize")
19
+
20
+ def json(self, **kwargs: typing.Any) -> str:
21
+ kwargs_with_defaults: typing.Any = {
22
+ "by_alias": True,
23
+ "exclude_unset": True,
24
+ **kwargs,
25
+ }
26
+ return super().json(**kwargs_with_defaults)
27
+
28
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
29
+ kwargs_with_defaults: typing.Any = {
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
+ allow_population_by_field_name = True
40
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,38 @@
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 .workspace_permission import WorkspacePermission
8
+
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
14
+
15
+ class WorkspaceMemberResponse(pydantic.BaseModel):
16
+ user: typing.Dict[str, typing.Any]
17
+ roles: typing.List[WorkspacePermission]
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}
@@ -0,0 +1,40 @@
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 .permission import Permission
8
+ from .workspace_role import WorkspaceRole
9
+
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
15
+
16
+ class WorkspacePermission(pydantic.BaseModel):
17
+ role_name: WorkspaceRole
18
+ role_description: typing.Optional[str]
19
+ permissions: typing.Optional[typing.List[Permission]]
20
+
21
+ def json(self, **kwargs: typing.Any) -> str:
22
+ kwargs_with_defaults: typing.Any = {
23
+ "by_alias": True,
24
+ "exclude_unset": True,
25
+ **kwargs,
26
+ }
27
+ return super().json(**kwargs_with_defaults)
28
+
29
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30
+ kwargs_with_defaults: typing.Any = {
31
+ "by_alias": True,
32
+ "exclude_unset": True,
33
+ **kwargs,
34
+ }
35
+ return super().dict(**kwargs_with_defaults)
36
+
37
+ class Config:
38
+ frozen = True
39
+ smart_union = True
40
+ json_encoders = {dt.datetime: serialize_datetime}