naeural-client 2.7.4__tar.gz → 2.7.6__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.
- {naeural_client-2.7.4 → naeural_client-2.7.6}/PKG-INFO +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/_ver.py +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/generic_session.py +3 -3
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/cli/cli_commands.py +2 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/environment.py +3 -3
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/config.py +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/nepctl.MD +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/pyproject.toml +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/.example_env +1 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex01_part1_connect.py +16 -3
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex01_part2_filter.py +8 -4
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex01_part3_adv_filter.py +11 -1
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex02_part1_deploy_webapi.py +15 -3
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex02_part2_deploy_plugin.py +14 -4
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex08_custom_webapi.py +1 -1
- naeural_client-2.7.6/tutorials/ex10_telegram_echo_bot.py +57 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex11_telegram_blackjack_bot.py +23 -3
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex12_telegram_smart_bot.py +12 -8
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex13_launch_repo_based_webapp.py +2 -2
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/ora_check.py +4 -0
- naeural_client-2.7.4/tutorials/ex10_telegram_echo_bot.py +0 -45
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.devcontainer/Dockerfile +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.devcontainer/devcontainer.json +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.gitattributes +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.github/workflows/python-publish.yml +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.gitignore +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/.vscode/launch.json +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/LICENSE +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/README.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/TODOs.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/distributed_custom_code_presets.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/instance.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/payload/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/payload/payload.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/pipeline.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/plugin_template.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/responses.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/transaction.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/webapp_pipeline.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base_decentra_object.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/bc/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/bc/base.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/bc/chain.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/bc/ec.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/certs/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/cli/README.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/cli/cli.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/cli/nodes.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/cli/oracles.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/code_cheker/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/code_cheker/base.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/code_cheker/checker.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/comm/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/comm/amqp_wrapper.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/comm/mqtt_wrapper.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/README.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/apps.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/base.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/comms.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/formatter.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/heartbeat.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/misc.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/const/payload.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/chain_dist_custom_job_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/custom_webapi_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/net_mon_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/telegram_basic_bot_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/telegram_conversational_bot_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/view_scene_01_plugin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/session/mqtt_session.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/base/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/base/base_formatter.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/a_dummy.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/aixp1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/default.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/io_formatter_manager.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/base_logger.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/class_instance_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/computer_vision_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/datetime_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/download_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/general_serialization_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/json_serialization_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/pickle_serialization_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/process_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/resource_size_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/timers_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/upload_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/utils_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/small_logger.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/tzlocal/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/tzlocal/unix.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/tzlocal/utils.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/tzlocal/win32.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/tzlocal/windows_tz.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/plugins_manager_mixin.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/__init__.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/comm_utils.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/dotenv.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/oracle_sync/oracle_tester.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/requirements.txt +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/8. custom_code_fastapi_assets/index.html +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/9. code_sandbox_from_scratch_assets/index.html +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/_example_pk_sdk.pem +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex03_custom_code_on_one_remote__example_1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex04_custom_code_on_one_remote__example_2.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex05_custom_code_on_one_remote__example_3.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex06_custom_code_on_multiple_remotes__example_1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex07_custom_code_on_multiple_remotes__example_2.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex09_code_sandbox_from_scratch.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/video_presentation/1. hello_world.ipynb +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/winrun.bat +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/README.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/auth_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/cstore_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/keys_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/payload_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/session_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/_checks/web3_check.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/decentralized/chain_dist_example.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/decentralized/chain_dist_example_initiator.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/decentralized/chain_dist_example_worker.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/enc_dec/enc_dec_test.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/eth/eth_sign.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/eth/info.md +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/eth/sign.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/multi-enc-dec/multi_test1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/multi-enc-dec/multi_test2.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/sign/simple_payload_checker.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/sign/test_sign1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/sign/test_sign2.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/test1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/utils/get_documentation.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/various/attach_example.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/various/ex1.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/various/hello.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/various/remote_exec.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/various/save_images.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/wl/wl_add.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/xarchive/_tutorials/3. simple_real_time_custom_code.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/xarchive/_tutorials/4. real_time_custom_code_2.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/xarchive/_tutorials/8. chatbot.py +0 -0
- {naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/xarchive/test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: naeural_client
|
3
|
-
Version: 2.7.
|
3
|
+
Version: 2.7.6
|
4
4
|
Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
|
5
5
|
Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
|
6
6
|
Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
|
@@ -2388,13 +2388,13 @@ class GenericSession(BaseDecentrAIObject):
|
|
2388
2388
|
if telegram_bot_token is None:
|
2389
2389
|
telegram_bot_token = os.getenv(telegram_bot_token_env_key)
|
2390
2390
|
if telegram_bot_token is None:
|
2391
|
-
message = f"Warning! No Telegram bot token provided as via env {
|
2391
|
+
message = f"Warning! No Telegram bot token provided as via env '{telegram_bot_token_env_key}' or explicitly as `telegram_bot_token` param."
|
2392
2392
|
raise ValueError(message)
|
2393
2393
|
|
2394
2394
|
if telegram_bot_name is None:
|
2395
|
-
telegram_bot_name = os.getenv(telegram_bot_name_env_key)
|
2395
|
+
telegram_bot_name = os.getenv(telegram_bot_name_env_key, name)
|
2396
2396
|
if telegram_bot_name is None:
|
2397
|
-
message = f"Warning! No Telegram bot name provided as via env {
|
2397
|
+
message = f"Warning! No Telegram bot name provided as via env '{telegram_bot_name_env_key}' or explicitly as `telegram_bot_name` param."
|
2398
2398
|
raise ValueError(message)
|
2399
2399
|
|
2400
2400
|
|
@@ -62,7 +62,8 @@ CLI_COMMANDS = {
|
|
62
62
|
"func": get_set_network, # DONE
|
63
63
|
"description": "Get/Set network",
|
64
64
|
"params": {
|
65
|
-
"--new": "The network to set either 'mainnet' or 'testnet'",
|
65
|
+
"--new": "The network to set either 'mainnet' or 'testnet' (same as --set)",
|
66
|
+
"--set": "The network to set either 'mainnet' or 'testnet' (same as --new)",
|
66
67
|
}
|
67
68
|
},
|
68
69
|
},
|
@@ -29,7 +29,7 @@ class ENVIRONMENT:
|
|
29
29
|
EE_SECURED = 'EE_SECURED'
|
30
30
|
AIXP_SECURED = 'AIXP_SECURED'
|
31
31
|
|
32
|
-
TELEGRAM_BOT_TOKEN_ENV_KEY = '
|
33
|
-
TELEGRAM_BOT_NAME_ENV_KEY = '
|
32
|
+
TELEGRAM_BOT_TOKEN_ENV_KEY = 'EE_TELEGRAM_BOT_TOKEN'
|
33
|
+
TELEGRAM_BOT_NAME_ENV_KEY = 'EE_TELEGRAM_BOT_NAME'
|
34
34
|
|
35
|
-
TELEGRAM_API_AGENT_TOKEN_ENV_KEY = '
|
35
|
+
TELEGRAM_API_AGENT_TOKEN_ENV_KEY = 'EE_TELEGRAM_API_AGENT_TOKEN'
|
@@ -94,7 +94,7 @@ def get_network():
|
|
94
94
|
return os.environ.get(dAuth.DAUTH_NET_ENV_KEY, dAuth.DAUTH_SDK_NET_DEFAULT)
|
95
95
|
|
96
96
|
def get_set_network(args):
|
97
|
-
net = args.new
|
97
|
+
net = args.new or args.set
|
98
98
|
env_network = get_network()
|
99
99
|
if net is None:
|
100
100
|
log_with_color(f"Current network: {env_network}", color='b')
|
@@ -46,9 +46,22 @@ class MessageHandler:
|
|
46
46
|
node_alias = heartbeat[PAYLOAD_DATA.EE_ID]
|
47
47
|
short_addr = self.shorten_address(node_addr)
|
48
48
|
cpu = heartbeat[HEARTBEAT_DATA.CPU]
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
cpu_load = heartbeat[HEARTBEAT_DATA.CPU_USED]
|
50
|
+
mem = heartbeat[HEARTBEAT_DATA.MACHINE_MEMORY]
|
51
|
+
mem_avail = heartbeat[HEARTBEAT_DATA.AVAILABLE_MEMORY]
|
52
|
+
disk_avail = heartbeat[HEARTBEAT_DATA.AVAILABLE_DISK]
|
53
|
+
disk_total = heartbeat[HEARTBEAT_DATA.TOTAL_DISK]
|
54
|
+
disk_load = (disk_total - disk_avail) / disk_total * 100
|
55
|
+
mem_load = (mem - mem_avail) / mem * 100
|
56
|
+
self.hb = heartbeat # simple storage of the last heartbeat
|
57
|
+
plugins = heartbeat[HEARTBEAT_DATA.ACTIVE_PLUGINS] or []
|
58
|
+
pipelines = heartbeat[HEARTBEAT_DATA.CONFIG_STREAMS] or []
|
59
|
+
session.P(
|
60
|
+
"<{}> {} {} Load: {:.1f}% CPU, {:.1f}% RAM, {:.1f}% Disk, {} plugins, {} pipelines".format(
|
61
|
+
short_addr, node_alias, cpu, cpu_load, mem_load, disk_load, len(plugins), len(pipelines)
|
62
|
+
),
|
63
|
+
color='magenta'
|
64
|
+
)
|
52
65
|
return
|
53
66
|
|
54
67
|
|
@@ -134,9 +134,13 @@ if __name__ == '__main__':
|
|
134
134
|
|
135
135
|
# Observation:
|
136
136
|
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
137
|
-
#
|
138
|
-
session
|
139
|
-
|
140
|
-
|
137
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
138
|
+
# active after the session is closed we use close_pipelines=True
|
139
|
+
# in production, you would not need this code as the script can close
|
140
|
+
# after the pipeline will be sent
|
141
|
+
session.wait(
|
142
|
+
seconds=120, # we wait the session for 60 seconds
|
143
|
+
close_pipelines=True, # we close the pipelines after the session
|
144
|
+
close_session=True, # we close the session after the session
|
141
145
|
)
|
142
146
|
session.P("Main thread exiting...")
|
@@ -142,7 +142,17 @@ if __name__ == '__main__':
|
|
142
142
|
# silent=True,
|
143
143
|
)
|
144
144
|
|
145
|
-
|
145
|
+
# Observation:
|
146
|
+
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
147
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
148
|
+
# active after the session is closed we use close_pipelines=True
|
149
|
+
# in production, you would not need this code as the script can close
|
150
|
+
# after the pipeline will be sent
|
151
|
+
session.wait(
|
152
|
+
seconds=120, # we wait the session for 60 seconds
|
153
|
+
close_pipelines=True, # we close the pipelines after the session
|
154
|
+
close_session=True, # we close the session after the session
|
155
|
+
)
|
146
156
|
session.P("Main thread exiting...")
|
147
157
|
|
148
158
|
netinfo = session.get_network_known_nodes()
|
@@ -24,7 +24,13 @@ def run_predict(plugin: CustomPluginTemplate, inputs: list[int], nr_steps: int)
|
|
24
24
|
if __name__ == '__main__':
|
25
25
|
|
26
26
|
session = Session(silent=True)
|
27
|
+
|
27
28
|
my_node = "0xai_ApM1AbzLq1VtsLIidmvzt1Nv4Cyl5Wed0fHNMoZv9u4X"
|
29
|
+
|
30
|
+
# NOTE: When working with SDK please use the nodes internal addresses. While the EVM address of the node
|
31
|
+
# is basically based on the same sk/pk it is in a different format and not directly usable with the SDK
|
32
|
+
# the internal node address is easily spoted as starting with 0xai_ and can be found
|
33
|
+
# via `docker exec r1node get_node_info` or via the launcher UI
|
28
34
|
|
29
35
|
app, _ = session.create_web_app(
|
30
36
|
node=my_node,
|
@@ -42,8 +48,14 @@ if __name__ == '__main__':
|
|
42
48
|
except Exception as e:
|
43
49
|
print("Error deploying webapp: ", e)
|
44
50
|
|
51
|
+
# Observation:
|
52
|
+
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
53
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
54
|
+
# active after the session is closed we use close_pipelines=True
|
55
|
+
# in production, you would not need this code as the script can close
|
56
|
+
# after the pipeline will be sent
|
45
57
|
session.wait(
|
46
|
-
|
47
|
-
|
48
|
-
|
58
|
+
seconds=120, # we wait the session for 60 seconds
|
59
|
+
close_pipelines=True, # we close the pipelines after the session
|
60
|
+
close_session=True, # we close the session after the session
|
49
61
|
)
|
@@ -20,6 +20,12 @@ def instance_on_data(pipeline: Pipeline, data: Payload):
|
|
20
20
|
if __name__ == '__main__':
|
21
21
|
# create a session
|
22
22
|
# the network credentials are read from the .env file automatically
|
23
|
+
|
24
|
+
# NOTE: When working with SDK please use the nodes internal addresses. While the EVM address of the node
|
25
|
+
# is basically based on the same sk/pk it is in a different format and not directly usable with the SDK
|
26
|
+
# the internal node address is easily spoted as starting with 0xai_ and can be found
|
27
|
+
# via `docker exec r1node get_node_info` or via the launcher UI
|
28
|
+
|
23
29
|
session: Session = Session(encrypt_comms=True)
|
24
30
|
|
25
31
|
session.wait_for_any_node()
|
@@ -57,9 +63,13 @@ if __name__ == '__main__':
|
|
57
63
|
|
58
64
|
# Observation:
|
59
65
|
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
60
|
-
#
|
61
|
-
session
|
62
|
-
|
63
|
-
|
66
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
67
|
+
# active after the session is closed we use close_pipelines=True
|
68
|
+
# in production, you would not need this code as the script can close
|
69
|
+
# after the pipeline will be sent
|
70
|
+
session.wait(
|
71
|
+
seconds=120, # we wait the session for 60 seconds
|
72
|
+
close_pipelines=True, # we close the pipelines after the session
|
73
|
+
close_session=True, # we close the session after the session
|
64
74
|
)
|
65
75
|
session.P("Main thread exiting...")
|
@@ -44,7 +44,7 @@ def predict(plugin: CustomPluginTemplate, series: list[int], steps: int) -> list
|
|
44
44
|
if __name__ == "__main__":
|
45
45
|
session = Session(silent=True)
|
46
46
|
|
47
|
-
node = os.environ.get("
|
47
|
+
node = os.environ.get("EE_TARGET_NODE", "INSERT_YOUR_NODE_ADDRESS_HERE")
|
48
48
|
session.P(f"Waiting for node {node} to be available for deployment...")
|
49
49
|
session.wait_for_node(node)
|
50
50
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import os
|
2
|
+
import time
|
3
|
+
|
4
|
+
from naeural_client import Session, CustomPluginTemplate, PLUGIN_TYPES
|
5
|
+
|
6
|
+
def reply(plugin: CustomPluginTemplate, message: str, user: str):
|
7
|
+
"""
|
8
|
+
This function is used to reply to a message. The given parameters are mandatory
|
9
|
+
"""
|
10
|
+
# for each user message we increase a counter
|
11
|
+
plugin.int_cache[user] += 1 # int_cache is a default dict that allows persistence in the plugin
|
12
|
+
plugin.P(f"Replying to the {plugin.int_cache[user]} msg of '{user}' on message '{message}'")
|
13
|
+
result = f"The answer to your {plugin.int_cache[user]} question is in the question itself: {message}"
|
14
|
+
return result
|
15
|
+
|
16
|
+
|
17
|
+
if __name__ == "__main__":
|
18
|
+
session = Session()
|
19
|
+
|
20
|
+
# NOTE: When working with SDK please use the nodes internal addresses. While the EVM address of the node
|
21
|
+
# is basically based on the same sk/pk it is in a different format and not directly usable with the SDK
|
22
|
+
# the internal node address is easily spoted as starting with 0xai_ and can be found
|
23
|
+
# via `docker exec r1node get_node_info` or via the launcher UI
|
24
|
+
|
25
|
+
# this tutorial assumes you have started your own local node for dev-testing purposes
|
26
|
+
# you can either supply the node address via env or directly here
|
27
|
+
# Note: in order to get the environment variable first you have to create the Session
|
28
|
+
# object that will load the environment variables
|
29
|
+
my_node = os.getenv("EE_TARGET_NODE", "0xai_my_own_node_address")
|
30
|
+
|
31
|
+
session.wait_for_node(my_node)
|
32
|
+
|
33
|
+
|
34
|
+
# now we create a telegram bot pipeline & plugin instance and for that we only need the Telegram token
|
35
|
+
# we can chose to use the token directly via `telegram_bot_token` parameter
|
36
|
+
# or use the environment key EE_TELEGRAM_BOT_TOKEN
|
37
|
+
# in this case for this simple example we are going to use the token directly
|
38
|
+
pipeline, _ = session.create_telegram_simple_bot(
|
39
|
+
node=my_node,
|
40
|
+
name="telegram_bot_echo",
|
41
|
+
telegram_bot_token="your_token_goes_here", # we use the token directly
|
42
|
+
message_handler=reply,
|
43
|
+
)
|
44
|
+
|
45
|
+
pipeline.deploy() # we deploy the pipeline
|
46
|
+
|
47
|
+
# Observation:
|
48
|
+
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
49
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
50
|
+
# active after the session is closed we use close_pipelines=True
|
51
|
+
# in production, you would not need this code as the script can close
|
52
|
+
# after the pipeline will be sent
|
53
|
+
session.wait(
|
54
|
+
seconds=120, # we wait the session for 120 seconds
|
55
|
+
close_pipelines=True, # we close the pipelines after the session
|
56
|
+
close_session=True, # we close the session after the session
|
57
|
+
)
|
@@ -186,12 +186,20 @@ def reply(plugin, message: str, user: str):
|
|
186
186
|
|
187
187
|
|
188
188
|
if __name__ == "__main__":
|
189
|
-
my_node = os.getenv("TARGET_NODE") # we can specify a node here, if we want to connect to a specific
|
190
189
|
|
191
|
-
session = Session()
|
190
|
+
session = Session()
|
191
|
+
|
192
|
+
# assume .env is available and will be used for the connection and tokens
|
193
|
+
# NOTE: When working with SDK please use the nodes internal addresses. While the EVM address of the node
|
194
|
+
# is basically based on the same sk/pk it is in a different format and not directly usable with the SDK
|
195
|
+
# the internal node address is easily spoted as starting with 0xai_ and can be found
|
196
|
+
# via `docker exec r1node get_node_info` or via the launcher UI
|
197
|
+
my_node = os.getenv("EE_TARGET_NODE", "0xai_your_node_address") # we can specify a node here, if we want to connect to a specific
|
198
|
+
|
192
199
|
session.wait_for_node(my_node) # wait for the node to be active
|
193
200
|
|
194
|
-
|
201
|
+
# unlike the previous example, we are going to use the token from the environment
|
202
|
+
# and deploy the app on the target node and leave it there
|
195
203
|
pipeline, _ = session.create_telegram_simple_bot(
|
196
204
|
node=my_node,
|
197
205
|
name="telegram_bot_blackjack",
|
@@ -200,4 +208,16 @@ if __name__ == "__main__":
|
|
200
208
|
|
201
209
|
pipeline.deploy() # we deploy the pipeline
|
202
210
|
|
211
|
+
|
212
|
+
# Observation:
|
213
|
+
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
214
|
+
# due to the fact that this is a example/tutorial and maybe we dont want to keep the pipeline
|
215
|
+
# active after the session is closed we use close_pipelines=True
|
216
|
+
# in production, you would not need this code as the script can close
|
217
|
+
# after the pipeline will be sent
|
218
|
+
session.wait(
|
219
|
+
seconds=600, # we wait the session for 10 minutes
|
220
|
+
close_pipelines=True, # we close the pipelines after the session
|
221
|
+
close_session=True, # we close the session after the session
|
222
|
+
)
|
203
223
|
|
@@ -2,21 +2,25 @@ import os
|
|
2
2
|
from naeural_client import Session
|
3
3
|
|
4
4
|
if __name__ == "__main__":
|
5
|
-
my_node = os.getenv("TARGET_NODE") # we specify a node here
|
6
|
-
# The node can also be specified directly, without using the environment variable.
|
7
|
-
# my_node = "<target_edge_node_identifier>"
|
8
5
|
|
9
|
-
if my_node is None:
|
10
|
-
# In case the node is not specified, we exit the script.
|
11
|
-
print("Please specify the node to connect to.")
|
12
|
-
exit(1)
|
13
|
-
|
14
6
|
# We define the system prompt
|
15
7
|
SYSTEM_PROMPT = """
|
16
8
|
Hi! I am a simple echo bot. I will repeat everything you say to me.
|
17
9
|
"""
|
18
10
|
|
19
11
|
session = Session() # assume .env is available and will be used for the connection and tokens
|
12
|
+
|
13
|
+
# NOTE: When working with SDK please use the nodes internal addresses. While the EVM address of the node
|
14
|
+
# is basically based on the same sk/pk it is in a different format and not directly usable with the SDK
|
15
|
+
# the internal node address is easily spoted as starting with 0xai_ and can be found
|
16
|
+
# via `docker exec r1node get_node_info` or via the launcher UI
|
17
|
+
|
18
|
+
my_node = os.getenv("EE_TARGET_NODE") # we specify a node here
|
19
|
+
# The node can also be specified directly, without using the environment variable.
|
20
|
+
# my_node = "<target_edge_node_identifier>"
|
21
|
+
|
22
|
+
assert my_node is not None, "Please provide the target edge node identifier"
|
23
|
+
|
20
24
|
session.wait_for_node(my_node) # wait for the node to be active
|
21
25
|
|
22
26
|
# Now we create a telegram bot pipeline & plugin instance.
|
@@ -12,8 +12,8 @@ if __name__ == "__main__":
|
|
12
12
|
session = Session()
|
13
13
|
|
14
14
|
nodes = [
|
15
|
-
environ.get("
|
16
|
-
environ.get("
|
15
|
+
environ.get("EE_TARGET_NODE_1", "INSERT_YOUR_NODE_ADDRESS_HERE"),
|
16
|
+
environ.get("EE_TARGET_NODE_2", "INSERT_YOUR_NODE_ADDRESS_HERE")
|
17
17
|
]
|
18
18
|
|
19
19
|
if isinstance(nodes, str):
|
@@ -4,6 +4,7 @@ import pandas as pd
|
|
4
4
|
|
5
5
|
if __name__ == "__main__":
|
6
6
|
N = 4
|
7
|
+
DEBUG = True
|
7
8
|
|
8
9
|
# the provided url, note: if this does not return json directly, it might need adjustment
|
9
10
|
url = "https://naeural-oracle.ngrok.app/active_nodes_list"
|
@@ -17,6 +18,9 @@ if __name__ == "__main__":
|
|
17
18
|
except Exception as e:
|
18
19
|
print(f"error occurred during request {i+1}: {e}")
|
19
20
|
continue
|
21
|
+
|
22
|
+
if DEBUG:
|
23
|
+
print(f"\nResponse #{i+1}:\n{json.dumps(data, indent=2)}")
|
20
24
|
|
21
25
|
# extract nodes data from the json response
|
22
26
|
result = data.get("result", {})
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import time
|
3
|
-
|
4
|
-
from naeural_client import Session, CustomPluginTemplate, PLUGIN_TYPES
|
5
|
-
|
6
|
-
def reply(plugin: CustomPluginTemplate, message: str, user: str):
|
7
|
-
"""
|
8
|
-
This function is used to reply to a message. The given parameters are mandatory
|
9
|
-
"""
|
10
|
-
# for each user message we increase a counter
|
11
|
-
plugin.int_cache[user] += 1 # int_cache is a default dict that allows persistence in the plugin
|
12
|
-
plugin.P(f"Replying to the {plugin.int_cache[user]} msg of '{user}' on message '{message}'")
|
13
|
-
result = f"The answer to your {plugin.int_cache[user]} question is in the question itself: {message}"
|
14
|
-
return result
|
15
|
-
|
16
|
-
|
17
|
-
if __name__ == "__main__":
|
18
|
-
# TELEGRAM_BOT_TOKEN_ENV_KEY = "TELEGRAM_BOT_TOKEN" # this is the default - we can specify a env key here
|
19
|
-
my_node = os.getenv("TARGET_NODE") # we can specify a node here, if we want to connect to a specific
|
20
|
-
|
21
|
-
session = Session() # assume .env is available and will be used for the connection and tokens
|
22
|
-
session.wait_for_node(my_node) # wait for the node to be active
|
23
|
-
|
24
|
-
|
25
|
-
# now we create a telegram bot pipeline & plugin instance
|
26
|
-
# we can chose to use the token directly or use the environment key
|
27
|
-
# instance: PLUGIN_TYPES.TELEGRAM_BASIC_BOT_01
|
28
|
-
pipeline, _ = session.create_telegram_simple_bot(
|
29
|
-
node=my_node,
|
30
|
-
name="telegram_bot_echo",
|
31
|
-
# telegram_bot_token=os.getenv("TELEGRAM_BOT_TOKEN"), # we use the token directly
|
32
|
-
# telegram_bot_token_env_key=TELEGRAM_BOT_TOKEN_ENV_KEY, # not mandatory - we can use the default
|
33
|
-
message_handler=reply,
|
34
|
-
)
|
35
|
-
|
36
|
-
pipeline.deploy() # we deploy the pipeline
|
37
|
-
|
38
|
-
# Observation:
|
39
|
-
# next code is not mandatory - it is used to keep the session open and cleanup the resources
|
40
|
-
# in production, you would not need this code as the script can close after the pipeline will be sent
|
41
|
-
session.run(
|
42
|
-
wait=120, # we run the session for 60 seconds
|
43
|
-
close_pipelines=True, # we close the pipelines after the session
|
44
|
-
close_session=True, # we close the session after the session
|
45
|
-
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/base/distributed_custom_code_presets.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/instance/net_mon_01_plugin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/default/session/mqtt_session.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/base/base_formatter.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/__init__.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/a_dummy.py
RENAMED
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/default/default.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/io_formatter/io_formatter_manager.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/datetime_mixin.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/download_mixin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/process_mixin.py
RENAMED
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/timers_mixin.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/upload_mixin.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/logging/logger_mixins/utils_mixin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/naeural_client/utils/oracle_sync/oracle_tester.py
RENAMED
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/8. custom_code_fastapi_assets/index.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex03_custom_code_on_one_remote__example_1.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex04_custom_code_on_one_remote__example_2.py
RENAMED
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/ex05_custom_code_on_one_remote__example_3.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/tutorials/video_presentation/1. hello_world.ipynb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/decentralized/chain_dist_example.py
RENAMED
File without changes
|
File without changes
|
{naeural_client-2.7.4 → naeural_client-2.7.6}/xperimental/decentralized/chain_dist_example_worker.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|