Can I leave the updating of data to OpenAI?

I am currently developing a chatbot that helps the user with goals.

The chat bot is connected to a goal setting tool that contains the users data on goals, checkins etc.

The chat bot lives in slack, but the goal setting tool is a separate web app.

My task is to enable functionality so that the user can update data in the goal setting tool, directly from slack, via the chat bot.

At first we wanted to build some kind of functionality using slacks app development features, like a button or a select text and right click, but really, the better thing would be to just tell the chat bot what you want to update and let the chat bot update it. For example:

User: “Hey, what are my goals”
ChatBot “Your goal is to clean your room”
User: “Ok, I will do it today.”
ChatBot: “Would you like me to add that as a checkin to your goal?”
User: “yes, please”.
ChatBot: “Ok, added “I will clean my room today” as a checkin to your goal “Clean the room””.
User: “wait, change that to tomorrow…”
ChatBot: "Ok, edited the checkin to “I will clean my room tomorrow” to your goal “Clean the room”.

We are using Prompt Chaining for the prompts today, so no fine tuning going on. The app is built in Node.js and I basically just want to add a prompt saying something like

"if the user wants you to update any data in the tool, use the following scripts for the various types of updates available:

Add Goal: // execute some script to update the database
Edit Goal: // execute some script to update the database
Add Checkin to Goal: // execute some script to update the database
Edit Checkin to Goal: // execute some script to update the database
"

Any experience in letting a bot execute and write to a database via script as described in the above example? I am a bit unsure how to structure the whole functionality.

Possible?

1 Like

You can take the example code from the plugins.

Try using function calling

User: “Hey, what are my goals”

function_call: get_my_goal({ date: today })
your api output: { date: today, goal: 'clean the room'}

ChatBot “Your goal is to clean your room”
User: “Ok, I will do it today.”
ChatBot: “Would you like me to add that as a checkin to your goal?”
User: “yes, please”.

function_call: add_checkin({goal: 'clean the room', checkin: 'I will clean my room today'})
your api output: { status: 'added', goal: 'clean the room', checkin: 'I will clean my room today'}

ChatBot: “Ok, added “I will clean my room today” as a checkin to your goal “Clean the room””.
User: “wait, change that to tomorrow…”

function_call: edit_checkin({goal: 'clean the room', checkin: 'I will clean my room tomorrow'})
your api output: {status: 'edited', goal: 'clean the room', checkin: 'I will clean my room tomorrow'}

ChatBot: "Ok, edited the checkin to “I will clean my room tomorrow” to your goal “Clean the room”.

Thanks for the advice guys, I guess the goto method now is with the custom actions in the new Assistants API and the custom GPT functionality, really awesome things ahead it seems like.