Dynamic Tasks
Dynamic Tasks are the core building blocks of the Cyne AI framework, enabling agents to perform specific tasks such as whale tracking, liquidity management, token swapping, and more.
Overview
Each task in Cyne AI consists of the following key components:
name: A unique identifier for the action.
similes: Alternative names or triggers for the action.
description: A detailed explanation of the action's purpose.
validate: Logic to check whether the action can be executed based on the current context.
handler: The implementation of the action's behavior.
examples: Demonstrates how the action works in practice.
Action Structure
The structure of an action in Cyne AI follows the format below:
interface Action {
name: string;
similes: string[];
description: string;
validate: (runtime: IAgentRuntime, message: Memory) => Promise<boolean>;
handler: (
runtime: IAgentRuntime,
message: Memory,
state?: State
) => Promise<void>;
examples: ActionExample[][];
suppressInitialMessage?: boolean;
}Key Components
name: Unique name for the action.
similes: Triggers or alternative names that activate the action.
description: A clear and concise explanation of the action's functionality.
validate: Ensures the action can be executed under the current conditions.
handler: Defines the logic and operations executed by the action.
examples: Provides real-world usage examples.
suppressInitialMessage: Suppresses automatic responses if the action generates its own output.
Built-In Actions in Cyne AI
1. CONTINUE
Continues the conversation by gathering more context or expanding on a topic.
2. IGNORE
Disengages gracefully from conversations when the discussion is finished or irrelevant.
3. TRACK_WHALE
Monitors large transactions on Solana and alerts users to potential market impacts.
4. EXECUTE_SWAP
Facilitates token swaps using the DEX aggregator for optimal rates.
5. ANALYZE_RISK
Performs risk analysis on a smart contract or liquidity pool.
6. GENERATE_REPORT
Creates detailed performance or trend reports.
Creating Custom Actions
Basic Template
Best Practices for Actions
Clear Purpose: Define a single, well-focused purpose for each action.
Robust Validation: Check prerequisites and validate inputs.
Error Handling: Handle errors gracefully and provide meaningful feedback.
Comprehensive Documentation: Provide examples and explain expected inputs, outputs, and scenarios.
Last updated