Skip to content

Commit 77b1135

Browse files
author
Tom Softreck
committed
update
1 parent 7d7ccce commit 77b1135

File tree

22 files changed

+448
-1202
lines changed

22 files changed

+448
-1202
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dialogchain"
3-
version = "0.1.16"
3+
version = "0.1.17"
44
description = "DialogChain - A flexible and extensible dialog processing framework"
55
authors = ["Tom Sapletta <info@softreck.dev>"]
66
readme = "README.md"

src/dialogchain/__init__.py

Lines changed: 68 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,77 +17,94 @@
1717
dialogchain validate -c config.yaml
1818
"""
1919

20+
import logging
21+
from typing import Dict, Any, Optional, Type, List, Union
22+
2023
__version__ = "0.2.0"
2124
__author__ = "DialogChain Team"
2225

23-
# Core components
24-
from .core.engine import DialogChainEngine
26+
# Import core components
27+
from .engine import (
28+
DialogChainEngine,
29+
Route,
30+
RouteConfig,
31+
ProcessorManager,
32+
ProcessorConfig,
33+
ConnectorManager,
34+
default_connector_manager,
35+
parse_uri,
36+
merge_dicts,
37+
get_nested_value,
38+
set_nested_value,
39+
deep_update,
40+
format_template
41+
)
2542

26-
# Processors
43+
# Import processors
2744
from .processors import (
28-
Processor,
45+
Processor,
2946
TransformProcessor,
3047
FilterProcessor,
31-
EnrichProcessor,
32-
ValidateProcessor
48+
ExternalProcessor,
49+
AggregateProcessor,
50+
DebugProcessor,
51+
create_processor,
3352
)
3453

35-
# Sources
36-
from .sources import (
54+
# Import connectors
55+
from .connectors import (
3756
Source,
38-
TimerSource,
39-
FileSource,
40-
IMAPSource,
41-
RTSPSource,
42-
GRPCSource
43-
)
44-
45-
# Destinations
46-
from .destinations import (
4757
Destination,
48-
LogDestination,
49-
FileDestination,
58+
RTSPSource,
59+
FileSource,
5060
HTTPDestination,
61+
FileDestination,
62+
IMAPSource,
63+
TimerSource,
5164
EmailDestination,
52-
MQTTDestination,
53-
GRPCDestination
65+
LogDestination,
5466
)
5567

56-
# Utils and exceptions
57-
from . import utils
58-
from .exceptions import *
68+
# For backward compatibility
69+
ProcessorType = Type[Processor]
5970

6071
__all__ = [
61-
# Core components
62-
"DialogChainEngine",
72+
# Core
73+
'DialogChainEngine',
74+
'Route',
75+
'RouteConfig',
76+
'ProcessorManager',
77+
'ProcessorConfig',
78+
'ConnectorManager',
79+
'default_connector_manager',
80+
'parse_uri',
81+
'merge_dicts',
82+
'get_nested_value',
83+
'set_nested_value',
84+
'deep_update',
85+
'format_template',
6386

6487
# Processors
65-
"Processor",
66-
"TransformProcessor",
67-
"FilterProcessor",
68-
"EnrichProcessor",
69-
"ValidateProcessor",
70-
71-
# Sources
72-
"Source",
73-
"TimerSource",
74-
"FileSource",
75-
"IMAPSource",
76-
"RTSPSource",
77-
"GRPCSource",
78-
79-
# Destinations
80-
"Destination",
81-
"LogDestination",
82-
"FileDestination",
83-
"HTTPDestination",
84-
"EmailDestination",
85-
"MQTTDestination",
86-
"GRPCDestination",
87-
88-
# Utils
89-
"utils",
88+
'Processor',
89+
'TransformProcessor',
90+
'FilterProcessor',
91+
'ExternalProcessor',
92+
'AggregateProcessor',
93+
'DebugProcessor',
94+
'create_processor',
95+
'ProcessorType',
9096

97+
# Connectors
98+
'Source',
99+
'Destination',
100+
'RTSPSource',
101+
'FileSource',
102+
'HTTPDestination',
103+
'FileDestination',
104+
'IMAPSource',
105+
'TimerSource',
106+
'EmailDestination',
107+
'LogDestination',
91108
# Exceptions
92109
"DialogChainError",
93110
"ConfigurationError",

src/dialogchain/connectors/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""Connectors for DialogChain data sources and destinations."""
22

3+
class ConnectorError(Exception):
4+
"""Base exception for all connector-related errors."""
5+
pass
6+
37
from .base import Source, Destination
48
from .sources.rtsp import RTSPSource
59
from .sources.imap import IMAPSource
@@ -12,6 +16,7 @@
1216

1317
# Re-export for backward compatibility
1418
__all__ = [
19+
'ConnectorError',
1520
'Source',
1621
'Destination',
1722
'RTSPSource',

src/dialogchain/connectors/destinations/email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import Any, Dict, List, Optional, Union, BinaryIO
1212
from pathlib import Path
1313

14-
from ....exceptions import DestinationError
14+
from ...exceptions import DestinationError
1515
from ..base import Destination
1616

1717
logger = logging.getLogger(__name__)

src/dialogchain/connectors/destinations/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pathlib import Path
88
from typing import Any, Dict, Optional, Union, BinaryIO, TextIO
99

10-
from ....exceptions import DestinationError
10+
from ...exceptions import DestinationError
1111
from ..base import Destination
1212

1313
logger = logging.getLogger(__name__)

src/dialogchain/connectors/destinations/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Any, Dict, Optional, Union
88
from urllib.parse import urlparse, parse_qs
99

10-
from ....exceptions import DestinationError
10+
from ...exceptions import DestinationError
1111
from ..base import Destination
1212

1313
logger = logging.getLogger(__name__)

src/dialogchain/connectors/destinations/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import json
55
from typing import Any, Dict, Optional, Union
66

7-
from ....exceptions import DestinationError
7+
from ...exceptions import DestinationError
88
from ..base import Destination
99

1010
logger = logging.getLogger(__name__)

src/dialogchain/connectors/sources/timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import time
66
from datetime import datetime, timedelta
7-
from typing import Dict, Any, AsyncIterator, Union
7+
from typing import Dict, Any, AsyncIterator, Union, Optional
88

99
from ..base import Source
1010

src/dialogchain/core/__init__.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1-
"""Core functionality for DialogChain processing engine."""
1+
"""
2+
DEPRECATED: This module is deprecated and will be removed in a future version.
3+
Please update your imports to use the new module locations:
24
3-
from .engine import DialogChainEngine
4-
from .routes import Route, RouteConfig
5-
from .tasks import TaskManager
5+
- dialogchain.engine (for DialogChainEngine, Route, RouteConfig)
6+
- dialogchain.engine.processor (for TaskManager)
7+
"""
8+
9+
import warnings
10+
11+
# Import from new locations with deprecation warnings
12+
warnings.warn(
13+
"The 'dialogchain.core' module is deprecated. "
14+
"Please update your imports to use 'dialogchain.engine' instead.",
15+
DeprecationWarning,
16+
stacklevel=2
17+
)
18+
19+
# Re-export for backward compatibility
20+
try:
21+
from ..engine import DialogChainEngine, Route, RouteConfig
22+
from ..engine.processor import ProcessorManager as TaskManager
23+
except ImportError as e:
24+
raise ImportError(
25+
"Failed to import from new module locations. "
26+
"Please update your code to use 'dialogchain.engine' directly."
27+
) from e
628

729
__all__ = [
830
'DialogChainEngine',

0 commit comments

Comments
 (0)