Restructuring the code #5
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If we'd restructure the code, it would make it easier to change and test it and also improve robustness:
tags.pymessage.pychat.pyTag/TagLineTagis a single tagTagLineis a line of tags with a defined prefixQuestion/AnswerQuestionis a question string for the AI (with a defined header for the file section)Answeris the response string from the AI (with a defined header for the file section)MessageMessageis composed ofQuestion+Answer, optionally a set ofTags and a filenameto_file(): write message to file (i. e.TagLine+Question.Prefix+Question+Answer.Prefix+Answerfrom_file(): read message parts from file and create aMessageinstanceChatMessages)Messages from DB folder (with filter for file names, tags and sort order)Questions andAnswers for a given string