acontext 0.0.11__tar.gz → 0.0.12__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.
Files changed (33) hide show
  1. {acontext-0.0.11 → acontext-0.0.12}/PKG-INFO +1 -1
  2. {acontext-0.0.11 → acontext-0.0.12}/pyproject.toml +1 -1
  3. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/agent/base.py +17 -0
  4. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/async_sessions.py +6 -6
  5. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/sessions.py +6 -6
  6. {acontext-0.0.11 → acontext-0.0.12}/README.md +0 -0
  7. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/__init__.py +0 -0
  8. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/_constants.py +0 -0
  9. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/_utils.py +0 -0
  10. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/agent/__init__.py +0 -0
  11. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/agent/disk.py +0 -0
  12. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/async_client.py +0 -0
  13. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/client.py +0 -0
  14. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/client_types.py +0 -0
  15. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/errors.py +0 -0
  16. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/messages.py +0 -0
  17. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/py.typed +0 -0
  18. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/__init__.py +0 -0
  19. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/async_blocks.py +0 -0
  20. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/async_disks.py +0 -0
  21. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/async_spaces.py +0 -0
  22. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/async_tools.py +0 -0
  23. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/blocks.py +0 -0
  24. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/disks.py +0 -0
  25. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/spaces.py +0 -0
  26. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/resources/tools.py +0 -0
  27. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/__init__.py +0 -0
  28. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/block.py +0 -0
  29. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/disk.py +0 -0
  30. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/session.py +0 -0
  31. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/space.py +0 -0
  32. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/types/tool.py +0 -0
  33. {acontext-0.0.11 → acontext-0.0.12}/src/acontext/uploads.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: acontext
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Python SDK for the Acontext API
5
5
  Keywords: acontext,sdk,client,api
6
6
  Requires-Dist: httpx>=0.28.1
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "acontext"
3
- version = "0.0.11"
3
+ version = "0.0.12"
4
4
  description = "Python SDK for the Acontext API"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -9,6 +9,9 @@ class BaseConverter:
9
9
  def to_anthropic_tool_schema(self) -> dict:
10
10
  raise NotImplementedError
11
11
 
12
+ def to_gemini_tool_schema(self) -> dict:
13
+ raise NotImplementedError
14
+
12
15
 
13
16
  class BaseTool(BaseConverter):
14
17
  @property
@@ -55,6 +58,17 @@ class BaseTool(BaseConverter):
55
58
  },
56
59
  }
57
60
 
61
+ def to_gemini_tool_schema(self) -> dict:
62
+ return {
63
+ "name": self.name,
64
+ "description": self.description,
65
+ "parameters": {
66
+ "type": "object",
67
+ "properties": self.arguments,
68
+ "required": self.required_arguments,
69
+ },
70
+ }
71
+
58
72
 
59
73
  class BaseToolPool(BaseConverter):
60
74
  def __init__(self):
@@ -85,5 +99,8 @@ class BaseToolPool(BaseConverter):
85
99
  def to_anthropic_tool_schema(self) -> list[dict]:
86
100
  return [tool.to_anthropic_tool_schema() for tool in self.tools.values()]
87
101
 
102
+ def to_gemini_tool_schema(self) -> list[dict]:
103
+ return [tool.to_gemini_tool_schema() for tool in self.tools.values()]
104
+
88
105
  def format_context(self, *args, **kwargs) -> BaseContext:
89
106
  raise NotImplementedError
@@ -173,7 +173,7 @@ class AsyncSessionsAPI:
173
173
  session_id: str,
174
174
  *,
175
175
  blob: MessageBlob,
176
- format: Literal["acontext", "openai", "anthropic"] = "openai",
176
+ format: Literal["acontext", "openai", "anthropic", "gemini"] = "openai",
177
177
  file_field: str | None = None,
178
178
  file: (
179
179
  FileUpload
@@ -186,7 +186,7 @@ class AsyncSessionsAPI:
186
186
 
187
187
  Args:
188
188
  session_id: The UUID of the session.
189
- blob: The message blob in Acontext, OpenAI, or Anthropic format.
189
+ blob: The message blob in Acontext, OpenAI, Anthropic, or Gemini format.
190
190
  format: The format of the message blob. Defaults to "openai".
191
191
  file_field: The field name for file upload. Only used when format is "acontext".
192
192
  Required if file is provided. Defaults to None.
@@ -199,9 +199,9 @@ class AsyncSessionsAPI:
199
199
  ValueError: If format is invalid, file/file_field provided for non-acontext format,
200
200
  or file is provided without file_field for acontext format.
201
201
  """
202
- if format not in {"acontext", "openai", "anthropic"}:
202
+ if format not in {"acontext", "openai", "anthropic", "gemini"}:
203
203
  raise ValueError(
204
- "format must be one of {'acontext', 'openai', 'anthropic'}"
204
+ "format must be one of {'acontext', 'openai', 'anthropic', 'gemini'}"
205
205
  )
206
206
 
207
207
  # File upload is only supported for acontext format
@@ -264,7 +264,7 @@ class AsyncSessionsAPI:
264
264
  limit: int | None = None,
265
265
  cursor: str | None = None,
266
266
  with_asset_public_url: bool | None = None,
267
- format: Literal["acontext", "openai", "anthropic"] = "openai",
267
+ format: Literal["acontext", "openai", "anthropic", "gemini"] = "openai",
268
268
  time_desc: bool | None = None,
269
269
  edit_strategies: Optional[List[EditStrategy]] = None,
270
270
  ) -> GetMessagesOutput:
@@ -275,7 +275,7 @@ class AsyncSessionsAPI:
275
275
  limit: Maximum number of messages to return. Defaults to None.
276
276
  cursor: Cursor for pagination. Defaults to None.
277
277
  with_asset_public_url: Whether to include presigned URLs for assets. Defaults to None.
278
- format: The format of the messages. Defaults to "openai".
278
+ format: The format of the messages. Defaults to "openai". Supports "acontext", "openai", "anthropic", or "gemini".
279
279
  time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
280
280
  edit_strategies: Optional list of edit strategies to apply before format conversion.
281
281
  Each strategy is a dict with 'type' and 'params' keys.
@@ -177,7 +177,7 @@ class SessionsAPI:
177
177
  session_id: str,
178
178
  *,
179
179
  blob: MessageBlob,
180
- format: Literal["acontext", "openai", "anthropic"] = "openai",
180
+ format: Literal["acontext", "openai", "anthropic", "gemini"] = "openai",
181
181
  file_field: str | None = None,
182
182
  file: (
183
183
  FileUpload
@@ -190,7 +190,7 @@ class SessionsAPI:
190
190
 
191
191
  Args:
192
192
  session_id: The UUID of the session.
193
- blob: The message blob in Acontext, OpenAI, or Anthropic format.
193
+ blob: The message blob in Acontext, OpenAI, Anthropic, or Gemini format.
194
194
  format: The format of the message blob. Defaults to "openai".
195
195
  file_field: The field name for file upload. Only used when format is "acontext".
196
196
  Required if file is provided. Defaults to None.
@@ -203,9 +203,9 @@ class SessionsAPI:
203
203
  ValueError: If format is invalid, file/file_field provided for non-acontext format,
204
204
  or file is provided without file_field for acontext format.
205
205
  """
206
- if format not in {"acontext", "openai", "anthropic"}:
206
+ if format not in {"acontext", "openai", "anthropic", "gemini"}:
207
207
  raise ValueError(
208
- "format must be one of {'acontext', 'openai', 'anthropic'}"
208
+ "format must be one of {'acontext', 'openai', 'anthropic', 'gemini'}"
209
209
  )
210
210
 
211
211
  # File upload is only supported for acontext format
@@ -268,7 +268,7 @@ class SessionsAPI:
268
268
  limit: int | None = None,
269
269
  cursor: str | None = None,
270
270
  with_asset_public_url: bool | None = None,
271
- format: Literal["acontext", "openai", "anthropic"] = "openai",
271
+ format: Literal["acontext", "openai", "anthropic", "gemini"] = "openai",
272
272
  time_desc: bool | None = None,
273
273
  edit_strategies: Optional[List[EditStrategy]] = None,
274
274
  ) -> GetMessagesOutput:
@@ -279,7 +279,7 @@ class SessionsAPI:
279
279
  limit: Maximum number of messages to return. Defaults to None.
280
280
  cursor: Cursor for pagination. Defaults to None.
281
281
  with_asset_public_url: Whether to include presigned URLs for assets. Defaults to None.
282
- format: The format of the messages. Defaults to "openai".
282
+ format: The format of the messages. Defaults to "openai". Supports "acontext", "openai", "anthropic", or "gemini".
283
283
  time_desc: Order by created_at descending if True, ascending if False. Defaults to None.
284
284
  edit_strategies: Optional list of edit strategies to apply before format conversion.
285
285
  Each strategy is a dict with 'type' and 'params' keys.
File without changes