acontext 0.1.6__py3-none-any.whl → 0.1.7__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.
@@ -40,6 +40,7 @@ class AsyncSessionsAPI:
40
40
  limit: int | None = None,
41
41
  cursor: str | None = None,
42
42
  time_desc: bool | None = None,
43
+ filter_by_configs: Mapping[str, Any] | None = None,
43
44
  ) -> ListSessionsOutput:
44
45
  """List all sessions in the project.
45
46
 
@@ -48,13 +49,25 @@ class AsyncSessionsAPI:
48
49
  limit: Maximum number of sessions to return. Defaults to None.
49
50
  cursor: Cursor for pagination. Defaults to None.
50
51
  time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
52
+ filter_by_configs: Filter by session configs using JSONB containment.
53
+ Only sessions where configs contains all key-value pairs in this
54
+ dict will be returned. Supports nested objects.
55
+ Note: Matching is case-sensitive and type-sensitive.
56
+ Sessions with NULL configs are excluded from filtered results.
57
+ Defaults to None.
51
58
 
52
59
  Returns:
53
60
  ListSessionsOutput containing the list of sessions and pagination information.
61
+
62
+ Example:
63
+ >>> sessions = await client.sessions.list(filter_by_configs={"agent": "bot1"})
54
64
  """
55
65
  params: dict[str, Any] = {}
56
66
  if user:
57
67
  params["user"] = user
68
+ # Handle filter_by_configs - JSON encode, skip empty dict
69
+ if filter_by_configs is not None and len(filter_by_configs) > 0:
70
+ params["filter_by_configs"] = json.dumps(filter_by_configs)
58
71
  params.update(
59
72
  build_params(
60
73
  limit=limit,
@@ -40,6 +40,7 @@ class SessionsAPI:
40
40
  limit: int | None = None,
41
41
  cursor: str | None = None,
42
42
  time_desc: bool | None = None,
43
+ filter_by_configs: Mapping[str, Any] | None = None,
43
44
  ) -> ListSessionsOutput:
44
45
  """List all sessions in the project.
45
46
 
@@ -48,13 +49,25 @@ class SessionsAPI:
48
49
  limit: Maximum number of sessions to return. Defaults to None.
49
50
  cursor: Cursor for pagination. Defaults to None.
50
51
  time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
52
+ filter_by_configs: Filter by session configs using JSONB containment.
53
+ Only sessions where configs contains all key-value pairs in this
54
+ dict will be returned. Supports nested objects.
55
+ Note: Matching is case-sensitive and type-sensitive.
56
+ Sessions with NULL configs are excluded from filtered results.
57
+ Defaults to None.
51
58
 
52
59
  Returns:
53
60
  ListSessionsOutput containing the list of sessions and pagination information.
61
+
62
+ Example:
63
+ >>> sessions = client.sessions.list(filter_by_configs={"agent": "bot1"})
54
64
  """
55
65
  params: dict[str, Any] = {}
56
66
  if user:
57
67
  params["user"] = user
68
+ # Handle filter_by_configs - JSON encode, skip empty dict
69
+ if filter_by_configs is not None and len(filter_by_configs) > 0:
70
+ params["filter_by_configs"] = json.dumps(filter_by_configs)
58
71
  params.update(
59
72
  build_params(
60
73
  limit=limit,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: acontext
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Python SDK for the Acontext API
5
5
  Keywords: acontext,sdk,client,api
6
6
  Requires-Dist: httpx>=0.28.1
@@ -17,13 +17,13 @@ acontext/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  acontext/resources/__init__.py,sha256=i2_12EUfxo2z-dgMu8dyAsEiT9nf2P00voN2_vMZ2K8,843
18
18
  acontext/resources/async_disks.py,sha256=rc8hSdVsZ1UbrK2kwxmEMZyP0aEMsvjyZ70cYddpiF8,12051
19
19
  acontext/resources/async_sandboxes.py,sha256=qkpEhmUUUrq_C1mVSVyUzBvxzBdq6BvL9e76FXyk19M,2850
20
- acontext/resources/async_sessions.py,sha256=wBUUIDUvMqe_mdR3l_3HuPfEWUcq65SOJLc5mKTu0nI,14691
20
+ acontext/resources/async_sessions.py,sha256=Rd-Eitn_bZtvIiuM0FScN2FvvS5uyrP6zML1YFxFTNw,15480
21
21
  acontext/resources/async_skills.py,sha256=eRn3NjBhR6_6GmEyZO_nKc0OnHgR_TeIHxqGX_73lwo,5999
22
22
  acontext/resources/async_tools.py,sha256=RbGaF2kX65Mun-q-Fp5H1J8waWTLIdCOfbdY19jpn1o,1091
23
23
  acontext/resources/async_users.py,sha256=CjW_Xz-UnNf449Hr1j3YeGgtIVZi2ePY5-r7Uj3wMIc,2005
24
24
  acontext/resources/disks.py,sha256=YyAzm6A00T4A3dI8YTEAOxwm6bnCnp8gWIoZ4lLGN5w,11859
25
25
  acontext/resources/sandboxes.py,sha256=2E9Ls15t3FQ9LBZOnk0--IjQhxwZGTPkbpS5zcnOJSo,2779
26
- acontext/resources/sessions.py,sha256=yaFwiWsShM4HVguwsM-Mp9HHJohl84R-LOFp8uGJUyU,14454
26
+ acontext/resources/sessions.py,sha256=eRdmcg_2wZxLf3UdMPNROnYtvO5wySd6Joyz5Zyypm8,15237
27
27
  acontext/resources/skills.py,sha256=CZFgJhRDtGlbDcTBKNxFkG4DlqoaJb0c_ymfV12QKdM,5930
28
28
  acontext/resources/tools.py,sha256=II_185B0HYKSP43hizE6C1zs7kjkkPLKihuEG8s-DRY,1046
29
29
  acontext/resources/users.py,sha256=vZfBHd2ARmd9d5d8n5rLaMUT5z2bMO82k7OcqMaFqxk,1946
@@ -36,6 +36,6 @@ acontext/types/skill.py,sha256=v7OAvtkwTeZAkLG7NQMcwFoSJ4g-HDWjPZ4EoMyU3mk,2779
36
36
  acontext/types/tool.py,sha256=UlX6JIGRKd96vPayOkyi6pGwFi6w9GwWwAxr4BcqVts,670
37
37
  acontext/types/user.py,sha256=dBzHCqULSJ3Sqw7T8nA0U8Sctz76Pd0hm1qsHvtEIBQ,1264
38
38
  acontext/uploads.py,sha256=6twnqQOY_eerNuEjeSKsE_3S0IfJUiczXtAy4aXqDl8,1379
39
- acontext-0.1.6.dist-info/WHEEL,sha256=e_m4S054HL0hyR3CpOk-b7Q7fDX6BuFkgL5OjAExXas,80
40
- acontext-0.1.6.dist-info/METADATA,sha256=xUgSw00x4t4EHQR7WLgfwlnjEgXJjD1LH2mk4t_KKSo,888
41
- acontext-0.1.6.dist-info/RECORD,,
39
+ acontext-0.1.7.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
40
+ acontext-0.1.7.dist-info/METADATA,sha256=IznF8UuS_qyw8NRBh1MTiXqzwEA4r9h5CrGGpfhFNiY,888
41
+ acontext-0.1.7.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.27
2
+ Generator: uv 0.9.28
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any