Vity Toolkit
TelegramTwitterGithubRequest new tool
  • Introduction
    • Vity Toolkit
    • 🚀Quick Start - Langchain
    • 🚀Quick Start - Vercel AI
  • Features
    • Apps and Actions
    • How can I use Action directly?
    • Agent Authentication
    • Extensions
  • Tools
    • Superteam Earn
    • Solana Wallet
    • Reddit
    • Gibwork
    • Twitter
  • EXAMPLES
    • AI Bounty Finder
Powered by GitBook
On this page
  1. Features

How can I use Action directly?

Learn how to use action/tool directly

Vity Toolkit allows you to execute action directly as function calls.

import { LangchainToolkit, Action } from "vity-toolkit";

const toolKit = new LangchainToolkit();
const result = await toolKit.executeAction({ action: Action.EARN_BOUNTY_LISTINGS });

console.log(result.data);

Many tools require some input parameters which you need to provide.

import { VityToolKit, Action } from "vity-toolkit";


const toolKit = new VityToolKit();

// 1. Get expected params for an action
const expectedParams = toolKit.getInputParamsForAction({ action: Action.EARN_FETCH_USER_POWS });
console.log(expectedParams);

// 2. Pass the expected params with values for executing the action
const params = { userId: '1ce11bfa-7fca-4d0f-9d19-c114b18a0207' };

const result = await toolKit.executeAction({ action: Action.EARN_FETCH_USER_POWS, inputParams: params });

console.log(result.data);

PreviousApps and ActionsNextAgent Authentication

Last updated 5 months ago