Skip to content

Commit

Permalink
v1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jan 24, 2025
1 parent bf5f8c5 commit 5accebb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions agixt/Conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ def update_message_by_id(self, message_id, new_message):
logging.info(f"No conversation found.")
session.close()
return

message = (
session.query(Message)
.filter(
Expand All @@ -1019,15 +1020,24 @@ def update_message_by_id(self, message_id, new_message):
)
.first()
)

if not message:
logging.info(
f"No message found with ID '{message_id}' in conversation '{self.conversation_name}'."
)
session.close()
return
message.content = new_message
session.commit()
session.close()

# Update the message content directly
message.content = str(new_message) # Ensure the content is a string

try:
session.commit()
except Exception as e:
logging.error(f"Error updating message: {e}")
session.rollback()
finally:
session.close()

def get_conversation_id(self):
if not self.conversation_name:
Expand Down
2 changes: 1 addition & 1 deletion agixt/endpoints/Conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ async def get_tts(
)
tts_url = await xt.text_to_speech(text=message, log_output=False)
new_message = (
f'{message}\n<audio controls><source src="{tts_url}" type="audio/wav"></audio>',
f'{message}\n<audio controls><source src="{tts_url}" type="audio/wav"></audio>'
)
c.update_message_by_id(message_id=message_id, new_message=new_message)
return {"message": new_message}
Expand Down
2 changes: 1 addition & 1 deletion agixt/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.7.1
v1.7.2

0 comments on commit 5accebb

Please sign in to comment.