fix: naming

This commit is contained in:
aryan
2025-01-01 03:37:56 +05:30
parent 18b719012b
commit e2f1536774
37 changed files with 121 additions and 67 deletions

View File

@@ -1,4 +1,6 @@
import { PublicKey } from "@solana/web3.js";
import { SolanaAgentKit } from "../agent";
import { z } from "zod";
export interface Config {
OPENAI_API_KEY?: string;
@@ -98,3 +100,56 @@ export interface GibworkCreateTaskReponse {
signature?: string | undefined;
}
/**
* Example of an action with input and output
*/
export interface ActionExample {
input: Record<string, any>;
output: Record<string, any>;
explanation: string;
}
/**
* Handler function type for executing the action
*/
export type Handler = (
agent: SolanaAgentKit,
input: Record<string, any>,
) => Promise<Record<string, any>>;
/**
* Main Action interface inspired by ELIZA
* This interface makes it easier to implement actions across different frameworks
*/
export interface Action {
/**
* Unique name of the action
*/
name: string;
/**
* Alternative names/phrases that can trigger this action
*/
similes: string[];
/**
* Detailed description of what the action does
*/
description: string;
/**
* Array of example inputs and outputs for the action
* Each inner array represents a group of related examples
*/
examples: ActionExample[][];
/**
* Zod schema for input validation
*/
schema: z.ZodType<any>;
/**
* Function that executes the action
*/
handler: Handler;
}