Accessing ChatGPT in Farcaster Frames for interactive conversations in the social feed
This project allows a user to ask a question and get a response from ChatGPT within a Farcaster Frame. The specific use case is to help people on Farcaster get instant answers to any questions about Filecoin/IPFS and Base so they can keep up to date on latest updates and releases. All within the social feed and not have to leave it. This type of Frame can be the go-to community resource for either project.
Inspiration
We wanted to integrate a chatbot to answer questions about Filecoin/IPFS and Base while boosting engagement on Farcaster. Most frames link to an external website out of the social feed, which is bad UX. Users can get direct answers while remaining in the social feed.
This is an example of how web3 and AI can blend.
How We Built It
We built the project using Replit and used a tutorial on Farcaster's YouTube which set up an Express server. This allowed for the simplest version of a frame so we could add a request to the OpenAI Chat Completions endpoint and handle the response.
Challenges
We wanted to use frames.js and/or Airstack but couldn't get an understanding from their documentation of how to customize for our use case.
OpenAI's responses return as text, however Frames have limited properties (images and buttons). The goal was to turn the OpenAI response into an image, but we didn't have time. So instead we put the response in another button. Hopefully, a property type similar to the "title" can be added to Frames to display the response.
Additionally, we were planning on making the request to a custom chatbot with specific, up to date documentation so only questions about Filecoin and Base get answered.