Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Dec 9, 2024
2 parents 0170fcf + 5be9d98 commit 8bcd005
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions app/helpers/llm_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from app.models.reminder import ReminderModel
from app.models.training import TrainingModel

_db = CONFIG.database.instance()
_search = CONFIG.ai_search.instance()
_sms = CONFIG.sms.instance()

Expand Down Expand Up @@ -93,20 +94,22 @@ async def new_claim(
# Launch post-call intelligence for the current call
await self.post_callback(self.call)
# Store the last message and use it at first message of the new claim
last_message = self.call.messages[-1]
call = CallStateModel(
initiate=self.call.initiate.model_copy(),
voice_id=self.call.voice_id,
self.call = await _db.call_create(
CallStateModel(
initiate=self.call.initiate.model_copy(),
voice_id=self.call.voice_id,
messages=[
# Reinsert the call action
MessageModel(
action=MessageActionEnum.CALL,
content="",
persona=MessagePersonaEnum.HUMAN,
),
# Reinsert the last two messages
self.call.messages[-2],
],
)
)
call.messages += [
MessageModel(
action=MessageActionEnum.CALL,
content="",
persona=MessagePersonaEnum.HUMAN,
),
last_message,
]
self.call = call
return "Claim, reminders and messages reset"

async def new_or_updated_reminder(
Expand Down

0 comments on commit 8bcd005

Please sign in to comment.