-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creates ActionConfigs for preset configuration on Actions (#300)
* adds notion of actionconfigs * fix import * adds playground action
- Loading branch information
Showing
11 changed files
with
134 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from vocode.streaming.action.base_action import BaseAction | ||
from vocode.streaming.action.nylas_send_email import NylasSendEmail | ||
from vocode.streaming.models.actions import ActionType | ||
from vocode.streaming.action.nylas_send_email import ( | ||
NylasSendEmail, | ||
NylasSendEmailActionConfig, | ||
) | ||
from vocode.streaming.models.actions import ActionConfig | ||
|
||
|
||
class ActionFactory: | ||
def create_action(self, action_type: str) -> BaseAction: | ||
if action_type == ActionType.NYLAS_SEND_EMAIL: | ||
return NylasSendEmail(should_respond=True) | ||
def create_action(self, action_config: ActionConfig) -> BaseAction: | ||
if isinstance(action_config, NylasSendEmailActionConfig): | ||
return NylasSendEmail(action_config, should_respond=True) | ||
else: | ||
raise Exception("Invalid action type") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters