Skip to content

Commit

Permalink
fix: Delete style and action from SMS
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Apr 22, 2024
1 parent 6c6c295 commit faee78a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helpers/call_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
from models.call import CallModel
from models.message import (
ActionEnum as MessageActionEnum,
extract_message_style,
MessageModel,
PersonaEnum as MessagePersonaEnum,
remove_message_action,
)
from helpers.call_utils import (
ContextEnum as CallContextEnum,
Expand Down Expand Up @@ -311,6 +313,9 @@ async def _post_call_sms(call: CallModel) -> None:
call=call,
)

# Delete action and style from the message as they are in the history and LLM hallucinates them
_, content = extract_message_style(remove_message_action(content or ""))

if not content:
_logger.warning("Error generating SMS report")
return
Expand Down

0 comments on commit faee78a

Please sign in to comment.