Skip to content

Commit 0cabf23

Browse files
authored
Package revision history entry in documentation updated (#4)
* Enhance logging in result assertion method Add logging for AI result extraction and verification. * Add entry for version 1.1.2 with improved logging * Refactor readme function to format changes from CHANGES.txt
1 parent 37afe05 commit 0cabf23

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

AIVision/library.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,11 @@ def add_watermark_to_image(
477477

478478
def _assert_result(self, response):
479479
result, explanation = self.genai.extract_result_and_explanation_from_response(response)
480-
if result and result.strip().lower() == "pass":
480+
try:
481+
logger.debug(f"AI Result is: ==>{result.strip().lower()}<==")
482+
except:
483+
logger.debug("AI Result not returned.")
484+
if result and "pass" in result.strip().lower():
481485
logger.info(f"Verification passed:\n{explanation}")
482486
else:
483487
raise AssertionError(f"Verification failed:\n{explanation}")

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
1.1.2, 2026-02-09 -- Improved debug logging
12
1.1.1, 2026-02-09 -- Pass/Fail AI response optimized
23
1.1.0, 2026-02-08 -- Added support for (text) files attachments
34
1.0.0, 2026-02-02 -- Release v1.0

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,16 @@ def license():
3535

3636
def readme():
3737
changes_title = '\n\nVersion history\n----------------\n\n'
38+
formatted_changes = []
3839

39-
with open('README.md') as r:
40-
with open('CHANGES.txt') as ch:
41-
return r.read() + changes_title + ch.read()
40+
with open('CHANGES.txt', 'r') as ch:
41+
for line in ch:
42+
stripped_line = line.strip()
43+
if stripped_line:
44+
formatted_changes.append(f'- {stripped_line}')
45+
46+
with open('README.md', 'r') as r:
47+
return r.read() + changes_title + '\n'.join(formatted_changes) + '\n'
4248

4349

4450
setup(name='robotframework_aivision',

0 commit comments

Comments
 (0)