dhenara-agent 0.1.0__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.
- dhenara_agent-0.1.0/MANIFEST.in +7 -0
- dhenara_agent-0.1.0/PKG-INFO +162 -0
- dhenara_agent-0.1.0/README.md +109 -0
- dhenara_agent-0.1.0/pyproject.toml +60 -0
- dhenara_agent-0.1.0/setup.cfg +4 -0
- dhenara_agent-0.1.0/setup.py +82 -0
- dhenara_agent-0.1.0/src/dhenara/agent/__init__.py +14 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/_base.py +302 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/_client.py +176 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/_stream.py +118 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/_urls.py +74 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/fns/__init__.py +1 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/fns/pydantic_endpoint.py +148 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/functional_types/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/functional_types/dhenara/__init__.py +17 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/functional_types/dhenara/_api_response/_devtime/_run_endpoint.py +143 -0
- dhenara_agent-0.1.0/src/dhenara/agent/client/types/functional_types/dhenara/_api_response/_runtime/_run_endpoint.py +37 -0
- dhenara_agent-0.1.0/src/dhenara/agent/config/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/config/_config.py +269 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/__init__.py +7 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/__init__.py +90 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/_component_registry.py +60 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/comp_exe_result.py +45 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/component.py +55 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/component_def.py +299 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/control.py +258 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/component/executor.py +334 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/context.py +473 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/context_registry.py +255 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/data/dad_template_engine.py +246 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/data/template_engine.py +746 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/defs.py +29 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/enums.py +60 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/executable.py +22 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/fns.py +23 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/_executor_registry.py +76 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node.py +54 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node_def.py +166 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node_exe_result.py +26 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node_executor.py +375 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node_io.py +49 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/node/node_settings.py +96 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/utils/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/base/utils/id_mixin.py +243 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/components/agent/__init__.py +10 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/components/agent/component.py +152 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/components/flow/__init__.py +29 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/components/flow/component.py +141 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/components/flow/node.py +32 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/events/__init__.py +2 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/events/event.py +123 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/events/event_bus.py +54 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/__init__.py +1 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/__init__.py +8 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/__init__.py +18 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/executor.py +613 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/input.py +24 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/node.py +19 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/output.py +27 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/settings.py +114 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/ai_model/tracing.py +153 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/__init__.py +17 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/executor.py +226 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/input.py +19 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/node.py +26 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/output.py +38 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/settings.py +34 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/command/tracing.py +69 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/__init__.py +5 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/enums.py +38 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/mixin/operations_mixin.py +179 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/types/__init__.py +26 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/types/file_operation.py +130 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/defs/types/folder_analyzer.py +300 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/__init__.py +18 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/executor.py +856 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/input.py +16 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/node.py +26 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/output.py +42 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/settings.py +66 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/file_operation/tracing.py +81 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/__init__.py +16 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/executor.py +1446 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/helpers/helper_fns.py +150 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/helpers/python_extractor.py +217 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/input.py +9 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/node.py +26 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/output.py +58 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/settings.py +43 -0
- dhenara_agent-0.1.0/src/dhenara/agent/dsl/inbuilt/flow_nodes/folder_analyzer/tracing.py +118 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/__init__.py +23 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/cli/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/cli/dashboard.py +34 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/config.py +49 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/__init__.py +6 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/_jaeger_with_docker.py +195 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/console_viewer.py +164 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/custom.py +393 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/dhenara/rerun_utils.py +36 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/jaeger/__init__.py +3 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/jaeger/jaeger.py +70 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/zipkin/__init__.py +3 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/dashboards/zipkin/zipkin.py +70 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/file/__init__.py +9 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/file/file_log_exporter.py +57 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/file/file_metric_exporter.py +69 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/file/file_span_exporter.py +60 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/jaeger/__init__.py +5 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/jaeger/jaeger_exporter.py +37 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/zipkin/__init__.py +5 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/exporters/zipkin/zipkin_exporter.py +37 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/logging.py +130 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/metrics.py +147 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/__init__.py +20 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/data/__init__.py +13 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/data/collector.py +195 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/data/profile.py +156 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/decorators/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/decorators/fns.py +475 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/decorators/fns2.py +269 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/tracing.py +112 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/tracing/tracing_log_handler.py +129 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/types/__init__.py +3 -0
- dhenara_agent-0.1.0/src/dhenara/agent/observability/types/settings.py +27 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/__init__.py +2 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/isolated_execution.py +55 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/registry/__init__.py +6 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/registry/_resource_registry.py +169 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/registry/registry.py +56 -0
- dhenara_agent-0.1.0/src/dhenara/agent/run/run_context.py +535 -0
- dhenara_agent-0.1.0/src/dhenara/agent/runner/__init__.py +7 -0
- dhenara_agent-0.1.0/src/dhenara/agent/runner/runner.py +172 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/base/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/base/_base_type.py +57 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/data/__init__.py +1 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/data/_run_env.py +16 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/platform/__init__.py +1 -0
- dhenara_agent-0.1.0/src/dhenara/agent/types/platform/_exceptions.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/git/__init__.py +4 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/git/gitbase.py +368 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/git/outcome_repository.py +191 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/git/repo_analyzer.py +1247 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/helpers/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/helpers/terminal/__init__.py +20 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/helpers/terminal/completion_helpers.py +9 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/helpers/terminal/node_input_helpers.py +376 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/io/artifact_manager.py +120 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/shared/__init__.py +1 -0
- dhenara_agent-0.1.0/src/dhenara/agent/utils/shared/_project.py +141 -0
- dhenara_agent-0.1.0/src/dhenara/cli/__init__.py +3 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/__deploy.py +96 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/__outputs.py +103 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/_print_utils.py +87 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/_utils.py +61 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/create.py +138 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/run.py +151 -0
- dhenara_agent-0.1.0/src/dhenara/cli/commands/startproject.py +216 -0
- dhenara_agent-0.1.0/src/dhenara/cli/main.py +44 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/agent/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/agent/agent.py +9 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/agent/flow.py +44 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/agent/handler.py +19 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/runner/__init__.py +0 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/runner/defs.py +21 -0
- dhenara_agent-0.1.0/src/dhenara/cli/templates/runner/runner.py +41 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/PKG-INFO +162 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/SOURCES.txt +175 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/dependency_links.txt +1 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/entry_points.txt +2 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/requires.txt +19 -0
- dhenara_agent-0.1.0/src/dhenara_agent.egg-info/top_level.txt +1 -0
- dhenara_agent-0.1.0/tests/test_client.py +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dhenara-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Dhenara Agent DSL (DAD) Framework SDK
|
|
5
|
+
Home-page: https://github.com/dhenara/dhenara-agent
|
|
6
|
+
Author: Dhenara
|
|
7
|
+
Author-email: support@dhenara.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://dhenara.com
|
|
10
|
+
Project-URL: Documentation, https://docs.dhenara.com/
|
|
11
|
+
Project-URL: Bug Reports, https://github.com/dhenara/dhenara-agent/issues
|
|
12
|
+
Project-URL: Source Code, https://github.com/dhenara/dhenara-agent
|
|
13
|
+
Keywords: ai,llm,machine learning,language models,ai agents,agent frameworks
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: dhenara-ai>=1.0.1
|
|
24
|
+
Requires-Dist: click>=8.0.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: httpx>=0.24.0
|
|
27
|
+
Requires-Dist: requests>=2.25.1
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: opentelemetry-api>=1.20.0
|
|
30
|
+
Requires-Dist: opentelemetry-sdk>=1.20.0
|
|
31
|
+
Requires-Dist: opentelemetry-instrumentation>=0.40b0
|
|
32
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.20.0
|
|
33
|
+
Requires-Dist: opentelemetry-exporter-zipkin
|
|
34
|
+
Provides-Extra: observability
|
|
35
|
+
Requires-Dist: opentelemetry-exporter-jaeger>=1.20.0; extra == "observability"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
|
|
40
|
+
Dynamic: author
|
|
41
|
+
Dynamic: author-email
|
|
42
|
+
Dynamic: classifier
|
|
43
|
+
Dynamic: description
|
|
44
|
+
Dynamic: description-content-type
|
|
45
|
+
Dynamic: home-page
|
|
46
|
+
Dynamic: keywords
|
|
47
|
+
Dynamic: license
|
|
48
|
+
Dynamic: project-url
|
|
49
|
+
Dynamic: provides-extra
|
|
50
|
+
Dynamic: requires-dist
|
|
51
|
+
Dynamic: requires-python
|
|
52
|
+
Dynamic: summary
|
|
53
|
+
|
|
54
|
+
# Dhenara Agent DSL (DAD)
|
|
55
|
+
|
|
56
|
+
## Overview
|
|
57
|
+
|
|
58
|
+
Dhenara Agent DSL (DAD) is an open-source framework built on top of the `dhenara-ai` Python package. It provides a
|
|
59
|
+
powerful, expressive, and type-safe domain-specific language (DSL) for defining and executing AI agent workflows. DAD
|
|
60
|
+
makes it easier to create, compose, and orchestrate AI agents with sophisticated behaviors, while maintaining robust
|
|
61
|
+
observability and reproducibility.
|
|
62
|
+
|
|
63
|
+
For full documentation, visit [docs.dhenara.com](https://docs.dhenara.com/).
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## What is Dhenara Agent DSL?
|
|
67
|
+
|
|
68
|
+
Dhenara Agent DSL or DAD (available as a Python package named `dhenara-agent`) is an AI agent framework with a strong
|
|
69
|
+
focus on:
|
|
70
|
+
|
|
71
|
+
1. **Expressive Agent Definition**: Create complex agent workflows using a straightforward, programming language-like
|
|
72
|
+
approach
|
|
73
|
+
2. **Component-Based Architecture**: Compose reusable components to build sophisticated agent systems
|
|
74
|
+
3. **Out-of-the-box Support for Multiple LLMs**: Switch between different LLM models on the fly
|
|
75
|
+
4. **Comprehensive Observability**: Built-in logging, tracing, and metrics collection for all agent activities using
|
|
76
|
+
OpenTelemetry and open-source exporters like Zipkin and Jaeger
|
|
77
|
+
5. **Reproducible Execution**: Track and replay agent execution through a run context system, reducing costs by
|
|
78
|
+
rerunning failed flows without additional AI Model API calls
|
|
79
|
+
6. **Extensible Node System**: Easily create custom node types to extend functionality
|
|
80
|
+
7. **Resource Management**: Flexible management of AI model resources and credentials
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
You can install the Dhenara Agent DSL framework using pip:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install dhenara-agent
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Core Concepts
|
|
91
|
+
|
|
92
|
+
### Basic Elements
|
|
93
|
+
|
|
94
|
+
DAD uses a hierarchical component model that allows for composition and reuse. It is built around three primary types of
|
|
95
|
+
components:
|
|
96
|
+
|
|
97
|
+
- **Execution Nodes**: Atomic execution units that perform specific functions (e.g., making an LLM API call, analyzing a
|
|
98
|
+
folder, performing file operations like creating/updating files)
|
|
99
|
+
- **Execution Flows**: Collections of nodes or sub-flows with execution logic, supporting sequential execution,
|
|
100
|
+
conditionals, and loops
|
|
101
|
+
- **Agents**: Higher-level abstractions that can contain flows and other agents, representing complete functional units
|
|
102
|
+
|
|
103
|
+
### Event-Driven Architecture
|
|
104
|
+
|
|
105
|
+
An event system enables loose coupling between components, allowing agents to react to events, request inputs, and
|
|
106
|
+
communicate with each other without tight coupling.
|
|
107
|
+
|
|
108
|
+
### Powerful Template Engine
|
|
109
|
+
|
|
110
|
+
A powerful template engine supports variable substitution, expressions, and hierarchical references, making it easy to
|
|
111
|
+
build dynamic prompts and process responses.
|
|
112
|
+
|
|
113
|
+
### Execution Model
|
|
114
|
+
|
|
115
|
+
The execution follows a hierarchical structure:
|
|
116
|
+
|
|
117
|
+
1. Components (Agents or Flows) define the overall structure
|
|
118
|
+
2. Nodes within components perform specific tasks
|
|
119
|
+
3. A RunContext manages the execution environment
|
|
120
|
+
4. Tracing, logging, and metrics provide visibility into execution
|
|
121
|
+
|
|
122
|
+
### Resource Management
|
|
123
|
+
|
|
124
|
+
DAD provides a flexible system for managing AI model resources and API credentials, making it easier to work with
|
|
125
|
+
different LLM providers and models.
|
|
126
|
+
|
|
127
|
+
## Usage Examples
|
|
128
|
+
|
|
129
|
+
### Basic Example
|
|
130
|
+
|
|
131
|
+
Here's a simple example of defining a flow using DAD:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from dhenara.agent.dsl import (
|
|
135
|
+
AIModelNode,
|
|
136
|
+
AIModelNodeSettings,
|
|
137
|
+
FlowDefinition,
|
|
138
|
+
ResourceConfigItem,
|
|
139
|
+
)
|
|
140
|
+
from dhenara.ai.types import Prompt
|
|
141
|
+
|
|
142
|
+
# Define a flow
|
|
143
|
+
my_flow = FlowDefinition()
|
|
144
|
+
|
|
145
|
+
# Add an AI model node to the flow
|
|
146
|
+
my_flow.node(
|
|
147
|
+
"question_answerer",
|
|
148
|
+
AIModelNode(
|
|
149
|
+
resources=ResourceConfigItem.with_model("claude-3-5-haiku"),
|
|
150
|
+
settings=AIModelNodeSettings(
|
|
151
|
+
system_instructions=["You are a helpful assistant."],
|
|
152
|
+
prompt=Prompt.with_dad_text("Answer the following question: $var{question}"),
|
|
153
|
+
),
|
|
154
|
+
),
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## Documentation
|
|
161
|
+
|
|
162
|
+
For comprehensive documentation including tutorials, API reference, and advanced usage examples, visit [docs.dhenara.com](https://docs.dhenara.com/).
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Dhenara Agent DSL (DAD)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Dhenara Agent DSL (DAD) is an open-source framework built on top of the `dhenara-ai` Python package. It provides a
|
|
6
|
+
powerful, expressive, and type-safe domain-specific language (DSL) for defining and executing AI agent workflows. DAD
|
|
7
|
+
makes it easier to create, compose, and orchestrate AI agents with sophisticated behaviors, while maintaining robust
|
|
8
|
+
observability and reproducibility.
|
|
9
|
+
|
|
10
|
+
For full documentation, visit [docs.dhenara.com](https://docs.dhenara.com/).
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## What is Dhenara Agent DSL?
|
|
14
|
+
|
|
15
|
+
Dhenara Agent DSL or DAD (available as a Python package named `dhenara-agent`) is an AI agent framework with a strong
|
|
16
|
+
focus on:
|
|
17
|
+
|
|
18
|
+
1. **Expressive Agent Definition**: Create complex agent workflows using a straightforward, programming language-like
|
|
19
|
+
approach
|
|
20
|
+
2. **Component-Based Architecture**: Compose reusable components to build sophisticated agent systems
|
|
21
|
+
3. **Out-of-the-box Support for Multiple LLMs**: Switch between different LLM models on the fly
|
|
22
|
+
4. **Comprehensive Observability**: Built-in logging, tracing, and metrics collection for all agent activities using
|
|
23
|
+
OpenTelemetry and open-source exporters like Zipkin and Jaeger
|
|
24
|
+
5. **Reproducible Execution**: Track and replay agent execution through a run context system, reducing costs by
|
|
25
|
+
rerunning failed flows without additional AI Model API calls
|
|
26
|
+
6. **Extensible Node System**: Easily create custom node types to extend functionality
|
|
27
|
+
7. **Resource Management**: Flexible management of AI model resources and credentials
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
You can install the Dhenara Agent DSL framework using pip:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install dhenara-agent
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Core Concepts
|
|
38
|
+
|
|
39
|
+
### Basic Elements
|
|
40
|
+
|
|
41
|
+
DAD uses a hierarchical component model that allows for composition and reuse. It is built around three primary types of
|
|
42
|
+
components:
|
|
43
|
+
|
|
44
|
+
- **Execution Nodes**: Atomic execution units that perform specific functions (e.g., making an LLM API call, analyzing a
|
|
45
|
+
folder, performing file operations like creating/updating files)
|
|
46
|
+
- **Execution Flows**: Collections of nodes or sub-flows with execution logic, supporting sequential execution,
|
|
47
|
+
conditionals, and loops
|
|
48
|
+
- **Agents**: Higher-level abstractions that can contain flows and other agents, representing complete functional units
|
|
49
|
+
|
|
50
|
+
### Event-Driven Architecture
|
|
51
|
+
|
|
52
|
+
An event system enables loose coupling between components, allowing agents to react to events, request inputs, and
|
|
53
|
+
communicate with each other without tight coupling.
|
|
54
|
+
|
|
55
|
+
### Powerful Template Engine
|
|
56
|
+
|
|
57
|
+
A powerful template engine supports variable substitution, expressions, and hierarchical references, making it easy to
|
|
58
|
+
build dynamic prompts and process responses.
|
|
59
|
+
|
|
60
|
+
### Execution Model
|
|
61
|
+
|
|
62
|
+
The execution follows a hierarchical structure:
|
|
63
|
+
|
|
64
|
+
1. Components (Agents or Flows) define the overall structure
|
|
65
|
+
2. Nodes within components perform specific tasks
|
|
66
|
+
3. A RunContext manages the execution environment
|
|
67
|
+
4. Tracing, logging, and metrics provide visibility into execution
|
|
68
|
+
|
|
69
|
+
### Resource Management
|
|
70
|
+
|
|
71
|
+
DAD provides a flexible system for managing AI model resources and API credentials, making it easier to work with
|
|
72
|
+
different LLM providers and models.
|
|
73
|
+
|
|
74
|
+
## Usage Examples
|
|
75
|
+
|
|
76
|
+
### Basic Example
|
|
77
|
+
|
|
78
|
+
Here's a simple example of defining a flow using DAD:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from dhenara.agent.dsl import (
|
|
82
|
+
AIModelNode,
|
|
83
|
+
AIModelNodeSettings,
|
|
84
|
+
FlowDefinition,
|
|
85
|
+
ResourceConfigItem,
|
|
86
|
+
)
|
|
87
|
+
from dhenara.ai.types import Prompt
|
|
88
|
+
|
|
89
|
+
# Define a flow
|
|
90
|
+
my_flow = FlowDefinition()
|
|
91
|
+
|
|
92
|
+
# Add an AI model node to the flow
|
|
93
|
+
my_flow.node(
|
|
94
|
+
"question_answerer",
|
|
95
|
+
AIModelNode(
|
|
96
|
+
resources=ResourceConfigItem.with_model("claude-3-5-haiku"),
|
|
97
|
+
settings=AIModelNodeSettings(
|
|
98
|
+
system_instructions=["You are a helpful assistant."],
|
|
99
|
+
prompt=Prompt.with_dad_text("Answer the following question: $var{question}"),
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## Documentation
|
|
108
|
+
|
|
109
|
+
For comprehensive documentation including tutorials, API reference, and advanced usage examples, visit [docs.dhenara.com](https://docs.dhenara.com/).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[tool.ruff]
|
|
2
|
+
target-version = "py310"
|
|
3
|
+
line-length = 120
|
|
4
|
+
src = ["src"]
|
|
5
|
+
force-exclude = true
|
|
6
|
+
exclude = []
|
|
7
|
+
|
|
8
|
+
[tool.ruff.lint]
|
|
9
|
+
select = [
|
|
10
|
+
"I", # automatically sort imports
|
|
11
|
+
"E", # find errors
|
|
12
|
+
"B", # Bugbear
|
|
13
|
+
"F", # linting
|
|
14
|
+
"W", # find warnings
|
|
15
|
+
"N", # naming errors
|
|
16
|
+
"UP", # PyUpgrade; update for newer syntax of the language. Eg: Use list in favor of List from 3.10
|
|
17
|
+
"YTT", # checks for misuse of sys.version or sys.version_info
|
|
18
|
+
"ASYNC", # checks for bad async / asyncio practices
|
|
19
|
+
"FLY", # Avoid unneccessary join: Use f"{a}_{b}_{c}" instead of "_".join([a, b, c])
|
|
20
|
+
"RUF", # ruff-specific rules
|
|
21
|
+
"PERF", # A Linter for performance anti-patterns
|
|
22
|
+
"S101", # checks for use of asserts instead of if cond: raise AssertionError
|
|
23
|
+
"FBT", # Disallow boolean traps
|
|
24
|
+
"A", # check if shadow built-ins
|
|
25
|
+
"COM", # Check if commas are missing
|
|
26
|
+
"CPY", # Check if copyright header is missing
|
|
27
|
+
"C4", # Comprehension linter
|
|
28
|
+
]
|
|
29
|
+
ignore = [
|
|
30
|
+
"RUF012", # mutable-class-default: Will fail with all Modelclass Meta def
|
|
31
|
+
"E722", # TODO_FUTURE: Ignoring the exception rule for the time being
|
|
32
|
+
"B904", # Chained exceptions
|
|
33
|
+
"COM812", # This rules may cause conflicts when used with the formatter.
|
|
34
|
+
"FBT001", # Prevents boolean-default-value-positional-argument
|
|
35
|
+
"FBT002", # Prevents boolean-default-value-positional-argument
|
|
36
|
+
"A005", # Module name shadows a Python standard-library module
|
|
37
|
+
"UP038", # Use `X | Y` in isinstance
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
[tool.ruff.lint.per-file-ignores]
|
|
42
|
+
"__init__.py" = [
|
|
43
|
+
"I", # Innore sorting order in init files else will compail fail
|
|
44
|
+
"F403", # Enable "import *" in init files
|
|
45
|
+
]
|
|
46
|
+
"tests/test_*.py" = ["S101"]
|
|
47
|
+
"*/tests/test_*.py" = ["S101"]
|
|
48
|
+
"*/templates/runner/runner.py" = ["I001"]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint.pycodestyle]
|
|
52
|
+
max-doc-length = 120
|
|
53
|
+
|
|
54
|
+
[tool.ruff.lint.isort]
|
|
55
|
+
split-on-trailing-comma = true
|
|
56
|
+
|
|
57
|
+
[tool.ruff.format]
|
|
58
|
+
quote-style = "double"
|
|
59
|
+
indent-style = "space"
|
|
60
|
+
docstring-code-format = true
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
from setuptools import find_namespace_packages, setup
|
|
5
|
+
|
|
6
|
+
version = None
|
|
7
|
+
# Read version without importing the package
|
|
8
|
+
with open(os.path.join("src/dhenara/agent", "__init__.py")) as f:
|
|
9
|
+
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
|
|
10
|
+
if version_match:
|
|
11
|
+
version = version_match.group(1)
|
|
12
|
+
else:
|
|
13
|
+
raise RuntimeError("Unable to find version string")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
setup(
|
|
17
|
+
name="dhenara-agent",
|
|
18
|
+
version=version,
|
|
19
|
+
package_dir={"": "src"},
|
|
20
|
+
packages=find_namespace_packages(where="src", include=["dhenara.*"]),
|
|
21
|
+
install_requires=[
|
|
22
|
+
"dhenara-ai>=1.0.1",
|
|
23
|
+
"click>=8.0.0", # CLI
|
|
24
|
+
"pyyaml>=6.0", # CLI
|
|
25
|
+
"httpx>=0.24.0",
|
|
26
|
+
"requests>=2.25.1",
|
|
27
|
+
"pydantic>=2.0.0",
|
|
28
|
+
# Observability dependencies: # TODO_FUTURE: Add a config
|
|
29
|
+
"opentelemetry-api>=1.20.0",
|
|
30
|
+
"opentelemetry-sdk>=1.20.0",
|
|
31
|
+
"opentelemetry-instrumentation>=0.40b0",
|
|
32
|
+
"opentelemetry-exporter-otlp>=1.20.0",
|
|
33
|
+
"opentelemetry-exporter-zipkin",
|
|
34
|
+
],
|
|
35
|
+
extras_require={
|
|
36
|
+
"observability": [
|
|
37
|
+
# Additional tracing visualization
|
|
38
|
+
"opentelemetry-exporter-jaeger>=1.20.0",
|
|
39
|
+
],
|
|
40
|
+
"dev": [
|
|
41
|
+
# Tests
|
|
42
|
+
"pytest>=7.0.0",
|
|
43
|
+
"pytest-asyncio>=0.18.0",
|
|
44
|
+
"pytest-cov>=3.0.0",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
python_requires=">=3.10",
|
|
48
|
+
description="Dhenara Agent DSL (DAD) Framework SDK",
|
|
49
|
+
long_description=open("README.md").read(),
|
|
50
|
+
long_description_content_type="text/markdown",
|
|
51
|
+
author="Dhenara",
|
|
52
|
+
author_email="support@dhenara.com",
|
|
53
|
+
url="https://github.com/dhenara/dhenara-agent",
|
|
54
|
+
license="MIT",
|
|
55
|
+
keywords="ai, llm, machine learning, language models, ai agents, agent frameworks",
|
|
56
|
+
project_urls={
|
|
57
|
+
"Homepage": "https://dhenara.com",
|
|
58
|
+
"Documentation": "https://docs.dhenara.com/",
|
|
59
|
+
"Bug Reports": "https://github.com/dhenara/dhenara-agent/issues",
|
|
60
|
+
"Source Code": "https://github.com/dhenara/dhenara-agent",
|
|
61
|
+
},
|
|
62
|
+
classifiers=[
|
|
63
|
+
"Development Status :: 3 - Alpha",
|
|
64
|
+
"Intended Audience :: Developers",
|
|
65
|
+
"Programming Language :: Python :: 3",
|
|
66
|
+
"Programming Language :: Python :: 3.10",
|
|
67
|
+
"Operating System :: OS Independent",
|
|
68
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
69
|
+
"License :: OSI Approved :: MIT License",
|
|
70
|
+
],
|
|
71
|
+
# CLI
|
|
72
|
+
entry_points={
|
|
73
|
+
"console_scripts": [
|
|
74
|
+
"dhenara=dhenara.cli:main",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
# Include template files in the package
|
|
78
|
+
package_data={
|
|
79
|
+
"dhenara.cli": ["templates/**/*.py"],
|
|
80
|
+
},
|
|
81
|
+
include_package_data=True,
|
|
82
|
+
)
|