From 1aa93984c80d03164457d4738b775484a5a67e68 Mon Sep 17 00:00:00 2001 From: Daniel Whiffing Date: Mon, 16 Sep 2024 11:31:01 -0400 Subject: [PATCH] No transaction value by default --- utils/generateToolFromABI.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/generateToolFromABI.ts b/utils/generateToolFromABI.ts index 42bf77e..2b29597 100644 --- a/utils/generateToolFromABI.ts +++ b/utils/generateToolFromABI.ts @@ -30,8 +30,7 @@ export const getContractABIDescriptions = ( { name: func.name, description: getToolDescription(contract, func), - valueDescription: - "An integer describing the amount to be included directly in a blockchain transaction. This should be represented as wei for ethereum based contracts, so if the user passes eth or gwei.etc, do the necessary conversion.", + valueDescription: "", inputs: func.inputs.map((input) => ({ name: input.name ?? "", description: getInputDescription(input), @@ -48,9 +47,11 @@ const generateToolFromABI = ); let schema: any = {}; - schema.transactionValue = z - .string() - .describe(abiDescription?.valueDescription ?? ""); + if (abiDescription?.valueDescription) { + schema.transactionValue = z + .string() + .describe(abiDescription?.valueDescription); + } func.inputs.forEach((input) => { const inputDescription =