ara-cli 0.1.9.52__py3-none-any.whl → 0.1.9.53__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ara-cli might be problematic. Click here for more details.

@@ -266,6 +266,12 @@ def fetch_templates_action(args):
266
266
  target = join(target_dir, item)
267
267
  shutil.copy2(source, target)
268
268
 
269
+ custom_prompt_templates_subdir = config.custom_prompt_templates_subdir
270
+ local_prompt_modules_dir = join(prompt_templates_dir, custom_prompt_templates_subdir)
271
+ os.makedirs(local_prompt_modules_dir, exist_ok=True)
272
+ for subdir in subdirs:
273
+ os.makedirs(join(local_prompt_modules_dir, subdir), exist_ok=True)
274
+
269
275
 
270
276
  def read_action(args):
271
277
  from ara_cli.artefact_reader import ArtefactReader
ara_cli/ara_config.py CHANGED
@@ -2,7 +2,7 @@ from typing import List, Dict, Union, Optional
2
2
  from pydantic import BaseModel
3
3
  import json
4
4
  import os
5
- from os.path import exists, join, dirname
5
+ from os.path import exists, dirname
6
6
  from os import makedirs
7
7
  from functools import lru_cache
8
8
 
@@ -18,6 +18,7 @@ class ARAconfig(BaseModel):
18
18
  glossary_dir: str = "./glossary"
19
19
  doc_dir: str = "./docs"
20
20
  local_prompt_templates_dir: str = "./ara/.araconfig"
21
+ custom_prompt_templates_subdir: Optional[str] = "custom-prompt-modules"
21
22
  local_ara_templates_dir: str = "./ara/.araconfig/templates/"
22
23
  ara_prompt_given_list_includes: List[str] = [
23
24
  "*.businessgoal",
@@ -136,12 +137,6 @@ class ConfigManager:
136
137
 
137
138
  if not exists(config_dir):
138
139
  makedirs(config_dir)
139
- # create defined default path structure for custom prompts
140
- makedirs(join(config_dir, "custom-prompt-modules"))
141
- makedirs(join(config_dir, "custom-prompt-modules", "commands"))
142
- makedirs(join(config_dir, "custom-prompt-modules", "rule"))
143
- makedirs(join(config_dir, "custom-prompt-modules", "intentions"))
144
- makedirs(join(config_dir, "custom-prompt-modules", "blueprints"))
145
140
 
146
141
  cls._config_instance = read_data(filepath)
147
142
  return cls._config_instance
ara_cli/chat.py CHANGED
@@ -662,7 +662,8 @@ Start chatting (type 'HELP'/'h' for available commands, 'QUIT'/'q' to exit chat
662
662
  local_templates_path = os.path.join(os.getcwd(), local_templates_path)
663
663
  os.chdir(original_directory)
664
664
 
665
- template_directory = f"{local_templates_path}/custom-prompt-modules/{plural}"
665
+ custom_prompt_templates_subdir = self.config.custom_prompt_templates_subdir
666
+ template_directory = f"{local_templates_path}/{custom_prompt_templates_subdir}/{plural}"
666
667
  self._load_helper(template_directory, template_name, template_type)
667
668
 
668
669
  def _load_template_helper(self, template_name, template_type, default_pattern):
@@ -930,20 +930,24 @@ def test_do_LOAD_COMMANDS(monkeypatch, temp_chat_file, commands_name, expected_d
930
930
  mock_load_template_helper.assert_called_once_with(commands_name, "commands", "*.commands.md")
931
931
 
932
932
 
933
- @pytest.mark.parametrize("template_name, template_type, default_pattern, expected_directory, expected_pattern", [
934
- ("global/test_command", "commands", "*.commands.md", "mocked_template_base_path/prompt-modules/commands/", "test_command"),
935
- ("local_command", "commands", "*.commands.md", "/project/mocked_local_templates_path/custom-prompt-modules/commands", "local_command"),
936
-
937
- ("global/test_rule", "rules", "*.rules.md", "mocked_template_base_path/prompt-modules/rules/", "test_rule"),
938
- ("local_rule", "rules", "*.rules.md", "/project/mocked_local_templates_path/custom-prompt-modules/rules", "local_rule"),
939
-
940
- ("global/test_intention", "intention", "*.intentions.md", "mocked_template_base_path/prompt-modules/intentions/", "test_intention"),
941
- ("local_intention", "intention", "*.intentions.md", "/project/mocked_local_templates_path/custom-prompt-modules/intentions", "local_intention"),
942
-
943
- ("global/test_blueprint", "blueprint", "*.blueprints.md", "mocked_template_base_path/prompt-modules/blueprints/", "test_blueprint"),
944
- ("local_blueprint", "blueprint", "*.blueprints.md", "/project/mocked_local_templates_path/custom-prompt-modules/blueprints", "local_blueprint")
933
+ @pytest.mark.parametrize("template_name, template_type, default_pattern, custom_template_subdir, expected_directory, expected_pattern", [
934
+ ("global/test_command", "commands", "*.commands.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/commands/", "test_command"),
935
+ ("local_command", "commands", "*.commands.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/commands", "local_command"),
936
+ ("local_command", "commands", "*.commands.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/commands", "local_command"),
937
+
938
+ ("global/test_rule", "rules", "*.rules.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/rules/", "test_rule"),
939
+ ("local_rule", "rules", "*.rules.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/rules", "local_rule"),
940
+ ("local_rule", "rules", "*.rules.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/rules", "local_rule"),
941
+
942
+ ("global/test_intention", "intention", "*.intentions.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/intentions/", "test_intention"),
943
+ ("local_intention", "intention", "*.intentions.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/intentions", "local_intention"),
944
+ ("local_intention", "intention", "*.intentions.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/intentions", "local_intention"),
945
+
946
+ ("global/test_blueprint", "blueprint", "*.blueprints.md", "mocked_custom_modules_path", "mocked_template_base_path/prompt-modules/blueprints/", "test_blueprint"),
947
+ ("local_blueprint", "blueprint", "*.blueprints.md", "custom-prompt-modules", "/project/mocked_local_templates_path/custom-prompt-modules/blueprints", "local_blueprint"),
948
+ ("local_blueprint", "blueprint", "*.blueprints.md", "mocked_custom_modules_path", "/project/mocked_local_templates_path/mocked_custom_modules_path/blueprints", "local_blueprint")
945
949
  ])
946
- def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, template_name, template_type, default_pattern, expected_directory, expected_pattern):
950
+ def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, template_name, template_type, default_pattern, custom_template_subdir, expected_directory, expected_pattern):
947
951
  mock_config = get_default_config()
948
952
  with patch('ara_cli.prompt_handler.ConfigManager.get_config', return_value=mock_config):
949
953
  chat = Chat(temp_chat_file.name, reset=False)
@@ -956,6 +960,7 @@ def test_load_template_from_global_or_local(monkeypatch, temp_chat_file, templat
956
960
 
957
961
  config = chat.config
958
962
  config.local_prompt_templates_dir = mock_local_templates_path
963
+ config.custom_prompt_templates_subdir = custom_template_subdir
959
964
  chat.config = config
960
965
 
961
966
  with patch.object(chat, '_load_helper') as mock_load_helper:
ara_cli/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "0.1.9.52" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
2
+ __version__ = "0.1.9.53" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ara-cli
3
- Version: 0.1.9.52
3
+ Version: 0.1.9.53
4
4
  Requires-Dist: litellm
5
5
  Requires-Dist: llama-index
6
6
  Requires-Dist: llama-index-llms-openai
@@ -1,9 +1,9 @@
1
1
  ara_cli/__init__.py,sha256=0zl7IegxTid26EBGLav_fXZ4CCIV3H5TfAoFQiOHjvg,148
2
2
  ara_cli/__main__.py,sha256=3fYaQUcudgjqtJa2gj2LoYnhy-Wy1OfZIfXEYQf4m0U,1806
3
3
  ara_cli/analyse_artefacts.py,sha256=JwA2zxkCy8vNOHoU9f3TICJesXRRXndHi2hT5m_uQ8Q,4965
4
- ara_cli/ara_command_action.py,sha256=5V5QnOYoLgvayym6CW2e0jJFc2HhKTZihHiysw9ZM48,18459
4
+ ara_cli/ara_command_action.py,sha256=axyDx6Wj2IDP_gXFtMbuBsVQBYc8_dLCed1FntwwuAA,18784
5
5
  ara_cli/ara_command_parser.py,sha256=wbuPElD9GSDpaxHRH3yoyKaLAYsk6n9lE78jERD2zXg,16770
6
- ara_cli/ara_config.py,sha256=3sbTY-NzLAL6augf06wLTh_5-exwM0dHVxqS_7dxWcg,4571
6
+ ara_cli/ara_config.py,sha256=_Arkr-b9XnrNHbBlFKb9tAo3OmdP4ZZiWvbY9m6Sbo0,4178
7
7
  ara_cli/artefact_creator.py,sha256=s0hY8-X0EAwEfZvIRK1F67bW55tB-EvgnvH2gYNTGpY,6022
8
8
  ara_cli/artefact_deleter.py,sha256=Co4wwCH3yW8H9NrOq7_2p5571EeHr0TsfE-H8KqoOfY,1900
9
9
  ara_cli/artefact_fuzzy_search.py,sha256=sDxHKfg6P5TIiwznFgrMuMMhDp6EKElCbZsfflmkCww,1339
@@ -12,7 +12,7 @@ ara_cli/artefact_lister.py,sha256=jhk4n4eqp7hDIq07q43QzS7-36BM3OfZ4EABxCeOGcw,47
12
12
  ara_cli/artefact_reader.py,sha256=qNaMPWShmWtDU5LLdh9efFB27djI4NAoq6zEFwdTd38,6983
13
13
  ara_cli/artefact_renamer.py,sha256=U0cwkR6j1KVjz1LRqiHa11sqFCSyi_GaG5AWJHoLOx0,4009
14
14
  ara_cli/artefact_scan.py,sha256=DgFGv4hnbCjYdIgPA2PbAuGDWg1q2fCjtIqxGs57b9w,1762
15
- ara_cli/chat.py,sha256=MOJHRszQTUtBmGkOC96cIiXfkyGvrDkEirRagJEvm8U,28522
15
+ ara_cli/chat.py,sha256=7xTtPEDk052_wmIzoti7GavEJ1vpRxe5c084WQ1C7dg,28617
16
16
  ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
17
17
  ara_cli/codefusionretriever.py,sha256=fCHgXdIBRzkVAnapX-KI2NQ44XbrrF4tEQmn5J6clUI,1980
18
18
  ara_cli/codehierachieretriever.py,sha256=Xd3EgEWWhkSf1TmTWtf8X5_YvyE_4B66nRrqarwSiTU,1182
@@ -31,7 +31,7 @@ ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,23
31
31
  ara_cli/tag_extractor.py,sha256=IlFOeWRhuojXc4qVgBlfU0SXqfL_UW_q_iBrC8pdL1U,948
32
32
  ara_cli/template_manager.py,sha256=YXPj2jGNDb-diIHFEK_vGJ-ZucodnXSGAPofKTnOofI,6633
33
33
  ara_cli/update_config_prompt.py,sha256=PZgNIN3dTw6p80GyX8Sp5apkAhSoykwnkEbHo3IOkUo,4571
34
- ara_cli/version.py,sha256=pkOflZPbtrSLZdm4j5Ws2p77G9Jo5_lAqkuvQ6g5RGs,146
34
+ ara_cli/version.py,sha256=zdcfkgyo8ri4vHlSLr0See7qcxgboKrS8FmxdjMDD5A,146
35
35
  ara_cli/artefact_models/artefact_load.py,sha256=dNcwZDW2Dk0bts9YnPZ0ESmWD2NbsLIvl4Z-qQeGmTQ,401
36
36
  ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
37
37
  ara_cli/artefact_models/artefact_model.py,sha256=ORnG8xKtK_hXuhfUXpiRBUV0QUUZNfR3wFSQU7oJiDo,14454
@@ -138,7 +138,7 @@ ara_cli/tests/test_artefact_lister.py,sha256=VCEOCgDgnAOeUUgIoGAbWgz60hf9UT-tdHg
138
138
  ara_cli/tests/test_artefact_reader.py,sha256=660K-d8ed-j8hulsUB_7baPD2-hhbg9TffUR5yVc4Uo,927
139
139
  ara_cli/tests/test_artefact_renamer.py,sha256=Dls9Z65h3HiG55Irki7aPOxoIxx8mfZTOqy5k2_Jbls,6155
140
140
  ara_cli/tests/test_artefact_scan.py,sha256=m0V3HMLJtrOBXpJIRUI0D6MbHssgxDU_c935Wc3jatQ,4696
141
- ara_cli/tests/test_chat.py,sha256=VLQYsniaQI663xy8XFeoqczrVAoiln7tUm0yDjR1oGY,45727
141
+ ara_cli/tests/test_chat.py,sha256=V75baLk2ZFz5WDSFTlvdbmMb6Dm7o12xoFEulmMgMDI,46765
142
142
  ara_cli/tests/test_classifier.py,sha256=grYGPksydNdPsaEBQxYHZTuTdcJWz7VQtikCKA6BNaQ,1920
143
143
  ara_cli/tests/test_directory_navigator.py,sha256=7G0MVrBbtBvbrFUpL0zb_9EkEWi1dulWuHsrQxMJxDY,140
144
144
  ara_cli/tests/test_file_classifier.py,sha256=6OYM-lYVYjxq4Qwl8U1btv_FYJhc5t3rKjYr2CXZ4uI,10069
@@ -148,8 +148,8 @@ ara_cli/tests/test_list_filter.py,sha256=gSRKirTtFuhRS3QlFHqWl89WvCvAdVEnFsCWTYm
148
148
  ara_cli/tests/test_tag_extractor.py,sha256=A4Usip4DrCS5iOGo8wYcTvIHJfN9V_yepYDjdCUyQNk,1729
149
149
  ara_cli/tests/test_template_manager.py,sha256=bRxka6cxHsCAOvXjfG8MrVO8qSZXhxW01tnph80UtNk,3143
150
150
  ara_cli/tests/test_update_config_prompt.py,sha256=vSsLvc18HZdVjVM93qXWVbJt752xTLL6VGjSVCrPufk,6729
151
- ara_cli-0.1.9.52.dist-info/METADATA,sha256=LPiTn-w5P0D8PN2cLtTCMzBNK16r6yTHyyUUCIn7W3E,367
152
- ara_cli-0.1.9.52.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
153
- ara_cli-0.1.9.52.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
154
- ara_cli-0.1.9.52.dist-info/top_level.txt,sha256=zzee_PwFmKqfBi9XgIunP6xy2S4TIt593CLLxenNaAE,8
155
- ara_cli-0.1.9.52.dist-info/RECORD,,
151
+ ara_cli-0.1.9.53.dist-info/METADATA,sha256=tjJzYWfAMjsG1Z1_6Q2BiBexg02DjOhGM9y7mShGCdg,367
152
+ ara_cli-0.1.9.53.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
153
+ ara_cli-0.1.9.53.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
154
+ ara_cli-0.1.9.53.dist-info/top_level.txt,sha256=zzee_PwFmKqfBi9XgIunP6xy2S4TIt593CLLxenNaAE,8
155
+ ara_cli-0.1.9.53.dist-info/RECORD,,