284 Commits

Author SHA1 Message Date
a51c2ec2e0 added test module for the 'glossary' command 2024-02-06 18:50:07 +01:00
3c5b049b1f added 'glossary' command 2024-02-06 18:50:07 +01:00
0ebf359647 main: missing directories are now created if user agrees 2024-02-05 18:42:49 +01:00
c0b49c96b7 configuration: added 'glossaries' directory 2024-02-05 18:21:38 +01:00
2d94f8a108 glossary: now supports quoted and unquoted entries (incl. tests) 2024-02-05 08:26:27 +01:00
86f0e6d99c glossary test: added testcases for 'to_str()' 2024-02-05 07:56:57 +01:00
15f6e819e5 glossary: added 'to_str()' function 2024-02-05 07:56:34 +01:00
86295c6492 glossary test: added description test 2024-02-04 15:18:41 +01:00
91a7541581 glossary: added description and removed useless input stripping 2024-02-04 15:18:15 +01:00
a2ae52014b glossary test: added suffix testcases 2024-02-03 21:10:21 +01:00
6e89e014bf glossary: added suffix check 2024-02-03 21:09:33 +01:00
85315d9c1c glossary: added test module for glossaries 2024-02-03 08:42:32 +01:00
2de0faabdb added module 'glossary.py' 2024-02-03 08:42:32 +01:00
0c83ef6ce7 translation: added check for valid document format when using OpenAI 2024-02-03 07:52:39 +01:00
8046f1a424 translation: speficied / implemented the question format for OpenAI based translations 2024-02-03 07:52:39 +01:00
2f95654c52 translation: some small required refactoring 2024-02-03 07:52:39 +01:00
0449f70c63 added new command 'translation' 2024-02-03 07:52:39 +01:00
Oleksandr Kozachuk
0e1267139f Fix some of the commands. 2024-02-03 07:52:39 +01:00
Oleksandr Kozachuk
02dab2807c Fix usage of the dynamic answer is some cases. 2024-02-03 07:52:39 +01:00
Oleksandr Kozachuk
70164a1d45 Activate and use OpenAI streaming API. 2024-02-03 07:52:39 +01:00
Oleksandr Kozachuk
8f95a362d2 Fix source_code function with the dynamic answer class. 2024-02-03 07:52:39 +01:00
Oleksandr Kozachuk
ee363d9894 Refactor message.Answer class in a way, that it can be constructed dynamically step by step, in preparation of using streaming API. 2024-02-03 07:52:39 +01:00
5774278fb7 README: added new 'question' command parameters 2023-10-20 09:16:03 +02:00
40d0de50de cmm: limited the message locations for the new cmm parameters to those that make sense 2023-10-20 09:16:03 +02:00
72d31c26e9 main: improved parameter descriptions 2023-10-20 09:16:03 +02:00
980e5ac51f chat: changed default glob to '*.msg' in all ChatDB functions 2023-10-20 09:00:58 +02:00
Oleksandr Kozachuk
114282dfd8 Add --glob and --location flags to hist and question commands, to be able to specify the location and files they should use. 2023-10-19 16:03:51 +02:00
Oleksandr Kozachuk
9a493b57da Per default use only files with .msg suffix ignoring other files. 2023-10-19 16:02:40 +02:00
Oleksandr Kozachuk
9b0951cb3f Change type msg_location to an Enum instead of Literal to be able to get all values easy and improve type checks. 2023-10-19 16:00:44 +02:00
Oleksandr Kozachuk
5f29f60168 Add .old/ to git ignore, I use that dir ofter for old files, I do not want to delete. 2023-10-17 11:53:49 +02:00
3ea1f49027 cmm: added options '--tight' and '--no-paging' to the 'hist --print' cmd 2023-10-02 08:35:19 +02:00
8f56399844 cmm: replaced options '--with-tags' and '--with-file' with '--with-metadata' 2023-10-01 10:11:16 +02:00
e4cb6eb22b README: updated 'hist' command description 2023-10-01 09:27:40 +02:00
e19c6bb1ea hist_cmd: added module 'test_hist_cmd.py' 2023-09-30 08:25:33 +02:00
811b2e6830 hist_cmd: implemented '--convert' option 2023-09-29 18:53:12 +02:00
2a8f01aee4 chat: 'msg_gather()' now supports globbing 2023-09-29 07:16:20 +02:00
efdb3cae2f question: moved around some code 2023-09-29 07:16:20 +02:00
aecfd1088d chat: added message file format as ChatDB class member 2023-09-29 07:16:20 +02:00
140dbed809 message: added function 'rm_file()' and test 2023-09-29 07:16:20 +02:00
01860ace2c test_question_cmd: modified tests to use '.msg' file suffix 2023-09-29 07:16:20 +02:00
df42bcee09 test_chat: added test for file_path collision detection 2023-09-29 07:16:20 +02:00
e34eab6519 test_chat: changed all tests to use the new '.msg' suffix 2023-09-29 07:16:20 +02:00
d07fd13e8e test_message: changed all tests to use the new '.msg' suffix 2023-09-29 07:16:20 +02:00
b8681e8274 message: fixed tag matching for YAML file format 2023-09-29 07:16:20 +02:00
d2be53aeab chat: switched to new message suffix and formats
- no longer using file suffix to choose the format
- added 'mformat' argument to 'write_xxx()' functions
- file suffix is now set by 'Message.to_file()' per default
2023-09-29 07:16:20 +02:00
9ca9a23569 message: introduced file suffix '.msg'
- '.msg' suffix is always used for writing
- 'Message.to_file()' will set the file suffix if the given file_path has none
- added 'mformat' argument to 'Message.to_file()' for choosing the file format
- '.txt' and '.yaml' suffixes are only supported for reading
2023-09-29 07:16:20 +02:00
6f3758e12e question_cmd: fixed '--create' option 2023-09-29 07:15:46 +02:00
dd836cd72d Merge pull request 'cmm question --repeat supports multiple questions, added tests and fixes' (#15) from repeat_multi into main
This PR primarily modifies the `cmm question --repeat` command to allow repeating multiple questions, instead of only the last one.

Additionally, this PR includes the following changes:

- In `ai_factory.py`, added optional parameters 'def_ai' and 'def_model' to the `create_ai` function which allows specifying a default AI and model.
- In `openai.py`, a potential bug was fixed where the 'tags' attribute was updated to ensure it is always a set, even when 'otags' is None.
- In `question.py`, a significant amount of new code was added to facilitate the 'repeat' functionality. This includes functions to create modified args based on an existing message (`create_msg_args`), to repeat a given list of messages (`repeat_messages`), and to invert the semantics of the INPUT tags for this command (`invert_input_tag_args`).
- In `main.py`, the 'nargs' parameter was changed from `+` to `*` in the 'or-tags', 'and-tags', and 'exclude-tags' arguments to accommodate the updated handling of tags in `question.py`.
- A new `test_common.py` file was added which includes a `FakeAI` class for testing purposes, and a `TestWithFakeAI` class which includes a number of methods for asserting various conditions about messages.

This PR also includes additional tests to verify the correct operation of the new 'repeat' functionality.
2023-09-26 18:04:27 +02:00
601ebe731a test_question_cmd: added a new testcase and made the old cases more explicit (easier to read) 2023-09-24 08:53:37 +02:00
87b25993be tests: moved 'FakeAI' and common functions to 'test_common.py' 2023-09-24 08:38:52 +02:00