axio-context-sqlite 0.11.3__tar.gz → 0.12.1__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.
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/.gitignore +1 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/PKG-INFO +1 -1
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/pyproject.toml +4 -1
- axio_context_sqlite-0.12.1/src/axio_context_sqlite/plugin.py +28 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/README.md +0 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/src/axio_context_sqlite/__init__.py +0 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/src/axio_context_sqlite/py.typed +0 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/src/axio_context_sqlite/store.py +0 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/tests/test_autocompact_sqlite.py +0 -0
- {axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/tests/test_store.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "axio-context-sqlite"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.12.1"
|
|
4
4
|
description = "SQLite-backed context store for Axio"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -14,6 +14,9 @@ classifiers = [
|
|
|
14
14
|
keywords = ["llm", "agent", "ai", "sqlite", "context", "storage"]
|
|
15
15
|
dependencies = ["axio", "aiosqlite>=0.20"]
|
|
16
16
|
|
|
17
|
+
[project.entry-points."axio.context"]
|
|
18
|
+
sqlite = "axio_context_sqlite.plugin:SQLiteContextBackend"
|
|
19
|
+
|
|
17
20
|
[project.urls]
|
|
18
21
|
Documentation = "https://docs.axio-agent.com"
|
|
19
22
|
Homepage = "https://github.com/mosquito/axio-agent"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Application context backend with one shared SQLite connection."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from uuid import uuid4
|
|
7
|
+
|
|
8
|
+
import aiosqlite
|
|
9
|
+
|
|
10
|
+
from .store import SQLiteContextStore, connect
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SQLiteContextBackend:
|
|
14
|
+
def __init__(self) -> None:
|
|
15
|
+
self.connection: aiosqlite.Connection | None = None
|
|
16
|
+
|
|
17
|
+
async def init(self, path: Path) -> None:
|
|
18
|
+
self.connection = await connect(path)
|
|
19
|
+
|
|
20
|
+
def create(self, session_id: str | None = None) -> SQLiteContextStore:
|
|
21
|
+
if self.connection is None:
|
|
22
|
+
raise RuntimeError("SQLite context backend is not initialized")
|
|
23
|
+
return SQLiteContextStore(self.connection, session_id or uuid4().hex)
|
|
24
|
+
|
|
25
|
+
async def close(self) -> None:
|
|
26
|
+
if self.connection is not None:
|
|
27
|
+
await self.connection.close()
|
|
28
|
+
self.connection = None
|
|
File without changes
|
{axio_context_sqlite-0.11.3 → axio_context_sqlite-0.12.1}/src/axio_context_sqlite/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|