Skip to content

Commit

Permalink
lint and formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rgstephens committed Dec 10, 2024
1 parent 3fcfc70 commit 44e081e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ formatter:

lint:
flake8 actions
black --check actions
black --check actions --line-length 79

types:
pytype --keep-going actions
Expand Down
5 changes: 4 additions & 1 deletion actions/add_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def name(self) -> str:
return "add_contact"

def run(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[str, Any]
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[str, Any],
) -> List[Dict[Text, Any]]:
contacts = get_contacts(tracker.sender_id)
name = tracker.get_slot("add_contact_name")
Expand Down
1 change: 0 additions & 1 deletion actions/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Any, List

from pydantic import BaseModel

from rasa.nlu.utils import write_json_to_file
from rasa.shared.utils.io import read_json_file

Expand Down
9 changes: 7 additions & 2 deletions actions/list_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ def name(self) -> str:
return "list_contacts"

def run(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[str, Any]
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[str, Any],
) -> List[Dict[Text, Any]]:
contacts = get_contacts(tracker.sender_id)
if len(contacts) > 0:
contacts_list = "".join([f"- {c.name} ({c.handle}) \n" for c in contacts])
contacts_list = "".join(
[f"- {c.name} ({c.handle}) \n" for c in contacts]
)
return [SlotSet("contacts_list", contacts_list)]
else:
return [SlotSet("contacts_list", None)]
5 changes: 4 additions & 1 deletion actions/remove_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def name(self) -> str:
return "remove_contact"

def run(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[str, Any]
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[str, Any],
) -> List[Dict[Text, Any]]:
contacts = get_contacts(tracker.sender_id)
handle = tracker.get_slot("remove_contact_handle")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rasa-pro~=3.10.12
rasa-pro~=3.10.14
rasa-sdk~=3.10.1 # if you change this, make sure to change the Dockerfile to match
# -r actions/requirements-actions.txt

0 comments on commit 44e081e

Please sign in to comment.