Gibwork

Guide to use gibwork tool on your AI agent using Vity Toolkit

Gibwork connects skilled professionals with freelance work opportunities, offering seamless integration with all Solana tokens for secure and efficient transactions.

Quick Start

1

Install the package.

npm install vity-toolkit langchain @langchain/openai
2

Initialize Vity Toolkit and Langchain.

import { ChatOpenAI } from "@langchain/openai";
import { App, LangchainToolkit } from "vity-toolkit";
import { createOpenAIFunctionsAgent, AgentExecutor } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";

const llm = new ChatOpenAI({ model: "gpt-4o" });
const toolKit = new LangchainToolkit({
    appPrivateKey: "<app-wallet-private-key>",
    userPrivateKey: "<user-wallet-private-key>",
});
3

Add the tool.

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

Define the Agent.

const prompt = ChatPromptTemplate.fromMessages([
    ["system", `You are an AI agent responsible for taking actions on Gibwork on users' behalf. 
        You need to take action on Gibwork using Gibwork APIs. Use correct tools to run APIs from the given tool-set.`],
    ["placeholder", "{chat_history}"],
    ["human", "{input}"],
    ["placeholder", "{agent_scratchpad}"],
]);

const agent = await createOpenAIFunctionsAgent({
    llm,
    tools,
    prompt,
});

const agentExecutor = new AgentExecutor({ agent, tools, verbose: true });
5

Execute the Agent.

const response = await agentExecutor.invoke({ input: "Create a Gibwork task: Follow my Twitter account @thatsmeadarsh if you have 50+ followers. My total budget is 11 USDC. Submit a screenshot showing you’ve followed, along with your Twitter profile link, to qualify for the reward. The mint address for USDC is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" });
console.log(response);

Supported Actions

Action
Description
Action.GIBWORK_EXPLORE

View all available tasks on the gibwork platform.

Action.GIBWORK_TASKS

Fetches Task details using a Task Id from the gibwork platform.

Action.GIBWORK_CREATE_TASK

Creates a task and returns a serialized transaction to fund the task on the gibwork platform.

Last updated