Dana API Reference¶
Coming Soon:
Complete reference documentation for Dana framework components and the Dana programming language.
Quick Start¶
# Import dana framework
import opendxa.dana as dana
# Basic usage
result = dana.run("reason('Hello, world!')")
print(result)
API Components¶
Dana Framework Components¶
# Import Dana common utilities
from opendxa.common import DXA_LOGGER, LLMResource, ConfigLoader
# Use Dana sandbox for execution
import opendxa.dana as dana
sandbox = dana.DanaSandbox()
result = sandbox.run("reason('Analyze this data')")
Reference Tables¶
Core APIs¶
API | Purpose | Key Components |
---|---|---|
Dana Sandbox | Main Dana execution API | DanaSandbox , ExecutionResult , dana.run() , dana.eval() |
Language Features¶
Feature | Purpose | Key Functions |
---|---|---|
Core Functions | Essential Dana functions | reason() , log() , print() , log_level() |
Built-in Functions | Pythonic built-in functions | len() , sum() , max() , min() , abs() , round() |
Type System | Type hints and type checking | Variable types, function signatures, validation |
Scoping System | Variable scopes and security | private: , public: , system: , local: |
Advanced Features¶
Feature | Purpose | Key Components |
---|---|---|
| Function Calling | Function calls and imports | Dana→Dana, Dana→Python, Python→Dana | | Sandbox Security | Security model and restrictions | Sandboxing, context isolation, safety |
Common Patterns¶
AI and Reasoning¶
# Basic reasoning
import opendxa.dana as dana
from opendxa.common import Loggable, LLMResource
# Simple reasoning
result = dana.run("reason('What is machine learning?')")
# Structured reasoning
analysis = dana.run("""
data = [1, 2, 3, 4, 5]
insights = reason('Analyze this data: {data}')
log('Analysis complete')
return insights
""")
Related APIs:
- Core Functions: reason()
- LLM integration and AI reasoning
- Type System: AI function signatures - Type safety for AI operations
Data Processing¶
# Collection operations
import opendxa.dana as dana
# Process data with built-ins
result = dana.run("""
numbers = [1, 2, 3, 4, 5]
total = sum(numbers)
average = total / len(numbers)
return {'total': total, 'average': average}
""")
Related APIs:
- Built-in Functions: Collections - len()
, sum()
, max()
, min()
- Type System: Data types - list
, dict
, tuple
, `