Member-only story
Coinbase SDK, AI AgentKit, Cryptocurrency
Adding Realtime Crypto Coin Price Fetching to the Coinbase / Open AI Chatbot — Multi-Tool Customizations
In addition to adding an easy new tool, I wanted to try adding multiple tools at once to the chatbot — works great!
Previously, I covered how to add new tools to the Coinbase SDK’s AgentKit Chatbot (the Open AI-integrated crypto chatbot project). It struck me that one thing I hadn’t yet tried is adding multiple tools at once. So, I whipped up another tool — this time a realtime crypto coin price checker — and added it to the codebase alongside my previous tool (a smart contract info-grabber).
The Idea and Challenge
I noticed that the default project cannot offer price quotes, so I thought I’d add that functionality quickly. Clearly, there are a handful of ways to go about this. At first, I thought maybe I’d do a fresh fetch each time the user (me) asks for a specific currency.
That would be doable, for sure. You’d just setup a “ticker” in your Zod object that listens for specifics like BTC, ETH, etc. I do think this could be a little more robust than what I wound up doing, but it might also cost more usage of the coin pricing API I wanted to hit up (the public endpoint from Coinbase…