🚀Quick Start - Vercel AI

Fetch top 5 bounties from superteam earn with the help of Vercel AI and Vity Toolkit in less than 15 lines

In this guide you'll learn how to implement and use Vity Toolkit with VercelAI in just a few lines of code. For the purpose of this example, we'll create an assistant that can fetch top 5 bounties from Superteam Earn.

Fetch top 5 bounties from Superteam Earn

In this example, we will use Vercel AI to fetch top 5 bounties from Superteam Earn using Vity Toolkit.

1

Install the package.

npm install vity-toolkit ai @ai-sdk/openai
2

Initialize Vity Toolkit.

import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { App, VercelAIToolkit } from "vity-toolkit";

const toolKit = new VercelAIToolkit();
3

Get the required tools.

const tools = toolKit.getTools({ apps: [App.EARN] });
4

Define the Agent.

const { text } = await generateText({
    model: openai("gpt-4o"),
    tools,
    maxSteps: 5,
    prompt: "What is top 5 bounties in superteam earn?",
});
5

Execute the Agent.

console.log(text);
Full code

Last updated