agenta 0.32.0a1__py3-none-any.whl → 0.33.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.
- agenta/__init__.py +2 -0
- agenta/client/backend/__init__.py +39 -31
- agenta/client/backend/admin/__init__.py +1 -0
- agenta/client/backend/admin/client.py +576 -0
- agenta/client/backend/apps/client.py +450 -68
- agenta/client/backend/bases/client.py +10 -10
- agenta/client/backend/client.py +112 -122
- agenta/client/backend/containers/client.py +70 -28
- agenta/client/backend/core/http_client.py +3 -3
- agenta/client/backend/environments/client.py +8 -8
- agenta/client/backend/evaluations/client.py +46 -52
- agenta/client/backend/evaluators/client.py +32 -32
- agenta/client/backend/human_evaluations/__init__.py +1 -0
- agenta/client/backend/human_evaluations/client.py +1692 -0
- agenta/client/backend/observability/__init__.py +4 -0
- agenta/client/backend/observability/client.py +221 -744
- agenta/client/backend/testsets/client.py +38 -202
- agenta/client/backend/types/__init__.py +34 -28
- agenta/client/backend/types/account_response.py +24 -0
- agenta/client/backend/types/app_variant_revision.py +2 -1
- agenta/client/backend/types/{create_trace_response.py → delete_evaluation.py} +2 -3
- agenta/client/backend/types/{evaluation_scenario_score_update.py → legacy_scope_request.py} +2 -2
- agenta/client/backend/types/legacy_scopes_response.py +29 -0
- agenta/client/backend/types/{human_evaluation_update.py → legacy_user_request.py} +4 -4
- agenta/client/backend/types/{span_variant.py → legacy_user_response.py} +2 -4
- agenta/client/backend/types/organization_membership_request.py +25 -0
- agenta/client/backend/types/organization_request.py +23 -0
- agenta/client/backend/types/permission.py +4 -0
- agenta/client/backend/types/{llm_tokens.py → project_membership_request.py} +8 -5
- agenta/client/backend/types/project_request.py +26 -0
- agenta/client/backend/types/project_scope.py +29 -0
- agenta/client/backend/types/provider_kind.py +1 -1
- agenta/client/backend/types/reference.py +22 -0
- agenta/client/backend/types/role.py +15 -0
- agenta/client/backend/types/scopes_response_model.py +22 -0
- agenta/client/backend/types/score.py +1 -1
- agenta/client/backend/types/secret_response_dto.py +2 -2
- agenta/client/backend/types/user_request.py +22 -0
- agenta/client/backend/types/workspace_membership_request.py +26 -0
- agenta/client/backend/types/workspace_request.py +25 -0
- agenta/client/backend/variants/client.py +208 -42
- agenta/client/backend/vault/client.py +11 -9
- agenta/sdk/__init__.py +3 -0
- agenta/sdk/agenta_init.py +3 -1
- agenta/sdk/assets.py +4 -4
- agenta/sdk/decorators/routing.py +129 -23
- agenta/sdk/decorators/tracing.py +16 -4
- agenta/sdk/litellm/litellm.py +44 -8
- agenta/sdk/litellm/mockllm.py +2 -2
- agenta/sdk/litellm/mocks/__init__.py +9 -3
- agenta/sdk/managers/apps.py +64 -0
- agenta/sdk/managers/shared.py +2 -2
- agenta/sdk/middleware/auth.py +156 -53
- agenta/sdk/middleware/config.py +28 -16
- agenta/sdk/middleware/inline.py +1 -1
- agenta/sdk/middleware/mock.py +1 -1
- agenta/sdk/middleware/otel.py +1 -1
- agenta/sdk/middleware/vault.py +1 -1
- agenta/sdk/tracing/exporters.py +0 -1
- agenta/sdk/tracing/inline.py +26 -30
- agenta/sdk/types.py +12 -9
- {agenta-0.32.0a1.dist-info → agenta-0.33.0.dist-info}/METADATA +23 -20
- {agenta-0.32.0a1.dist-info → agenta-0.33.0.dist-info}/RECORD +69 -63
- agenta/client/backend/observability_v_1/__init__.py +0 -5
- agenta/client/backend/observability_v_1/client.py +0 -763
- agenta/client/backend/types/create_span.py +0 -45
- agenta/client/backend/types/human_evaluation_scenario_update.py +0 -30
- agenta/client/backend/types/new_human_evaluation.py +0 -27
- agenta/client/backend/types/outputs.py +0 -5
- agenta/client/backend/types/span.py +0 -42
- agenta/client/backend/types/span_detail.py +0 -44
- agenta/client/backend/types/span_status_code.py +0 -5
- agenta/client/backend/types/trace_detail.py +0 -44
- agenta/client/backend/types/with_pagination.py +0 -26
- /agenta/client/backend/{observability_v_1 → observability}/types/__init__.py +0 -0
- /agenta/client/backend/{observability_v_1 → observability}/types/format.py +0 -0
- /agenta/client/backend/{observability_v_1 → observability}/types/query_analytics_response.py +0 -0
- /agenta/client/backend/{observability_v_1 → observability}/types/query_traces_response.py +0 -0
- {agenta-0.32.0a1.dist-info → agenta-0.33.0.dist-info}/WHEEL +0 -0
- {agenta-0.32.0a1.dist-info → agenta-0.33.0.dist-info}/entry_points.txt +0 -0
|
@@ -27,15 +27,15 @@ class BasesClient:
|
|
|
27
27
|
Retrieve a list of bases filtered by app_id and base_name.
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
request (Request): The incoming request.
|
|
31
|
+
app_id (str): The ID of the app to filter by.
|
|
32
|
+
base_name (Optional[str], optional): The name of the base to filter by. Defaults to None.
|
|
33
33
|
|
|
34
34
|
Returns:
|
|
35
|
-
|
|
35
|
+
List[BaseOutput]: A list of BaseOutput objects representing the filtered bases.
|
|
36
36
|
|
|
37
37
|
Raises:
|
|
38
|
-
|
|
38
|
+
HTTPException: If there was an error retrieving the bases.
|
|
39
39
|
|
|
40
40
|
Parameters
|
|
41
41
|
----------
|
|
@@ -112,15 +112,15 @@ class AsyncBasesClient:
|
|
|
112
112
|
Retrieve a list of bases filtered by app_id and base_name.
|
|
113
113
|
|
|
114
114
|
Args:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
request (Request): The incoming request.
|
|
116
|
+
app_id (str): The ID of the app to filter by.
|
|
117
|
+
base_name (Optional[str], optional): The name of the base to filter by. Defaults to None.
|
|
118
118
|
|
|
119
119
|
Returns:
|
|
120
|
-
|
|
120
|
+
List[BaseOutput]: A list of BaseOutput objects representing the filtered bases.
|
|
121
121
|
|
|
122
122
|
Raises:
|
|
123
|
-
|
|
123
|
+
HTTPException: If there was an error retrieving the bases.
|
|
124
124
|
|
|
125
125
|
Parameters
|
|
126
126
|
----------
|
agenta/client/backend/client.py
CHANGED
|
@@ -3,20 +3,21 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
import httpx
|
|
5
5
|
from .core.client_wrapper import SyncClientWrapper
|
|
6
|
-
from .
|
|
6
|
+
from .admin.client import AdminClient
|
|
7
7
|
from .vault.client import VaultClient
|
|
8
8
|
from .access_control.client import AccessControlClient
|
|
9
9
|
from .scopes.client import ScopesClient
|
|
10
10
|
from .apps.client import AppsClient
|
|
11
11
|
from .variants.client import VariantsClient
|
|
12
12
|
from .evaluations.client import EvaluationsClient
|
|
13
|
+
from .human_evaluations.client import HumanEvaluationsClient
|
|
13
14
|
from .evaluators.client import EvaluatorsClient
|
|
14
15
|
from .testsets.client import TestsetsClient
|
|
15
16
|
from .containers.client import ContainersClient
|
|
16
17
|
from .environments.client import EnvironmentsClient
|
|
17
18
|
from .bases.client import BasesClient
|
|
18
19
|
from .configs.client import ConfigsClient
|
|
19
|
-
from .
|
|
20
|
+
from .observability.client import ObservabilityClient
|
|
20
21
|
from .core.request_options import RequestOptions
|
|
21
22
|
from .types.list_api_keys_response import ListApiKeysResponse
|
|
22
23
|
from .core.pydantic_utilities import parse_obj_as
|
|
@@ -34,20 +35,21 @@ import datetime as dt
|
|
|
34
35
|
from .types.workspace_role_response import WorkspaceRoleResponse
|
|
35
36
|
from .types.permission import Permission
|
|
36
37
|
from .core.client_wrapper import AsyncClientWrapper
|
|
37
|
-
from .
|
|
38
|
+
from .admin.client import AsyncAdminClient
|
|
38
39
|
from .vault.client import AsyncVaultClient
|
|
39
40
|
from .access_control.client import AsyncAccessControlClient
|
|
40
41
|
from .scopes.client import AsyncScopesClient
|
|
41
42
|
from .apps.client import AsyncAppsClient
|
|
42
43
|
from .variants.client import AsyncVariantsClient
|
|
43
44
|
from .evaluations.client import AsyncEvaluationsClient
|
|
45
|
+
from .human_evaluations.client import AsyncHumanEvaluationsClient
|
|
44
46
|
from .evaluators.client import AsyncEvaluatorsClient
|
|
45
47
|
from .testsets.client import AsyncTestsetsClient
|
|
46
48
|
from .containers.client import AsyncContainersClient
|
|
47
49
|
from .environments.client import AsyncEnvironmentsClient
|
|
48
50
|
from .bases.client import AsyncBasesClient
|
|
49
51
|
from .configs.client import AsyncConfigsClient
|
|
50
|
-
from .
|
|
52
|
+
from .observability.client import AsyncObservabilityClient
|
|
51
53
|
|
|
52
54
|
# this is used as the default value for optional parameters
|
|
53
55
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -97,35 +99,32 @@ class AgentaApi:
|
|
|
97
99
|
self._client_wrapper = SyncClientWrapper(
|
|
98
100
|
base_url=base_url,
|
|
99
101
|
api_key=api_key,
|
|
100
|
-
httpx_client=
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if follow_redirects is not None
|
|
108
|
-
else httpx.Client(timeout=_defaulted_timeout)
|
|
109
|
-
)
|
|
110
|
-
),
|
|
102
|
+
httpx_client=httpx_client
|
|
103
|
+
if httpx_client is not None
|
|
104
|
+
else httpx.Client(
|
|
105
|
+
timeout=_defaulted_timeout, follow_redirects=follow_redirects
|
|
106
|
+
)
|
|
107
|
+
if follow_redirects is not None
|
|
108
|
+
else httpx.Client(timeout=_defaulted_timeout),
|
|
111
109
|
timeout=_defaulted_timeout,
|
|
112
110
|
)
|
|
113
|
-
self.
|
|
111
|
+
self.admin = AdminClient(client_wrapper=self._client_wrapper)
|
|
114
112
|
self.vault = VaultClient(client_wrapper=self._client_wrapper)
|
|
115
113
|
self.access_control = AccessControlClient(client_wrapper=self._client_wrapper)
|
|
116
114
|
self.scopes = ScopesClient(client_wrapper=self._client_wrapper)
|
|
117
115
|
self.apps = AppsClient(client_wrapper=self._client_wrapper)
|
|
118
116
|
self.variants = VariantsClient(client_wrapper=self._client_wrapper)
|
|
119
117
|
self.evaluations = EvaluationsClient(client_wrapper=self._client_wrapper)
|
|
118
|
+
self.human_evaluations = HumanEvaluationsClient(
|
|
119
|
+
client_wrapper=self._client_wrapper
|
|
120
|
+
)
|
|
120
121
|
self.evaluators = EvaluatorsClient(client_wrapper=self._client_wrapper)
|
|
121
122
|
self.testsets = TestsetsClient(client_wrapper=self._client_wrapper)
|
|
122
123
|
self.containers = ContainersClient(client_wrapper=self._client_wrapper)
|
|
123
124
|
self.environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
|
|
124
125
|
self.bases = BasesClient(client_wrapper=self._client_wrapper)
|
|
125
126
|
self.configs = ConfigsClient(client_wrapper=self._client_wrapper)
|
|
126
|
-
self.
|
|
127
|
-
client_wrapper=self._client_wrapper
|
|
128
|
-
)
|
|
127
|
+
self.observability = ObservabilityClient(client_wrapper=self._client_wrapper)
|
|
129
128
|
|
|
130
129
|
def list_api_keys(
|
|
131
130
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -134,10 +133,10 @@ class AgentaApi:
|
|
|
134
133
|
List all API keys associated with the authenticated user.
|
|
135
134
|
|
|
136
135
|
Args:
|
|
137
|
-
|
|
136
|
+
request (Request): The incoming request object.
|
|
138
137
|
|
|
139
138
|
Returns:
|
|
140
|
-
|
|
139
|
+
List[ListAPIKeysResponse]: A list of API Keys associated with the user.
|
|
141
140
|
|
|
142
141
|
Parameters
|
|
143
142
|
----------
|
|
@@ -185,10 +184,10 @@ class AgentaApi:
|
|
|
185
184
|
Creates an API key for a user.
|
|
186
185
|
|
|
187
186
|
Args:
|
|
188
|
-
|
|
187
|
+
request (Request): The request object containing the user ID in the request state.
|
|
189
188
|
|
|
190
189
|
Returns:
|
|
191
|
-
|
|
190
|
+
str: The created API key.
|
|
192
191
|
|
|
193
192
|
Parameters
|
|
194
193
|
----------
|
|
@@ -239,14 +238,14 @@ class AgentaApi:
|
|
|
239
238
|
Delete an API key with the given key prefix for the authenticated user.
|
|
240
239
|
|
|
241
240
|
Args:
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
key_prefix (str): The prefix of the API key to be deleted.
|
|
242
|
+
request (Request): The incoming request object.
|
|
244
243
|
|
|
245
244
|
Returns:
|
|
246
|
-
|
|
245
|
+
dict: A dictionary containing a success message upon successful deletion.
|
|
247
246
|
|
|
248
247
|
Raises:
|
|
249
|
-
|
|
248
|
+
HTTPException: If the API key is not found or does not belong to the user.
|
|
250
249
|
|
|
251
250
|
Parameters
|
|
252
251
|
----------
|
|
@@ -310,7 +309,7 @@ class AgentaApi:
|
|
|
310
309
|
"""
|
|
311
310
|
This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
|
|
312
311
|
Returns:
|
|
313
|
-
|
|
312
|
+
bool: True. If the request reaches this point, the API key is valid.
|
|
314
313
|
|
|
315
314
|
Parameters
|
|
316
315
|
----------
|
|
@@ -372,13 +371,13 @@ class AgentaApi:
|
|
|
372
371
|
Returns a list of organizations associated with the user's session.
|
|
373
372
|
|
|
374
373
|
Args:
|
|
375
|
-
|
|
374
|
+
stoken_session (SessionContainer): The user's session token.
|
|
376
375
|
|
|
377
376
|
Returns:
|
|
378
|
-
|
|
377
|
+
list[Organization]: A list of organizations associated with the user's session.
|
|
379
378
|
|
|
380
379
|
Raises:
|
|
381
|
-
|
|
380
|
+
HTTPException: If there is an error retrieving the organizations from the database.
|
|
382
381
|
|
|
383
382
|
Parameters
|
|
384
383
|
----------
|
|
@@ -549,11 +548,11 @@ class AgentaApi:
|
|
|
549
548
|
Get an organization's details.
|
|
550
549
|
|
|
551
550
|
Raises:
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
HTTPException: _description_
|
|
552
|
+
Permission Denied
|
|
554
553
|
|
|
555
554
|
Returns:
|
|
556
|
-
|
|
555
|
+
OrganizationDB Instance
|
|
557
556
|
|
|
558
557
|
Parameters
|
|
559
558
|
----------
|
|
@@ -777,12 +776,12 @@ class AgentaApi:
|
|
|
777
776
|
Resend an invitation to a user to an Organization.
|
|
778
777
|
|
|
779
778
|
Raises:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
779
|
+
HTTPException: _description_; status_code: 500
|
|
780
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
781
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
783
782
|
|
|
784
783
|
Returns:
|
|
785
|
-
|
|
784
|
+
JSONResponse: Resent invitation to user; status_code: 200
|
|
786
785
|
|
|
787
786
|
Parameters
|
|
788
787
|
----------
|
|
@@ -863,12 +862,12 @@ class AgentaApi:
|
|
|
863
862
|
Accept an invitation to a workspace.
|
|
864
863
|
|
|
865
864
|
Raises:
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
865
|
+
HTTPException: _description_; status_code: 500
|
|
866
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
867
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
869
868
|
|
|
870
869
|
Returns:
|
|
871
|
-
|
|
870
|
+
JSONResponse: Accepted invitation to workspace; status_code: 200
|
|
872
871
|
|
|
873
872
|
Parameters
|
|
874
873
|
----------
|
|
@@ -1112,10 +1111,10 @@ class AgentaApi:
|
|
|
1112
1111
|
Returns a list of all available workspace roles.
|
|
1113
1112
|
|
|
1114
1113
|
Returns:
|
|
1115
|
-
|
|
1114
|
+
List[WorkspaceRoleResponse]: A list of WorkspaceRole objects representing the available workspace roles.
|
|
1116
1115
|
|
|
1117
1116
|
Raises:
|
|
1118
|
-
|
|
1117
|
+
HTTPException: If an error occurs while retrieving the workspace roles.
|
|
1119
1118
|
|
|
1120
1119
|
Parameters
|
|
1121
1120
|
----------
|
|
@@ -1165,10 +1164,10 @@ class AgentaApi:
|
|
|
1165
1164
|
Returns a list of all available workspace permissions.
|
|
1166
1165
|
|
|
1167
1166
|
Returns:
|
|
1168
|
-
|
|
1167
|
+
List[Permission]: A list of Permission objects representing the available workspace permissions.
|
|
1169
1168
|
|
|
1170
1169
|
Raises:
|
|
1171
|
-
|
|
1170
|
+
HTTPException: If there is an error retrieving the workspace permissions.
|
|
1172
1171
|
|
|
1173
1172
|
Parameters
|
|
1174
1173
|
----------
|
|
@@ -1222,16 +1221,16 @@ class AgentaApi:
|
|
|
1222
1221
|
Assigns a role to a user in a workspace.
|
|
1223
1222
|
|
|
1224
1223
|
Args:
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1224
|
+
payload (UserRole): The payload containing the organization id, user email, and role to assign.
|
|
1225
|
+
workspace_id (str): The ID of the workspace.
|
|
1226
|
+
request (Request): The FastAPI request object.
|
|
1228
1227
|
|
|
1229
1228
|
Returns:
|
|
1230
|
-
|
|
1229
|
+
bool: True if the role was successfully assigned, False otherwise.
|
|
1231
1230
|
|
|
1232
1231
|
Raises:
|
|
1233
|
-
|
|
1234
|
-
|
|
1232
|
+
HTTPException: If the user does not have permission to perform this action.
|
|
1233
|
+
HTTPException: If there is an error assigning the role to the user.
|
|
1235
1234
|
|
|
1236
1235
|
Parameters
|
|
1237
1236
|
----------
|
|
@@ -1316,18 +1315,18 @@ class AgentaApi:
|
|
|
1316
1315
|
Delete a role assignment from a user in a workspace.
|
|
1317
1316
|
|
|
1318
1317
|
Args:
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1318
|
+
workspace_id (str): The ID of the workspace.
|
|
1319
|
+
email (str): The email of the user to remove the role from.
|
|
1320
|
+
org_id (str): The ID of the organization.
|
|
1321
|
+
role (str): The role to remove from the user.
|
|
1322
|
+
request (Request): The FastAPI request object.
|
|
1324
1323
|
|
|
1325
1324
|
Returns:
|
|
1326
|
-
|
|
1325
|
+
bool: True if the role assignment was successfully deleted.
|
|
1327
1326
|
|
|
1328
1327
|
Raises:
|
|
1329
|
-
|
|
1330
|
-
|
|
1328
|
+
HTTPException: If there is an error in the request or the user does not have permission to perform the action.
|
|
1329
|
+
HTTPException: If there is an error in updating the user's roles.
|
|
1331
1330
|
|
|
1332
1331
|
Parameters
|
|
1333
1332
|
----------
|
|
@@ -1408,17 +1407,14 @@ class AgentaApi:
|
|
|
1408
1407
|
Remove a user from a workspace.
|
|
1409
1408
|
|
|
1410
1409
|
Parameters:
|
|
1411
|
-
|
|
1412
1410
|
- payload (UserRole): The payload containing the user email and organization ID.
|
|
1413
1411
|
- workspace_id (str): The ID of the workspace.
|
|
1414
1412
|
- request (Request): The FastAPI request object.
|
|
1415
1413
|
|
|
1416
1414
|
Returns:
|
|
1417
|
-
|
|
1418
1415
|
- WorkspaceResponse: The updated workspace.
|
|
1419
1416
|
|
|
1420
1417
|
Raises:
|
|
1421
|
-
|
|
1422
1418
|
- HTTPException: If the user does not have permission to perform this action.
|
|
1423
1419
|
- HTTPException: If there is an error during the removal process.
|
|
1424
1420
|
|
|
@@ -1634,22 +1630,16 @@ class AsyncAgentaApi:
|
|
|
1634
1630
|
self._client_wrapper = AsyncClientWrapper(
|
|
1635
1631
|
base_url=base_url,
|
|
1636
1632
|
api_key=api_key,
|
|
1637
|
-
httpx_client=
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
if follow_redirects is not None
|
|
1645
|
-
else httpx.AsyncClient(timeout=_defaulted_timeout)
|
|
1646
|
-
)
|
|
1647
|
-
),
|
|
1633
|
+
httpx_client=httpx_client
|
|
1634
|
+
if httpx_client is not None
|
|
1635
|
+
else httpx.AsyncClient(
|
|
1636
|
+
timeout=_defaulted_timeout, follow_redirects=follow_redirects
|
|
1637
|
+
)
|
|
1638
|
+
if follow_redirects is not None
|
|
1639
|
+
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
|
1648
1640
|
timeout=_defaulted_timeout,
|
|
1649
1641
|
)
|
|
1650
|
-
self.
|
|
1651
|
-
client_wrapper=self._client_wrapper
|
|
1652
|
-
)
|
|
1642
|
+
self.admin = AsyncAdminClient(client_wrapper=self._client_wrapper)
|
|
1653
1643
|
self.vault = AsyncVaultClient(client_wrapper=self._client_wrapper)
|
|
1654
1644
|
self.access_control = AsyncAccessControlClient(
|
|
1655
1645
|
client_wrapper=self._client_wrapper
|
|
@@ -1658,13 +1648,16 @@ class AsyncAgentaApi:
|
|
|
1658
1648
|
self.apps = AsyncAppsClient(client_wrapper=self._client_wrapper)
|
|
1659
1649
|
self.variants = AsyncVariantsClient(client_wrapper=self._client_wrapper)
|
|
1660
1650
|
self.evaluations = AsyncEvaluationsClient(client_wrapper=self._client_wrapper)
|
|
1651
|
+
self.human_evaluations = AsyncHumanEvaluationsClient(
|
|
1652
|
+
client_wrapper=self._client_wrapper
|
|
1653
|
+
)
|
|
1661
1654
|
self.evaluators = AsyncEvaluatorsClient(client_wrapper=self._client_wrapper)
|
|
1662
1655
|
self.testsets = AsyncTestsetsClient(client_wrapper=self._client_wrapper)
|
|
1663
1656
|
self.containers = AsyncContainersClient(client_wrapper=self._client_wrapper)
|
|
1664
1657
|
self.environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
|
|
1665
1658
|
self.bases = AsyncBasesClient(client_wrapper=self._client_wrapper)
|
|
1666
1659
|
self.configs = AsyncConfigsClient(client_wrapper=self._client_wrapper)
|
|
1667
|
-
self.
|
|
1660
|
+
self.observability = AsyncObservabilityClient(
|
|
1668
1661
|
client_wrapper=self._client_wrapper
|
|
1669
1662
|
)
|
|
1670
1663
|
|
|
@@ -1675,10 +1668,10 @@ class AsyncAgentaApi:
|
|
|
1675
1668
|
List all API keys associated with the authenticated user.
|
|
1676
1669
|
|
|
1677
1670
|
Args:
|
|
1678
|
-
|
|
1671
|
+
request (Request): The incoming request object.
|
|
1679
1672
|
|
|
1680
1673
|
Returns:
|
|
1681
|
-
|
|
1674
|
+
List[ListAPIKeysResponse]: A list of API Keys associated with the user.
|
|
1682
1675
|
|
|
1683
1676
|
Parameters
|
|
1684
1677
|
----------
|
|
@@ -1734,10 +1727,10 @@ class AsyncAgentaApi:
|
|
|
1734
1727
|
Creates an API key for a user.
|
|
1735
1728
|
|
|
1736
1729
|
Args:
|
|
1737
|
-
|
|
1730
|
+
request (Request): The request object containing the user ID in the request state.
|
|
1738
1731
|
|
|
1739
1732
|
Returns:
|
|
1740
|
-
|
|
1733
|
+
str: The created API key.
|
|
1741
1734
|
|
|
1742
1735
|
Parameters
|
|
1743
1736
|
----------
|
|
@@ -1796,14 +1789,14 @@ class AsyncAgentaApi:
|
|
|
1796
1789
|
Delete an API key with the given key prefix for the authenticated user.
|
|
1797
1790
|
|
|
1798
1791
|
Args:
|
|
1799
|
-
|
|
1800
|
-
|
|
1792
|
+
key_prefix (str): The prefix of the API key to be deleted.
|
|
1793
|
+
request (Request): The incoming request object.
|
|
1801
1794
|
|
|
1802
1795
|
Returns:
|
|
1803
|
-
|
|
1796
|
+
dict: A dictionary containing a success message upon successful deletion.
|
|
1804
1797
|
|
|
1805
1798
|
Raises:
|
|
1806
|
-
|
|
1799
|
+
HTTPException: If the API key is not found or does not belong to the user.
|
|
1807
1800
|
|
|
1808
1801
|
Parameters
|
|
1809
1802
|
----------
|
|
@@ -1875,7 +1868,7 @@ class AsyncAgentaApi:
|
|
|
1875
1868
|
"""
|
|
1876
1869
|
This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
|
|
1877
1870
|
Returns:
|
|
1878
|
-
|
|
1871
|
+
bool: True. If the request reaches this point, the API key is valid.
|
|
1879
1872
|
|
|
1880
1873
|
Parameters
|
|
1881
1874
|
----------
|
|
@@ -1945,13 +1938,13 @@ class AsyncAgentaApi:
|
|
|
1945
1938
|
Returns a list of organizations associated with the user's session.
|
|
1946
1939
|
|
|
1947
1940
|
Args:
|
|
1948
|
-
|
|
1941
|
+
stoken_session (SessionContainer): The user's session token.
|
|
1949
1942
|
|
|
1950
1943
|
Returns:
|
|
1951
|
-
|
|
1944
|
+
list[Organization]: A list of organizations associated with the user's session.
|
|
1952
1945
|
|
|
1953
1946
|
Raises:
|
|
1954
|
-
|
|
1947
|
+
HTTPException: If there is an error retrieving the organizations from the database.
|
|
1955
1948
|
|
|
1956
1949
|
Parameters
|
|
1957
1950
|
----------
|
|
@@ -2146,11 +2139,11 @@ class AsyncAgentaApi:
|
|
|
2146
2139
|
Get an organization's details.
|
|
2147
2140
|
|
|
2148
2141
|
Raises:
|
|
2149
|
-
|
|
2150
|
-
|
|
2142
|
+
HTTPException: _description_
|
|
2143
|
+
Permission Denied
|
|
2151
2144
|
|
|
2152
2145
|
Returns:
|
|
2153
|
-
|
|
2146
|
+
OrganizationDB Instance
|
|
2154
2147
|
|
|
2155
2148
|
Parameters
|
|
2156
2149
|
----------
|
|
@@ -2398,12 +2391,12 @@ class AsyncAgentaApi:
|
|
|
2398
2391
|
Resend an invitation to a user to an Organization.
|
|
2399
2392
|
|
|
2400
2393
|
Raises:
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2394
|
+
HTTPException: _description_; status_code: 500
|
|
2395
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
2396
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
2404
2397
|
|
|
2405
2398
|
Returns:
|
|
2406
|
-
|
|
2399
|
+
JSONResponse: Resent invitation to user; status_code: 200
|
|
2407
2400
|
|
|
2408
2401
|
Parameters
|
|
2409
2402
|
----------
|
|
@@ -2492,12 +2485,12 @@ class AsyncAgentaApi:
|
|
|
2492
2485
|
Accept an invitation to a workspace.
|
|
2493
2486
|
|
|
2494
2487
|
Raises:
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2488
|
+
HTTPException: _description_; status_code: 500
|
|
2489
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
2490
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
2498
2491
|
|
|
2499
2492
|
Returns:
|
|
2500
|
-
|
|
2493
|
+
JSONResponse: Accepted invitation to workspace; status_code: 200
|
|
2501
2494
|
|
|
2502
2495
|
Parameters
|
|
2503
2496
|
----------
|
|
@@ -2765,10 +2758,10 @@ class AsyncAgentaApi:
|
|
|
2765
2758
|
Returns a list of all available workspace roles.
|
|
2766
2759
|
|
|
2767
2760
|
Returns:
|
|
2768
|
-
|
|
2761
|
+
List[WorkspaceRoleResponse]: A list of WorkspaceRole objects representing the available workspace roles.
|
|
2769
2762
|
|
|
2770
2763
|
Raises:
|
|
2771
|
-
|
|
2764
|
+
HTTPException: If an error occurs while retrieving the workspace roles.
|
|
2772
2765
|
|
|
2773
2766
|
Parameters
|
|
2774
2767
|
----------
|
|
@@ -2826,10 +2819,10 @@ class AsyncAgentaApi:
|
|
|
2826
2819
|
Returns a list of all available workspace permissions.
|
|
2827
2820
|
|
|
2828
2821
|
Returns:
|
|
2829
|
-
|
|
2822
|
+
List[Permission]: A list of Permission objects representing the available workspace permissions.
|
|
2830
2823
|
|
|
2831
2824
|
Raises:
|
|
2832
|
-
|
|
2825
|
+
HTTPException: If there is an error retrieving the workspace permissions.
|
|
2833
2826
|
|
|
2834
2827
|
Parameters
|
|
2835
2828
|
----------
|
|
@@ -2891,16 +2884,16 @@ class AsyncAgentaApi:
|
|
|
2891
2884
|
Assigns a role to a user in a workspace.
|
|
2892
2885
|
|
|
2893
2886
|
Args:
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2887
|
+
payload (UserRole): The payload containing the organization id, user email, and role to assign.
|
|
2888
|
+
workspace_id (str): The ID of the workspace.
|
|
2889
|
+
request (Request): The FastAPI request object.
|
|
2897
2890
|
|
|
2898
2891
|
Returns:
|
|
2899
|
-
|
|
2892
|
+
bool: True if the role was successfully assigned, False otherwise.
|
|
2900
2893
|
|
|
2901
2894
|
Raises:
|
|
2902
|
-
|
|
2903
|
-
|
|
2895
|
+
HTTPException: If the user does not have permission to perform this action.
|
|
2896
|
+
HTTPException: If there is an error assigning the role to the user.
|
|
2904
2897
|
|
|
2905
2898
|
Parameters
|
|
2906
2899
|
----------
|
|
@@ -2993,18 +2986,18 @@ class AsyncAgentaApi:
|
|
|
2993
2986
|
Delete a role assignment from a user in a workspace.
|
|
2994
2987
|
|
|
2995
2988
|
Args:
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
2989
|
+
workspace_id (str): The ID of the workspace.
|
|
2990
|
+
email (str): The email of the user to remove the role from.
|
|
2991
|
+
org_id (str): The ID of the organization.
|
|
2992
|
+
role (str): The role to remove from the user.
|
|
2993
|
+
request (Request): The FastAPI request object.
|
|
3001
2994
|
|
|
3002
2995
|
Returns:
|
|
3003
|
-
|
|
2996
|
+
bool: True if the role assignment was successfully deleted.
|
|
3004
2997
|
|
|
3005
2998
|
Raises:
|
|
3006
|
-
|
|
3007
|
-
|
|
2999
|
+
HTTPException: If there is an error in the request or the user does not have permission to perform the action.
|
|
3000
|
+
HTTPException: If there is an error in updating the user's roles.
|
|
3008
3001
|
|
|
3009
3002
|
Parameters
|
|
3010
3003
|
----------
|
|
@@ -3093,17 +3086,14 @@ class AsyncAgentaApi:
|
|
|
3093
3086
|
Remove a user from a workspace.
|
|
3094
3087
|
|
|
3095
3088
|
Parameters:
|
|
3096
|
-
|
|
3097
3089
|
- payload (UserRole): The payload containing the user email and organization ID.
|
|
3098
3090
|
- workspace_id (str): The ID of the workspace.
|
|
3099
3091
|
- request (Request): The FastAPI request object.
|
|
3100
3092
|
|
|
3101
3093
|
Returns:
|
|
3102
|
-
|
|
3103
3094
|
- WorkspaceResponse: The updated workspace.
|
|
3104
3095
|
|
|
3105
3096
|
Raises:
|
|
3106
|
-
|
|
3107
3097
|
- HTTPException: If the user does not have permission to perform this action.
|
|
3108
3098
|
- HTTPException: If there is an error during the removal process.
|
|
3109
3099
|
|