Dedicated suffix for 'Message' files #13

Open
opened 2023-09-17 13:53:43 +02:00 by juk0de · 0 comments
Collaborator

Currently, a Message file can have two formats: txt and yaml and the file suffix depends on the format, i. e. we allow both 0001.txt and 0001.yaml for a Message with the ID 0001. This causes various issues:

  • A Message with the same ID can exist twice
    • see Chat.validate()
  • Other files with the same suffix but different content can cause errors
    • see Chat.read_dir()
  • It's hard to introduce files with different content but same format

Solution
Introduce a new suffix (e. g. .msg) for all Message files, independent of the format. When reading those files, try one format first and in case of errors, try the other. Always use .msg when writing files, but add an optional parameter format to Message.to_file().

Currently, a `Message` file can have two formats: `txt` and `yaml` and the file suffix depends on the format, i. e. we allow both `0001.txt` and `0001.yaml` for a `Message` with the ID `0001`. This causes various issues: * A Message with the same ID can exist twice * see `Chat.validate()` * Other files with the same suffix but different content can cause errors * see `Chat.read_dir()` * It's hard to introduce files with different content but same format * e. g. files containing [DeepL glossaries](https://www.deepl.com/de/docs-api/glossaries) **Solution** Introduce a new suffix (e. g. `.msg`) for **all** `Message` files, independent of the format. When reading those files, try one format first and in case of errors, try the other. Always use `.msg` when writing files, but add an optional parameter `format` to `Message.to_file()`.
juk0de added the enhancement label 2023-09-17 13:53:43 +02:00
juk0de added reference msg_suffix 2023-09-26 18:26:28 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kaizenkodo/ChatMastermind#13