From 331482ac6a7a8638464974650dcb159b8cbffc8e Mon Sep 17 00:00:00 2001 From: Damjan Date: Sat, 18 Jan 2025 10:06:09 +0100 Subject: [PATCH] Update get_asset.ts --- src/langchain/metaplex/get_asset.ts | 10 ++++------ src/langchain/metaplex/get_assets_by_authority.ts | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/langchain/metaplex/get_asset.ts b/src/langchain/metaplex/get_asset.ts index dc242754..897ab30e 100644 --- a/src/langchain/metaplex/get_asset.ts +++ b/src/langchain/metaplex/get_asset.ts @@ -3,10 +3,10 @@ import { SolanaAgentKit } from "../../agent"; export class SolanaGetAssetTool extends Tool { name = "solana_get_asset"; - description = `Fetch asset details using the Metaplex DAS API. + description = `Fetch asset details for a given asset ID using the Metaplex DAS API. - Inputs (input is a JSON string): - assetId: string, eg "Asset ID" (required)`; + Inputs (input is a string): + eg "8TrvJBRa6Pzb9BDadqroHhWTHxaxK8Ws8r91oZ2jxaVV" (required)`; constructor(private solanaKit: SolanaAgentKit) { super(); @@ -14,9 +14,7 @@ export class SolanaGetAssetTool extends Tool { protected async _call(input: string): Promise { try { - const parsedInput = JSON.parse(input); - - const result = await this.solanaKit.getAsset(parsedInput.assetId); + const result = await this.solanaKit.getAsset(input); return JSON.stringify({ status: "success", diff --git a/src/langchain/metaplex/get_assets_by_authority.ts b/src/langchain/metaplex/get_assets_by_authority.ts index 9065f74a..9894d717 100644 --- a/src/langchain/metaplex/get_assets_by_authority.ts +++ b/src/langchain/metaplex/get_assets_by_authority.ts @@ -3,7 +3,7 @@ import { SolanaAgentKit } from "../../agent"; export class SolanaGetAssetsByAuthorityTool extends Tool { name = "solana_get_assets_by_authority"; - description = `Fetch a list of assets owned by a specific address using the Metaplex DAS API. + description = `Fetch a list of assets by a specific authority address using the Metaplex DAS API. Inputs (input is a JSON string): authority: string, eg "mRdta4rc2RtsxEUDYuvKLamMZAdW6qHcwuq866Skxxv" (required)