From 3168b250e03a88e81cb7d05fb4ac55b0e72e8b8d Mon Sep 17 00:00:00 2001 From: Alivecow Date: Fri, 21 Mar 2025 14:13:14 +0100 Subject: [PATCH] fix: Fix poem extraction from AI response Refs: OPS-64 --- .gitignore | 3 +++ senju/haiku.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a1db2f1..a2b9c12 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,6 @@ pyrightconfig.json # Ollama Local Dir ollama + +# Yes i know +*.kate-swp diff --git a/senju/haiku.py b/senju/haiku.py index 2fd7a2f..66d5348 100644 --- a/senju/haiku.py +++ b/senju/haiku.py @@ -39,7 +39,7 @@ class Haiku: lines = ai_response.split("\n") - for _ in range(0, 2): + while len(lines) != 3: lines.pop() logging.warning(lines)