agenta 0.31.0__py3-none-any.whl → 0.32.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.
- agenta/client/backend/__init__.py +4 -8
- agenta/client/backend/apps/client.py +68 -68
- agenta/client/backend/bases/client.py +10 -10
- agenta/client/backend/client.py +96 -88
- agenta/client/backend/containers/client.py +70 -28
- agenta/client/backend/environments/client.py +8 -8
- agenta/client/backend/evaluations/client.py +46 -46
- agenta/client/backend/evaluators/client.py +32 -32
- agenta/client/backend/human_evaluations/__init__.py +1 -0
- agenta/client/backend/human_evaluations/client.py +1696 -0
- agenta/client/backend/testsets/client.py +28 -28
- agenta/client/backend/types/__init__.py +3 -7
- agenta/client/backend/types/{evaluation_scenario_score_update.py → delete_evaluation.py} +3 -3
- agenta/client/backend/variants/client.py +54 -42
- agenta/sdk/tracing/inline.py +3 -1
- {agenta-0.31.0.dist-info → agenta-0.32.0.dist-info}/METADATA +10 -9
- {agenta-0.31.0.dist-info → agenta-0.32.0.dist-info}/RECORD +19 -20
- {agenta-0.31.0.dist-info → agenta-0.32.0.dist-info}/WHEEL +1 -1
- agenta/client/backend/types/human_evaluation_scenario_update.py +0 -30
- agenta/client/backend/types/human_evaluation_update.py +0 -22
- agenta/client/backend/types/new_human_evaluation.py +0 -27
- {agenta-0.31.0.dist-info → agenta-0.32.0.dist-info}/entry_points.txt +0 -0
agenta/client/backend/client.py
CHANGED
|
@@ -10,6 +10,7 @@ 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
|
|
@@ -41,6 +42,7 @@ 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
|
|
@@ -113,6 +115,9 @@ class AgentaApi:
|
|
|
113
115
|
self.apps = AppsClient(client_wrapper=self._client_wrapper)
|
|
114
116
|
self.variants = VariantsClient(client_wrapper=self._client_wrapper)
|
|
115
117
|
self.evaluations = EvaluationsClient(client_wrapper=self._client_wrapper)
|
|
118
|
+
self.human_evaluations = HumanEvaluationsClient(
|
|
119
|
+
client_wrapper=self._client_wrapper
|
|
120
|
+
)
|
|
116
121
|
self.evaluators = EvaluatorsClient(client_wrapper=self._client_wrapper)
|
|
117
122
|
self.testsets = TestsetsClient(client_wrapper=self._client_wrapper)
|
|
118
123
|
self.containers = ContainersClient(client_wrapper=self._client_wrapper)
|
|
@@ -130,10 +135,10 @@ class AgentaApi:
|
|
|
130
135
|
List all API keys associated with the authenticated user.
|
|
131
136
|
|
|
132
137
|
Args:
|
|
133
|
-
|
|
138
|
+
request (Request): The incoming request object.
|
|
134
139
|
|
|
135
140
|
Returns:
|
|
136
|
-
|
|
141
|
+
List[ListAPIKeysResponse]: A list of API Keys associated with the user.
|
|
137
142
|
|
|
138
143
|
Parameters
|
|
139
144
|
----------
|
|
@@ -181,10 +186,10 @@ class AgentaApi:
|
|
|
181
186
|
Creates an API key for a user.
|
|
182
187
|
|
|
183
188
|
Args:
|
|
184
|
-
|
|
189
|
+
request (Request): The request object containing the user ID in the request state.
|
|
185
190
|
|
|
186
191
|
Returns:
|
|
187
|
-
|
|
192
|
+
str: The created API key.
|
|
188
193
|
|
|
189
194
|
Parameters
|
|
190
195
|
----------
|
|
@@ -235,14 +240,14 @@ class AgentaApi:
|
|
|
235
240
|
Delete an API key with the given key prefix for the authenticated user.
|
|
236
241
|
|
|
237
242
|
Args:
|
|
238
|
-
|
|
239
|
-
|
|
243
|
+
key_prefix (str): The prefix of the API key to be deleted.
|
|
244
|
+
request (Request): The incoming request object.
|
|
240
245
|
|
|
241
246
|
Returns:
|
|
242
|
-
|
|
247
|
+
dict: A dictionary containing a success message upon successful deletion.
|
|
243
248
|
|
|
244
249
|
Raises:
|
|
245
|
-
|
|
250
|
+
HTTPException: If the API key is not found or does not belong to the user.
|
|
246
251
|
|
|
247
252
|
Parameters
|
|
248
253
|
----------
|
|
@@ -306,7 +311,10 @@ class AgentaApi:
|
|
|
306
311
|
"""
|
|
307
312
|
This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
|
|
308
313
|
Returns:
|
|
309
|
-
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
bool: True. If the request reaches this point, the API key is valid.
|
|
310
318
|
|
|
311
319
|
Parameters
|
|
312
320
|
----------
|
|
@@ -368,13 +376,13 @@ class AgentaApi:
|
|
|
368
376
|
Returns a list of organizations associated with the user's session.
|
|
369
377
|
|
|
370
378
|
Args:
|
|
371
|
-
|
|
379
|
+
stoken_session (SessionContainer): The user's session token.
|
|
372
380
|
|
|
373
381
|
Returns:
|
|
374
|
-
|
|
382
|
+
list[Organization]: A list of organizations associated with the user's session.
|
|
375
383
|
|
|
376
384
|
Raises:
|
|
377
|
-
|
|
385
|
+
HTTPException: If there is an error retrieving the organizations from the database.
|
|
378
386
|
|
|
379
387
|
Parameters
|
|
380
388
|
----------
|
|
@@ -545,11 +553,11 @@ class AgentaApi:
|
|
|
545
553
|
Get an organization's details.
|
|
546
554
|
|
|
547
555
|
Raises:
|
|
548
|
-
|
|
549
|
-
|
|
556
|
+
HTTPException: _description_
|
|
557
|
+
Permission Denied
|
|
550
558
|
|
|
551
559
|
Returns:
|
|
552
|
-
|
|
560
|
+
OrganizationDB Instance
|
|
553
561
|
|
|
554
562
|
Parameters
|
|
555
563
|
----------
|
|
@@ -773,12 +781,12 @@ class AgentaApi:
|
|
|
773
781
|
Resend an invitation to a user to an Organization.
|
|
774
782
|
|
|
775
783
|
Raises:
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
784
|
+
HTTPException: _description_; status_code: 500
|
|
785
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
786
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
779
787
|
|
|
780
788
|
Returns:
|
|
781
|
-
|
|
789
|
+
JSONResponse: Resent invitation to user; status_code: 200
|
|
782
790
|
|
|
783
791
|
Parameters
|
|
784
792
|
----------
|
|
@@ -859,12 +867,12 @@ class AgentaApi:
|
|
|
859
867
|
Accept an invitation to a workspace.
|
|
860
868
|
|
|
861
869
|
Raises:
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
870
|
+
HTTPException: _description_; status_code: 500
|
|
871
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
872
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
865
873
|
|
|
866
874
|
Returns:
|
|
867
|
-
|
|
875
|
+
JSONResponse: Accepted invitation to workspace; status_code: 200
|
|
868
876
|
|
|
869
877
|
Parameters
|
|
870
878
|
----------
|
|
@@ -1108,10 +1116,10 @@ class AgentaApi:
|
|
|
1108
1116
|
Returns a list of all available workspace roles.
|
|
1109
1117
|
|
|
1110
1118
|
Returns:
|
|
1111
|
-
|
|
1119
|
+
List[WorkspaceRoleResponse]: A list of WorkspaceRole objects representing the available workspace roles.
|
|
1112
1120
|
|
|
1113
1121
|
Raises:
|
|
1114
|
-
|
|
1122
|
+
HTTPException: If an error occurs while retrieving the workspace roles.
|
|
1115
1123
|
|
|
1116
1124
|
Parameters
|
|
1117
1125
|
----------
|
|
@@ -1161,10 +1169,10 @@ class AgentaApi:
|
|
|
1161
1169
|
Returns a list of all available workspace permissions.
|
|
1162
1170
|
|
|
1163
1171
|
Returns:
|
|
1164
|
-
|
|
1172
|
+
List[Permission]: A list of Permission objects representing the available workspace permissions.
|
|
1165
1173
|
|
|
1166
1174
|
Raises:
|
|
1167
|
-
|
|
1175
|
+
HTTPException: If there is an error retrieving the workspace permissions.
|
|
1168
1176
|
|
|
1169
1177
|
Parameters
|
|
1170
1178
|
----------
|
|
@@ -1218,16 +1226,16 @@ class AgentaApi:
|
|
|
1218
1226
|
Assigns a role to a user in a workspace.
|
|
1219
1227
|
|
|
1220
1228
|
Args:
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1229
|
+
payload (UserRole): The payload containing the organization id, user email, and role to assign.
|
|
1230
|
+
workspace_id (str): The ID of the workspace.
|
|
1231
|
+
request (Request): The FastAPI request object.
|
|
1224
1232
|
|
|
1225
1233
|
Returns:
|
|
1226
|
-
|
|
1234
|
+
bool: True if the role was successfully assigned, False otherwise.
|
|
1227
1235
|
|
|
1228
1236
|
Raises:
|
|
1229
|
-
|
|
1230
|
-
|
|
1237
|
+
HTTPException: If the user does not have permission to perform this action.
|
|
1238
|
+
HTTPException: If there is an error assigning the role to the user.
|
|
1231
1239
|
|
|
1232
1240
|
Parameters
|
|
1233
1241
|
----------
|
|
@@ -1312,18 +1320,18 @@ class AgentaApi:
|
|
|
1312
1320
|
Delete a role assignment from a user in a workspace.
|
|
1313
1321
|
|
|
1314
1322
|
Args:
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1323
|
+
workspace_id (str): The ID of the workspace.
|
|
1324
|
+
email (str): The email of the user to remove the role from.
|
|
1325
|
+
org_id (str): The ID of the organization.
|
|
1326
|
+
role (str): The role to remove from the user.
|
|
1327
|
+
request (Request): The FastAPI request object.
|
|
1320
1328
|
|
|
1321
1329
|
Returns:
|
|
1322
|
-
|
|
1330
|
+
bool: True if the role assignment was successfully deleted.
|
|
1323
1331
|
|
|
1324
1332
|
Raises:
|
|
1325
|
-
|
|
1326
|
-
|
|
1333
|
+
HTTPException: If there is an error in the request or the user does not have permission to perform the action.
|
|
1334
|
+
HTTPException: If there is an error in updating the user's roles.
|
|
1327
1335
|
|
|
1328
1336
|
Parameters
|
|
1329
1337
|
----------
|
|
@@ -1404,17 +1412,14 @@ class AgentaApi:
|
|
|
1404
1412
|
Remove a user from a workspace.
|
|
1405
1413
|
|
|
1406
1414
|
Parameters:
|
|
1407
|
-
|
|
1408
1415
|
- payload (UserRole): The payload containing the user email and organization ID.
|
|
1409
1416
|
- workspace_id (str): The ID of the workspace.
|
|
1410
1417
|
- request (Request): The FastAPI request object.
|
|
1411
1418
|
|
|
1412
1419
|
Returns:
|
|
1413
|
-
|
|
1414
1420
|
- WorkspaceResponse: The updated workspace.
|
|
1415
1421
|
|
|
1416
1422
|
Raises:
|
|
1417
|
-
|
|
1418
1423
|
- HTTPException: If the user does not have permission to perform this action.
|
|
1419
1424
|
- HTTPException: If there is an error during the removal process.
|
|
1420
1425
|
|
|
@@ -1650,6 +1655,9 @@ class AsyncAgentaApi:
|
|
|
1650
1655
|
self.apps = AsyncAppsClient(client_wrapper=self._client_wrapper)
|
|
1651
1656
|
self.variants = AsyncVariantsClient(client_wrapper=self._client_wrapper)
|
|
1652
1657
|
self.evaluations = AsyncEvaluationsClient(client_wrapper=self._client_wrapper)
|
|
1658
|
+
self.human_evaluations = AsyncHumanEvaluationsClient(
|
|
1659
|
+
client_wrapper=self._client_wrapper
|
|
1660
|
+
)
|
|
1653
1661
|
self.evaluators = AsyncEvaluatorsClient(client_wrapper=self._client_wrapper)
|
|
1654
1662
|
self.testsets = AsyncTestsetsClient(client_wrapper=self._client_wrapper)
|
|
1655
1663
|
self.containers = AsyncContainersClient(client_wrapper=self._client_wrapper)
|
|
@@ -1667,10 +1675,10 @@ class AsyncAgentaApi:
|
|
|
1667
1675
|
List all API keys associated with the authenticated user.
|
|
1668
1676
|
|
|
1669
1677
|
Args:
|
|
1670
|
-
|
|
1678
|
+
request (Request): The incoming request object.
|
|
1671
1679
|
|
|
1672
1680
|
Returns:
|
|
1673
|
-
|
|
1681
|
+
List[ListAPIKeysResponse]: A list of API Keys associated with the user.
|
|
1674
1682
|
|
|
1675
1683
|
Parameters
|
|
1676
1684
|
----------
|
|
@@ -1726,10 +1734,10 @@ class AsyncAgentaApi:
|
|
|
1726
1734
|
Creates an API key for a user.
|
|
1727
1735
|
|
|
1728
1736
|
Args:
|
|
1729
|
-
|
|
1737
|
+
request (Request): The request object containing the user ID in the request state.
|
|
1730
1738
|
|
|
1731
1739
|
Returns:
|
|
1732
|
-
|
|
1740
|
+
str: The created API key.
|
|
1733
1741
|
|
|
1734
1742
|
Parameters
|
|
1735
1743
|
----------
|
|
@@ -1788,14 +1796,14 @@ class AsyncAgentaApi:
|
|
|
1788
1796
|
Delete an API key with the given key prefix for the authenticated user.
|
|
1789
1797
|
|
|
1790
1798
|
Args:
|
|
1791
|
-
|
|
1792
|
-
|
|
1799
|
+
key_prefix (str): The prefix of the API key to be deleted.
|
|
1800
|
+
request (Request): The incoming request object.
|
|
1793
1801
|
|
|
1794
1802
|
Returns:
|
|
1795
|
-
|
|
1803
|
+
dict: A dictionary containing a success message upon successful deletion.
|
|
1796
1804
|
|
|
1797
1805
|
Raises:
|
|
1798
|
-
|
|
1806
|
+
HTTPException: If the API key is not found or does not belong to the user.
|
|
1799
1807
|
|
|
1800
1808
|
Parameters
|
|
1801
1809
|
----------
|
|
@@ -1867,7 +1875,10 @@ class AsyncAgentaApi:
|
|
|
1867
1875
|
"""
|
|
1868
1876
|
This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
|
|
1869
1877
|
Returns:
|
|
1870
|
-
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
bool: True. If the request reaches this point, the API key is valid.
|
|
1871
1882
|
|
|
1872
1883
|
Parameters
|
|
1873
1884
|
----------
|
|
@@ -1937,13 +1948,13 @@ class AsyncAgentaApi:
|
|
|
1937
1948
|
Returns a list of organizations associated with the user's session.
|
|
1938
1949
|
|
|
1939
1950
|
Args:
|
|
1940
|
-
|
|
1951
|
+
stoken_session (SessionContainer): The user's session token.
|
|
1941
1952
|
|
|
1942
1953
|
Returns:
|
|
1943
|
-
|
|
1954
|
+
list[Organization]: A list of organizations associated with the user's session.
|
|
1944
1955
|
|
|
1945
1956
|
Raises:
|
|
1946
|
-
|
|
1957
|
+
HTTPException: If there is an error retrieving the organizations from the database.
|
|
1947
1958
|
|
|
1948
1959
|
Parameters
|
|
1949
1960
|
----------
|
|
@@ -2138,11 +2149,11 @@ class AsyncAgentaApi:
|
|
|
2138
2149
|
Get an organization's details.
|
|
2139
2150
|
|
|
2140
2151
|
Raises:
|
|
2141
|
-
|
|
2142
|
-
|
|
2152
|
+
HTTPException: _description_
|
|
2153
|
+
Permission Denied
|
|
2143
2154
|
|
|
2144
2155
|
Returns:
|
|
2145
|
-
|
|
2156
|
+
OrganizationDB Instance
|
|
2146
2157
|
|
|
2147
2158
|
Parameters
|
|
2148
2159
|
----------
|
|
@@ -2390,12 +2401,12 @@ class AsyncAgentaApi:
|
|
|
2390
2401
|
Resend an invitation to a user to an Organization.
|
|
2391
2402
|
|
|
2392
2403
|
Raises:
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2404
|
+
HTTPException: _description_; status_code: 500
|
|
2405
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
2406
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
2396
2407
|
|
|
2397
2408
|
Returns:
|
|
2398
|
-
|
|
2409
|
+
JSONResponse: Resent invitation to user; status_code: 200
|
|
2399
2410
|
|
|
2400
2411
|
Parameters
|
|
2401
2412
|
----------
|
|
@@ -2484,12 +2495,12 @@ class AsyncAgentaApi:
|
|
|
2484
2495
|
Accept an invitation to a workspace.
|
|
2485
2496
|
|
|
2486
2497
|
Raises:
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2498
|
+
HTTPException: _description_; status_code: 500
|
|
2499
|
+
HTTPException: Invitation not found or has expired; status_code: 400
|
|
2500
|
+
HTTPException: You already belong to this organization; status_code: 400
|
|
2490
2501
|
|
|
2491
2502
|
Returns:
|
|
2492
|
-
|
|
2503
|
+
JSONResponse: Accepted invitation to workspace; status_code: 200
|
|
2493
2504
|
|
|
2494
2505
|
Parameters
|
|
2495
2506
|
----------
|
|
@@ -2757,10 +2768,10 @@ class AsyncAgentaApi:
|
|
|
2757
2768
|
Returns a list of all available workspace roles.
|
|
2758
2769
|
|
|
2759
2770
|
Returns:
|
|
2760
|
-
|
|
2771
|
+
List[WorkspaceRoleResponse]: A list of WorkspaceRole objects representing the available workspace roles.
|
|
2761
2772
|
|
|
2762
2773
|
Raises:
|
|
2763
|
-
|
|
2774
|
+
HTTPException: If an error occurs while retrieving the workspace roles.
|
|
2764
2775
|
|
|
2765
2776
|
Parameters
|
|
2766
2777
|
----------
|
|
@@ -2818,10 +2829,10 @@ class AsyncAgentaApi:
|
|
|
2818
2829
|
Returns a list of all available workspace permissions.
|
|
2819
2830
|
|
|
2820
2831
|
Returns:
|
|
2821
|
-
|
|
2832
|
+
List[Permission]: A list of Permission objects representing the available workspace permissions.
|
|
2822
2833
|
|
|
2823
2834
|
Raises:
|
|
2824
|
-
|
|
2835
|
+
HTTPException: If there is an error retrieving the workspace permissions.
|
|
2825
2836
|
|
|
2826
2837
|
Parameters
|
|
2827
2838
|
----------
|
|
@@ -2883,16 +2894,16 @@ class AsyncAgentaApi:
|
|
|
2883
2894
|
Assigns a role to a user in a workspace.
|
|
2884
2895
|
|
|
2885
2896
|
Args:
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2897
|
+
payload (UserRole): The payload containing the organization id, user email, and role to assign.
|
|
2898
|
+
workspace_id (str): The ID of the workspace.
|
|
2899
|
+
request (Request): The FastAPI request object.
|
|
2889
2900
|
|
|
2890
2901
|
Returns:
|
|
2891
|
-
|
|
2902
|
+
bool: True if the role was successfully assigned, False otherwise.
|
|
2892
2903
|
|
|
2893
2904
|
Raises:
|
|
2894
|
-
|
|
2895
|
-
|
|
2905
|
+
HTTPException: If the user does not have permission to perform this action.
|
|
2906
|
+
HTTPException: If there is an error assigning the role to the user.
|
|
2896
2907
|
|
|
2897
2908
|
Parameters
|
|
2898
2909
|
----------
|
|
@@ -2985,18 +2996,18 @@ class AsyncAgentaApi:
|
|
|
2985
2996
|
Delete a role assignment from a user in a workspace.
|
|
2986
2997
|
|
|
2987
2998
|
Args:
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2999
|
+
workspace_id (str): The ID of the workspace.
|
|
3000
|
+
email (str): The email of the user to remove the role from.
|
|
3001
|
+
org_id (str): The ID of the organization.
|
|
3002
|
+
role (str): The role to remove from the user.
|
|
3003
|
+
request (Request): The FastAPI request object.
|
|
2993
3004
|
|
|
2994
3005
|
Returns:
|
|
2995
|
-
|
|
3006
|
+
bool: True if the role assignment was successfully deleted.
|
|
2996
3007
|
|
|
2997
3008
|
Raises:
|
|
2998
|
-
|
|
2999
|
-
|
|
3009
|
+
HTTPException: If there is an error in the request or the user does not have permission to perform the action.
|
|
3010
|
+
HTTPException: If there is an error in updating the user's roles.
|
|
3000
3011
|
|
|
3001
3012
|
Parameters
|
|
3002
3013
|
----------
|
|
@@ -3085,17 +3096,14 @@ class AsyncAgentaApi:
|
|
|
3085
3096
|
Remove a user from a workspace.
|
|
3086
3097
|
|
|
3087
3098
|
Parameters:
|
|
3088
|
-
|
|
3089
3099
|
- payload (UserRole): The payload containing the user email and organization ID.
|
|
3090
3100
|
- workspace_id (str): The ID of the workspace.
|
|
3091
3101
|
- request (Request): The FastAPI request object.
|
|
3092
3102
|
|
|
3093
3103
|
Returns:
|
|
3094
|
-
|
|
3095
3104
|
- WorkspaceResponse: The updated workspace.
|
|
3096
3105
|
|
|
3097
3106
|
Raises:
|
|
3098
|
-
|
|
3099
3107
|
- HTTPException: If the user does not have permission to perform this action.
|
|
3100
3108
|
- HTTPException: If there is an error during the removal process.
|
|
3101
3109
|
|
|
@@ -34,13 +34,13 @@ class ContainersClient:
|
|
|
34
34
|
Builds a Docker image from a tar file containing the application code.
|
|
35
35
|
|
|
36
36
|
Args:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
app_id (str): The ID of the application to build the image for.
|
|
38
|
+
base_name (str): The base name of the image to build.
|
|
39
|
+
tar_file (UploadFile): The tar file containing the application code.
|
|
40
|
+
stoken_session (SessionContainer): The session container for the user making the request.
|
|
41
41
|
|
|
42
42
|
Returns:
|
|
43
|
-
|
|
43
|
+
Image: The Docker image that was built.
|
|
44
44
|
|
|
45
45
|
Parameters
|
|
46
46
|
----------
|
|
@@ -124,7 +124,7 @@ class ContainersClient:
|
|
|
124
124
|
Restart docker container.
|
|
125
125
|
|
|
126
126
|
Args:
|
|
127
|
-
|
|
127
|
+
payload (RestartAppContainer) -- the required data (app_name and variant_name)
|
|
128
128
|
|
|
129
129
|
Parameters
|
|
130
130
|
----------
|
|
@@ -159,7 +159,11 @@ class ContainersClient:
|
|
|
159
159
|
headers={
|
|
160
160
|
"content-type": "application/json",
|
|
161
161
|
},
|
|
162
|
-
request_options=
|
|
162
|
+
request_options=(
|
|
163
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
164
|
+
if request_options
|
|
165
|
+
else {"timeout_in_seconds": 600}
|
|
166
|
+
),
|
|
163
167
|
omit=OMIT,
|
|
164
168
|
)
|
|
165
169
|
try:
|
|
@@ -222,7 +226,11 @@ class ContainersClient:
|
|
|
222
226
|
_response = self._client_wrapper.httpx_client.request(
|
|
223
227
|
"containers/templates",
|
|
224
228
|
method="GET",
|
|
225
|
-
request_options=
|
|
229
|
+
request_options=(
|
|
230
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
231
|
+
if request_options
|
|
232
|
+
else {"timeout_in_seconds": 600}
|
|
233
|
+
),
|
|
226
234
|
)
|
|
227
235
|
try:
|
|
228
236
|
if 200 <= _response.status_code < 300:
|
|
@@ -249,15 +257,24 @@ class ContainersClient:
|
|
|
249
257
|
Constructs the URL for an app container based on the provided base_id or variant_id.
|
|
250
258
|
|
|
251
259
|
Args:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
base_id (Optional[str]): The ID of the base to use for the app container.
|
|
264
|
+
variant_id (Optional[str]): The ID of the variant to use for the app container.
|
|
265
|
+
request (Request): The request object.
|
|
255
266
|
|
|
256
267
|
Returns:
|
|
257
|
-
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
URI: The URI for the app container.
|
|
258
272
|
|
|
259
273
|
Raises:
|
|
260
|
-
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
HTTPException: If the base or variant cannot be found or the user does not have access.
|
|
261
278
|
|
|
262
279
|
Parameters
|
|
263
280
|
----------
|
|
@@ -290,7 +307,11 @@ class ContainersClient:
|
|
|
290
307
|
"base_id": base_id,
|
|
291
308
|
"variant_id": variant_id,
|
|
292
309
|
},
|
|
293
|
-
request_options=
|
|
310
|
+
request_options=(
|
|
311
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
312
|
+
if request_options
|
|
313
|
+
else {"timeout_in_seconds": 600}
|
|
314
|
+
),
|
|
294
315
|
)
|
|
295
316
|
try:
|
|
296
317
|
if 200 <= _response.status_code < 300:
|
|
@@ -333,13 +354,13 @@ class AsyncContainersClient:
|
|
|
333
354
|
Builds a Docker image from a tar file containing the application code.
|
|
334
355
|
|
|
335
356
|
Args:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
357
|
+
app_id (str): The ID of the application to build the image for.
|
|
358
|
+
base_name (str): The base name of the image to build.
|
|
359
|
+
tar_file (UploadFile): The tar file containing the application code.
|
|
360
|
+
stoken_session (SessionContainer): The session container for the user making the request.
|
|
340
361
|
|
|
341
362
|
Returns:
|
|
342
|
-
|
|
363
|
+
Image: The Docker image that was built.
|
|
343
364
|
|
|
344
365
|
Parameters
|
|
345
366
|
----------
|
|
@@ -431,7 +452,7 @@ class AsyncContainersClient:
|
|
|
431
452
|
Restart docker container.
|
|
432
453
|
|
|
433
454
|
Args:
|
|
434
|
-
|
|
455
|
+
payload (RestartAppContainer) -- the required data (app_name and variant_name)
|
|
435
456
|
|
|
436
457
|
Parameters
|
|
437
458
|
----------
|
|
@@ -474,7 +495,11 @@ class AsyncContainersClient:
|
|
|
474
495
|
headers={
|
|
475
496
|
"content-type": "application/json",
|
|
476
497
|
},
|
|
477
|
-
request_options=
|
|
498
|
+
request_options=(
|
|
499
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
500
|
+
if request_options
|
|
501
|
+
else {"timeout_in_seconds": 600}
|
|
502
|
+
),
|
|
478
503
|
omit=OMIT,
|
|
479
504
|
)
|
|
480
505
|
try:
|
|
@@ -545,7 +570,11 @@ class AsyncContainersClient:
|
|
|
545
570
|
_response = await self._client_wrapper.httpx_client.request(
|
|
546
571
|
"containers/templates",
|
|
547
572
|
method="GET",
|
|
548
|
-
request_options=
|
|
573
|
+
request_options=(
|
|
574
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
575
|
+
if request_options
|
|
576
|
+
else {"timeout_in_seconds": 600}
|
|
577
|
+
),
|
|
549
578
|
)
|
|
550
579
|
try:
|
|
551
580
|
if 200 <= _response.status_code < 300:
|
|
@@ -572,15 +601,24 @@ class AsyncContainersClient:
|
|
|
572
601
|
Constructs the URL for an app container based on the provided base_id or variant_id.
|
|
573
602
|
|
|
574
603
|
Args:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
base_id (Optional[str]): The ID of the base to use for the app container.
|
|
608
|
+
variant_id (Optional[str]): The ID of the variant to use for the app container.
|
|
609
|
+
request (Request): The request object.
|
|
578
610
|
|
|
579
611
|
Returns:
|
|
580
|
-
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
URI: The URI for the app container.
|
|
581
616
|
|
|
582
617
|
Raises:
|
|
583
|
-
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
HTTPException: If the base or variant cannot be found or the user does not have access.
|
|
584
622
|
|
|
585
623
|
Parameters
|
|
586
624
|
----------
|
|
@@ -621,7 +659,11 @@ class AsyncContainersClient:
|
|
|
621
659
|
"base_id": base_id,
|
|
622
660
|
"variant_id": variant_id,
|
|
623
661
|
},
|
|
624
|
-
request_options=
|
|
662
|
+
request_options=(
|
|
663
|
+
{**request_options, "timeout_in_seconds": 600}
|
|
664
|
+
if request_options
|
|
665
|
+
else {"timeout_in_seconds": 600}
|
|
666
|
+
),
|
|
625
667
|
)
|
|
626
668
|
try:
|
|
627
669
|
if 200 <= _response.status_code < 300:
|