ara-cli 0.1.9.71__py3-none-any.whl → 0.1.9.73__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.

ara_cli/chat.py CHANGED
@@ -348,7 +348,7 @@ Start chatting (type 'HELP'/'h' for available commands, 'QUIT'/'q' to exit chat
348
348
 
349
349
  @file_exists_check
350
350
  def load_text_file(self, file_path, prefix: str = "", suffix: str = "", block_delimiter: str = ""):
351
- with open(file_path, 'r', encoding='utf-8') as file:
351
+ with open(file_path, 'r', encoding='utf-8', errors="replace") as file:
352
352
  file_content = file.read()
353
353
  if block_delimiter:
354
354
  file_content = f"{block_delimiter}\n{file_content}\n{block_delimiter}"
ara_cli/prompt_handler.py CHANGED
@@ -12,6 +12,7 @@ from re import findall
12
12
  import re
13
13
  import shutil
14
14
  import glob
15
+ import logging
15
16
 
16
17
 
17
18
  class LLMSingleton:
@@ -78,9 +79,25 @@ def send_prompt(prompt):
78
79
  if "provider" in config_parameters:
79
80
  del config_parameters["provider"]
80
81
 
82
+ filtered_prompt = list(filter(
83
+ lambda msg: (
84
+ msg.get('content') and
85
+ isinstance(msg['content'], list) and
86
+ any(
87
+ item.get('type') == 'text' and
88
+ item.get('text', '').strip() != ''
89
+ for item in msg['content']
90
+ )
91
+ ) or (
92
+ isinstance(msg.get('content'), str) and
93
+ msg['content'].strip() != ''
94
+ ),
95
+ prompt
96
+ ))
97
+
81
98
  completion = litellm.completion(
82
99
  **config_parameters,
83
- messages=prompt,
100
+ messages=filtered_prompt,
84
101
  stream=True
85
102
  )
86
103
  for chunk in completion:
@@ -355,10 +372,19 @@ def prepend_system_prompt(message_list):
355
372
 
356
373
 
357
374
  def append_images_to_message(message, image_data_list):
375
+ logger = logging.getLogger(__name__)
376
+
377
+ logger.debug(f"append_images_to_message called with image_data_list length: {len(image_data_list) if image_data_list else 0}")
378
+
358
379
  if not image_data_list:
380
+ logger.debug("No images to append, returning original message")
359
381
  return message
382
+
360
383
  message_content = message["content"]
384
+ logger.debug(f"Original message content: {message_content}")
385
+
361
386
  message["content"] = message_content + image_data_list
387
+ logger.debug(f"Updated message content with {len(image_data_list)} images")
362
388
 
363
389
  return message
364
390
 
ara_cli/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "0.1.9.71" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
2
+ __version__ = "0.1.9.73" # 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.4
2
2
  Name: ara_cli
3
- Version: 0.1.9.71
3
+ Version: 0.1.9.73
4
4
  Requires-Dist: litellm
5
5
  Requires-Dist: llama-index
6
6
  Requires-Dist: llama-index-llms-openai
@@ -12,7 +12,7 @@ ara_cli/artefact_lister.py,sha256=jhk4n4eqp7hDIq07q43QzS7-36BM3OfZ4EABxCeOGcw,47
12
12
  ara_cli/artefact_reader.py,sha256=E6DMBvbOYf1OoLf-OyLaiB6K2-gd7iHmjoQZU9Rsy6g,6965
13
13
  ara_cli/artefact_renamer.py,sha256=Hnz_3zD9xxnBa1FHyUE6mIktLk_9ttP2rFRvQIkmz-o,4061
14
14
  ara_cli/artefact_scan.py,sha256=yg1ozwavWmqsrO9lx4bY3ggCooiPJ_DYQuZuJlFJdqc,3617
15
- ara_cli/chat.py,sha256=Vv4tfzP203hCISd2Q0W0ZZ7ua7dk0jJ1qdl9NiHI5gM,28635
15
+ ara_cli/chat.py,sha256=YQMMGzX6OcC62eSa-d9OgnyOIY-vGSpe9CWkw4yQERw,28653
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
@@ -25,13 +25,13 @@ ara_cli/list_filter.py,sha256=qKGwwQsrWe7L5FbdxEbBYD1bbbi8c-RMypjXqXvLbgs,5291
25
25
  ara_cli/output_suppressor.py,sha256=nwiHaQLwabOjMoJOeUESBnZszGMxrQZfJ3N2OvahX7Y,389
26
26
  ara_cli/prompt_chat.py,sha256=kd_OINDQFit6jN04bb7mzgY259JBbRaTaNp9F-webkc,1346
27
27
  ara_cli/prompt_extractor.py,sha256=6l1Or7wuFNUDqbMg-NDXpFX-WMi2XV7YGH6hGDvow2o,7557
28
- ara_cli/prompt_handler.py,sha256=ukYWR_AMDd8nfGkeUKyYQ8PO_-PfO8x9tV1kNcNWOT4,17672
28
+ ara_cli/prompt_handler.py,sha256=v0254EUk1A2h0y1NmpkllVH6v6Q6i0Yh9qXkQMBXVY4,18544
29
29
  ara_cli/prompt_rag.py,sha256=ydlhe4CUqz0jdzlY7jBbpKaf_5fjMrAZKnriKea3ZAg,7485
30
30
  ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,2360
31
31
  ara_cli/tag_extractor.py,sha256=4krQyvmLR2ffhe7N7lWC7QjaxXcb90HaQdmjnBiD8ak,2523
32
32
  ara_cli/template_manager.py,sha256=flMO3yXMUIgBxCgLdRtIhxezPDs5kfh3IASySSa1IKI,6669
33
33
  ara_cli/update_config_prompt.py,sha256=Oy9vNTw6UhDohyTEfSKkqE5ifEMPlmWNYkKHgUrK_pY,4607
34
- ara_cli/version.py,sha256=EyUSNmWg71ZqSwLCGsMkHZC9sx8se2ACVTOoCek_sn0,146
34
+ ara_cli/version.py,sha256=Fkcphnkq4lozj0BsW7BdT4bRYhcfnB6-sroqJftaUbU,146
35
35
  ara_cli/artefact_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  ara_cli/artefact_models/artefact_load.py,sha256=dNcwZDW2Dk0bts9YnPZ0ESmWD2NbsLIvl4Z-qQeGmTQ,401
37
37
  ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
@@ -141,7 +141,7 @@ tests/test_artefact_lister.py,sha256=VCEOCgDgnAOeUUgIoGAbWgz60hf9UT-tdHg18LGfB34
141
141
  tests/test_artefact_reader.py,sha256=660K-d8ed-j8hulsUB_7baPD2-hhbg9TffUR5yVc4Uo,927
142
142
  tests/test_artefact_renamer.py,sha256=lSnKCCfoFGgKhTdDZrEaeBq1xJAak1QoqH5aSeOe9Ro,3494
143
143
  tests/test_artefact_scan.py,sha256=m1dws5d5m-dMnCn43BVhnNHHLU75zgVWaKIEK9y76fk,7512
144
- tests/test_chat.py,sha256=-00mni6Kik_RO8BGUpWqaL4S0wt2MbUBi5jD06dSHJM,47538
144
+ tests/test_chat.py,sha256=LCILs4qPykTjziAx29cw2mnDWNMrHPa7xSNCjj9p7z0,47556
145
145
  tests/test_classifier.py,sha256=grYGPksydNdPsaEBQxYHZTuTdcJWz7VQtikCKA6BNaQ,1920
146
146
  tests/test_directory_navigator.py,sha256=7G0MVrBbtBvbrFUpL0zb_9EkEWi1dulWuHsrQxMJxDY,140
147
147
  tests/test_file_classifier.py,sha256=kLWPiePu3F5mkVuI_lK_2QlLh2kXD_Mt2K8KZZ1fAnA,10940
@@ -151,8 +151,8 @@ tests/test_list_filter.py,sha256=fJA3d_SdaOAUkE7jn68MOVS0THXGghy1fye_64Zvo1U,796
151
151
  tests/test_tag_extractor.py,sha256=nSiAYlTKZ7TLAOtcJpwK5zTWHhFYU0tI5xKnivLc1dU,2712
152
152
  tests/test_template_manager.py,sha256=q-LMHRG4rHkD6ON6YW4cpZxUx9hul6Or8wVVRC2kb-8,4099
153
153
  tests/test_update_config_prompt.py,sha256=xsqj1WTn4BsG5Q2t-sNPfu7EoMURFcS-hfb5VSXUnJc,6765
154
- ara_cli-0.1.9.71.dist-info/METADATA,sha256=EloNN_cqYAUedL2f6JFADIE1mBXJSXD8nknW5Ggc9Y8,415
155
- ara_cli-0.1.9.71.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
156
- ara_cli-0.1.9.71.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
157
- ara_cli-0.1.9.71.dist-info/top_level.txt,sha256=WM4cLHT5DYUaWzLtRj-gu3yVNFpGQ6lLRI3FMmC-38I,14
158
- ara_cli-0.1.9.71.dist-info/RECORD,,
154
+ ara_cli-0.1.9.73.dist-info/METADATA,sha256=roHkKTln1RD4o2Elt62jRX3K4D4Za5HqS5IEU-BDn0A,415
155
+ ara_cli-0.1.9.73.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
156
+ ara_cli-0.1.9.73.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
157
+ ara_cli-0.1.9.73.dist-info/top_level.txt,sha256=WM4cLHT5DYUaWzLtRj-gu3yVNFpGQ6lLRI3FMmC-38I,14
158
+ ara_cli-0.1.9.73.dist-info/RECORD,,
tests/test_chat.py CHANGED
@@ -485,7 +485,7 @@ def test_load_text_file(temp_chat_file, file_name, file_content, prefix, suffix,
485
485
 
486
486
  assert result is True
487
487
 
488
- mock_file.assert_any_call(file_name, 'r', encoding='utf-8')
488
+ mock_file.assert_any_call(file_name, 'r', encoding='utf-8', errors="replace")
489
489
 
490
490
  mock_file.assert_any_call(chat.chat_name, 'a', encoding='utf-8')
491
491