adrienne
@adrienne
One of the challenges I've had building the GM Farcaster AI bot is getting it to have a back-and-forth conversation on Farcaster with a user in a natural way, just like you and I would :) The API is serverless and stateless, so every time the bot is tagged, it has no awareness or memory of being tagged before. My first attempt to give the bot awareness of ongoing conversations was by building a recursive function that recreated the chat history between the bot and the user. I then passed this history into the prompt as "conversation history." I later switched to using the new Neynar API, which provides a conversation summary. This change simplified my code and broadened the botβs awareness to include comments from other users in the thread, not just the direct back-and-forth. It's working OK, but it's not great. Yesterday, I learned there might be a better approach by using the "messages" array in the GPT API instead of the "jam everything into a massive prompt" method.
1 reply
0 recast
4 reactions
adrienne
@adrienne
I've been handling everything with "one large prompt" sent to an LLM, injecting specific knowledge (like GM Farcaster transcripts) and chat memory (using Neynar's thread summary). But I want to run an experiment using the API's messages array to send chat history as separate messages instead of injecting it into the prompt. API docs: https://platform.openai.com/docs/api-reference/chat/create I'll start small by removing the chat history from the main prompt and test passing it as separate messages. This will simplify the prompt and allow the model to use its built-in capabilities to manage the conversation flow. To get started, I need to rebuild a chat history, going back to what I initially started with. @rish, do you guys have an API that does this, or any other APIs or tooling that might be useful? Or does any other AI bot developer have advice?
2 replies
0 recast
0 reaction
vrypan |--o--|
@vrypan.eth
How about this? https://warpcast.com/vrypan.eth/0x74d751831186cfa03409438db3934d88fe1571f0
0 reply
0 recast
0 reaction