Add compatibility attribute 'content' to response for legacy support

legacy
lasseedfast 5 months ago
parent 3239d6c367
commit 13ba2fe457
  1. 10
      _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:

Loading…
Cancel
Save