digitalkin 0.2.25rc0__py3-none-any.whl → 0.3.2.dev14__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.
- base_server/server_async_insecure.py +6 -5
- base_server/server_async_secure.py +6 -5
- base_server/server_sync_insecure.py +5 -4
- base_server/server_sync_secure.py +5 -4
- digitalkin/__version__.py +1 -1
- digitalkin/core/__init__.py +1 -0
- digitalkin/core/common/__init__.py +9 -0
- digitalkin/core/common/factories.py +156 -0
- digitalkin/core/job_manager/__init__.py +1 -0
- digitalkin/{modules → core}/job_manager/base_job_manager.py +138 -32
- digitalkin/core/job_manager/single_job_manager.py +373 -0
- digitalkin/{modules → core}/job_manager/taskiq_broker.py +121 -26
- digitalkin/core/job_manager/taskiq_job_manager.py +541 -0
- digitalkin/core/task_manager/__init__.py +1 -0
- digitalkin/core/task_manager/base_task_manager.py +539 -0
- digitalkin/core/task_manager/local_task_manager.py +108 -0
- digitalkin/core/task_manager/remote_task_manager.py +87 -0
- digitalkin/core/task_manager/surrealdb_repository.py +266 -0
- digitalkin/core/task_manager/task_executor.py +249 -0
- digitalkin/core/task_manager/task_session.py +368 -0
- digitalkin/grpc_servers/__init__.py +1 -19
- digitalkin/grpc_servers/_base_server.py +3 -3
- digitalkin/grpc_servers/module_server.py +120 -195
- digitalkin/grpc_servers/module_servicer.py +81 -44
- digitalkin/grpc_servers/utils/__init__.py +1 -0
- digitalkin/grpc_servers/utils/exceptions.py +0 -8
- digitalkin/grpc_servers/utils/grpc_client_wrapper.py +25 -9
- digitalkin/grpc_servers/utils/grpc_error_handler.py +53 -0
- digitalkin/grpc_servers/utils/utility_schema_extender.py +100 -0
- digitalkin/logger.py +64 -27
- digitalkin/mixins/__init__.py +19 -0
- digitalkin/mixins/base_mixin.py +10 -0
- digitalkin/mixins/callback_mixin.py +24 -0
- digitalkin/mixins/chat_history_mixin.py +110 -0
- digitalkin/mixins/cost_mixin.py +76 -0
- digitalkin/mixins/file_history_mixin.py +93 -0
- digitalkin/mixins/filesystem_mixin.py +46 -0
- digitalkin/mixins/logger_mixin.py +51 -0
- digitalkin/mixins/storage_mixin.py +79 -0
- digitalkin/models/__init__.py +1 -1
- digitalkin/models/core/__init__.py +1 -0
- digitalkin/{modules/job_manager → models/core}/job_manager_models.py +3 -11
- digitalkin/models/core/task_monitor.py +74 -0
- digitalkin/models/grpc_servers/__init__.py +1 -0
- digitalkin/{grpc_servers/utils → models/grpc_servers}/models.py +92 -7
- digitalkin/models/module/__init__.py +18 -11
- digitalkin/models/module/base_types.py +61 -0
- digitalkin/models/module/module.py +9 -1
- digitalkin/models/module/module_context.py +282 -6
- digitalkin/models/module/module_types.py +29 -105
- digitalkin/models/module/setup_types.py +490 -0
- digitalkin/models/module/tool_cache.py +68 -0
- digitalkin/models/module/tool_reference.py +117 -0
- digitalkin/models/module/utility.py +167 -0
- digitalkin/models/services/__init__.py +9 -0
- digitalkin/models/services/cost.py +1 -0
- digitalkin/models/services/registry.py +35 -0
- digitalkin/models/services/storage.py +39 -5
- digitalkin/modules/__init__.py +5 -1
- digitalkin/modules/_base_module.py +265 -167
- digitalkin/modules/archetype_module.py +6 -1
- digitalkin/modules/tool_module.py +16 -3
- digitalkin/modules/trigger_handler.py +7 -6
- digitalkin/modules/triggers/__init__.py +8 -0
- digitalkin/modules/triggers/healthcheck_ping_trigger.py +45 -0
- digitalkin/modules/triggers/healthcheck_services_trigger.py +63 -0
- digitalkin/modules/triggers/healthcheck_status_trigger.py +52 -0
- digitalkin/services/__init__.py +4 -0
- digitalkin/services/communication/__init__.py +7 -0
- digitalkin/services/communication/communication_strategy.py +76 -0
- digitalkin/services/communication/default_communication.py +101 -0
- digitalkin/services/communication/grpc_communication.py +234 -0
- digitalkin/services/cost/__init__.py +9 -2
- digitalkin/services/cost/grpc_cost.py +9 -42
- digitalkin/services/filesystem/default_filesystem.py +0 -2
- digitalkin/services/filesystem/grpc_filesystem.py +10 -39
- digitalkin/services/registry/__init__.py +22 -1
- digitalkin/services/registry/default_registry.py +135 -4
- digitalkin/services/registry/exceptions.py +47 -0
- digitalkin/services/registry/grpc_registry.py +306 -0
- digitalkin/services/registry/registry_models.py +15 -0
- digitalkin/services/registry/registry_strategy.py +88 -4
- digitalkin/services/services_config.py +25 -3
- digitalkin/services/services_models.py +5 -1
- digitalkin/services/setup/default_setup.py +6 -7
- digitalkin/services/setup/grpc_setup.py +52 -15
- digitalkin/services/storage/grpc_storage.py +4 -4
- digitalkin/services/user_profile/__init__.py +12 -0
- digitalkin/services/user_profile/default_user_profile.py +55 -0
- digitalkin/services/user_profile/grpc_user_profile.py +69 -0
- digitalkin/services/user_profile/user_profile_strategy.py +25 -0
- digitalkin/utils/__init__.py +28 -0
- digitalkin/utils/arg_parser.py +1 -1
- digitalkin/utils/development_mode_action.py +2 -2
- digitalkin/utils/dynamic_schema.py +483 -0
- digitalkin/utils/package_discover.py +1 -2
- digitalkin/utils/schema_splitter.py +207 -0
- {digitalkin-0.2.25rc0.dist-info → digitalkin-0.3.2.dev14.dist-info}/METADATA +11 -30
- digitalkin-0.3.2.dev14.dist-info/RECORD +143 -0
- {digitalkin-0.2.25rc0.dist-info → digitalkin-0.3.2.dev14.dist-info}/top_level.txt +1 -0
- modules/archetype_with_tools_module.py +244 -0
- modules/cpu_intensive_module.py +1 -1
- modules/dynamic_setup_module.py +338 -0
- modules/minimal_llm_module.py +1 -1
- modules/text_transform_module.py +1 -1
- monitoring/digitalkin_observability/__init__.py +46 -0
- monitoring/digitalkin_observability/http_server.py +150 -0
- monitoring/digitalkin_observability/interceptors.py +176 -0
- monitoring/digitalkin_observability/metrics.py +201 -0
- monitoring/digitalkin_observability/prometheus.py +137 -0
- monitoring/tests/test_metrics.py +172 -0
- services/filesystem_module.py +7 -5
- services/storage_module.py +4 -2
- digitalkin/grpc_servers/registry_server.py +0 -65
- digitalkin/grpc_servers/registry_servicer.py +0 -456
- digitalkin/grpc_servers/utils/factory.py +0 -180
- digitalkin/modules/job_manager/single_job_manager.py +0 -294
- digitalkin/modules/job_manager/taskiq_job_manager.py +0 -290
- digitalkin-0.2.25rc0.dist-info/RECORD +0 -89
- /digitalkin/{grpc_servers/utils → models/grpc_servers}/types.py +0 -0
- {digitalkin-0.2.25rc0.dist-info → digitalkin-0.3.2.dev14.dist-info}/WHEEL +0 -0
- {digitalkin-0.2.25rc0.dist-info → digitalkin-0.3.2.dev14.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: digitalkin
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.3.2.dev14
|
|
4
4
|
Summary: SDK to build kin used in DigitalKin
|
|
5
5
|
Author-email: "DigitalKin.ai" <contact@digitalkin.ai>
|
|
6
6
|
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
|
@@ -452,36 +452,17 @@ Classifier: License :: Other/Proprietary License
|
|
|
452
452
|
Requires-Python: >=3.10
|
|
453
453
|
Description-Content-Type: text/markdown
|
|
454
454
|
License-File: LICENSE
|
|
455
|
-
Requires-Dist:
|
|
456
|
-
Requires-Dist: grpcio-health-checking>=1.
|
|
457
|
-
Requires-Dist: grpcio-reflection>=1.
|
|
458
|
-
Requires-Dist: grpcio-status>=1.
|
|
459
|
-
Requires-Dist: pydantic>=2.
|
|
460
|
-
|
|
461
|
-
Requires-Dist: typos>=1.34.0; extra == "dev"
|
|
462
|
-
Requires-Dist: ruff>=0.12.5; extra == "dev"
|
|
463
|
-
Requires-Dist: mypy>=1.17.0; extra == "dev"
|
|
464
|
-
Requires-Dist: pyright>=1.1.403; extra == "dev"
|
|
465
|
-
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
|
|
466
|
-
Requires-Dist: bump2version>=1.0.1; extra == "dev"
|
|
467
|
-
Requires-Dist: build>=1.3.0; extra == "dev"
|
|
468
|
-
Requires-Dist: twine>=6.1.0; extra == "dev"
|
|
469
|
-
Requires-Dist: cryptography>=45.0.5; extra == "dev"
|
|
470
|
-
Provides-Extra: examples
|
|
471
|
-
Requires-Dist: openai>=1.75.0; extra == "examples"
|
|
472
|
-
Provides-Extra: tests
|
|
473
|
-
Requires-Dist: freezegun>=1.5.3; extra == "tests"
|
|
474
|
-
Requires-Dist: hdrhistogram>=0.10.3; extra == "tests"
|
|
475
|
-
Requires-Dist: grpcio-testing>=1.71.0; extra == "tests"
|
|
476
|
-
Requires-Dist: psutil>=7.0.0; extra == "tests"
|
|
477
|
-
Requires-Dist: pytest>=8.4.0; extra == "tests"
|
|
478
|
-
Requires-Dist: pytest-asyncio>=1.1.0; extra == "tests"
|
|
479
|
-
Requires-Dist: pytest-cov>=6.1.0; extra == "tests"
|
|
455
|
+
Requires-Dist: agentic-mesh-protocol==0.2.1.dev0
|
|
456
|
+
Requires-Dist: grpcio-health-checking>=1.76.0
|
|
457
|
+
Requires-Dist: grpcio-reflection>=1.76.0
|
|
458
|
+
Requires-Dist: grpcio-status>=1.76.0
|
|
459
|
+
Requires-Dist: pydantic>=2.12.5
|
|
460
|
+
Requires-Dist: surrealdb>=1.0.7
|
|
480
461
|
Provides-Extra: taskiq
|
|
481
|
-
Requires-Dist: rstream>=0.
|
|
482
|
-
Requires-Dist: taskiq-aio-pika>=0.
|
|
483
|
-
Requires-Dist: taskiq-redis>=1.
|
|
484
|
-
Requires-Dist: taskiq[reload]>=0.
|
|
462
|
+
Requires-Dist: rstream>=0.40.0; extra == "taskiq"
|
|
463
|
+
Requires-Dist: taskiq-aio-pika>=0.5.0; extra == "taskiq"
|
|
464
|
+
Requires-Dist: taskiq-redis>=1.2.0; extra == "taskiq"
|
|
465
|
+
Requires-Dist: taskiq[reload]>=0.12.1; extra == "taskiq"
|
|
485
466
|
Dynamic: license-file
|
|
486
467
|
|
|
487
468
|
# DigitalKin Python SDK
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
base_server/__init__.py,sha256=gs8t9Dg0dNVHRdYYbEQY8bn8tzEUv2zE6eBhKNPG3kU,88
|
|
2
|
+
base_server/server_async_insecure.py,sha256=VkOj_v_lDA5QfZi34goVGExf4t03_HfqrntcUC4VwfA,3894
|
|
3
|
+
base_server/server_async_secure.py,sha256=6JFlvs53aAGjgC1uDA3rjA9brBDbnj_tkyOiarVOZfA,4691
|
|
4
|
+
base_server/server_sync_insecure.py,sha256=Z9PUywCOr4gJTZWJ4UxunazKL1t9l4GoW0w7lNr94A8,3133
|
|
5
|
+
base_server/server_sync_secure.py,sha256=BhzXtrT3zFUocq05EReDyhX40ty5oW8RterHV5Pyl40,3945
|
|
6
|
+
base_server/mock/__init__.py,sha256=YZFT-F1l_TpvJYuIPX-7kTeE1CfOjhx9YmNRXVoi-jQ,143
|
|
7
|
+
base_server/mock/mock_pb2.py,sha256=sETakcS3PAAm4E-hTCV1jIVaQTPEAIoVVHupB8Z_k7Y,1843
|
|
8
|
+
base_server/mock/mock_pb2_grpc.py,sha256=BbOT70H6q3laKgkHfOx1QdfmCS_HxCY4wCOX84YAdG4,3180
|
|
9
|
+
digitalkin/__init__.py,sha256=7LLBAba0th-3SGqcpqFO-lopWdUkVLKzLZiMtB-mW3M,162
|
|
10
|
+
digitalkin/__version__.py,sha256=tx0UO-z3MMklNvXWALLHn-_8akwd6_mCkqJ81h4kFg0,196
|
|
11
|
+
digitalkin/logger.py,sha256=8ze_tjt2G6mDTuQcsf7-UTXWP3UHZ7LZVSs_iqF4rX4,4685
|
|
12
|
+
digitalkin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
digitalkin/core/__init__.py,sha256=FJRcJ-B1Viyn-38L8XpOpZ8KOnf1I7PCDOAmKXLQhqc,71
|
|
14
|
+
digitalkin/core/common/__init__.py,sha256=Gh2eJAJRnrUE93jSEfG7r0nb01Xh1kSkNL6nEpfzK_s,218
|
|
15
|
+
digitalkin/core/common/factories.py,sha256=mV6SmXXrZxzIQ7DLdDtPdjapSDZt5Ua-nBIDsozs_Vk,5047
|
|
16
|
+
digitalkin/core/job_manager/__init__.py,sha256=gGtgQpE6vbBHxAj1SYMbcpj45Q6x8IcsqnyQPfyZZ-8,25
|
|
17
|
+
digitalkin/core/job_manager/base_job_manager.py,sha256=fRnoR74uduImGYOKj4kZ5bo0xv9hrXSCUuq0NHfDpPE,10089
|
|
18
|
+
digitalkin/core/job_manager/single_job_manager.py,sha256=xOgl8HNUpfd_OPmoJpUt8hJznxDTeUzFpEFBRgEYzp4,14464
|
|
19
|
+
digitalkin/core/job_manager/taskiq_broker.py,sha256=ORGg2QSLDaWiCqie8ZGkbcDq7LDuWWSx7hg-SoUv99E,11544
|
|
20
|
+
digitalkin/core/job_manager/taskiq_job_manager.py,sha256=d23iylsc2RUvoE95VxZWa5Kb_yqptMOF63l7MDtuZtk,21264
|
|
21
|
+
digitalkin/core/task_manager/__init__.py,sha256=k9i-qIoee_1yXogyQolaVFDUQBIZU3ENbYKtjrCNmTQ,31
|
|
22
|
+
digitalkin/core/task_manager/base_task_manager.py,sha256=ahkflSul07hMAWRX22CoJf9FxpQhWzi_oKZz3YAN6lc,19416
|
|
23
|
+
digitalkin/core/task_manager/local_task_manager.py,sha256=Z1gv4dCGD32LBSfMZJ4dGyYDe80lZRAyowTgGC6E4Vk,3534
|
|
24
|
+
digitalkin/core/task_manager/remote_task_manager.py,sha256=zgccmnwwtB0nyeIZlL5Ji8SY1J89z_vjA4JD9ur7HzY,3082
|
|
25
|
+
digitalkin/core/task_manager/surrealdb_repository.py,sha256=a22FblutOYbtWtoh0SEqNIm_f6it3XkRReyBBLqy6Qk,9874
|
|
26
|
+
digitalkin/core/task_manager/task_executor.py,sha256=8xh5_1zuRAaGZIH_gWyNsA4T7YYaF0sl51dLS8a6aAk,10981
|
|
27
|
+
digitalkin/core/task_manager/task_session.py,sha256=5jw21bT_SPXUzWE7tk6YG62EXqlRJcrSakFXDFDRy28,12730
|
|
28
|
+
digitalkin/grpc_servers/__init__.py,sha256=ZIRMJ1Lcas8yQ106GCup6hn2UBOsx1sNk8ap0lpEDnY,72
|
|
29
|
+
digitalkin/grpc_servers/_base_server.py,sha256=ZVeCDwI7w7fFbPTXPkeJb_SOuLfd2T7za3T4oCu2UWY,18680
|
|
30
|
+
digitalkin/grpc_servers/module_server.py,sha256=Ec3izzV2YpdN8rGs_cX-iVulQ00FkLR5dBflHlQ8a6Y,7849
|
|
31
|
+
digitalkin/grpc_servers/module_servicer.py,sha256=7GQOyAPYMxHVaJGplgDNiVoKr1oaAIL-zdZpyDpznTA,20530
|
|
32
|
+
digitalkin/grpc_servers/utils/__init__.py,sha256=ZnAIb_F8z4NhtPypqkdmzgRSzolKnJTk3oZx5GfWH5Y,38
|
|
33
|
+
digitalkin/grpc_servers/utils/exceptions.py,sha256=LtaDtlqXCeT6iqApogs4pbtezotOVeg4fhnFzGBvFsY,692
|
|
34
|
+
digitalkin/grpc_servers/utils/grpc_client_wrapper.py,sha256=nGG8QdKnBH0UG9qbKrlPwIvcvPgW3osw7O3cImxisPE,3279
|
|
35
|
+
digitalkin/grpc_servers/utils/grpc_error_handler.py,sha256=0wPEU4713_ZlgIilaeXJV2bi90tHwYO1myDrSLeenKk,1848
|
|
36
|
+
digitalkin/grpc_servers/utils/utility_schema_extender.py,sha256=UCJR5YAKA_Wg5Q9feInf4AZW6AVtSQZYRZuMsaEgZVo,3775
|
|
37
|
+
digitalkin/mixins/__init__.py,sha256=d6ljaoyJZJT9XxOrXZG5FVNvbLURb3_CZrkp4GPZWYM,590
|
|
38
|
+
digitalkin/mixins/base_mixin.py,sha256=uLkg6MbDtVc9DysjdfNIGKahxQLnnjuL3DYpuyNLbk8,486
|
|
39
|
+
digitalkin/mixins/callback_mixin.py,sha256=90nHm9-pbKT14GAy3CB3fsBtpYu5IH0woOQdNLM2e_Y,836
|
|
40
|
+
digitalkin/mixins/chat_history_mixin.py,sha256=SqCmnh6Ybed3TQoQbvUjbzwKs_evvfW_lr4j_Uncg0A,4231
|
|
41
|
+
digitalkin/mixins/cost_mixin.py,sha256=nFqhLsRHdXAt3GOH6qI8sqX9KW3leTPW3gaclensBVw,2274
|
|
42
|
+
digitalkin/mixins/file_history_mixin.py,sha256=5MgxglccVe11M7YnoeuXbJYXNEwVZdiGd5Fl8sytcTM,3504
|
|
43
|
+
digitalkin/mixins/filesystem_mixin.py,sha256=Q1sEY_dKZVi2Sa21fypwpsz9h7uQ7ggVqzpuVgheF_o,1510
|
|
44
|
+
digitalkin/mixins/logger_mixin.py,sha256=l-SK3qACIzRfyHgj7KhzvW3ZhmVa-W1JB9tmppgpqg4,1842
|
|
45
|
+
digitalkin/mixins/storage_mixin.py,sha256=ptZ4a2bydIa48q0V9e395vWHTu7yw4A6rI4jwKY6gwI,2392
|
|
46
|
+
digitalkin/models/__init__.py,sha256=xK0YGXsHI4ghGzIURRhIRYYM3sxbnOsk9UeMXdl5l-o,170
|
|
47
|
+
digitalkin/models/core/__init__.py,sha256=jOMDmPX0uSfGA9zUi0u_kOvYJ46VdIssoIhVYvNSeew,19
|
|
48
|
+
digitalkin/models/core/job_manager_models.py,sha256=wvf2dzRzAu0-zzzAXQe6XTC36cNA10sXRLt2p_TFqjk,1003
|
|
49
|
+
digitalkin/models/core/task_monitor.py,sha256=CW-jydSgXMV464W0pqfar0HpgqlSxqdujmC-f8p9EQc,2639
|
|
50
|
+
digitalkin/models/grpc_servers/__init__.py,sha256=0tA71nPSXgRrh9DoLvx-TSwZXdYIRUEItoadpTL1cTo,42
|
|
51
|
+
digitalkin/models/grpc_servers/models.py,sha256=gRX94eL71a5mLIie-lCOwE7a0As_AuGduxPPzTHbAe4,13797
|
|
52
|
+
digitalkin/models/grpc_servers/types.py,sha256=rQ78s4nAet2jy-NIDj_PUWriT0kuGHr_w6ELjmjgBao,539
|
|
53
|
+
digitalkin/models/module/__init__.py,sha256=N55wan3rAUVPEGLIDjXoFM_-DYY_zxvbQOZHzNDfwoY,751
|
|
54
|
+
digitalkin/models/module/base_types.py,sha256=oIylVNqo0idTFj4dRgCt7P19daNZ-AlvgCPpL9TJvto,1850
|
|
55
|
+
digitalkin/models/module/module.py,sha256=k0W8vfJJFth8XdDzkHm32SyTuSf3h2qF0hSrxAfGF1s,956
|
|
56
|
+
digitalkin/models/module/module_context.py,sha256=qpjyMYgTCyQS0lW2RhTKZsoQKwFpv6l08FIM0sqC6DQ,10326
|
|
57
|
+
digitalkin/models/module/module_types.py,sha256=C9azCNBk76xMa-Mww8_6AiwQR8MLAsEyUOvBYxytovI,739
|
|
58
|
+
digitalkin/models/module/setup_types.py,sha256=XMKyDm-7n_Za9tDBv1AkgXUowlUj46SMxWANa_yg_LU,18311
|
|
59
|
+
digitalkin/models/module/tool_cache.py,sha256=RP3JwASV8dFUZEKudyALbu0_tq81lstuEc4QHMQpmvM,2073
|
|
60
|
+
digitalkin/models/module/tool_reference.py,sha256=6GhLQC4pqCV3b7Nmm0mr0TZC13RDHIUOm1J-pIdWsmo,3479
|
|
61
|
+
digitalkin/models/module/utility.py,sha256=gnbYfWpXGbomUI0fWf7T-Qm_VvT-LXDv1OuA9zObwVg,5589
|
|
62
|
+
digitalkin/models/services/__init__.py,sha256=jhfVw6egq0OcHmos_fypH9XFehbHTBw09wluVFVFEyw,226
|
|
63
|
+
digitalkin/models/services/cost.py,sha256=9PXvd5RrIk9vCrRjcUGQ9ZyAokEbwLg4s0RfnE-aLP4,1616
|
|
64
|
+
digitalkin/models/services/registry.py,sha256=hz_r03-K633XHu2fOb5HWsE59EPFusBBipy0Gz6OBvI,705
|
|
65
|
+
digitalkin/models/services/storage.py,sha256=wp7F-AvTsU46ujGPcguqM5kUKRZx4399D4EGAAJt2zs,1143
|
|
66
|
+
digitalkin/modules/__init__.py,sha256=vTQk8DWopxQSJ17BjE5dNhq247Rou55iQLJdBxoPUmo,296
|
|
67
|
+
digitalkin/modules/_base_module.py,sha256=4-fS376f9ti3xSgM946yRccHcEGttdo2QYKaxdqk1kY,22451
|
|
68
|
+
digitalkin/modules/archetype_module.py,sha256=XC9tl1Yr6QlbPn_x0eov6UUZwQgwW--BYPPMYVJH_NU,505
|
|
69
|
+
digitalkin/modules/tool_module.py,sha256=GBis7bKCkvWFCYLRvaS9oZVmLBBve1w8BhVnKOU2sCc,506
|
|
70
|
+
digitalkin/modules/trigger_handler.py,sha256=qPNMi-8NHqscOxciHeaXtpwjXApT3YzjMF23zQAjaZY,1770
|
|
71
|
+
digitalkin/modules/triggers/__init__.py,sha256=OKzUWqlnm9wzAAvztPocSK36i69giWEQnxn0hbdfCsM,323
|
|
72
|
+
digitalkin/modules/triggers/healthcheck_ping_trigger.py,sha256=fQjfOB_NMPocISXAT8rlk896_pXIY8v0op0JhZNv_G0,1558
|
|
73
|
+
digitalkin/modules/triggers/healthcheck_services_trigger.py,sha256=TpPw5XTnw3Bt9VCoFXQ_V-SIAR8LMoJmDGiyegWW6To,2286
|
|
74
|
+
digitalkin/modules/triggers/healthcheck_status_trigger.py,sha256=rozWQWvO7a2ZTg8BjFCyEWeAai5vdbi7BBwu0vR5jv8,1768
|
|
75
|
+
digitalkin/services/__init__.py,sha256=DugdZZ3uKXFsA5C-DuP41ssGegU1FybI3HQcW_Se4bk,1101
|
|
76
|
+
digitalkin/services/base_strategy.py,sha256=yA9KUJGRKuuaxA6l3GcMv8zKfWoIsW03UxJT80Yea2I,766
|
|
77
|
+
digitalkin/services/services_config.py,sha256=rz1cJdO_dfUN3kwOQ40XRSE4ZH3mgM43vXka94gjymY,8689
|
|
78
|
+
digitalkin/services/services_models.py,sha256=Cb-ajJxHlEOQmoylMCfNdN08T6IOmMLXHrAZ6pxprrQ,1855
|
|
79
|
+
digitalkin/services/agent/__init__.py,sha256=vJc8JN0pdtA8ecypLBeHrwAUIW6H2C8NyW-dk24rTpk,244
|
|
80
|
+
digitalkin/services/agent/agent_strategy.py,sha256=42Q9RciHX6tg3CgDQkbrlIx4h_TX0WIuSpLmCjitVmA,492
|
|
81
|
+
digitalkin/services/agent/default_agent.py,sha256=4N_E_eQxJGOx1KVUUg5jNOje-3ncMxF3ePB-uDuGrJc,345
|
|
82
|
+
digitalkin/services/communication/__init__.py,sha256=YbRjrg_BbNURgS56SlXSCzRBvyUELGgrIkuX19eA1f8,408
|
|
83
|
+
digitalkin/services/communication/communication_strategy.py,sha256=u35O-al9LQxiORM9ZrGeHrBtT7CegtCsMwGdwvu2MlQ,2335
|
|
84
|
+
digitalkin/services/communication/default_communication.py,sha256=zBExaitUxpuIyoWANdx5JHY9pHDRnSffTiHLvU5QqwY,3166
|
|
85
|
+
digitalkin/services/communication/grpc_communication.py,sha256=I78vlWlvn4ACTgOiUedgksApQvX2v1_FkitAGwSgCjs,8023
|
|
86
|
+
digitalkin/services/cost/__init__.py,sha256=sD_a5LrnLluASOC5m5vgIqjaco-MzZJd6XhillIBHr0,400
|
|
87
|
+
digitalkin/services/cost/cost_strategy.py,sha256=MpPX33P_S5b2by6F4zT-rcyeRuh2V4NYPZe05VpDOGQ,2649
|
|
88
|
+
digitalkin/services/cost/default_cost.py,sha256=XE7kNFde8NmbulU9m1lc3mi-vHFkbaJf0XHUc0D4UHE,3945
|
|
89
|
+
digitalkin/services/cost/grpc_cost.py,sha256=2xJ3baTNubCnawpbNftTuFVnPpDZPouSrUWe1cVlInE,5272
|
|
90
|
+
digitalkin/services/filesystem/__init__.py,sha256=BhwMl_BUvM0d65fmglkp0SVwn3RfYiUOKJgIMnOCaGM,381
|
|
91
|
+
digitalkin/services/filesystem/default_filesystem.py,sha256=WQbU-Bsi9r-28VqhKbrplce3otzjSKS-5iqKEpGWdQU,15117
|
|
92
|
+
digitalkin/services/filesystem/filesystem_strategy.py,sha256=zibVLvX_IBQ-kgh-KYzHdszDeiHFPEAZszu_k99x1GQ,9487
|
|
93
|
+
digitalkin/services/filesystem/grpc_filesystem.py,sha256=9Cjp4ie-mJ2EMMZ8DjCqeV6S6CiS_gwWalGoeCAusEk,12137
|
|
94
|
+
digitalkin/services/identity/__init__.py,sha256=InkeyLgFYYwItx8mePA8HpfacOMWZwwuc0G4pWtKq9s,270
|
|
95
|
+
digitalkin/services/identity/default_identity.py,sha256=Y2auZHrGSZTIN5D8HyjLvLcNbYFM1CNUE23x7p5VIGw,386
|
|
96
|
+
digitalkin/services/identity/identity_strategy.py,sha256=skappBbds1_qa0Gr24FGrNX1N0_OYhYT1Lh7dUaAirE,429
|
|
97
|
+
digitalkin/services/registry/__init__.py,sha256=WPGQM3U-QvMXhsaOy9BN0kVMU3QkPFwAMT3lGmTR-Ko,835
|
|
98
|
+
digitalkin/services/registry/default_registry.py,sha256=tOqw9Ve9w_BzhqrZmHuUl5Ps-J_KTEwYg3tu1gNIHmw,4258
|
|
99
|
+
digitalkin/services/registry/exceptions.py,sha256=tAcVXioCzDqfBvxB_P0uQpaK_LDLrFb0KpymROuqs-8,1371
|
|
100
|
+
digitalkin/services/registry/grpc_registry.py,sha256=2_He-I9I4SXdjYA9QYxFWQrr_xBao6LIYXsgiICkeHY,10822
|
|
101
|
+
digitalkin/services/registry/registry_models.py,sha256=DJEwMJg5_BewpgHDtY8xIGWj9jA9H07iYgHLCv81giY,331
|
|
102
|
+
digitalkin/services/registry/registry_strategy.py,sha256=N6oLxMwnYkM_XVW7WDxZoSfFafjUtsFDig3F8VQZj7Q,2745
|
|
103
|
+
digitalkin/services/setup/__init__.py,sha256=t6xcvEWqTbcRZstBFK9cESEqaZKvpW14VtYygxIqfYQ,65
|
|
104
|
+
digitalkin/services/setup/default_setup.py,sha256=zTG9Nvw3Tqy9qctSEnjWE4Mlqol321AUaTlIm6Jl1k0,8195
|
|
105
|
+
digitalkin/services/setup/grpc_setup.py,sha256=aEAHiG0WSzNSQtJjn7xAGQwj70b0HrFO8GBKFXRx3aI,13925
|
|
106
|
+
digitalkin/services/setup/setup_strategy.py,sha256=ZnJ_HwWCkHCPrqKekSD5L9y3p8wMwfjQ8sj2hLZq6go,4004
|
|
107
|
+
digitalkin/services/snapshot/__init__.py,sha256=Uzlnzo0CYlSpVsdiI37hW7xQk8hu3YA1fOI6O6MSzB0,270
|
|
108
|
+
digitalkin/services/snapshot/default_snapshot.py,sha256=Mb8QwWRsHh9I_tN0ln_ZiFa1QCZxOVWmuVLemQOTWpc,1058
|
|
109
|
+
digitalkin/services/snapshot/snapshot_strategy.py,sha256=B1TU3V_k9A-OdqBkdyc41-ihnrW5Btcwd1KyQdHT46A,898
|
|
110
|
+
digitalkin/services/storage/__init__.py,sha256=T-ocYLLphudkQgzvG47jBOm5GQsRFRIGA88y7Ur4akg,341
|
|
111
|
+
digitalkin/services/storage/default_storage.py,sha256=D8e-UYUkb2GvDEHMWcN3EkcIKXWA8DrsaQsXVjoXAYQ,7975
|
|
112
|
+
digitalkin/services/storage/grpc_storage.py,sha256=c6HWDEI3lr6NO9HHSTBpRhZ7h0qqMBIBCMnjjj4e2c4,7200
|
|
113
|
+
digitalkin/services/storage/storage_strategy.py,sha256=sERF5tIJnzpb1iNqTXic9xRkGaXMifo6kb709ubB-Yo,8848
|
|
114
|
+
digitalkin/services/user_profile/__init__.py,sha256=RKEZCsgCHS7fmswhWgUoQd6vZ_1pYnRqERoF8fmu7jw,434
|
|
115
|
+
digitalkin/services/user_profile/default_user_profile.py,sha256=46DH_VBCHKXJVyagVcc8kH5sLwRK54Fe_0ahqYJ1maA,1847
|
|
116
|
+
digitalkin/services/user_profile/grpc_user_profile.py,sha256=xDiUC5Ceofa6QtGPmqJV3ik5j8HDHc1zxtpia49rlRw,2780
|
|
117
|
+
digitalkin/services/user_profile/user_profile_strategy.py,sha256=CH8kT__1MUwA21k5djjmB5ZZ6pYg57OWbe_7owBCgwU,681
|
|
118
|
+
digitalkin/utils/__init__.py,sha256=gDoEk5CP8tiBmIq-38aPhIMlnDUiqRrduuVXhpSPQnc,541
|
|
119
|
+
digitalkin/utils/arg_parser.py,sha256=wzscRlE1Qp1gGl-lAJlkkwnbU1O2oezj6BwK_BZFBIk,3158
|
|
120
|
+
digitalkin/utils/development_mode_action.py,sha256=2hznh0ajW_4ZTysfoc0Y49161f_PQPATRgNk8NAn1_o,1623
|
|
121
|
+
digitalkin/utils/dynamic_schema.py,sha256=5-B3dBGlCYYv6uRJkgudtc0ZpBOTYxl0yKedDGsteZQ,15184
|
|
122
|
+
digitalkin/utils/llm_ready_schema.py,sha256=JjMug_lrQllqFoanaC091VgOqwAd-_YzcpqFlS7p778,2375
|
|
123
|
+
digitalkin/utils/package_discover.py,sha256=sa6Zp5Kape1Zr4iYiNrnZxiHDnqM06ODk6yfWHom53w,13465
|
|
124
|
+
digitalkin/utils/schema_splitter.py,sha256=KMvYRHDHlwdhh_c6FJxkWvLStZo9Kbj-jd3pIGPZfxk,9317
|
|
125
|
+
digitalkin-0.3.2.dev14.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
|
|
126
|
+
modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
127
|
+
modules/archetype_with_tools_module.py,sha256=PXTS6IXmC_OjxTmVrL_pYVI0MKwXjD5I1UJO_2xa10Q,7632
|
|
128
|
+
modules/cpu_intensive_module.py,sha256=GZlirQDZdYuXrI46sv1q4RNAHZjL4EptHVQTvgK9zz8,8363
|
|
129
|
+
modules/dynamic_setup_module.py,sha256=tKvUWZdlYZkfAgKR0mLuFcLiFGKpVgpsz10LeJ6B2QI,11410
|
|
130
|
+
modules/minimal_llm_module.py,sha256=N9aIzZQI-miyH4AB4xTmGHpMvdSLnYyXNOD4Z3YFzis,11216
|
|
131
|
+
modules/text_transform_module.py,sha256=MfhI_Ki1U6qk379ne6oazNEu4PhO4R3cRezEcr0nGPw,7251
|
|
132
|
+
monitoring/digitalkin_observability/__init__.py,sha256=PXG4xbMbmiVNkIaVG899H9CHvcld7c0bSbaLHqKeDeo,1247
|
|
133
|
+
monitoring/digitalkin_observability/http_server.py,sha256=kFbWFQvaqq2VVwwqDozV0pRPe7RkAXsa9xCWruMlOyk,4527
|
|
134
|
+
monitoring/digitalkin_observability/interceptors.py,sha256=Sx6o0s8FSMfIGKVAtjVl7l-sIygP45od6eITl7DroBU,6219
|
|
135
|
+
monitoring/digitalkin_observability/metrics.py,sha256=XhVRE8y6tbzJqxIzEHa5MT3I0k3hgpxjzZf_R6SyjbQ,7553
|
|
136
|
+
monitoring/digitalkin_observability/prometheus.py,sha256=gDmM9ySaVwPAe7Yg84pLxmEKu0Cudezi8pK3RtqWs6g,5457
|
|
137
|
+
monitoring/tests/test_metrics.py,sha256=ugnYfAwqBPO6zA8z4afKTlyBWECTivacYSN-URQCn2E,5856
|
|
138
|
+
services/filesystem_module.py,sha256=U4dgqtuDadaXz8PJ1d_uQ_1EPncBqudAQCLUICF9yL4,7421
|
|
139
|
+
services/storage_module.py,sha256=Wz2MzLvqs2D_bnBBgtnujYcAKK2V2KFMk8K21RoepSE,6972
|
|
140
|
+
digitalkin-0.3.2.dev14.dist-info/METADATA,sha256=03YpSbukSbDTJwmfICpNbhT_10U739n0pJL7vJgxk1A,29725
|
|
141
|
+
digitalkin-0.3.2.dev14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
142
|
+
digitalkin-0.3.2.dev14.dist-info/top_level.txt,sha256=AYVIesKrO0jnedQ-Muog9JBehG81WeTCNeOFoJgwsgE,51
|
|
143
|
+
digitalkin-0.3.2.dev14.dist-info/RECORD,,
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"""Example archetype module with tool cache integration."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import Any, ClassVar, Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
from digitalkin.models.grpc_servers.models import ClientConfig, SecurityMode, ServerMode
|
|
9
|
+
from digitalkin.models.module.module_context import ModuleContext
|
|
10
|
+
from digitalkin.models.module.setup_types import SetupModel
|
|
11
|
+
from digitalkin.models.module.tool_reference import (
|
|
12
|
+
ToolReference,
|
|
13
|
+
ToolReferenceConfig,
|
|
14
|
+
ToolSelectionMode,
|
|
15
|
+
)
|
|
16
|
+
from digitalkin.modules._base_module import BaseModule # noqa: PLC2701
|
|
17
|
+
from digitalkin.services.services_models import ServicesStrategy
|
|
18
|
+
|
|
19
|
+
logging.basicConfig(
|
|
20
|
+
level=logging.DEBUG,
|
|
21
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
22
|
+
)
|
|
23
|
+
logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MessageInputPayload(BaseModel):
|
|
27
|
+
"""Message input payload."""
|
|
28
|
+
|
|
29
|
+
payload_type: Literal["message"] = "message"
|
|
30
|
+
user_prompt: str
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ArchetypeInput(BaseModel):
|
|
34
|
+
"""Archetype input."""
|
|
35
|
+
|
|
36
|
+
payload: MessageInputPayload = Field(discriminator="payload_type")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class MessageOutputPayload(BaseModel):
|
|
40
|
+
"""Message output payload."""
|
|
41
|
+
|
|
42
|
+
payload_type: Literal["message"] = "message"
|
|
43
|
+
response: str
|
|
44
|
+
tools_used: list[str] = Field(default_factory=list)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ArchetypeOutput(BaseModel):
|
|
48
|
+
"""Archetype output."""
|
|
49
|
+
|
|
50
|
+
payload: MessageOutputPayload = Field(discriminator="payload_type")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ArchetypeSetup(SetupModel):
|
|
54
|
+
"""Setup with tool references resolved during config setup."""
|
|
55
|
+
|
|
56
|
+
model_name: str = Field(
|
|
57
|
+
default="gpt-4",
|
|
58
|
+
json_schema_extra={"config": True},
|
|
59
|
+
)
|
|
60
|
+
temperature: float = Field(
|
|
61
|
+
default=0.7,
|
|
62
|
+
json_schema_extra={"config": True},
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
search_tool: ToolReference = Field(
|
|
66
|
+
default_factory=lambda: ToolReference(
|
|
67
|
+
config=ToolReferenceConfig(
|
|
68
|
+
mode=ToolSelectionMode.FIXED,
|
|
69
|
+
module_id="search-tool-v1",
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
json_schema_extra={"config": True},
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
calculator_tool: ToolReference = Field(
|
|
76
|
+
default_factory=lambda: ToolReference(
|
|
77
|
+
config=ToolReferenceConfig(
|
|
78
|
+
mode=ToolSelectionMode.TAG,
|
|
79
|
+
tag="math-calculator",
|
|
80
|
+
)
|
|
81
|
+
),
|
|
82
|
+
json_schema_extra={"config": True},
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
dynamic_tool: ToolReference = Field(
|
|
86
|
+
default_factory=lambda: ToolReference(
|
|
87
|
+
config=ToolReferenceConfig(
|
|
88
|
+
mode=ToolSelectionMode.DISCOVERABLE,
|
|
89
|
+
)
|
|
90
|
+
),
|
|
91
|
+
json_schema_extra={"config": True},
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
system_prompt: str = Field(
|
|
95
|
+
default="You are a helpful assistant with access to tools.",
|
|
96
|
+
json_schema_extra={"hidden": True},
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class ArchetypeConfigSetup(BaseModel):
|
|
101
|
+
"""Config setup model."""
|
|
102
|
+
|
|
103
|
+
additional_instructions: str | None = None
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class ArchetypeSecret(BaseModel):
|
|
107
|
+
"""Secrets model."""
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
client_config = ClientConfig(
|
|
111
|
+
host="[::]",
|
|
112
|
+
port=50152,
|
|
113
|
+
mode=ServerMode.ASYNC,
|
|
114
|
+
security=SecurityMode.INSECURE,
|
|
115
|
+
credentials=None,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class ArchetypeWithToolsModule(
|
|
120
|
+
BaseModule[
|
|
121
|
+
ArchetypeInput,
|
|
122
|
+
ArchetypeOutput,
|
|
123
|
+
ArchetypeSetup,
|
|
124
|
+
ArchetypeSecret,
|
|
125
|
+
]
|
|
126
|
+
):
|
|
127
|
+
"""Archetype module demonstrating tool cache usage."""
|
|
128
|
+
|
|
129
|
+
name = "ArchetypeWithToolsModule"
|
|
130
|
+
description = "Archetype with tool cache integration"
|
|
131
|
+
|
|
132
|
+
config_setup_format = ArchetypeConfigSetup
|
|
133
|
+
input_format = ArchetypeInput
|
|
134
|
+
output_format = ArchetypeOutput
|
|
135
|
+
setup_format = ArchetypeSetup
|
|
136
|
+
secret_format = ArchetypeSecret
|
|
137
|
+
|
|
138
|
+
metadata: ClassVar[dict[str, Any]] = {
|
|
139
|
+
"name": "ArchetypeWithToolsModule",
|
|
140
|
+
"version": "1.0.0",
|
|
141
|
+
"tags": ["archetype", "tools"],
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
services_config_strategies: ClassVar[dict[str, ServicesStrategy | None]] = {}
|
|
145
|
+
services_config_params: ClassVar[dict[str, dict[str, Any | None] | None]] = {
|
|
146
|
+
"registry": {
|
|
147
|
+
"config": {},
|
|
148
|
+
"client_config": client_config,
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async def run_config_setup(
|
|
153
|
+
self,
|
|
154
|
+
context: ModuleContext, # noqa: ARG002
|
|
155
|
+
config_setup_data: ArchetypeSetup,
|
|
156
|
+
) -> ArchetypeSetup:
|
|
157
|
+
"""Custom config setup logic, runs in parallel with tool resolution.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
context: Module context with services.
|
|
161
|
+
config_setup_data: Setup data being configured.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Configured setup data.
|
|
165
|
+
"""
|
|
166
|
+
logger.info("Running config setup for %s", self.name)
|
|
167
|
+
return config_setup_data
|
|
168
|
+
|
|
169
|
+
async def initialize(self, context: ModuleContext, setup_data: ArchetypeSetup) -> None: # noqa: ARG002
|
|
170
|
+
"""Initialize module.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
context: Module context with services and tool cache.
|
|
174
|
+
setup_data: Setup data for the module.
|
|
175
|
+
"""
|
|
176
|
+
logger.info("Initializing %s", self.name)
|
|
177
|
+
if context.tool_cache:
|
|
178
|
+
logger.info("Available tools: %s", context.tool_cache.list_tools())
|
|
179
|
+
|
|
180
|
+
async def run(
|
|
181
|
+
self,
|
|
182
|
+
input_data: ArchetypeInput,
|
|
183
|
+
setup_data: ArchetypeSetup, # noqa: ARG002
|
|
184
|
+
) -> None:
|
|
185
|
+
"""Run module with tool cache lookups and call_module_by_id.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
input_data: Input data to process.
|
|
189
|
+
setup_data: Setup configuration.
|
|
190
|
+
"""
|
|
191
|
+
logger.info("Running %s", self.name)
|
|
192
|
+
|
|
193
|
+
tools_used: list[str] = []
|
|
194
|
+
tool_results: list[str] = []
|
|
195
|
+
|
|
196
|
+
# Get search tool from cache and call via call_module_by_id
|
|
197
|
+
search_info = self.context.tool_cache.get("search_tool")
|
|
198
|
+
if search_info:
|
|
199
|
+
tools_used.append(f"search:{search_info.module_id}")
|
|
200
|
+
async for response in self.context.call_module_by_id(
|
|
201
|
+
module_id=search_info.module_id,
|
|
202
|
+
input_data={"query": input_data.payload.user_prompt},
|
|
203
|
+
setup_id=self.context.session.setup_id,
|
|
204
|
+
mission_id=self.context.session.mission_id,
|
|
205
|
+
):
|
|
206
|
+
tool_results.append(f"search_result: {response}")
|
|
207
|
+
|
|
208
|
+
# Get calculator tool from cache
|
|
209
|
+
calc_info = self.context.tool_cache.get("calculator_tool")
|
|
210
|
+
if calc_info:
|
|
211
|
+
tools_used.append(f"calculator:{calc_info.module_id}")
|
|
212
|
+
async for response in self.context.call_module_by_id(
|
|
213
|
+
module_id=calc_info.module_id,
|
|
214
|
+
input_data={"expression": "2 + 2"},
|
|
215
|
+
setup_id=self.context.session.setup_id,
|
|
216
|
+
mission_id=self.context.session.mission_id,
|
|
217
|
+
):
|
|
218
|
+
tool_results.append(f"calc_result: {response}")
|
|
219
|
+
|
|
220
|
+
# Dynamic discovery via registry fallback for tools not in cache
|
|
221
|
+
dynamic_info = self.context.tool_cache.get(
|
|
222
|
+
"some_dynamic_tool",
|
|
223
|
+
registry=self.context.registry,
|
|
224
|
+
)
|
|
225
|
+
if dynamic_info:
|
|
226
|
+
tools_used.append(f"dynamic:{dynamic_info.module_id}")
|
|
227
|
+
async for response in self.context.call_module_by_id(
|
|
228
|
+
module_id=dynamic_info.module_id,
|
|
229
|
+
input_data={"prompt": input_data.payload.user_prompt},
|
|
230
|
+
setup_id=self.context.session.setup_id,
|
|
231
|
+
mission_id=self.context.session.mission_id,
|
|
232
|
+
):
|
|
233
|
+
tool_results.append(f"dynamic_result: {response}")
|
|
234
|
+
|
|
235
|
+
response = MessageOutputPayload(
|
|
236
|
+
response=f"Processed: {input_data.payload.user_prompt} | Results: {len(tool_results)}",
|
|
237
|
+
tools_used=tools_used,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
await self.context.callbacks.send_message(ArchetypeOutput(payload=response))
|
|
241
|
+
|
|
242
|
+
async def cleanup(self) -> None:
|
|
243
|
+
"""Clean up resources."""
|
|
244
|
+
logger.info("Cleaning up %s", self.name)
|
modules/cpu_intensive_module.py
CHANGED
|
@@ -4,9 +4,9 @@ import logging
|
|
|
4
4
|
from collections.abc import Callable
|
|
5
5
|
from typing import Any, ClassVar, Literal
|
|
6
6
|
|
|
7
|
+
from digitalkin.grpc_servers.utils.models import ClientConfig, SecurityMode, ServerConfig, ServerMode
|
|
7
8
|
from pydantic import BaseModel, Field
|
|
8
9
|
|
|
9
|
-
from digitalkin.grpc_servers.utils.models import ClientConfig, SecurityMode, ServerConfig, ServerMode
|
|
10
10
|
from digitalkin.modules._base_module import BaseModule
|
|
11
11
|
from digitalkin.services.services_models import ServicesStrategy
|
|
12
12
|
from digitalkin.services.setup.setup_strategy import SetupData
|