-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework Replies #20
base: master
Are you sure you want to change the base?
Rework Replies #20
Conversation
This PR proposes the following IIUC, A reply is defined as a regex pattern + some config (the prompt), along with a list of replies (some prompts might only have one reply but others might have lots) that Eelbot will reply with once there is a match. The way this data is organized in the database is a unconventional. Conventional thinking to me suggests organizing the data as follows
This design is:
There isn't any obvious examples of people doing this in relational DBs, and while I personally do feel a more conventional design would have suited our purpose, it will be interesting to investigate this further, to see
So a bunch of thoughts & follow up work (not necessarily needed for this PR to merge) in no particular order Some of these questions / points are better thought of in the context of "how would something similar to this behave with a very very large dataset, the typical: 'How would you build twitter?' realm of questions"
|
# Add custom replies by creating a table under the `reply` schema in the database first, then adding an entry here to | ||
# reference it. Check the README for more details. | ||
- table_name: "myreply" | ||
regexps: | ||
- "a{3,6}" | ||
percent: 33 | ||
min_delay: 3 | ||
max_delay: 6 | ||
timeout: 600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to do this, IMO this needs to live in the DB not in config, it doesn't fully achieve the goal of being able to extend replies to -> easily / with eelbot-ui this way.
If you do this lets see if we can avoid having so many long type switches for all the numerical types in golang :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I did this is because the config is loaded once at startup whereas the DB tables can be changed at runtime (replies added/removed etc.). I felt like putting the config in the DB could imply that this too could be changed on the fly. I'll move the config to the DB now, and in a future MR perhaps, I think hot reloading of the config can be handled in the app by watching for changes (not sure how easy it is in Postgres).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not sure how easy it is in Postgres).
Not difficult IIUC. But I figure what we will more likely want to consider is having eelbot-ui signal to eelbot about changes rather than a DB level event.
I felt like putting the config in the DB could imply that this too could be changed on the fly
Yep, suspected this was the reason. But I do think we should build this around the hopefully realistic future case where eelbot-ui is going to be used to enter in a lot of new reply types without having to re-deploy eelbot often.
@CodiumAI-Agent /review |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
Reworks the "reply" portion of eelbot so that it uses the database for selecting a reply from. Replies are also more dynamic in nature and support matching using regex.