koi-net 1.0.0b15__py3-none-any.whl → 1.0.0b17__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.
Potentially problematic release.
This version of koi-net might be problematic. Click here for more details.
- koi_net/config.py +9 -3
- koi_net/identity.py +3 -3
- koi_net/network/interface.py +2 -2
- koi_net/processor/interface.py +4 -6
- {koi_net-1.0.0b15.dist-info → koi_net-1.0.0b17.dist-info}/METADATA +1 -1
- {koi_net-1.0.0b15.dist-info → koi_net-1.0.0b17.dist-info}/RECORD +8 -8
- {koi_net-1.0.0b15.dist-info → koi_net-1.0.0b17.dist-info}/WHEEL +0 -0
- {koi_net-1.0.0b15.dist-info → koi_net-1.0.0b17.dist-info}/licenses/LICENSE +0 -0
koi_net/config.py
CHANGED
|
@@ -40,7 +40,7 @@ class EnvConfig(BaseModel):
|
|
|
40
40
|
return env_val
|
|
41
41
|
return value
|
|
42
42
|
|
|
43
|
-
class
|
|
43
|
+
class NodeConfig(BaseModel):
|
|
44
44
|
server: ServerConfig | None = Field(default_factory=ServerConfig)
|
|
45
45
|
koi_net: KoiNetConfig
|
|
46
46
|
_file_path: str = PrivateAttr(default="config.yaml")
|
|
@@ -49,7 +49,7 @@ class Config(BaseModel):
|
|
|
49
49
|
@classmethod
|
|
50
50
|
def load_from_yaml(
|
|
51
51
|
cls,
|
|
52
|
-
file_path: str
|
|
52
|
+
file_path: str = "config.yaml",
|
|
53
53
|
generate_missing: bool = True
|
|
54
54
|
):
|
|
55
55
|
yaml = YAML()
|
|
@@ -62,8 +62,14 @@ class Config(BaseModel):
|
|
|
62
62
|
config._file_content = file_content
|
|
63
63
|
|
|
64
64
|
except FileNotFoundError:
|
|
65
|
+
# empty_fields = {}
|
|
66
|
+
# for name, field in cls.model_fields.items():
|
|
67
|
+
|
|
68
|
+
# if field.default is None or field.default_factory is None:
|
|
69
|
+
# print(empty_fields)
|
|
65
70
|
config = cls()
|
|
66
71
|
|
|
72
|
+
|
|
67
73
|
config._file_path = file_path
|
|
68
74
|
|
|
69
75
|
if generate_missing:
|
|
@@ -92,4 +98,4 @@ class Config(BaseModel):
|
|
|
92
98
|
f.write(self._file_content)
|
|
93
99
|
raise e
|
|
94
100
|
|
|
95
|
-
ConfigType = TypeVar("ConfigType", bound=
|
|
101
|
+
ConfigType = TypeVar("ConfigType", bound=NodeConfig)
|
koi_net/identity.py
CHANGED
|
@@ -3,7 +3,7 @@ from rid_lib.ext.bundle import Bundle
|
|
|
3
3
|
from rid_lib.ext.cache import Cache
|
|
4
4
|
from rid_lib.types.koi_net_node import KoiNetNode
|
|
5
5
|
|
|
6
|
-
from .config import
|
|
6
|
+
from .config import NodeConfig
|
|
7
7
|
from .protocol.node import NodeProfile
|
|
8
8
|
|
|
9
9
|
logger = logging.getLogger(__name__)
|
|
@@ -12,12 +12,12 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
class NodeIdentity:
|
|
13
13
|
"""Represents a node's identity (RID, profile, bundle)."""
|
|
14
14
|
|
|
15
|
-
config:
|
|
15
|
+
config: NodeConfig
|
|
16
16
|
cache: Cache
|
|
17
17
|
|
|
18
18
|
def __init__(
|
|
19
19
|
self,
|
|
20
|
-
config:
|
|
20
|
+
config: NodeConfig,
|
|
21
21
|
cache: Cache
|
|
22
22
|
):
|
|
23
23
|
"""Initializes node identity from a name and profile.
|
koi_net/network/interface.py
CHANGED
|
@@ -15,7 +15,7 @@ from ..protocol.node import NodeType
|
|
|
15
15
|
from ..protocol.edge import EdgeType
|
|
16
16
|
from ..protocol.event import Event
|
|
17
17
|
from ..identity import NodeIdentity
|
|
18
|
-
from ..config import
|
|
18
|
+
from ..config import ConfigType
|
|
19
19
|
|
|
20
20
|
logger = logging.getLogger(__name__)
|
|
21
21
|
|
|
@@ -173,7 +173,7 @@ class NetworkInterface(Generic[ConfigType]):
|
|
|
173
173
|
self.request_handler.broadcast_events(node, events=events)
|
|
174
174
|
return True
|
|
175
175
|
except httpx.ConnectError:
|
|
176
|
-
logger.warning("Broadcast failed
|
|
176
|
+
logger.warning("Broadcast failed")
|
|
177
177
|
for event in events:
|
|
178
178
|
self.push_event_to(event, node)
|
|
179
179
|
return False
|
koi_net/processor/interface.py
CHANGED
|
@@ -9,7 +9,7 @@ from rid_lib.types.koi_net_node import KoiNetNode
|
|
|
9
9
|
from ..identity import NodeIdentity
|
|
10
10
|
from ..network import NetworkInterface
|
|
11
11
|
from ..protocol.event import Event, EventType
|
|
12
|
-
from ..config import
|
|
12
|
+
from ..config import NodeConfig
|
|
13
13
|
from .handler import (
|
|
14
14
|
KnowledgeHandler,
|
|
15
15
|
HandlerType,
|
|
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
|
|
|
28
28
|
class ProcessorInterface():
|
|
29
29
|
"""Provides access to this node's knowledge processing pipeline."""
|
|
30
30
|
|
|
31
|
-
config:
|
|
31
|
+
config: NodeConfig
|
|
32
32
|
cache: Cache
|
|
33
33
|
network: NetworkInterface
|
|
34
34
|
identity: NodeIdentity
|
|
@@ -39,7 +39,7 @@ class ProcessorInterface():
|
|
|
39
39
|
|
|
40
40
|
def __init__(
|
|
41
41
|
self,
|
|
42
|
-
config:
|
|
42
|
+
config: NodeConfig,
|
|
43
43
|
cache: Cache,
|
|
44
44
|
network: NetworkInterface,
|
|
45
45
|
identity: NodeIdentity,
|
|
@@ -229,9 +229,7 @@ class ProcessorInterface():
|
|
|
229
229
|
|
|
230
230
|
for node in kobj.network_targets:
|
|
231
231
|
self.network.push_event_to(kobj.normalized_event, node)
|
|
232
|
-
|
|
233
|
-
logger.warning("Dropping unresponsive node")
|
|
234
|
-
self.handle(rid=node, event_type=EventType.FORGET)
|
|
232
|
+
self.network.flush_webhook_queue(node)
|
|
235
233
|
|
|
236
234
|
kobj = self.call_handler_chain(HandlerType.Final, kobj)
|
|
237
235
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
koi_net/__init__.py,sha256=b0Ze0pZmJAuygpWUFHM6Kvqo3DkU_uzmkptv1EpAArw,31
|
|
2
|
-
koi_net/config.py,sha256=
|
|
2
|
+
koi_net/config.py,sha256=35RNSOcWxnJzasPAkYabFWcKyDR-2kM1NTrq_fYOkm0,3153
|
|
3
3
|
koi_net/core.py,sha256=IO8kqiNMYVeuNzilq7eHBA7IulsxRjrCbWnIAx6_abA,4406
|
|
4
|
-
koi_net/identity.py,sha256=
|
|
4
|
+
koi_net/identity.py,sha256=muc5vuQ8zUOebhwAB3-ql6W2pgQETiYXXQAFBv8bLyg,1288
|
|
5
5
|
koi_net/network/__init__.py,sha256=r_RN-q_mDYC-2RAkN-lJoMUX76TXyfEUc_MVKW87z0g,39
|
|
6
6
|
koi_net/network/graph.py,sha256=dsfPuHUTkCzlj0QeL0e7dgp7-FR5_AGP7eE8EpBPhC0,4710
|
|
7
|
-
koi_net/network/interface.py,sha256=
|
|
7
|
+
koi_net/network/interface.py,sha256=icpl0rzpC5yV86BQBAbjAjK7AWhgCFoyFLm_Fjf1mCI,10451
|
|
8
8
|
koi_net/network/request_handler.py,sha256=66gjX2x4UnBWZYwKLjp_3WkhL-ekhR3VAyfGviHTcUs,4790
|
|
9
9
|
koi_net/network/response_handler.py,sha256=CAwici2Etj9ESndERXdtYkMlc4gWHz_xc7jHgY2Qjcg,1830
|
|
10
10
|
koi_net/processor/__init__.py,sha256=x4fAY0hvQEDcpfdTB3POIzxBQjYAtn0qQazPo1Xm0m4,41
|
|
11
11
|
koi_net/processor/default_handlers.py,sha256=f8Yl21lLGMa_oW51bf8sBuunfP9_rmiSu32T-rZ4kUY,8542
|
|
12
12
|
koi_net/processor/handler.py,sha256=7X6M6PP8m6-xdtsP1y4QO83g_MN5VSszNNikprITK80,2523
|
|
13
|
-
koi_net/processor/interface.py,sha256=
|
|
13
|
+
koi_net/processor/interface.py,sha256=Kyw4SQos_1WdcPJJe-j2w4xDIfwtmpF4mfGlkRVRqUI,12876
|
|
14
14
|
koi_net/processor/knowledge_object.py,sha256=RCgzkILsWm1Jw_NkSu4jTRYA9Ugga6mJ4jqKWwketQs,4090
|
|
15
15
|
koi_net/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
koi_net/protocol/api_models.py,sha256=DYDKCRD2Uja633bBAyTsaxyb1oF9pX9yQ9NpNAbkczo,1070
|
|
@@ -19,7 +19,7 @@ koi_net/protocol/edge.py,sha256=CcmvIY4P1HEBdKNJ4wFRDmwYMRMss24Besmbi7ZRFxQ,427
|
|
|
19
19
|
koi_net/protocol/event.py,sha256=HxzLN-iCXPyr2YzrswMIkgZYeUdFbBpa5v98dAB06lQ,1328
|
|
20
20
|
koi_net/protocol/helpers.py,sha256=8ZkQrjb_G0QEaMIKe9wkFOBonl1bkmemx_pwKMwIiLg,695
|
|
21
21
|
koi_net/protocol/node.py,sha256=2HhCh3LdBLlY2Z_kXNmKHzpVLKbP_ODob3HjHayFQtM,375
|
|
22
|
-
koi_net-1.0.
|
|
23
|
-
koi_net-1.0.
|
|
24
|
-
koi_net-1.0.
|
|
25
|
-
koi_net-1.0.
|
|
22
|
+
koi_net-1.0.0b17.dist-info/METADATA,sha256=5kfC3M0D9boL2YDIsIRy1T3HRDZkEPJhl2KsPgNeihI,34203
|
|
23
|
+
koi_net-1.0.0b17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
24
|
+
koi_net-1.0.0b17.dist-info/licenses/LICENSE,sha256=03mgCL5qth2aD9C3F3qNVs4sFJSpK9kjtYCyOwdSp7s,1069
|
|
25
|
+
koi_net-1.0.0b17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|