Create Gibwork Task

The Create Gibwork Task tool is part of AgentiPy, used for creating tasks on the Gibwork platform (api2.gib.work). These tasks are initiated on the Solana blockchain and can involve token rewards for completion.

Functionality

This tool is implemented in the GibworkManager class.

Key Methods:

  • create_gibwork_task(agent: SolanaAgentKit, title: str, content: str, requirements: str, tags: list[str], token_mint_address: PublicKey, token_amount: int) -> GibworkCreateTaskResponse:

    • Constructs a payload with task details: title, content (description of the task), requirements, tags (list of keywords), payer (agent's wallet address), and token information (mint address and amount for rewards).

    • Makes a POST request to the Gibwork API (https://api2.gib.work/tasks/public/transaction) to get a serialized transaction.

    • Deserializes the transaction, signs it with the agent's wallet.

    • Sends and confirms the transaction on the Solana network.

    • Returns a GibworkCreateTaskResponse containing the status, task ID, and transaction signature.

Note: This tool interacts with an external API (Gibwork) and the Solana blockchain. It requires a valid SolanaAgentKit setup with a funded wallet. The token_mint_address and token_amount must correspond to tokens held by the agent's wallet.

Source Code

You can find the source code for this tool on GitHub: https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/create_gibwork.py

Last updated