From 13ba2fe457b03dc693bd111dd678f98ed4f062a1 Mon Sep 17 00:00:00 2001 From: lasseedfast Date: Thu, 18 Sep 2025 15:22:44 +0200 Subject: [PATCH] Add compatibility attribute 'content' to response for legacy support --- _llm/llm.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_llm/llm.py b/_llm/llm.py index 4705599..93999e8 100644 --- a/_llm/llm.py +++ b/_llm/llm.py @@ -555,7 +555,15 @@ class LLM: if not self.chat: self.messages = [self.messages[0]] - return response.message + #* Add attribute 'content' for compatibility with old version of _llm.py + #* This is a copy of response.message.content + #TODO Remove this when _llm.py is updated + # Show a warning if using old version of _llm.py + Warning = ("Please use reposen.message.content when ising _llm") + + response.content = response.message + + return response else: return "An error occurred." except Exception as e: