wizelit-sdk 0.1.29__py3-none-any.whl → 0.1.30__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.
- wizelit_sdk/agent_wrapper/job.py +4 -4
- wizelit_sdk/agent_wrapper/streaming.py +2 -2
- wizelit_sdk/database.py +1 -1
- wizelit_sdk/models/base.py +3 -2
- wizelit_sdk/models/job.py +2 -2
- {wizelit_sdk-0.1.29.dist-info → wizelit_sdk-0.1.30.dist-info}/METADATA +1 -1
- wizelit_sdk-0.1.30.dist-info/RECORD +13 -0
- wizelit_sdk-0.1.29.dist-info/RECORD +0 -13
- {wizelit_sdk-0.1.29.dist-info → wizelit_sdk-0.1.30.dist-info}/WHEEL +0 -0
wizelit_sdk/agent_wrapper/job.py
CHANGED
|
@@ -6,7 +6,7 @@ import asyncio
|
|
|
6
6
|
import uuid
|
|
7
7
|
import time
|
|
8
8
|
from datetime import datetime, UTC
|
|
9
|
-
from typing import
|
|
9
|
+
from typing import Optional, Awaitable, Any, TYPE_CHECKING
|
|
10
10
|
from fastmcp import Context
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
@@ -19,7 +19,7 @@ class MemoryLogHandler(logging.Handler):
|
|
|
19
19
|
Custom logging handler that stores log messages in a list.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
def __init__(self, logs_list:
|
|
22
|
+
def __init__(self, logs_list: list[str]):
|
|
23
23
|
super().__init__()
|
|
24
24
|
self.logs_list = logs_list
|
|
25
25
|
self.setFormatter(logging.Formatter('%(message)s'))
|
|
@@ -156,7 +156,7 @@ class Job:
|
|
|
156
156
|
self._ctx = ctx
|
|
157
157
|
self._id = job_id or f"JOB-{str(uuid.uuid4())[:8]}"
|
|
158
158
|
self._status = "running"
|
|
159
|
-
self._logs:
|
|
159
|
+
self._logs: list[str] = []
|
|
160
160
|
self._result: Optional[str] = None
|
|
161
161
|
self._error: Optional[str] = None
|
|
162
162
|
self._db_manager = db_manager
|
|
@@ -176,7 +176,7 @@ class Job:
|
|
|
176
176
|
return self._logger
|
|
177
177
|
|
|
178
178
|
@property
|
|
179
|
-
def logs(self) ->
|
|
179
|
+
def logs(self) -> list[str]:
|
|
180
180
|
"""List of log messages (timestamped strings)."""
|
|
181
181
|
return self._logs
|
|
182
182
|
|
|
@@ -196,11 +196,11 @@ class LogStreamer:
|
|
|
196
196
|
self._redis = None
|
|
197
197
|
logger.info("Redis connection closed")
|
|
198
198
|
|
|
199
|
-
async def __aenter__(self):
|
|
199
|
+
async def __aenter__(self) -> 'LogStreamer':
|
|
200
200
|
"""Async context manager entry."""
|
|
201
201
|
await self._ensure_connected()
|
|
202
202
|
return self
|
|
203
203
|
|
|
204
|
-
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
204
|
+
async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
|
|
205
205
|
"""Async context manager exit."""
|
|
206
206
|
await self.close()
|
wizelit_sdk/database.py
CHANGED
|
@@ -132,7 +132,7 @@ class DatabaseManager:
|
|
|
132
132
|
finally:
|
|
133
133
|
await session.close()
|
|
134
134
|
|
|
135
|
-
async def close(self):
|
|
135
|
+
async def close(self) -> None:
|
|
136
136
|
"""Dispose of the engine and close all connections."""
|
|
137
137
|
await self.engine.dispose()
|
|
138
138
|
logger.info("Database connections closed")
|
wizelit_sdk/models/base.py
CHANGED
|
@@ -3,6 +3,7 @@ from sqlalchemy import Column
|
|
|
3
3
|
from sqlalchemy.dialects.postgresql import UUID
|
|
4
4
|
import uuid
|
|
5
5
|
from datetime import datetime
|
|
6
|
+
from typing import Dict, Any
|
|
6
7
|
|
|
7
8
|
Base = declarative_base()
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ class TimestampMixin:
|
|
|
10
11
|
"""Mixin for models that need timestamp functionality."""
|
|
11
12
|
|
|
12
13
|
@staticmethod
|
|
13
|
-
def get_timestamp():
|
|
14
|
+
def get_timestamp() -> str:
|
|
14
15
|
return datetime.utcnow().isoformat()
|
|
15
16
|
|
|
16
17
|
|
|
@@ -20,6 +21,6 @@ class BaseModel(Base):
|
|
|
20
21
|
|
|
21
22
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
|
22
23
|
|
|
23
|
-
def to_dict(self):
|
|
24
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
24
25
|
"""Convert model to dictionary."""
|
|
25
26
|
return {c.name: getattr(self, c.name) for c in self.__table__.columns}
|
wizelit_sdk/models/job.py
CHANGED
|
@@ -41,7 +41,7 @@ class JobModel(BaseModel):
|
|
|
41
41
|
Index('idx_job_created_at', 'created_at'),
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
def __repr__(self):
|
|
44
|
+
def __repr__(self) -> str:
|
|
45
45
|
return f"<JobModel(id={self.id}, status={self.status})>"
|
|
46
46
|
|
|
47
47
|
|
|
@@ -68,5 +68,5 @@ class JobLogModel(BaseModel):
|
|
|
68
68
|
Index('idx_job_log_job_id_timestamp', 'job_id', 'timestamp'),
|
|
69
69
|
)
|
|
70
70
|
|
|
71
|
-
def __repr__(self):
|
|
71
|
+
def __repr__(self) -> str:
|
|
72
72
|
return f"<JobLogModel(id={self.id}, job_id={self.job_id}, level={self.level})>"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
wizelit_sdk/__init__.py,sha256=76Dt-WxNbEJwOCPqu2P9AooVSQoGmc8-CH1fxIWJ5Lo,471
|
|
2
|
+
wizelit_sdk/database.py,sha256=HzvMY-KZQBkGs-Ey_wKAIPOJEb5BqGjEi98Tip7CQBo,4830
|
|
3
|
+
wizelit_sdk/agent_wrapper/__init__.py,sha256=srVcHZfvpf3q8m2nzIST6Ofl2V8Vv5GRtcNXudOLiD8,333
|
|
4
|
+
wizelit_sdk/agent_wrapper/agent_wrapper.py,sha256=qkskmRRjhIooXVeyZHbH5q1OIp30zw29bBRUoqTPYLE,23476
|
|
5
|
+
wizelit_sdk/agent_wrapper/job.py,sha256=jW2Cl7QvSgZDUqWqZSND-V1XphGdISJuh9ViHgCn7iU,13770
|
|
6
|
+
wizelit_sdk/agent_wrapper/signature_validation.py,sha256=Njplwofw36jXoWgBooaZCbwhkf72pR-UoRQ3Q6-biro,3729
|
|
7
|
+
wizelit_sdk/agent_wrapper/streaming.py,sha256=l7SbvPuQYMdGO38t1upyI5wTVdd5eB-2BSwU-BQSlvc,6673
|
|
8
|
+
wizelit_sdk/models/__init__.py,sha256=UB7nfHoE6hGcjfzy7w8AmuKVmYrTg9wIgGjG8GWziJ0,143
|
|
9
|
+
wizelit_sdk/models/base.py,sha256=11XyxLUG0VjdiNxe4zmzGDUjKEOsjSvUjA8yaQgfCa0,758
|
|
10
|
+
wizelit_sdk/models/job.py,sha256=HD8ohVqzakC8J7VAwmh8UCi_BLLiqx85TbR0FjO2rlg,2494
|
|
11
|
+
wizelit_sdk-0.1.30.dist-info/METADATA,sha256=zCb8i8TbnbAVCtHzcBxhgvQOlNIyNehCKQUWVCYpeqA,3297
|
|
12
|
+
wizelit_sdk-0.1.30.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
wizelit_sdk-0.1.30.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
wizelit_sdk/__init__.py,sha256=76Dt-WxNbEJwOCPqu2P9AooVSQoGmc8-CH1fxIWJ5Lo,471
|
|
2
|
-
wizelit_sdk/database.py,sha256=6F2Nyt-sr5U5GkAB9OeSCU-iv2byZBDsg7aXqCl-ntk,4822
|
|
3
|
-
wizelit_sdk/agent_wrapper/__init__.py,sha256=srVcHZfvpf3q8m2nzIST6Ofl2V8Vv5GRtcNXudOLiD8,333
|
|
4
|
-
wizelit_sdk/agent_wrapper/agent_wrapper.py,sha256=qkskmRRjhIooXVeyZHbH5q1OIp30zw29bBRUoqTPYLE,23476
|
|
5
|
-
wizelit_sdk/agent_wrapper/job.py,sha256=Gk2CyLBQFzIosYuGrqUj6_rZ9kDIO6YLYQ7Pxk6ASuM,13776
|
|
6
|
-
wizelit_sdk/agent_wrapper/signature_validation.py,sha256=Njplwofw36jXoWgBooaZCbwhkf72pR-UoRQ3Q6-biro,3729
|
|
7
|
-
wizelit_sdk/agent_wrapper/streaming.py,sha256=f0VV3IzGAlfQY_cw2OHgxWjvM16Hs42_b700EUX2QpY,6633
|
|
8
|
-
wizelit_sdk/models/__init__.py,sha256=UB7nfHoE6hGcjfzy7w8AmuKVmYrTg9wIgGjG8GWziJ0,143
|
|
9
|
-
wizelit_sdk/models/base.py,sha256=aEPGMZVczKnlWz4Ps99e_xI5TcuSV3DxCigRMU5BnhE,704
|
|
10
|
-
wizelit_sdk/models/job.py,sha256=P68Vb1k77Z_Tha4dE0GzrLPa0LJrnMCxyYMENZyD7Kc,2480
|
|
11
|
-
wizelit_sdk-0.1.29.dist-info/METADATA,sha256=iHeysF2Hd1I49-GtFeqEVIfmK0u_LHQIXtFc5OavD0g,3297
|
|
12
|
-
wizelit_sdk-0.1.29.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
-
wizelit_sdk-0.1.29.dist-info/RECORD,,
|
|
File without changes
|