naeural-client 2.0.1__tar.gz → 2.0.3__tar.gz

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.
Files changed (119) hide show
  1. naeural_client-2.0.3/.devcontainer/Dockerfile +27 -0
  2. naeural_client-2.0.3/.devcontainer/devcontainer.json +22 -0
  3. {naeural_client-2.0.1 → naeural_client-2.0.3}/.gitignore +1 -3
  4. naeural_client-2.0.3/.vscode/launch.json +18 -0
  5. {naeural_client-2.0.1 → naeural_client-2.0.3}/LICENSE +0 -1
  6. {naeural_client-2.0.1 → naeural_client-2.0.3}/PKG-INFO +9 -9
  7. {naeural_client-2.0.1 → naeural_client-2.0.3}/README.md +5 -5
  8. {naeural_client-2.0.1 → naeural_client-2.0.3}/TODOs.md +1 -1
  9. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/_ver.py +1 -1
  10. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/generic_session.py +56 -35
  11. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/instance.py +2 -2
  12. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/payload/payload.py +14 -1
  13. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/pipeline.py +14 -14
  14. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/plugin_template.py +31 -0
  15. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base_decentra_object.py +1 -1
  16. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/code_cheker/base.py +29 -2
  17. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/environment.py +4 -0
  18. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/instance/custom_web_app_01_plugin.py +50 -17
  19. {naeural_client-2.0.1 → naeural_client-2.0.3}/pyproject.toml +4 -4
  20. {naeural_client-2.0.1 → naeural_client-2.0.3}/tutorials/9. code_sandbox_from_scratch_assets/index.html +1 -1
  21. naeural_client-2.0.3/tutorials/ex1_connect_to_network.py +126 -0
  22. naeural_client-2.0.1/tutorials/2. first_deploy.py → naeural_client-2.0.3/tutorials/ex2_first_deploy.py +7 -2
  23. naeural_client-2.0.1/tutorials/3. custom_code_on_one_remote__example_1.py → naeural_client-2.0.3/tutorials/ex3_custom_code_on_one_remote__example_1.py +9 -1
  24. naeural_client-2.0.1/tutorials/4. custom_code_on_one_remote__example_2.py → naeural_client-2.0.3/tutorials/ex4_custom_code_on_one_remote__example_2.py +8 -1
  25. naeural_client-2.0.1/tutorials/5. custom_code_on_one_remote__example_3.py → naeural_client-2.0.3/tutorials/ex5_custom_code_on_one_remote__example_3.py +8 -1
  26. naeural_client-2.0.1/tutorials/6. custom_code_on_multiple_remotes__example_1.py → naeural_client-2.0.3/tutorials/ex6_custom_code_on_multiple_remotes__example_1.py +4 -0
  27. naeural_client-2.0.1/tutorials/7. custom_code_on_multiple_remotes__example_2.py → naeural_client-2.0.3/tutorials/ex7_custom_code_on_multiple_remotes__example_2.py +5 -0
  28. naeural_client-2.0.3/tutorials/ex8_custom_web_app.py +111 -0
  29. naeural_client-2.0.1/tutorials/9. code_sandbox_from_scratch.py → naeural_client-2.0.3/tutorials/ex9_code_sandbox_from_scratch.py +8 -1
  30. naeural_client-2.0.1/tutorials/1. connect_to_network.py +0 -25
  31. naeural_client-2.0.1/tutorials/8. custom_web_app.py +0 -67
  32. {naeural_client-2.0.1 → naeural_client-2.0.3}/.gitattributes +0 -0
  33. {naeural_client-2.0.1 → naeural_client-2.0.3}/.github/workflows/python-publish.yml +0 -0
  34. {naeural_client-2.0.1 → naeural_client-2.0.3}/__init__.py +0 -0
  35. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/__init__.py +0 -0
  36. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/__init__.py +0 -0
  37. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/distributed_custom_code_presets.py +0 -0
  38. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/payload/__init__.py +0 -0
  39. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/responses.py +0 -0
  40. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/base/transaction.py +0 -0
  41. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/bc/__init__.py +0 -0
  42. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/bc/base.py +0 -0
  43. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/bc/chain.py +0 -0
  44. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/bc/ec.py +0 -0
  45. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/certs/__init__.py +0 -0
  46. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
  47. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/code_cheker/__init__.py +0 -0
  48. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/code_cheker/checker.py +0 -0
  49. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/comm/__init__.py +0 -0
  50. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/comm/amqp_wrapper.py +0 -0
  51. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/comm/mqtt_wrapper.py +0 -0
  52. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/README.md +0 -0
  53. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/__init__.py +0 -0
  54. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/base.py +0 -0
  55. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/comms.py +0 -0
  56. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/formatter.py +0 -0
  57. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/heartbeat.py +0 -0
  58. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/misc.py +0 -0
  59. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/const/payload.py +0 -0
  60. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/__init__.py +0 -0
  61. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/instance/__init__.py +0 -0
  62. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
  63. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/instance/net_mon_01_plugin.py +0 -0
  64. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/instance/view_scene_01_plugin.py +0 -0
  65. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/default/session/mqtt_session.py +0 -0
  66. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/__init__.py +0 -0
  67. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/base/__init__.py +0 -0
  68. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/base/base_formatter.py +0 -0
  69. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/default/__init__.py +0 -0
  70. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/default/a_dummy.py +0 -0
  71. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/default/aixp1.py +0 -0
  72. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/default/default.py +0 -0
  73. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/io_formatter/io_formatter_manager.py +0 -0
  74. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/__init__.py +0 -0
  75. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/base_logger.py +0 -0
  76. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/__init__.py +0 -0
  77. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/class_instance_mixin.py +0 -0
  78. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/computer_vision_mixin.py +0 -0
  79. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/datetime_mixin.py +0 -0
  80. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/download_mixin.py +0 -0
  81. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/general_serialization_mixin.py +0 -0
  82. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/json_serialization_mixin.py +0 -0
  83. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
  84. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/process_mixin.py +0 -0
  85. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/resource_size_mixin.py +0 -0
  86. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/timers_mixin.py +0 -0
  87. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/upload_mixin.py +0 -0
  88. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/logger_mixins/utils_mixin.py +0 -0
  89. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/small_logger.py +0 -0
  90. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/tzlocal/__init__.py +0 -0
  91. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/tzlocal/unix.py +0 -0
  92. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/tzlocal/utils.py +0 -0
  93. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/tzlocal/win32.py +0 -0
  94. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/logging/tzlocal/windows_tz.py +0 -0
  95. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/plugins_manager_mixin.py +0 -0
  96. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/utils/__init__.py +0 -0
  97. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/utils/comm_utils.py +0 -0
  98. {naeural_client-2.0.1 → naeural_client-2.0.3}/naeural_client/utils/dotenv.py +0 -0
  99. {naeural_client-2.0.1 → naeural_client-2.0.3}/requirements.txt +0 -0
  100. {naeural_client-2.0.1 → naeural_client-2.0.3}/tutorials/.example_env +0 -0
  101. {naeural_client-2.0.1 → naeural_client-2.0.3}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
  102. {naeural_client-2.0.1 → naeural_client-2.0.3}/tutorials/_example_pk_sdk.pem +0 -0
  103. {naeural_client-2.0.1 → naeural_client-2.0.3}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
  104. {naeural_client-2.0.1 → naeural_client-2.0.3}/winrun.bat +0 -0
  105. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/.example_env +0 -0
  106. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/README.md +0 -0
  107. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/_archive/test.py +0 -0
  108. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/_tutorials/3. simple_real_time_custom_code.py +0 -0
  109. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/_tutorials/4. real_time_custom_code_2.py +0 -0
  110. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/_tutorials/8. chatbot.py +0 -0
  111. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/attach_example.py +0 -0
  112. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/decentralized/chain_dist_example.py +0 -0
  113. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
  114. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
  115. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/ex1.py +0 -0
  116. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/hello.py +0 -0
  117. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/remote_exec.py +0 -0
  118. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/save_images.py +0 -0
  119. {naeural_client-2.0.1 → naeural_client-2.0.3}/xperimental/utils/get_documentation.py +0 -0
@@ -0,0 +1,27 @@
1
+ # Simple ultr-lightweight image for python development
2
+ # Use the latest Python 3 slim image for a lightweight base
3
+ FROM python:3.11-slim
4
+
5
+ # Set the working directory
6
+ WORKDIR /workspace
7
+
8
+ # Install system dependencies required for some Python packages
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ libffi-dev \
12
+ libssl-dev \
13
+ git \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Install the SDK requirements
17
+ RUN pip install --no-cache-dir \
18
+ pika \
19
+ paho-mqtt \
20
+ numpy \
21
+ "pyopenssl>=23.0.0" \
22
+ "cryptography>=39.0.0" \
23
+ python-dateutil \
24
+ pyaml
25
+
26
+ # Set the default command to bash (optional)
27
+ CMD ["bash"]
@@ -0,0 +1,22 @@
1
+ {
2
+ "name" : "Naeural Edge Protocol SDK Development Container",
3
+ "dockerFile" : "Dockerfile",
4
+ // "image": "aidamian/image:tag",
5
+
6
+
7
+ "runArgs": [
8
+ //"--gpus=all",
9
+ "--hostname",
10
+ "sdk_dev"
11
+ ],
12
+
13
+
14
+ "customizations": {
15
+ "vscode" : {
16
+ "extensions": [
17
+ "ms-python.python",
18
+ "ms-toolsai.jupyter"
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -143,8 +143,7 @@ inference/model_testing/_solisbox/_logs/MPTF.txt
143
143
  inference/model_testing/_solisbox/_logs/20211224_102325_MPTF_001_log.txt
144
144
 
145
145
 
146
- # vscode stuff
147
- .vscode
146
+
148
147
  plugins/libs/_cache/
149
148
  core/utils/_cache/
150
149
  plugins/business/scoring_plugins/_solisbox/
@@ -172,7 +171,6 @@ blur_debugger/blur_debugger_draw__BLUR_DEBUGGER_DRAW_STEP__Tracking/
172
171
 
173
172
  *.ths
174
173
 
175
- .vscode
176
174
  .pypirc
177
175
 
178
176
  personal
@@ -0,0 +1,18 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python: File",
9
+ "type": "python",
10
+ "request": "launch",
11
+ "program": "${file}",
12
+ "justMyCode": true,
13
+
14
+ "console": "integratedTerminal",
15
+ "pythonArgs": ["-i"]
16
+ }
17
+ ]
18
+ }
@@ -186,7 +186,6 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2024 Naeural.AI
190
189
 
191
190
  Licensed under the Apache License, Version 2.0 (the "License");
192
191
  you may not use this file except in compliance with the License.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: naeural_client
3
- Version: 2.0.1
4
- Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol framework
5
- Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
6
- Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
3
+ Version: 2.0.3
4
+ Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
5
+ Project-URL: Homepage, https://github.com/Naeural Edge ProtocolEdgeProtocol/naeural_client
6
+ Project-URL: Bug Tracker, https://github.com/Naeural Edge ProtocolEdgeProtocol/naeural_client/issues
7
7
  Author-email: Stefan Saraev <saraevstefan@gmail.com>, Andrei Ionut Damian <andrei.damian@me.com>, Cristan Bleotiu <cristibleotiu@gmail.com>
8
8
  License-File: LICENSE
9
9
  Classifier: License :: OSI Approved :: MIT License
@@ -21,7 +21,7 @@ Description-Content-Type: text/markdown
21
21
 
22
22
  # naeural_client SDK
23
23
 
24
- This is the Python SDK package that allows interactions, development and deployment of jobs in Naeural network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the Naeural Execution Engine processing nodes ecosystem. For further information please see [Naeural AI OS - Decentralized ubiquitous computing MLOps execution engine](https://arxiv.org/pdf/2306.08708).
24
+ This is the Python SDK package that allows interactions, development and deployment of jobs in Naeural Edge Protocol network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the Naeural Edge Protocol Execution Engine processing nodes ecosystem. For further information please see [Naeural Edge Protocol AI OS - Decentralized ubiquitous computing MLOps execution engine](https://arxiv.org/pdf/2306.08708).
25
25
 
26
26
  ## Dependencies
27
27
 
@@ -337,9 +337,9 @@ For any inquiries related to the funding and its impact on this project, please
337
337
  ```bibtex
338
338
  @misc{naeural_client,
339
339
  author = {Stefan Saraev, Andrei Damian},
340
- title = {naeural_client: Python SDK for Naeural Edge Protocol},
340
+ title = {naeural_client: Python SDK for Naeural Edge Protocol Edge Protocol},
341
341
  year = {2024},
342
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/naeural_client}},
342
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/naeural_client}},
343
343
  }
344
344
  ```
345
345
 
@@ -348,7 +348,7 @@ For any inquiries related to the funding and its impact on this project, please
348
348
  author = {Damian, Bleotiu, Saraev, Constantinescu},
349
349
  title = {SOLIS – Sistem Omogen multi-Locație cu funcționalități Inteligente și Sustenabile”
350
350
  SMIS 143488},
351
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/}},
351
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/}},
352
352
  note = {This project includes open-source components developed with support from the Romanian Competitiveness Operational Programme under grants SMIS 143488. The content is solely the responsibility of the authors and does not necessarily reflect the views of the funding agencies.},
353
353
  year = {2021-2022}
354
354
  }
@@ -358,7 +358,7 @@ SMIS 143488},
358
358
  @misc{project_funding_acknowledgment2,
359
359
  author = {Damian, Bleotiu, Saraev, Constantinescu, Milik, Lupaescu},
360
360
  title = {ReDeN – Rețea Descentralizată Neurală SMIS 156084},
361
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/}},
361
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/}},
362
362
  note = {This project includes open-source components developed with support from the Romanian Competitiveness Operational Programme under grants SMIS 143488. The content is solely the responsibility of the authors and does not necessarily reflect the views of the funding agencies.},
363
363
  year = {2023-2024}
364
364
  }
@@ -1,6 +1,6 @@
1
1
  # naeural_client SDK
2
2
 
3
- This is the Python SDK package that allows interactions, development and deployment of jobs in Naeural network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the Naeural Execution Engine processing nodes ecosystem. For further information please see [Naeural AI OS - Decentralized ubiquitous computing MLOps execution engine](https://arxiv.org/pdf/2306.08708).
3
+ This is the Python SDK package that allows interactions, development and deployment of jobs in Naeural Edge Protocol network. The SDK enables low-code development and deployment of end-to-end AI (and not only) cooperative application pipelines within the Naeural Edge Protocol Execution Engine processing nodes ecosystem. For further information please see [Naeural Edge Protocol AI OS - Decentralized ubiquitous computing MLOps execution engine](https://arxiv.org/pdf/2306.08708).
4
4
 
5
5
  ## Dependencies
6
6
 
@@ -316,9 +316,9 @@ For any inquiries related to the funding and its impact on this project, please
316
316
  ```bibtex
317
317
  @misc{naeural_client,
318
318
  author = {Stefan Saraev, Andrei Damian},
319
- title = {naeural_client: Python SDK for Naeural Edge Protocol},
319
+ title = {naeural_client: Python SDK for Naeural Edge Protocol Edge Protocol},
320
320
  year = {2024},
321
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/naeural_client}},
321
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/naeural_client}},
322
322
  }
323
323
  ```
324
324
 
@@ -327,7 +327,7 @@ For any inquiries related to the funding and its impact on this project, please
327
327
  author = {Damian, Bleotiu, Saraev, Constantinescu},
328
328
  title = {SOLIS – Sistem Omogen multi-Locație cu funcționalități Inteligente și Sustenabile”
329
329
  SMIS 143488},
330
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/}},
330
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/}},
331
331
  note = {This project includes open-source components developed with support from the Romanian Competitiveness Operational Programme under grants SMIS 143488. The content is solely the responsibility of the authors and does not necessarily reflect the views of the funding agencies.},
332
332
  year = {2021-2022}
333
333
  }
@@ -337,7 +337,7 @@ SMIS 143488},
337
337
  @misc{project_funding_acknowledgment2,
338
338
  author = {Damian, Bleotiu, Saraev, Constantinescu, Milik, Lupaescu},
339
339
  title = {ReDeN – Rețea Descentralizată Neurală SMIS 156084},
340
- howpublished = {\url{https://github.com/NaeuralEdgeProtocol/}},
340
+ howpublished = {\url{https://github.com/Naeural Edge ProtocolEdgeProtocol/}},
341
341
  note = {This project includes open-source components developed with support from the Romanian Competitiveness Operational Programme under grants SMIS 143488. The content is solely the responsibility of the authors and does not necessarily reflect the views of the funding agencies.},
342
342
  year = {2023-2024}
343
343
  }
@@ -9,4 +9,4 @@ Secondary:
9
9
 
10
10
  - session method to get list of all online nodes from supervisor
11
11
 
12
- - change DecentrAIObject to NaeuralObject
12
+ - change DecentrAIObject to Naeural Edge ProtocolObject
@@ -1,4 +1,4 @@
1
- __VER__ = "2.0.1"
1
+ __VER__ = "2.0.3"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -23,7 +23,7 @@ from .transaction import Transaction
23
23
 
24
24
  class GenericSession(BaseDecentrAIObject):
25
25
  """
26
- A Session is a connection to a communication server which provides the channel to interact with nodes from the Naeural network.
26
+ A Session is a connection to a communication server which provides the channel to interact with nodes from the Naeural Edge Protocol network.
27
27
  A Session manages `Pipelines` and handles all messages received from the communication server.
28
28
  The Session handles all callbacks that are user-defined and passed as arguments in the API calls.
29
29
  """
@@ -74,7 +74,7 @@ class GenericSession(BaseDecentrAIObject):
74
74
  root_topic="naeural",
75
75
  **kwargs) -> None:
76
76
  """
77
- A Session is a connection to a communication server which provides the channel to interact with nodes from the Naeural network.
77
+ A Session is a connection to a communication server which provides the channel to interact with nodes from the Naeural Edge Protocol network.
78
78
  A Session manages `Pipelines` and handles all messages received from the communication server.
79
79
  The Session handles all callbacks that are user-defined and passed as arguments in the API calls.
80
80
 
@@ -91,8 +91,8 @@ class GenericSession(BaseDecentrAIObject):
91
91
  secured: bool, optional
92
92
  True if connection is secured, by default None
93
93
  name : str, optional
94
- The name of this connection, used to identify owned pipelines on a specific Naeural edge node.
95
- The name will be used as `INITIATOR_ID` and `SESSION_ID` when communicating with Naeural edge nodes, by default 'pySDK'
94
+ The name of this connection, used to identify owned pipelines on a specific Naeural Edge Protocol edge node.
95
+ The name will be used as `INITIATOR_ID` and `SESSION_ID` when communicating with Naeural Edge Protocol edge nodes, by default 'pySDK'
96
96
  config : dict, optional
97
97
  Configures the names of the channels this session will connect to.
98
98
  If using a Mqtt server, these channels are in fact topics.
@@ -102,7 +102,7 @@ class GenericSession(BaseDecentrAIObject):
102
102
  If set, process the messages that come only from the nodes from this list.
103
103
  Defaults to None
104
104
  show_commands : bool
105
- If True, will print the commands that are being sent to the Naeural edge nodes.
105
+ If True, will print the commands that are being sent to the Naeural Edge Protocol edge nodes.
106
106
  Defaults to False
107
107
  log : Logger, optional
108
108
  A logger object which implements basic logging functionality and some other utils stuff. Can be ignored for now.
@@ -335,7 +335,7 @@ class GenericSession(BaseDecentrAIObject):
335
335
  Parameters
336
336
  ----------
337
337
  node_addr : str
338
- The address of the Naeural edge node that sent the message.
338
+ The address of the Naeural Edge Protocol edge node that sent the message.
339
339
 
340
340
  Returns
341
341
  -------
@@ -351,7 +351,7 @@ class GenericSession(BaseDecentrAIObject):
351
351
  Parameters
352
352
  ----------
353
353
  node_addr : str
354
- The address of the Naeural edge node that sent the message.
354
+ The address of the Naeural Edge Protocol edge node that sent the message.
355
355
  """
356
356
  self._dct_node_last_seen_time[node_addr] = tm()
357
357
  self._dct_node_addr_name[node_addr] = node_id
@@ -364,7 +364,7 @@ class GenericSession(BaseDecentrAIObject):
364
364
  Parameters
365
365
  ----------
366
366
  node_addr : str
367
- The address of the Naeural edge node that sent the message.
367
+ The address of the Naeural Edge Protocol edge node that sent the message.
368
368
  dict_msg : dict
369
369
  The message received from the communication server.
370
370
  """
@@ -383,7 +383,7 @@ class GenericSession(BaseDecentrAIObject):
383
383
  dict_msg : dict
384
384
  The message received from the communication server
385
385
  msg_node_addr : str
386
- The address of the Naeural edge node that sent the message.
386
+ The address of the Naeural Edge Protocol edge node that sent the message.
387
387
  msg_pipeline : str
388
388
  The name of the pipeline that sent the message.
389
389
  msg_signature : str
@@ -449,7 +449,7 @@ class GenericSession(BaseDecentrAIObject):
449
449
  dict_msg : dict
450
450
  The message received from the communication server
451
451
  msg_node_addr : str
452
- The address of the Naeural edge node that sent the message.
452
+ The address of the Naeural Edge Protocol edge node that sent the message.
453
453
  msg_pipeline : str
454
454
  The name of the pipeline that sent the message.
455
455
  msg_signature : str
@@ -509,7 +509,7 @@ class GenericSession(BaseDecentrAIObject):
509
509
  dict_msg : dict
510
510
  The message received from the communication server
511
511
  msg_node_addr : str
512
- The address of the Naeural edge node that sent the message.
512
+ The address of the Naeural Edge Protocol edge node that sent the message.
513
513
  msg_pipeline : str
514
514
  The name of the pipeline that sent the message.
515
515
  msg_signature : str
@@ -538,7 +538,14 @@ class GenericSession(BaseDecentrAIObject):
538
538
  for transaction in open_transactions_copy:
539
539
  transaction.handle_payload(dict_msg)
540
540
  if self.custom_on_payload is not None:
541
- self.custom_on_payload(self, msg_node_addr, msg_pipeline, msg_signature, msg_instance, Payload(msg_data))
541
+ self.custom_on_payload(
542
+ self, # session
543
+ msg_node_addr, # node_addr
544
+ msg_pipeline, # pipeline
545
+ msg_signature, # plugin signature
546
+ msg_instance, # plugin instance name
547
+ Payload(msg_data) # the actual payload
548
+ )
542
549
 
543
550
  return
544
551
 
@@ -662,7 +669,7 @@ class GenericSession(BaseDecentrAIObject):
662
669
  Parameters
663
670
  ----------
664
671
  to : str
665
- The name of the Naeural edge node that will receive the payload.
672
+ The name of the Naeural Edge Protocol edge node that will receive the payload.
666
673
  payload : dict
667
674
  The payload to send.
668
675
  """
@@ -808,13 +815,14 @@ class GenericSession(BaseDecentrAIObject):
808
815
  os.getenv(ENVIRONMENT.AIXP_USER),
809
816
  os.getenv(ENVIRONMENT.EE_USERNAME),
810
817
  os.getenv(ENVIRONMENT.EE_USER),
818
+ os.getenv(ENVIRONMENT.EE_MQTT_USER),
811
819
  self._config.get(comm_ct.USER),
812
820
  ]
813
821
 
814
822
  user = next((x for x in possible_user_values if x is not None), None)
815
823
 
816
824
  if user is None:
817
- env_error = "Error: No user specified for Naeural network connection. Please make sure you have the correct credentials in the environment variables within the .env file or provide them as params in code (not recommended due to potential security issue)."
825
+ env_error = "Error: No user specified for Naeural Edge Protocol network connection. Please make sure you have the correct credentials in the environment variables within the .env file or provide them as params in code (not recommended due to potential security issue)."
818
826
  raise ValueError(env_error)
819
827
  if self._config.get(comm_ct.USER, None) is None:
820
828
  self._config[comm_ct.USER] = user
@@ -827,13 +835,14 @@ class GenericSession(BaseDecentrAIObject):
827
835
  os.getenv(ENVIRONMENT.EE_PASSWORD),
828
836
  os.getenv(ENVIRONMENT.EE_PASS),
829
837
  os.getenv(ENVIRONMENT.EE_PWD),
838
+ os.getenv(ENVIRONMENT.EE_MQTT),
830
839
  self._config.get(comm_ct.PASS),
831
840
  ]
832
841
 
833
842
  pwd = next((x for x in possible_password_values if x is not None), None)
834
843
 
835
844
  if pwd is None:
836
- raise ValueError("Error: No password specified for Naeural network connection")
845
+ raise ValueError("Error: No password specified for Naeural Edge Protocol network connection")
837
846
  if self._config.get(comm_ct.PASS, None) is None:
838
847
  self._config[comm_ct.PASS] = pwd
839
848
 
@@ -843,6 +852,7 @@ class GenericSession(BaseDecentrAIObject):
843
852
  os.getenv(ENVIRONMENT.AIXP_HOST),
844
853
  os.getenv(ENVIRONMENT.EE_HOSTNAME),
845
854
  os.getenv(ENVIRONMENT.EE_HOST),
855
+ os.getenv(ENVIRONMENT.EE_MQTT_HOST),
846
856
  self._config.get(comm_ct.HOST),
847
857
  "r9092118.ala.eu-central-1.emqxsl.com",
848
858
  ]
@@ -850,7 +860,7 @@ class GenericSession(BaseDecentrAIObject):
850
860
  host = next((x for x in possible_host_values if x is not None), None)
851
861
 
852
862
  if host is None:
853
- raise ValueError("Error: No host specified for Naeural network connection")
863
+ raise ValueError("Error: No host specified for Naeural Edge Protocol network connection")
854
864
  if self._config.get(comm_ct.HOST, None) is None:
855
865
  self._config[comm_ct.HOST] = host
856
866
 
@@ -858,6 +868,7 @@ class GenericSession(BaseDecentrAIObject):
858
868
  port,
859
869
  os.getenv(ENVIRONMENT.AIXP_PORT),
860
870
  os.getenv(ENVIRONMENT.EE_PORT),
871
+ os.getenv(ENVIRONMENT.EE_MQTT_PORT),
861
872
  self._config.get(comm_ct.PORT),
862
873
  8883,
863
874
  ]
@@ -865,7 +876,7 @@ class GenericSession(BaseDecentrAIObject):
865
876
  port = next((x for x in possible_port_values if x is not None), None)
866
877
 
867
878
  if port is None:
868
- raise ValueError("Error: No port specified for Naeural network connection")
879
+ raise ValueError("Error: No port specified for Naeural Edge Protocol network connection")
869
880
  if self._config.get(comm_ct.PORT, None) is None:
870
881
  self._config[comm_ct.PORT] = int(port)
871
882
 
@@ -920,7 +931,7 @@ class GenericSession(BaseDecentrAIObject):
920
931
  command : str
921
932
  The command to send.
922
933
  worker : str
923
- The name of the Naeural edge node that will receive the command.
934
+ The name of the Naeural Edge Protocol edge node that will receive the command.
924
935
  payload : dict
925
936
  The payload to send.
926
937
  show_command : bool, optional
@@ -1134,7 +1145,7 @@ class GenericSession(BaseDecentrAIObject):
1134
1145
  max_wait_time=0,
1135
1146
  **kwargs) -> Pipeline:
1136
1147
  """
1137
- Create a new pipeline on a node. A pipeline is the equivalent of the "config file" used by the Naeural edge node team internally.
1148
+ Create a new pipeline on a node. A pipeline is the equivalent of the "config file" used by the Naeural Edge Protocol edge node team internally.
1138
1149
 
1139
1150
  A `Pipeline` is a an object that encapsulates a one-to-many, data acquisition to data processing, flow of data.
1140
1151
 
@@ -1150,14 +1161,14 @@ class GenericSession(BaseDecentrAIObject):
1150
1161
 
1151
1162
  `Plugin` == `Signature`
1152
1163
 
1153
- This call can busy-wait for a number of seconds to listen to heartbeats, in order to check if an Naeural edge node is online or not.
1164
+ This call can busy-wait for a number of seconds to listen to heartbeats, in order to check if an Naeural Edge Protocol edge node is online or not.
1154
1165
  If the node does not appear online, a warning will be displayed at the stdout, telling the user that the message that handles the
1155
1166
  creation of the pipeline will be sent, but it is not guaranteed that the specific node will receive it.
1156
1167
 
1157
1168
  Parameters
1158
1169
  ----------
1159
1170
  node : str
1160
- Address or Name of the Naeural edge node that will handle this pipeline.
1171
+ Address or Name of the Naeural Edge Protocol edge node that will handle this pipeline.
1161
1172
  name : str
1162
1173
  Name of the pipeline. This is good to be kept unique, as it allows multiple parties to overwrite each others configurations.
1163
1174
  data_source : str, optional
@@ -1233,36 +1244,36 @@ class GenericSession(BaseDecentrAIObject):
1233
1244
 
1234
1245
  def get_active_nodes(self):
1235
1246
  """
1236
- Get the list of all Naeural edge nodes that sent a message since this session was created, and that are considered online
1247
+ Get the list of all Naeural Edge Protocol edge nodes that sent a message since this session was created, and that are considered online
1237
1248
 
1238
1249
  Returns
1239
1250
  -------
1240
1251
  list
1241
- List of names of all the Naeural edge nodes that are considered online
1252
+ List of names of all the Naeural Edge Protocol edge nodes that are considered online
1242
1253
 
1243
1254
  """
1244
1255
  return [k for k, v in self._dct_node_last_seen_time.items() if tm() - v < self.online_timeout]
1245
1256
 
1246
1257
  def get_allowed_nodes(self):
1247
1258
  """
1248
- Get the list of all active Naeural edge nodes to whom this session can send messages
1259
+ Get the list of all active Naeural Edge Protocol edge nodes to whom this session can send messages
1249
1260
 
1250
1261
  Returns
1251
1262
  -------
1252
1263
  list[str]
1253
- List of names of all the active Naeural edge nodes to whom this session can send messages
1264
+ List of names of all the active Naeural Edge Protocol edge nodes to whom this session can send messages
1254
1265
  """
1255
1266
  active_nodes = self.get_active_nodes()
1256
1267
  return [node for node in self._dct_can_send_to_node if self._dct_can_send_to_node[node] and node in active_nodes]
1257
1268
 
1258
1269
  def get_active_pipelines(self, node):
1259
1270
  """
1260
- Get a dictionary with all the pipelines that are active on this Naeural edge node
1271
+ Get a dictionary with all the pipelines that are active on this Naeural Edge Protocol edge node
1261
1272
 
1262
1273
  Parameters
1263
1274
  ----------
1264
1275
  node : str
1265
- Address or Name of the Naeural edge node
1276
+ Address or Name of the Naeural Edge Protocol edge node
1266
1277
 
1267
1278
  Returns
1268
1279
  -------
@@ -1302,7 +1313,7 @@ class GenericSession(BaseDecentrAIObject):
1302
1313
  on_notification=None,
1303
1314
  max_wait_time=0) -> Pipeline:
1304
1315
  """
1305
- Create a Pipeline object and attach to an existing pipeline on an Naeural edge node.
1316
+ Create a Pipeline object and attach to an existing pipeline on an Naeural Edge Protocol edge node.
1306
1317
  Useful when one wants to treat an existing pipeline as one of his own,
1307
1318
  or when one wants to attach callbacks to various events (on_data, on_notification).
1308
1319
 
@@ -1320,7 +1331,7 @@ class GenericSession(BaseDecentrAIObject):
1320
1331
 
1321
1332
  `Plugin` == `Signature`
1322
1333
 
1323
- This call can busy-wait for a number of seconds to listen to heartbeats, in order to check if an Naeural edge node is online or not.
1334
+ This call can busy-wait for a number of seconds to listen to heartbeats, in order to check if an Naeural Edge Protocol edge node is online or not.
1324
1335
  If the node does not appear online, a warning will be displayed at the stdout, telling the user that the message that handles the
1325
1336
  creation of the pipeline will be sent, but it is not guaranteed that the specific node will receive it.
1326
1337
 
@@ -1328,7 +1339,7 @@ class GenericSession(BaseDecentrAIObject):
1328
1339
  Parameters
1329
1340
  ----------
1330
1341
  node : str
1331
- Address or Name of the Naeural edge node that handles this pipeline.
1342
+ Address or Name of the Naeural Edge Protocol edge node that handles this pipeline.
1332
1343
  name : str
1333
1344
  Name of the existing pipeline.
1334
1345
  on_data : Callable[[Pipeline, str, str, dict], None], optional
@@ -1393,12 +1404,12 @@ class GenericSession(BaseDecentrAIObject):
1393
1404
  max_wait_time=0,
1394
1405
  **kwargs) -> Pipeline:
1395
1406
  """
1396
- Create a new pipeline on a node, or attach to an existing pipeline on an Naeural edge node.
1407
+ Create a new pipeline on a node, or attach to an existing pipeline on an Naeural Edge Protocol edge node.
1397
1408
 
1398
1409
  Parameters
1399
1410
  ----------
1400
1411
  node : str
1401
- Address or Name of the Naeural edge node that will handle this pipeline.
1412
+ Address or Name of the Naeural Edge Protocol edge node that will handle this pipeline.
1402
1413
  name : str
1403
1414
  Name of the pipeline. This is good to be kept unique, as it allows multiple parties to overwrite each others configurations.
1404
1415
  data_source : str
@@ -1552,7 +1563,7 @@ class GenericSession(BaseDecentrAIObject):
1552
1563
  Parameters
1553
1564
  ----------
1554
1565
  node : str
1555
- The address or name of the Naeural edge node.
1566
+ The address or name of the Naeural Edge Protocol edge node.
1556
1567
  timeout : int, optional
1557
1568
  The timeout, by default 15
1558
1569
 
@@ -1586,7 +1597,7 @@ class GenericSession(BaseDecentrAIObject):
1586
1597
  Parameters
1587
1598
  ----------
1588
1599
  node : str
1589
- The address or name of the Naeural edge node.
1600
+ The address or name of the Naeural Edge Protocol edge node.
1590
1601
 
1591
1602
  Returns
1592
1603
  -------
@@ -1640,7 +1651,9 @@ class GenericSession(BaseDecentrAIObject):
1640
1651
  *,
1641
1652
  node,
1642
1653
  name,
1643
- signature,
1654
+ signature="CUSTOM_CODE_FASTAPI_01",
1655
+ endpoints=None,
1656
+ use_ngrok=True,
1644
1657
  **kwargs
1645
1658
  ):
1646
1659
 
@@ -1652,8 +1665,16 @@ class GenericSession(BaseDecentrAIObject):
1652
1665
  instance = pipeline.create_plugin_instance(
1653
1666
  signature=signature,
1654
1667
  instance_id=self.log.get_unique_id(),
1668
+ use_ngrok=use_ngrok,
1655
1669
  **kwargs
1656
1670
  )
1671
+
1672
+ if endpoints is not None:
1673
+ for endpoint in endpoints:
1674
+ assert isinstance(endpoint, dict), "Each endpoint must be a dictionary defining the endpoint configuration."
1675
+ instance.add_new_endpoint(**endpoint)
1676
+ # end for
1677
+ # end if we have endpoints defined in the call
1657
1678
 
1658
1679
  return pipeline, instance
1659
1680
 
@@ -310,7 +310,7 @@ class Instance():
310
310
  def __register_transaction_for_instance_command(self, session_id: str = None, timeout: float = 0) -> list[Transaction]:
311
311
  """
312
312
  Register a new transaction for the instance command.
313
- This method is called before sending an instance command to the Naeural edge node.
313
+ This method is called before sending an instance command to the Naeural Edge Protocol edge node.
314
314
 
315
315
  Parameters
316
316
  ----------
@@ -441,7 +441,7 @@ class Instance():
441
441
  def send_instance_command(self, command, payload=None, command_params=None, wait_confirmation=True, session_id=None, timeout=10):
442
442
  """
443
443
  Send a command to the instance.
444
- This command can block until the command is confirmed by the Naeural edge node.
444
+ This command can block until the command is confirmed by the Naeural Edge Protocol edge node.
445
445
 
446
446
  Example:
447
447
  --------
@@ -8,7 +8,7 @@ import numpy as np
8
8
  class Payload(UserDict):
9
9
  """
10
10
  This class enriches the default python dict, providing
11
- helpful methods to process the payloads received from Naeural edge nodes.
11
+ helpful methods to process the payloads received from Naeural Edge Protocol edge nodes.
12
12
  """
13
13
 
14
14
  def get_images_as_np(self, key='IMG') -> list:
@@ -64,3 +64,16 @@ class Payload(UserDict):
64
64
  except ModuleNotFoundError:
65
65
  raise "This functionality requires the PIL library. To use this feature, please install it using 'pip install pillow'"
66
66
  return image
67
+
68
+
69
+ if __name__ == "__main__":
70
+ import json
71
+ payload = Payload()
72
+ payload.data = {
73
+ "IMG": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABKklEQVR42mNkAAwOyKg",
74
+ "TEST" : "TEST"
75
+ }
76
+
77
+ print(type(payload), payload)
78
+ print(type(payload.data), payload.data)
79
+ print(json.dumps(payload.data, indent=2))