From 47d50f49d9d847c2ac9e4e083380776c5a587035 Mon Sep 17 00:00:00 2001 From: Agus Date: Fri, 28 Mar 2025 20:19:37 +0100 Subject: [PATCH] docs: Add GOAT integration to docs (#30478) This PR adds: 1. Docs for the GOAT integration 2. An "Agentic Finance" table to the Tools page that includes GOAT **Twitter handle**: @0xaguspunk --- docs/docs/integrations/providers/goat.mdx | 39 ++++ docs/docs/integrations/tools/goat.ipynb | 217 ++++++++++++++++++++++ docs/scripts/tool_feat_table.py | 31 ++++ libs/packages.yml | 7 +- 4 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 docs/docs/integrations/providers/goat.mdx create mode 100644 docs/docs/integrations/tools/goat.ipynb diff --git a/docs/docs/integrations/providers/goat.mdx b/docs/docs/integrations/providers/goat.mdx new file mode 100644 index 00000000000..042a700b455 --- /dev/null +++ b/docs/docs/integrations/providers/goat.mdx @@ -0,0 +1,39 @@ +# GOAT + +[GOAT](https://github.com/goat-sdk/goat) is the finance toolkit for AI agents. + +Create agents that can: + +- Send and receive payments +- Purchase physical and digital goods and services +- Engage in various investment strategies: + - Earn yield + - Bet on prediction markets +- Purchase crypto assets +- Tokenize any asset +- Get financial insights + +### How it works +GOAT leverages blockchains, cryptocurrencies (such as stablecoins), and wallets as the infrastructure to enable agents to become economic actors: + +1. Give your agent a [wallet](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets) +2. Allow it to transact [anywhere](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets) +3. Use more than [+200 tools](https://github.com/goat-sdk/goat/tree/main#tools) + +See everything GOAT supports [here](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets). + +**Lightweight and extendable** +Different from other toolkits, GOAT is designed to be lightweight and extendable by keeping its core minimal and allowing you to install only the tools you need. + +If you don't find what you need on our more than 200 integrations you can easily: + +- Create your own plugin +- Integrate a new chain +- Integrate a new wallet +- Integrate a new agent framework + +See how to do it [here](https://github.com/goat-sdk/goat/tree/main#-contributing). + +## Installation and Setup + +Check out our [quickstart](https://github.com/goat-sdk/goat/tree/main/python/examples/by-framework/langchain) to see how to set up and install GOAT. diff --git a/docs/docs/integrations/tools/goat.ipynb b/docs/docs/integrations/tools/goat.ipynb new file mode 100644 index 00000000000..bebbc1e9ff1 --- /dev/null +++ b/docs/docs/integrations/tools/goat.ipynb @@ -0,0 +1,217 @@ +{ + "cells": [ + { + "cell_type": "raw", + "id": "afaf8039", + "metadata": { + "vscode": { + "languageId": "raw" + } + }, + "source": [ + "---\n", + "sidebar_label: GOAT\n", + "---" + ] + }, + { + "cell_type": "markdown", + "id": "e49f1e0d", + "metadata": {}, + "source": [ + "# GOAT\n", + "\n", + "[GOAT](https://github.com/goat-sdk/goat) is the finance toolkit for AI agents.\n", + "\n", + "## Overview\n", + "\n", + "Create agents that can:\n", + "\n", + "- Send and receive payments\n", + "- Purchase physical and digital goods and services\n", + "- Engage in various investment strategies:\n", + " - Earn yield\n", + " - Bet on prediction markets\n", + "- Purchase crypto assets\n", + "- Tokenize any asset\n", + "- Get financial insights\n", + "\n", + "### How it works\n", + "GOAT leverages blockchains, cryptocurrencies (such as stablecoins), and wallets as the infrastructure to enable agents to become economic actors:\n", + "\n", + "1. Give your agent a [wallet](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)\n", + "2. Allow it to transact [anywhere](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)\n", + "3. Use more than [+200 tools](https://github.com/goat-sdk/goat/tree/main#tools)\n", + "\n", + "See everything GOAT supports [here](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets).\n", + "\n", + "**Lightweight and extendable**\n", + "Different from other toolkits, GOAT is designed to be lightweight and extendable by keeping its core minimal and allowing you to install only the tools you need.\n", + "\n", + "If you don't find what you need on our more than 200 integrations you can easily:\n", + "\n", + "- Create your own plugin\n", + "- Integrate a new chain\n", + "- Integrate a new wallet\n", + "- Integrate a new agent framework\n", + "\n", + "See how to do it [here](https://github.com/goat-sdk/goat/tree/main#-contributing)." + ] + }, + { + "cell_type": "markdown", + "id": "0730d6a1-c893-4840-9817-5e5251676d5d", + "metadata": {}, + "source": [ + "### Quickstarts\n", + "\n", + "The best way to get started is by using the quickstarts below. See how you can configure GOAT to achieve any of the use cases below.\n", + "\n", + "- **By use case**\n", + " - **Money transmission**\n", + " - Send and receive payments [[EVM](https://github.com/goat-sdk/goat/tree/main/python/examples/by-use-case/evm-send-and-receive-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/python/examples/by-use-case/solana-send-and-receive-tokens)]\n", + " - **Investing**\n", + " - Generate yield [[Solana](https://github.com/goat-sdk/goat/tree/main/python/examples/by-use-case/solana-usdc-yield-deposit)]\n", + " - Purchase crypto assets [[EVM](https://github.com/goat-sdk/goat/tree/main/python/examples/by-use-case/evm-swap-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/python/examples/by-use-case/solana-swap-tokens)]\n", + "- **By wallet**\n", + " - [Crossmint](https://github.com/goat-sdk/goat/tree/main/python/examples/by-wallet/crossmint)\n", + "- **See all python quickstarts [here](https://github.com/goat-sdk/goat/tree/main/python/examples).**\n" + ] + }, + { + "cell_type": "markdown", + "id": "abd26764", + "metadata": {}, + "source": [ + "## Setup\n", + "\n", + "1. Install the core package and langchain adapter:\n", + "\n", + "```bash\n", + "pip install goat-sdk goat-sdk-adapter-langchain\n", + "```\n", + "\n", + "2. Install the type of wallet you want to use (e.g solana):\n", + "\n", + "```bash\n", + "pip install goat-sdk-wallet-solana\n", + "```\n", + "\n", + "3. Install the plugins you want to use in that chain:\n", + "\n", + "```bash\n", + "pip install goat-sdk-plugin-spl-token\n", + "```\n", + "\n", + "## Instantiation\n", + "\n", + "Now we can instantiate our toolkit:\n", + "\n", + "```python\n", + "from goat_adapters.langchain import get_on_chain_tools\n", + "from goat_wallets.solana import solana, send_solana\n", + "from goat_plugins.spl_token import spl_token, SplTokenPluginOptions\n", + "from goat_plugins.spl_token.tokens import SPL_TOKENS\n", + "\n", + "# Initialize Solana client\n", + "client = SolanaClient(os.getenv(\"SOLANA_RPC_ENDPOINT\"))\n", + "\n", + "# Initialize regular Solana wallet\n", + "keypair = Keypair.from_base58_string(os.getenv(\"SOLANA_WALLET_SEED\") or \"\")\n", + "wallet = solana(client, keypair)\n", + "\n", + "tools = get_on_chain_tools(\n", + " wallet=wallet,\n", + " plugins=[\n", + " send_solana(),\n", + " spl_token(SplTokenPluginOptions(\n", + " network=\"mainnet\", # Using devnet as specified in .env\n", + " tokens=SPL_TOKENS\n", + " )),\n", + " ],\n", + " )\n", + "```\n", + "\n", + "## Invocation\n", + "```python\n", + "tools[\"get_balance\"].invoke({ \"address\": \"0x1234567890123456789012345678901234567890\" })\n", + "```\n", + "\n", + "## Use within an agent\n", + "\n", + "```python\n", + "import os\n", + "import asyncio\n", + "from dotenv import load_dotenv\n", + "\n", + "# Load environment variables\n", + "load_dotenv()\n", + "\n", + "from solana.rpc.api import Client as SolanaClient\n", + "from solders.keypair import Keypair\n", + "\n", + "from goat_adapters.langchain import get_on_chain_tools\n", + "from goat_wallets.solana import solana, send_solana\n", + "from goat_plugins.spl_token import spl_token, SplTokenPluginOptions\n", + "from goat_plugins.spl_token.tokens import SPL_TOKENS\n", + "\n", + "# Initialize Solana client\n", + "client = SolanaClient(os.getenv(\"SOLANA_RPC_ENDPOINT\"))\n", + "\n", + "# Initialize regular Solana wallet\n", + "keypair = Keypair.from_base58_string(os.getenv(\"SOLANA_WALLET_SEED\") or \"\")\n", + "wallet = solana(client, keypair)\n", + "\n", + "# Initialize LLM\n", + "llm = ChatOpenAI(model=\"gpt-4o-mini\")\n", + "\n", + "def main():\n", + " # Initialize tools with Solana wallet\n", + " tools = get_on_chain_tools(\n", + " wallet=wallet,\n", + " plugins=[\n", + " send_solana(),\n", + " spl_token(SplTokenPluginOptions(\n", + " network=\"mainnet\", # Using devnet as specified in .env\n", + " tokens=SPL_TOKENS\n", + " )),\n", + " ],\n", + " )\n", + "\n", + " # Initialize agent\n", + " # Your agent code here\n", + "\n", + "\n", + "if __name__ == \"__main__\":\n", + " main()\n", + "```\n", + "\n", + "## API reference\n", + "\n", + "- For a complete list of tools, see the [GOAT SDK documentation](https://github.com/goat-sdk/goat).\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/scripts/tool_feat_table.py b/docs/scripts/tool_feat_table.py index 5e5a3498413..5add3279611 100644 --- a/docs/scripts/tool_feat_table.py +++ b/docs/scripts/tool_feat_table.py @@ -169,6 +169,14 @@ DATABASE_TOOL_FEAT_TABLE = { }, } +FINANCE_TOOL_FEAT_TABLE = { + "GOAT": { + "link": "/docs/integrations/tools/goat", + "pricing": "Free", + "capabilities": "Create and receive payments, purchase physical goods, make investments, and more.", + }, +} + TOOLS_TEMPLATE = """\ --- sidebar_position: 0 @@ -220,6 +228,12 @@ The following table shows tools that can be used to automate tasks in databases: {database_table} +## Finance + +The following table shows tools that can be used to execute financial transactions such as payments, purchases, and more: + +{finance_table} + ## All tools import {{ IndexTable }} from "@theme/FeatureTables"; @@ -290,6 +304,22 @@ def get_database_table() -> str: return "\n".join(["|".join(row) for row in rows]) +def get_finance_table() -> str: + """Get the table of finance tools.""" + header = ["tool", "pricing", "capabilities"] + title = ["Tool/Toolkit", "Pricing", "Capabilities"] + rows = [title, [":-"] + [":-:"] * (len(title) - 1)] + for finance_tool, feats in sorted(FINANCE_TOOL_FEAT_TABLE.items()): + # Fields are in the order of the header + row = [ + f"[{finance_tool}]({feats['link']})", + ] + for h in header[1:]: + row.append(feats.get(h)) + rows.append(row) + return "\n".join(["|".join(row) for row in rows]) + + def get_search_tools_table() -> str: """Get the table of search tools.""" header = ["tool", "pricing", "available_data"] @@ -355,6 +385,7 @@ if __name__ == "__main__": productivity_table=get_productivity_table(), webbrowsing_table=get_webbrowsing_table(), database_table=get_database_table(), + finance_table=get_finance_table(), ) with open(output_integrations_dir / "tools" / "index.mdx", "w") as f: f.write(tools_page) diff --git a/libs/packages.yml b/libs/packages.yml index ea4881568b2..23f86fd6b8d 100644 --- a/libs/packages.yml +++ b/libs/packages.yml @@ -2,6 +2,11 @@ # it is EXPERIMENTAL and may be removed in the future packages: +- name: goat-sdk-adapter-langchain + path: python/src/adapters/langchain + repo: goat-sdk/goat + name_title: GOAT SDK + provider_page: goat - name: langchain-core path: libs/core repo: langchain-ai/langchain @@ -559,4 +564,4 @@ packages: repo: memgraph/langchain-memgraph - name: langchain-vectara path: libs/vectara - repo: vectara/langchain-vectara + repo: vectara/langchain-vectara \ No newline at end of file