wizelit-sdk 0.1.24__py3-none-any.whl → 0.1.25__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/__init__.py +1 -2
- wizelit_sdk/agent_wrapper/agent_wrapper.py +8 -7
- wizelit_sdk/agent_wrapper/job.py +3 -3
- {wizelit_sdk-0.1.24.dist-info → wizelit_sdk-0.1.25.dist-info}/METADATA +1 -1
- {wizelit_sdk-0.1.24.dist-info → wizelit_sdk-0.1.25.dist-info}/RECORD +6 -6
- {wizelit_sdk-0.1.24.dist-info → wizelit_sdk-0.1.25.dist-info}/WHEEL +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"""Agent Wrapper - Internal utility package."""
|
|
2
2
|
|
|
3
3
|
# Import main functions
|
|
4
|
-
from .utils import greet, greet_many, greet_many3
|
|
5
4
|
from .agent_wrapper import WizelitAgent
|
|
6
5
|
from .job import Job
|
|
7
6
|
from .streaming import LogStreamer
|
|
8
7
|
|
|
9
|
-
__all__ = ["
|
|
8
|
+
__all__ = ["WizelitAgent", "Job", "LogStreamer"]
|
|
@@ -3,7 +3,7 @@ import asyncio
|
|
|
3
3
|
import inspect
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
|
-
from typing import Callable, Any, Optional, Literal, Dict, TYPE_CHECKING
|
|
6
|
+
from typing import Callable, Any, Optional, Literal, Dict, TYPE_CHECKING, Union
|
|
7
7
|
from contextvars import ContextVar
|
|
8
8
|
from fastmcp import FastMCP, Context
|
|
9
9
|
from fastmcp.dependencies import CurrentContext
|
|
@@ -362,9 +362,10 @@ class WizelitAgent:
|
|
|
362
362
|
return result
|
|
363
363
|
|
|
364
364
|
except Exception as e:
|
|
365
|
-
# Mark job as failed
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
# Mark job as failed when a job instance exists
|
|
366
|
+
active_job = job or _current_job.get()
|
|
367
|
+
if active_job is not None:
|
|
368
|
+
active_job.status = "failed"
|
|
368
369
|
|
|
369
370
|
# Stream error information
|
|
370
371
|
await ctx.report_progress(
|
|
@@ -483,7 +484,7 @@ class WizelitAgent:
|
|
|
483
484
|
return None
|
|
484
485
|
|
|
485
486
|
try:
|
|
486
|
-
from models.job import JobModel
|
|
487
|
+
from wizelit_sdk.models.job import JobModel
|
|
487
488
|
from sqlalchemy import select
|
|
488
489
|
|
|
489
490
|
async with self._db_manager.get_session() as session:
|
|
@@ -532,7 +533,7 @@ class WizelitAgent:
|
|
|
532
533
|
return None
|
|
533
534
|
|
|
534
535
|
try:
|
|
535
|
-
from models.job import JobLogModel
|
|
536
|
+
from wizelit_sdk.models.job import JobLogModel
|
|
536
537
|
from sqlalchemy import select
|
|
537
538
|
|
|
538
539
|
async with self._db_manager.get_session() as session:
|
|
@@ -579,7 +580,7 @@ class WizelitAgent:
|
|
|
579
580
|
return True
|
|
580
581
|
|
|
581
582
|
def set_job_result(
|
|
582
|
-
self, job_id: str, result: Optional[str
|
|
583
|
+
self, job_id: str, result: Optional[Union[str, dict[str, Any]]]
|
|
583
584
|
) -> bool:
|
|
584
585
|
"""
|
|
585
586
|
Set the result of a job by job_id.
|
wizelit_sdk/agent_wrapper/job.py
CHANGED
|
@@ -60,7 +60,7 @@ class DatabaseLogHandler(logging.Handler):
|
|
|
60
60
|
"""
|
|
61
61
|
try:
|
|
62
62
|
# Import here to avoid circular dependency
|
|
63
|
-
from models.job import JobLogModel
|
|
63
|
+
from wizelit_sdk.models.job import JobLogModel
|
|
64
64
|
from datetime import datetime
|
|
65
65
|
|
|
66
66
|
async def write_log():
|
|
@@ -274,7 +274,7 @@ class Job:
|
|
|
274
274
|
try:
|
|
275
275
|
result = await coro
|
|
276
276
|
# Store string results for convenience
|
|
277
|
-
if isinstance(result, str
|
|
277
|
+
if isinstance(result, (str, dict)):
|
|
278
278
|
self.result = result
|
|
279
279
|
if self._status == "running":
|
|
280
280
|
self.status = "completed"
|
|
@@ -351,7 +351,7 @@ class Job:
|
|
|
351
351
|
return
|
|
352
352
|
|
|
353
353
|
try:
|
|
354
|
-
from models.job import JobModel
|
|
354
|
+
from wizelit_sdk.models.job import JobModel
|
|
355
355
|
|
|
356
356
|
async with self._db_manager.get_session() as session:
|
|
357
357
|
# Check if job already exists
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
wizelit_sdk/__init__.py,sha256=76Dt-WxNbEJwOCPqu2P9AooVSQoGmc8-CH1fxIWJ5Lo,471
|
|
2
2
|
wizelit_sdk/database.py,sha256=39Vu5A8CV7u7ItIwRgrkAugD9UqNbG5vQrCsMOgTamc,4631
|
|
3
|
-
wizelit_sdk/agent_wrapper/__init__.py,sha256=
|
|
4
|
-
wizelit_sdk/agent_wrapper/agent_wrapper.py,sha256=
|
|
5
|
-
wizelit_sdk/agent_wrapper/job.py,sha256=
|
|
3
|
+
wizelit_sdk/agent_wrapper/__init__.py,sha256=OAF36jAmI0A3ByppsYMzJDHeDG9X0Ac4LbFzNp0b7jw,219
|
|
4
|
+
wizelit_sdk/agent_wrapper/agent_wrapper.py,sha256=e9KCQSpC7hox3q6sqzhOLDIq37btw7IT4ejeuljc6Gk,22742
|
|
5
|
+
wizelit_sdk/agent_wrapper/job.py,sha256=oG7Ev-EW0GiLGM7fHhQrJJCdr_pJJsaDj9Tjg31_eW0,13831
|
|
6
6
|
wizelit_sdk/agent_wrapper/streaming.py,sha256=f0VV3IzGAlfQY_cw2OHgxWjvM16Hs42_b700EUX2QpY,6633
|
|
7
7
|
wizelit_sdk/agent_wrapper/utils.py,sha256=OUihj3Kk6uI0y7bDr_L_YQs33vSK0GAJRl0c4km4DNs,951
|
|
8
8
|
wizelit_sdk/models/__init__.py,sha256=UB7nfHoE6hGcjfzy7w8AmuKVmYrTg9wIgGjG8GWziJ0,143
|
|
9
9
|
wizelit_sdk/models/base.py,sha256=aEPGMZVczKnlWz4Ps99e_xI5TcuSV3DxCigRMU5BnhE,704
|
|
10
10
|
wizelit_sdk/models/job.py,sha256=P68Vb1k77Z_Tha4dE0GzrLPa0LJrnMCxyYMENZyD7Kc,2480
|
|
11
|
-
wizelit_sdk-0.1.
|
|
12
|
-
wizelit_sdk-0.1.
|
|
13
|
-
wizelit_sdk-0.1.
|
|
11
|
+
wizelit_sdk-0.1.25.dist-info/METADATA,sha256=-7bPTthsvDaNfjR_nPDoOLsIAclM_N2TA0-ND5ln1-k,2778
|
|
12
|
+
wizelit_sdk-0.1.25.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
wizelit_sdk-0.1.25.dist-info/RECORD,,
|
|
File without changes
|