> For the complete documentation index, see [llms.txt](https://vity-toolkit.gitbook.io/vity-toolkit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vity-toolkit.gitbook.io/vity-toolkit/tools/gibwork.md).

# 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

{% stepper %}
{% step %}
**Install the package.**

```bash
npm install vity-toolkit langchain @langchain/openai
```

{% endstep %}

{% step %}
**Initialize Vity Toolkit and Langchain.**

```typescript
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>",
});
```

{% endstep %}

{% step %}
**Add the tool.**

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

{% endstep %}

{% step %}
**Define the Agent.**

```typescript
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 });
```

{% endstep %}

{% step %}
**Execute the Agent.**

```typescript
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);
```

{% endstep %}
{% endstepper %}

### Supported Actions

<table><thead><tr><th>Action</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>Action.GIBWORK_EXPLORE
</code></pre></td><td>View all available tasks on the gibwork platform.</td></tr><tr><td><pre><code>Action.GIBWORK_TASKS
</code></pre></td><td>Fetches Task details using a Task Id from the gibwork platform.</td></tr><tr><td><pre><code>Action.GIBWORK_CREATE_TASK
</code></pre></td><td>Creates a task and returns a serialized transaction to fund the task on the gibwork platform.</td></tr></tbody></table>
