Deep Trust Network Software Development Kit¶
Welcome to the Deep Trust Network (DTN) SDK documentation. This comprehensive guide will help you integrate AI functionality into your decentralized applications using the DTN network.
What is DTN SDK?¶
The Deep Trust Network SDK provides a set of smart contracts that enable developers to seamlessly integrate AI capabilities into their blockchain applications. The SDK handles the complex aspects of AI request routing, payment processing, and result delivery through a trust-based network.
Key Features¶
- AI Session Management: Handle payments and session lifecycle for AI requests
- Flexible Routing: Choose between trusted network nodes or custom routing
- Multiple AI Models: Support for various AI models with different APIs and pricing
- Gas-Efficient: Optimized for cost-effective AI interactions on blockchain
- Trust-Based Network: Leverage staked nodes for reliable AI service delivery
Quick Start¶
import "@deeptrust/contracts/with-dtn-ai.sol";
contract MyAIContract is WithDtnAi {
// Your AI-powered contract implementation
}
What You'll Learn¶
This documentation covers:
- Getting Started: Installation and basic setup
- Core Concepts: Understanding AI sessions, models, routing, and callbacks
- Smart Contracts: Detailed reference for all available contracts
- Examples: Practical implementations for common use cases
- API Reference: Complete function and event documentation
- Advanced Topics: Custom routing, fee management, and error handling
Supported Contracts¶
The SDK includes the following core contracts:
with-dtn-ai.sol
- Base contract for AI functionalitywith-dtn-ai-upgradeable.sol
- Upgradeable version of the base contractidtn-ai.sol
- Interface definitions for AI interactionsdtn-defaults.sol
- Default configurations and helper functions
Getting Help¶
Ready to build the future of decentralized AI? Let's get started!