acontext 0.0.8__tar.gz → 0.0.10__tar.gz
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.
- acontext-0.0.10/PKG-INFO +34 -0
- acontext-0.0.10/README.md +19 -0
- {acontext-0.0.8 → acontext-0.0.10}/pyproject.toml +1 -1
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/__init__.py +3 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/async_sessions.py +2 -2
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/sessions.py +2 -2
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/__init__.py +2 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/session.py +53 -2
- acontext-0.0.8/PKG-INFO +0 -661
- acontext-0.0.8/README.md +0 -646
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/_constants.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/_utils.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/agent/__init__.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/agent/base.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/agent/disk.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/async_client.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/client.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/client_types.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/errors.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/messages.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/py.typed +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/__init__.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/async_blocks.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/async_disks.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/async_spaces.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/async_tools.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/blocks.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/disks.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/spaces.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/resources/tools.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/block.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/disk.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/space.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/types/tool.py +0 -0
- {acontext-0.0.8 → acontext-0.0.10}/src/acontext/uploads.py +0 -0
acontext-0.0.10/PKG-INFO
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: acontext
|
|
3
|
+
Version: 0.0.10
|
|
4
|
+
Summary: Python SDK for the Acontext API
|
|
5
|
+
Keywords: acontext,sdk,client,api
|
|
6
|
+
Requires-Dist: httpx>=0.28.1
|
|
7
|
+
Requires-Dist: openai>=2.6.1
|
|
8
|
+
Requires-Dist: anthropic>=0.72.0
|
|
9
|
+
Requires-Dist: pydantic>=2.12.3
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Project-URL: Homepage, https://github.com/memodb-io/Acontext
|
|
12
|
+
Project-URL: Issues, https://github.com/memodb-io/Acontext/issues
|
|
13
|
+
Project-URL: Repository, https://github.com/memodb-io/Acontext
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
## acontext client for python
|
|
17
|
+
|
|
18
|
+
Python SDK for interacting with the Acontext REST API.
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install acontext
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> Requires Python 3.10 or newer.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# 🔍 Document
|
|
33
|
+
|
|
34
|
+
To understand more about this SDK, please view [our docs](https://docs.acontext.io/) and [api references](https://docs.acontext.io/api-reference/introduction)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## acontext client for python
|
|
2
|
+
|
|
3
|
+
Python SDK for interacting with the Acontext REST API.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install acontext
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
> Requires Python 3.10 or newer.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# 🔍 Document
|
|
18
|
+
|
|
19
|
+
To understand more about this SDK, please view [our docs](https://docs.acontext.io/) and [api references](https://docs.acontext.io/api-reference/introduction)
|
|
@@ -19,6 +19,7 @@ from .resources import (
|
|
|
19
19
|
SessionsAPI,
|
|
20
20
|
SpacesAPI,
|
|
21
21
|
)
|
|
22
|
+
from .types import Task, TaskData
|
|
22
23
|
|
|
23
24
|
__all__ = [
|
|
24
25
|
"AcontextClient",
|
|
@@ -36,6 +37,8 @@ __all__ = [
|
|
|
36
37
|
"AsyncBlocksAPI",
|
|
37
38
|
"AsyncSessionsAPI",
|
|
38
39
|
"AsyncSpacesAPI",
|
|
40
|
+
"Task",
|
|
41
|
+
"TaskData",
|
|
39
42
|
"__version__",
|
|
40
43
|
]
|
|
41
44
|
|
|
@@ -167,7 +167,7 @@ class AsyncSessionsAPI:
|
|
|
167
167
|
)
|
|
168
168
|
return GetTasksOutput.model_validate(data)
|
|
169
169
|
|
|
170
|
-
async def
|
|
170
|
+
async def store_message(
|
|
171
171
|
self,
|
|
172
172
|
session_id: str,
|
|
173
173
|
*,
|
|
@@ -181,7 +181,7 @@ class AsyncSessionsAPI:
|
|
|
181
181
|
| None
|
|
182
182
|
) = None,
|
|
183
183
|
) -> Message:
|
|
184
|
-
"""
|
|
184
|
+
"""Store a message to a session.
|
|
185
185
|
|
|
186
186
|
Args:
|
|
187
187
|
session_id: The UUID of the session.
|
|
@@ -171,7 +171,7 @@ class SessionsAPI:
|
|
|
171
171
|
)
|
|
172
172
|
return GetTasksOutput.model_validate(data)
|
|
173
173
|
|
|
174
|
-
def
|
|
174
|
+
def store_message(
|
|
175
175
|
self,
|
|
176
176
|
session_id: str,
|
|
177
177
|
*,
|
|
@@ -185,7 +185,7 @@ class SessionsAPI:
|
|
|
185
185
|
| None
|
|
186
186
|
) = None,
|
|
187
187
|
) -> Message:
|
|
188
|
-
"""
|
|
188
|
+
"""Store a message to a session.
|
|
189
189
|
|
|
190
190
|
Args:
|
|
191
191
|
session_id: The UUID of the session.
|
|
@@ -20,6 +20,7 @@ from .session import (
|
|
|
20
20
|
PublicURL,
|
|
21
21
|
Session,
|
|
22
22
|
Task,
|
|
23
|
+
TaskData,
|
|
23
24
|
TokenCounts,
|
|
24
25
|
)
|
|
25
26
|
from .block import Block
|
|
@@ -58,6 +59,7 @@ __all__ = [
|
|
|
58
59
|
"PublicURL",
|
|
59
60
|
"Session",
|
|
60
61
|
"Task",
|
|
62
|
+
"TaskData",
|
|
61
63
|
"TokenCounts",
|
|
62
64
|
# Space types
|
|
63
65
|
"ExperienceConfirmation",
|
|
@@ -30,6 +30,34 @@ class RemoveToolResultStrategy(TypedDict):
|
|
|
30
30
|
params: RemoveToolResultParams
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
class RemoveToolCallParamsParams(TypedDict, total=False):
|
|
34
|
+
"""Parameters for the remove_tool_call_params edit strategy.
|
|
35
|
+
|
|
36
|
+
Attributes:
|
|
37
|
+
keep_recent_n_tool_calls: Number of most recent tool calls to keep with full parameters.
|
|
38
|
+
Defaults to 3 if not specified.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
keep_recent_n_tool_calls: NotRequired[int]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class RemoveToolCallParamsStrategy(TypedDict):
|
|
46
|
+
"""Edit strategy to remove parameters from old tool-call parts.
|
|
47
|
+
|
|
48
|
+
Keeps the most recent N tool calls with full parameters, replacing older
|
|
49
|
+
tool call arguments with empty JSON "{}". The tool call ID and name remain
|
|
50
|
+
intact so tool-results can still reference them.
|
|
51
|
+
|
|
52
|
+
Example:
|
|
53
|
+
{"type": "remove_tool_call_params", "params": {"keep_recent_n_tool_calls": 5}}
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
type: Literal["remove_tool_call_params"]
|
|
57
|
+
params: RemoveToolCallParamsParams
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
33
61
|
class TokenLimitParams(TypedDict):
|
|
34
62
|
"""Parameters for the token_limit edit strategy.
|
|
35
63
|
|
|
@@ -59,7 +87,7 @@ class TokenLimitStrategy(TypedDict):
|
|
|
59
87
|
|
|
60
88
|
# Union type for all edit strategies
|
|
61
89
|
# When adding new strategies, add them to this Union: EditStrategy = Union[RemoveToolResultStrategy, OtherStrategy, ...]
|
|
62
|
-
EditStrategy = Union[RemoveToolResultStrategy, TokenLimitStrategy]
|
|
90
|
+
EditStrategy = Union[RemoveToolResultStrategy, RemoveToolCallParamsStrategy, TokenLimitStrategy]
|
|
63
91
|
|
|
64
92
|
|
|
65
93
|
class Asset(BaseModel):
|
|
@@ -120,6 +148,25 @@ class Session(BaseModel):
|
|
|
120
148
|
updated_at: str = Field(..., description="ISO 8601 formatted update timestamp")
|
|
121
149
|
|
|
122
150
|
|
|
151
|
+
class TaskData(BaseModel):
|
|
152
|
+
"""Task data model representing the structured data stored in a task.
|
|
153
|
+
|
|
154
|
+
This schema matches the TaskData model in acontext_core/schema/session/task.py
|
|
155
|
+
and the Go API TaskData struct.
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
task_description: str = Field(..., description="Description of the task")
|
|
159
|
+
progresses: list[str] | None = Field(
|
|
160
|
+
None, description="List of progress updates for the task"
|
|
161
|
+
)
|
|
162
|
+
user_preferences: list[str] | None = Field(
|
|
163
|
+
None, description="List of user preferences related to the task"
|
|
164
|
+
)
|
|
165
|
+
sop_thinking: str | None = Field(
|
|
166
|
+
None, description="Standard Operating Procedure thinking notes"
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
123
170
|
class Task(BaseModel):
|
|
124
171
|
"""Task model representing a task in a session."""
|
|
125
172
|
|
|
@@ -127,7 +174,7 @@ class Task(BaseModel):
|
|
|
127
174
|
session_id: str = Field(..., description="Session UUID")
|
|
128
175
|
project_id: str = Field(..., description="Project UUID")
|
|
129
176
|
order: int = Field(..., description="Task order")
|
|
130
|
-
data:
|
|
177
|
+
data: TaskData = Field(..., description="Structured task data")
|
|
131
178
|
status: str = Field(
|
|
132
179
|
...,
|
|
133
180
|
description="Task status: 'success', 'failed', 'running', or 'pending'",
|
|
@@ -168,6 +215,10 @@ class GetMessagesOutput(BaseModel):
|
|
|
168
215
|
...,
|
|
169
216
|
description="List of messages in the requested format (Message, OpenAI format, or Anthropic format)",
|
|
170
217
|
)
|
|
218
|
+
ids: list[str] = Field(
|
|
219
|
+
...,
|
|
220
|
+
description="List of message UUIDs corresponding to each item in the same order",
|
|
221
|
+
)
|
|
171
222
|
next_cursor: str | None = Field(None, description="Cursor for pagination")
|
|
172
223
|
has_more: bool = Field(..., description="Whether there are more items")
|
|
173
224
|
public_urls: dict[str, PublicURL] | None = Field(
|