wizelit-sdk 0.1.23__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/__init__.py CHANGED
@@ -1,11 +1,11 @@
1
1
  """Wizelit SDK package."""
2
2
 
3
- from wizelit_sdk.agent_wrapper import WizelitAgentWrapper
3
+ from wizelit_sdk.agent_wrapper import WizelitAgent
4
4
  from wizelit_sdk.database import DatabaseManager
5
5
  from wizelit_sdk.agent_wrapper.job import Job
6
6
  from wizelit_sdk.agent_wrapper.streaming import LogStreamer
7
7
  from wizelit_sdk.models.base import BaseModel
8
8
  from wizelit_sdk.models.job import JobModel, JobLogModel, JobStatus
9
9
 
10
- __all__ = ["WizelitAgentWrapper", "DatabaseManager", "Job", "LogStreamer", "BaseModel", "JobModel", "JobLogModel", "JobStatus"]
10
+ __all__ = ["WizelitAgent", "DatabaseManager", "Job", "LogStreamer", "BaseModel", "JobModel", "JobLogModel", "JobStatus"]
11
11
 
@@ -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
- from .agent_wrapper import WizelitAgentWrapper
4
+ from .agent_wrapper import WizelitAgent
6
5
  from .job import Job
7
6
  from .streaming import LogStreamer
8
7
 
9
- __all__ = ["greet", "greet_many", "greet_many3", "WizelitAgentWrapper", "Job", "LogStreamer"]
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
@@ -34,7 +34,7 @@ class CurrentJob:
34
34
  return _current_job.get()
35
35
 
36
36
 
37
- class WizelitAgentWrapper:
37
+ class WizelitAgent:
38
38
  """
39
39
  Main wrapper class that converts Python functions into MCP server tools.
40
40
  Built on top of fast-mcp with enhanced streaming and agent framework support.
@@ -87,7 +87,7 @@ class WizelitAgentWrapper:
87
87
  print(f"Warning: Failed to initialize log streamer: {e}")
88
88
 
89
89
  print(
90
- f"WizelitAgentWrapper initialized with name: {name}, transport: {transport}, host: {host}, port: {port}"
90
+ f"WizelitAgent initialized with name: {name}, transport: {transport}, host: {host}, port: {port}"
91
91
  )
92
92
 
93
93
  def ingest(
@@ -362,9 +362,10 @@ class WizelitAgentWrapper:
362
362
  return result
363
363
 
364
364
  except Exception as e:
365
- # Mark job as failed (only if job exists)
366
- if job is not None:
367
- job.status = "failed"
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 WizelitAgentWrapper:
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 WizelitAgentWrapper:
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 WizelitAgentWrapper:
579
580
  return True
580
581
 
581
582
  def set_job_result(
582
- self, job_id: str, result: Optional[str | dict[str, Any]]
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.
@@ -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|dict):
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizelit-sdk
3
- Version: 0.1.23
3
+ Version: 0.1.25
4
4
  Summary: Wizelit Agent Wrapper - Internal utility package
5
5
  Author-email: Your Name <your.email@company.com>
6
6
  Requires-Python: >=3.10
@@ -0,0 +1,13 @@
1
+ wizelit_sdk/__init__.py,sha256=76Dt-WxNbEJwOCPqu2P9AooVSQoGmc8-CH1fxIWJ5Lo,471
2
+ wizelit_sdk/database.py,sha256=39Vu5A8CV7u7ItIwRgrkAugD9UqNbG5vQrCsMOgTamc,4631
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
+ wizelit_sdk/agent_wrapper/streaming.py,sha256=f0VV3IzGAlfQY_cw2OHgxWjvM16Hs42_b700EUX2QpY,6633
7
+ wizelit_sdk/agent_wrapper/utils.py,sha256=OUihj3Kk6uI0y7bDr_L_YQs33vSK0GAJRl0c4km4DNs,951
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.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,,
@@ -1,13 +0,0 @@
1
- wizelit_sdk/__init__.py,sha256=6UyHRL8Wu0CAWHIErlmDZFxqI_BZwsco_DWnoMr_H6A,485
2
- wizelit_sdk/database.py,sha256=39Vu5A8CV7u7ItIwRgrkAugD9UqNbG5vQrCsMOgTamc,4631
3
- wizelit_sdk/agent_wrapper/__init__.py,sha256=q4xsoiAyI_KM9TSL9rFfxPzGrONJt3GF6MlEx6vDkis,321
4
- wizelit_sdk/agent_wrapper/agent_wrapper.py,sha256=r1N47KT4Sh6Gudt6ZEFNXvDDD8g4kOkuwTm19K9Np9c,22644
5
- wizelit_sdk/agent_wrapper/job.py,sha256=Vvmm6eTX1cbXpFuwPMLaom6hEgdk3ovitnaj9d9p02o,13804
6
- wizelit_sdk/agent_wrapper/streaming.py,sha256=f0VV3IzGAlfQY_cw2OHgxWjvM16Hs42_b700EUX2QpY,6633
7
- wizelit_sdk/agent_wrapper/utils.py,sha256=OUihj3Kk6uI0y7bDr_L_YQs33vSK0GAJRl0c4km4DNs,951
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.23.dist-info/METADATA,sha256=ta0J_LwnCa4NGBO2q-v0c23_G-b-SfK6Okhhzr-3zjM,2778
12
- wizelit_sdk-0.1.23.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
13
- wizelit_sdk-0.1.23.dist-info/RECORD,,