Actions.do  - External World Interactions
Execute operations that impact external systems from your AI applications
Overview
Actions.do provides a framework for defining and executing operations that interact with external systems. This AI primitive enables:
- Standardized interfaces for external operations
- Secure execution with proper validation and error handling
- Composable operations for complex workflows
- Auditability through detailed tracking
- Tool capabilities for Agents to interact with external systems
Features
- Input Validation: Ensure actions receive valid parameters
- Error Handling: Gracefully manage and report failures
- Retry Logic: Automatically retry failed actions with backoff
- Audit Logging: Track who executed what actions and when
- Rate Limiting: Prevent overloading external systems
Usage
import { defineAction } from 'actions.do'
// Define an email action
const sendEmail = defineAction({
name: 'sendEmail',
description: 'Sends an email to a recipient',
// Define the input parameters
input: {
to: { type: 'string', format: 'email', required: true },
subject: { type: 'string', required: true },
body: { type: 'string', required: true },
attachments: { type: 'array', items: 'Attachment', optional: true },
},
// Define the output schema
output: {
messageId: { type: 'string' },
status: { type: 'string', enum: ['sent', 'queued', 'failed'] },
},
})
Last updated on