fleet-python 0.2.23__py3-none-any.whl → 0.2.25__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 fleet-python might be problematic. Click here for more details.

fleet/__init__.py CHANGED
@@ -24,7 +24,7 @@ from .exceptions import (
24
24
  )
25
25
  from .client import Fleet, SyncEnv
26
26
  from ._async.client import AsyncFleet, AsyncEnv
27
- from .models import InstanceResponse
27
+ from .models import InstanceResponse, Environment
28
28
  from .instance.models import Resource, ResetResponse
29
29
 
30
30
  # Import sync verifiers with explicit naming
@@ -62,7 +62,8 @@ __all__ = [
62
62
  "AsyncFleet",
63
63
  "AsyncEnv",
64
64
  # Models
65
- "InstanceRecord",
65
+ "InstanceResponse",
66
+ "SyncEnv",
66
67
  "Resource",
67
68
  "ResetResponse",
68
69
  # Task models
fleet/_async/client.py CHANGED
@@ -29,6 +29,7 @@ from ..models import (
29
29
  VerifiersCheckResponse,
30
30
  VerifiersExecuteResponse,
31
31
  TaskListResponse,
32
+ AccountResponse,
32
33
  )
33
34
  from .tasks import Task
34
35
 
@@ -124,6 +125,7 @@ class AsyncEnv(EnvironmentBase):
124
125
  key: str,
125
126
  function_name: str,
126
127
  args: tuple,
128
+ args_array: list,
127
129
  kwargs: dict,
128
130
  timeout: Optional[int] = 30,
129
131
  needs_upload: bool = True,
@@ -135,6 +137,7 @@ class AsyncEnv(EnvironmentBase):
135
137
  key,
136
138
  function_name,
137
139
  args,
140
+ args_array,
138
141
  kwargs,
139
142
  timeout,
140
143
  needs_upload
@@ -199,6 +202,7 @@ class AsyncFleet:
199
202
  json=request.model_dump(),
200
203
  base_url=region_base_url,
201
204
  )
205
+
202
206
  instance = AsyncEnv(client=self.client, **response.json())
203
207
  await instance.instance.load()
204
208
  return instance
@@ -268,6 +272,15 @@ class AsyncFleet:
268
272
 
269
273
  return tasks
270
274
 
275
+ async def account(self) -> AccountResponse:
276
+ """Get account information including instance limits and usage.
277
+
278
+ Returns:
279
+ AccountResponse containing team_id, team_name, instance_limit, and instance_count
280
+ """
281
+ response = await self.client.request("GET", "/v1/account")
282
+ return AccountResponse(**response.json())
283
+
271
284
 
272
285
  # Shared
273
286
  async def _delete_instance(client: AsyncWrapper, instance_id: str) -> InstanceResponse:
@@ -289,6 +302,7 @@ async def _execute_verifier_remote(
289
302
  key: str,
290
303
  function_name: str,
291
304
  args: tuple,
305
+ args_array: list,
292
306
  kwargs: dict,
293
307
  timeout: Optional[int] = 30,
294
308
  needs_upload: bool = True,
@@ -304,6 +318,7 @@ async def _execute_verifier_remote(
304
318
  "key": key,
305
319
  "sha256": bundle_sha,
306
320
  "args": args_kwargs_b64,
321
+ "args_array": args_array,
307
322
  "function_name": function_name,
308
323
  "timeout": timeout,
309
324
  "region": "us-west-1", # TODO: make configurable
@@ -1,5 +1,5 @@
1
1
  from ..client import AsyncFleet, AsyncEnv
2
- from ...models import Environment as EnvironmentModel
2
+ from ...models import Environment as EnvironmentModel, AccountResponse
3
3
  from typing import List, Optional
4
4
 
5
5
 
@@ -23,3 +23,7 @@ async def list_instances_async(
23
23
 
24
24
  async def get_async(instance_id: str) -> AsyncEnv:
25
25
  return await AsyncFleet().instance(instance_id)
26
+
27
+
28
+ async def account_async() -> AccountResponse:
29
+ return await AsyncFleet().account()
fleet/_async/models.py CHANGED
@@ -319,3 +319,9 @@ class InstanceResponse(BaseModel):
319
319
  env_variables: Optional[Dict[str, Any]] = Field(None, title='Env Variables')
320
320
  urls: Optional[InstanceURLs] = Field(None, title='Urls')
321
321
  health: Optional[bool] = Field(None, title='Health')
322
+
323
+ class AccountResponse(BaseModel):
324
+ team_id: str = Field(..., title='Team Id')
325
+ team_name: str = Field(..., title='Team Name')
326
+ instance_limit: int = Field(..., title='Instance Limit')
327
+ instance_count: int = Field(..., title='Instance Count')
@@ -129,6 +129,10 @@ class AsyncVerifierFunction:
129
129
  "Please provide a synchronous version of your verifier."
130
130
  )
131
131
 
132
+ args_array = list(args)
133
+ args_array.append({"env": env.instance_id})
134
+ args = tuple(args_array)
135
+
132
136
  try:
133
137
  # Check if bundle needs to be uploaded
134
138
  bundle_sha, needs_upload = await self._check_bundle_status(env)
@@ -144,6 +148,7 @@ class AsyncVerifierFunction:
144
148
  key=self.key,
145
149
  function_name=self.func.__name__,
146
150
  args=args,
151
+ args_array=args_array,
147
152
  kwargs=kwargs,
148
153
  needs_upload=True
149
154
  )
fleet/client.py CHANGED
@@ -29,6 +29,7 @@ from .models import (
29
29
  VerifiersCheckResponse,
30
30
  VerifiersExecuteResponse,
31
31
  TaskListResponse,
32
+ AccountResponse,
32
33
  )
33
34
  from .tasks import Task
34
35
 
@@ -124,6 +125,7 @@ class SyncEnv(EnvironmentBase):
124
125
  key: str,
125
126
  function_name: str,
126
127
  args: tuple,
128
+ args_array: list,
127
129
  kwargs: dict,
128
130
  timeout: Optional[int] = 30,
129
131
  needs_upload: bool = True,
@@ -135,6 +137,7 @@ class SyncEnv(EnvironmentBase):
135
137
  key,
136
138
  function_name,
137
139
  args,
140
+ args_array,
138
141
  kwargs,
139
142
  timeout,
140
143
  needs_upload
@@ -199,6 +202,7 @@ class Fleet:
199
202
  json=request.model_dump(),
200
203
  base_url=region_base_url,
201
204
  )
205
+
202
206
  instance = SyncEnv(client=self.client, **response.json())
203
207
  instance.instance.load()
204
208
  return instance
@@ -268,6 +272,15 @@ class Fleet:
268
272
 
269
273
  return tasks
270
274
 
275
+ def account(self) -> AccountResponse:
276
+ """Get account information including instance limits and usage.
277
+
278
+ Returns:
279
+ AccountResponse containing team_id, team_name, instance_limit, and instance_count
280
+ """
281
+ response = self.client.request("GET", "/v1/account")
282
+ return AccountResponse(**response.json())
283
+
271
284
 
272
285
  # Shared
273
286
  def _delete_instance(client: SyncWrapper, instance_id: str) -> InstanceResponse:
@@ -289,6 +302,7 @@ def _execute_verifier_remote(
289
302
  key: str,
290
303
  function_name: str,
291
304
  args: tuple,
305
+ args_array: list,
292
306
  kwargs: dict,
293
307
  timeout: Optional[int] = 30,
294
308
  needs_upload: bool = True,
@@ -304,6 +318,7 @@ def _execute_verifier_remote(
304
318
  "key": key,
305
319
  "sha256": bundle_sha,
306
320
  "args": args_kwargs_b64,
321
+ "args_array": args_array,
307
322
  "function_name": function_name,
308
323
  "timeout": timeout,
309
324
  "region": "us-west-1", # TODO: make configurable
fleet/config.py CHANGED
@@ -1,5 +1,5 @@
1
1
  DEFAULT_MAX_RETRIES = 5
2
- DEFAULT_TIMEOUT = 300.0
2
+ DEFAULT_TIMEOUT = 60.0
3
3
 
4
4
  GLOBAL_BASE_URL = "https://orchestrator.fleetai.com"
5
5
  REGION_BASE_URL = {
fleet/env/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Fleet env module - convenience functions for environment management."""
2
2
 
3
- from .client import make, list_envs, list_regions, get, list_instances
3
+ from .client import make, list_envs, list_regions, get, list_instances, account
4
4
 
5
5
  # Import async versions from _async
6
6
  from .._async.env.client import (
@@ -9,6 +9,7 @@ from .._async.env.client import (
9
9
  list_regions_async,
10
10
  get_async,
11
11
  list_instances_async,
12
+ account_async,
12
13
  )
13
14
 
14
15
  __all__ = [
@@ -22,4 +23,6 @@ __all__ = [
22
23
  "list_regions_async",
23
24
  "list_instances_async",
24
25
  "get_async",
26
+ "account",
27
+ "account_async",
25
28
  ]
fleet/env/client.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from ..client import Fleet, SyncEnv
2
- from ..models import Environment as EnvironmentModel
2
+ from ..models import Environment as EnvironmentModel, AccountResponse
3
3
  from typing import List, Optional
4
4
 
5
5
 
@@ -23,3 +23,7 @@ def list_instances(
23
23
 
24
24
  def get(instance_id: str) -> SyncEnv:
25
25
  return Fleet().instance(instance_id)
26
+
27
+
28
+ def account() -> AccountResponse:
29
+ return Fleet().account()
fleet/models.py CHANGED
@@ -319,3 +319,9 @@ class InstanceResponse(BaseModel):
319
319
  env_variables: Optional[Dict[str, Any]] = Field(None, title='Env Variables')
320
320
  urls: Optional[InstanceURLs] = Field(None, title='Urls')
321
321
  health: Optional[bool] = Field(None, title='Health')
322
+
323
+ class AccountResponse(BaseModel):
324
+ team_id: str = Field(..., title='Team Id')
325
+ team_name: str = Field(..., title='Team Name')
326
+ instance_limit: int = Field(..., title='Instance Limit')
327
+ instance_count: int = Field(..., title='Instance Count')
@@ -128,6 +128,10 @@ class SyncVerifierFunction:
128
128
  "Please provide a synchronous version of your verifier."
129
129
  )
130
130
 
131
+ args_array = list(args)
132
+ args_array.append({"env": env.instance_id})
133
+ args = tuple(args_array)
134
+
131
135
  try:
132
136
  # Check if bundle needs to be uploaded
133
137
  bundle_sha, needs_upload = self._check_bundle_status(env)
@@ -143,6 +147,7 @@ class SyncVerifierFunction:
143
147
  key=self.key,
144
148
  function_name=self.func.__name__,
145
149
  args=args,
150
+ args_array=args_array,
146
151
  kwargs=kwargs,
147
152
  needs_upload=True
148
153
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.23
3
+ Version: 0.2.25
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -15,22 +15,22 @@ examples/openai_example.py,sha256=I2vk_SJN9BkSRQCYRJfbtGJ-HJ2xzQj-lOjwqmLos5M,82
15
15
  examples/openai_simple_example.py,sha256=I42ytIwv0INgDO39pp1MOQSqsJz2YYH8GeNNBaUtq3A,1748
16
16
  examples/query_builder_example.py,sha256=Q3lUBETHpu1aS2FXAO79ADYqCxOjMMMZNgCcFVapiII,3918
17
17
  examples/quickstart.py,sha256=1VT39IRRhemsJgxi0O0gprdpcw7HB4pYO97GAYagIcg,3788
18
- fleet/__init__.py,sha256=5js0jYu1wddNyfy4sJIcoVGMZNZeHHSAPJJzfFXN-Po,2276
18
+ fleet/__init__.py,sha256=2WHAk_ZRIxDs1uxrWf-sSeokiK4f_nDVHJJ1_VUFSPA,2306
19
19
  fleet/base.py,sha256=0yYuMN0lBkrfTTZBt5NQp5112xWgziuWEk4GuHJB1wE,9189
20
- fleet/client.py,sha256=SDrq3gfmbAa-F-wmewHN7PyoUc2SWKy2DdaYmJHx1dk,11591
21
- fleet/config.py,sha256=zd19st83NJdW9DdOq7Irpc0x-iUnMad0JOtAr_nD5DM,273
20
+ fleet/client.py,sha256=K7tLdwvLx-ExGtNoIDqsuROb-egaM-OxGijI19vnUqY,12069
21
+ fleet/config.py,sha256=rqR-y2TbZS-VYACaqrg-PUe0y0UDbR1ZNU1KGJZBwNQ,272
22
22
  fleet/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
23
- fleet/models.py,sha256=aPjcwbGfyEoDaS5Iip3cAyy3j5NDqhP0wyrvtVvF3M8,11410
23
+ fleet/models.py,sha256=trtM-3A2wW4pOg6EvbKxiukU2clSNFrj4Uax7l2uiIM,11665
24
24
  fleet/tasks.py,sha256=OScp0tHIbCmOpmCFzHATBmA7WiJMlehP3rvEfeMAoPk,1648
25
25
  fleet/types.py,sha256=eXeI8BFmiU5hln0PVvJbUZs7BSjl6wSqAtN9zaJT6yY,652
26
26
  fleet/_async/__init__.py,sha256=AJWCnuo7XKja4yBb8fK2wX7ntciLXQrpzdRHwjTRP6M,62
27
27
  fleet/_async/base.py,sha256=s0rYOtXsMJeitOvpa-Oh8ciLV226p_TIPp3fplzWvV4,9209
28
- fleet/_async/client.py,sha256=jByARVSmtsOS9Qlukwij_exPzIQW5TBMtIGKnLqlF00,11924
28
+ fleet/_async/client.py,sha256=2LlMFO5cnLIwvunSixKRk3kJ-F55WufmoyutwgDYf64,12414
29
29
  fleet/_async/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
30
- fleet/_async/models.py,sha256=aPjcwbGfyEoDaS5Iip3cAyy3j5NDqhP0wyrvtVvF3M8,11410
30
+ fleet/_async/models.py,sha256=trtM-3A2wW4pOg6EvbKxiukU2clSNFrj4Uax7l2uiIM,11665
31
31
  fleet/_async/tasks.py,sha256=7ddJWkgulGW7dTPVQUUcl2L0HgsajmMQY6AUblHpG8A,1649
32
32
  fleet/_async/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- fleet/_async/env/client.py,sha256=PQGKcvnVTr3o2KNsgQM7ZBqaCjimv-wEn-XiYGm44Ko,753
33
+ fleet/_async/env/client.py,sha256=MR2Ju7AudGWmztTVUPPut-ys3yqD7D00D_jsxZaRybA,858
34
34
  fleet/_async/instance/__init__.py,sha256=PtmJq8J8bh0SOQ2V55QURz5GJfobozwtQoqhaOk3_tI,515
35
35
  fleet/_async/instance/base.py,sha256=3qUBuUR8OVS36LzdP6KyZzngtwPKYO09HoY6Ekxp-KA,1625
36
36
  fleet/_async/instance/client.py,sha256=2ZNoBxRJXDQc8fohCLy_RNo-wmuUKXzJo5RZQeCQnkQ,6069
@@ -40,9 +40,9 @@ fleet/_async/resources/browser.py,sha256=oldoSiymJ1lJkADhpUG81ViOBDNyppX1jSoEwe9
40
40
  fleet/_async/resources/sqlite.py,sha256=DvDLRI5dJ7_v4WkHw-Zday1M_FQUdzAqUCy9FtfOY8w,26636
41
41
  fleet/_async/verifiers/__init__.py,sha256=Z2Ic77mw6-mhF5CmVrucmDnAGSTAtiejR_eZjTjPPA0,447
42
42
  fleet/_async/verifiers/bundler.py,sha256=A4yR3wBOcVZYFAv87CD58QlJn6L4QXeilrasnVm8n74,26185
43
- fleet/_async/verifiers/verifier.py,sha256=fhy1bs_n0Ki2xDtisZI86McIZ09-v5WUFo5tZCBRsvA,12153
44
- fleet/env/__init__.py,sha256=yYk657kVDnMWYbuPS_2o0kpVC99AYD85o5WG1jCaWSY,531
45
- fleet/env/client.py,sha256=pG5S1ylDN0pqUGQtRqayDSnYI7ZVpCFvTbtC4LuMRts,628
43
+ fleet/_async/verifiers/verifier.py,sha256=-BNKVKVpg_x4VoPNafEEIGZrP0u7Nh-7OKN6juCiqqs,12322
44
+ fleet/env/__init__.py,sha256=Wt6mO2dQnOdzdjOCvtiIP49wpSrmS7OaZ_OeHNrzqsY,595
45
+ fleet/env/client.py,sha256=2FzA7qfR-B7tVdCNa4uQk10g8zXV-9MNjAqx2D5vQ7c,710
46
46
  fleet/instance/__init__.py,sha256=-Anms7Vw_FO8VBIvwnAnq4rQjwl_XNfAS-i7bypHMow,478
47
47
  fleet/instance/base.py,sha256=OYqzBwZFfTX9wlBGSG5gljqj98NbiJeKIfFJ3uj5I4s,1587
48
48
  fleet/instance/client.py,sha256=4x-3IZZNwlK02OJLKp7mhSymRgXk8NToRCDU3ZuDnJ0,5891
@@ -59,11 +59,11 @@ fleet/verifiers/db.py,sha256=tssmvJjDHuBIy8qlL_P5-UdmEFUw2DZcqLsWZ8ot3Xw,27766
59
59
  fleet/verifiers/decorator.py,sha256=Q-KHhicnIYFwX7FX_VZguzNfu8ZslqNUeWxcS2CwNVY,3386
60
60
  fleet/verifiers/parse.py,sha256=FYbzgX86dLAxoAZ3jXfu6zRPlNxgzjTkhO3yxMC0hZ4,5261
61
61
  fleet/verifiers/sql_differ.py,sha256=dmiGCFXVMEMbAX519OjhVqgA8ZvhnvdmC1BVpL7QCF0,6490
62
- fleet/verifiers/verifier.py,sha256=-iEnLi4BOpqMV8tJgSPcTi_mGWM3vMJiAYTmaJolo2c,12080
63
- fleet_python-0.2.23.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
+ fleet/verifiers/verifier.py,sha256=XVK6a17GnQjxjEkYgl05QKjlmqTA5sWf-eGzcM-QR7E,12249
63
+ fleet_python-0.2.25.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
64
64
  scripts/fix_sync_imports.py,sha256=zangqElfqIvIc-E0S46m6R-51pTZ6gbd8oUVkvCGzJo,4768
65
65
  scripts/unasync.py,sha256=--Fmaae47o-dZ1HYgX1c3Nvi-rMjcFymTRlJcWWnmpw,725
66
- fleet_python-0.2.23.dist-info/METADATA,sha256=BnRRdSDuEiBGpMKUnjrB89CfR4SYbqgo7LhDy6yC6DI,3297
67
- fleet_python-0.2.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
- fleet_python-0.2.23.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
69
- fleet_python-0.2.23.dist-info/RECORD,,
66
+ fleet_python-0.2.25.dist-info/METADATA,sha256=K9TL_OP6vnVBzED_sXSpvZDli67CXfQ5FKOotwEMkKg,3297
67
+ fleet_python-0.2.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
+ fleet_python-0.2.25.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
69
+ fleet_python-0.2.25.dist-info/RECORD,,