Removed tooling added

This commit is contained in:
0xCipherCoder
2025-01-10 19:15:37 +05:30
193 changed files with 1475 additions and 722 deletions

View File

@@ -0,0 +1,30 @@
import { BaseSolanaTool } from "../common/base";
import { CreateImageResponse } from "./types";
import { create_image } from "../../tools/agent";
export class SolanaCreateImageTool extends BaseSolanaTool {
name = "solana_create_image";
description =
"Create an image using OpenAI's DALL-E. Input should be a string prompt for the image.";
private validateInput(input: string): void {
if (typeof input !== "string" || input.trim().length === 0) {
throw new Error("Input must be a non-empty string prompt");
}
}
protected async _call(input: string): Promise<string> {
try {
this.validateInput(input);
const result = await create_image(this.solanaKit, input.trim());
return JSON.stringify({
status: "success",
message: "Image created successfully",
...result,
} as CreateImageResponse);
} catch (error: any) {
return this.handleError(error);
}
}
}