Skip to content

Commit

Permalink
Add test using ActionInput instead of TwilioPhoneCallActionInput
Browse files Browse the repository at this point in the history
  • Loading branch information
HHousen committed Aug 10, 2023
1 parent 3998740 commit 1f860d0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/streaming/models/test_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,43 @@ def test_transcript_to_string():
ACTION_WORKER: action_config=NylasSendEmailActionConfig() conversation_id='123' params=NylasSendEmailParameters(recipient_email='[email protected]', body='What up', subject='This is the bot') twilio_sid='123'
ACTION_WORKER: action_type='action_nylas_send_email' response=NylasSendEmailResponse(success=True)"""
)


def test_transcript_to_string_no_phone_input():
transcript = Transcript(
event_logs=[
Message(sender=Sender.BOT, text="What up"),
Message(
sender=Sender.HUMAN,
text="Send me an email you bot. My email is [email protected]",
),
ActionStart(
action_type="action_nylas_send_email",
action_input=ActionInput(
action_config=NylasSendEmailActionConfig(),
conversation_id="123",
params=NylasSendEmailParameters(
recipient_email="[email protected]",
body="What up",
subject="This is the bot",
),
_user_message_tracker=asyncio.Event(),
),
),
ActionFinish(
action_type="action_nylas_send_email",
action_output=ActionOutput(
action_type="action_nylas_send_email",
response=NylasSendEmailResponse(success=True),
),
),
]
)

assert (
transcript.to_string()
== """BOT: What up
HUMAN: Send me an email you bot. My email is [email protected]
ACTION_WORKER: action_config=NylasSendEmailActionConfig() conversation_id='123' params=NylasSendEmailParameters(recipient_email='[email protected]', body='What up', subject='This is the bot')
ACTION_WORKER: action_type='action_nylas_send_email' response=NylasSendEmailResponse(success=True)"""
)

0 comments on commit 1f860d0

Please sign in to comment.