Skip to content

Commit

Permalink
fix: Tool new_claim create a new claim
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed May 17, 2024
1 parent 6769740 commit ae051c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions helpers/call_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ async def _tools_cancellation_callback() -> None:
# Execute tools
tool_tasks = [tool_call.execute_function(plugins) for tool_call in tool_calls]
await asyncio.gather(*tool_tasks)
call = plugins.call # Update call model if object reference changed

# Store message
call.messages.append(
Expand Down
15 changes: 13 additions & 2 deletions helpers/llm_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,19 @@ async def new_claim(
self.post_call_intelligence(self.call)
# Store the last message and use it at first message of the new claim
last_message = self.call.messages[-1]
call = CallStateModel(phone_number=self.call.phone_number)
call.messages.append(last_message)
call = CallStateModel(
phone_number=self.call.phone_number,
voice_id=self.call.voice_id,
)
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 ae051c1

Please sign in to comment.