Skip to content

Commit d53bc8f

Browse files
author
hfhoffman1144
committed
idk
1 parent 01eef12 commit d53bc8f

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

python-langgraph/chains/binary_questions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ class BinaryAnswer(BaseModel):
2626
binary_question_model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
2727

2828
BINARY_QUESTION_CHAIN = (
29-
binary_question_prompt | binary_question_model.with_structured_output(BinaryAnswer)
29+
binary_question_prompt
30+
| binary_question_model.with_structured_output(BinaryAnswer)
3031
)

python-langgraph/chains/escalation_check.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ class EscalationCheck(BaseModel):
2828
escalation_check_model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
2929

3030
ESCALATION_CHECK_CHAIN = (
31-
escalation_prompt | escalation_check_model.with_structured_output(EscalationCheck)
31+
escalation_prompt
32+
| escalation_check_model.with_structured_output(EscalationCheck)
3233
)

python-langgraph/chains/notice_extraction.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ class NoticeEmailExtract(BaseModel):
6565
@property
6666
def date_of_notice(self) -> date | None:
6767
try:
68-
return datetime.strptime(self.date_of_notice_str, "%Y-%m-%d").date()
68+
return datetime.strptime(
69+
self.date_of_notice_str, "%Y-%m-%d"
70+
).date()
6971
except Exception as e:
7072
print(e)
7173
return None
@@ -74,7 +76,9 @@ def date_of_notice(self) -> date | None:
7476
@property
7577
def compliance_deadline(self) -> date | None:
7678
try:
77-
return datetime.strptime(self.compliance_deadline_str, "%Y-%m-%d").date()
79+
return datetime.strptime(
80+
self.compliance_deadline_str, "%Y-%m-%d"
81+
).date()
7882
except Exception as e:
7983
print(e)
8084
return None
@@ -100,6 +104,7 @@ def compliance_deadline(self) -> date | None:
100104

101105
notice_parser_model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
102106

103-
NOTICE_PARSER_CHAIN = info_parse_prompt | notice_parser_model.with_structured_output(
104-
NoticeEmailExtract
107+
NOTICE_PARSER_CHAIN = (
108+
info_parse_prompt
109+
| notice_parser_model.with_structured_output(NoticeEmailExtract)
105110
)

python-langgraph/graphs/email_agent.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def forward_email(email_message: str, send_to_email: str) -> bool:
2727

2828

2929
@tool
30-
def send_wrong_email_notification_to_sender(sender_email: str, correct_department: str):
30+
def send_wrong_email_notification_to_sender(
31+
sender_email: str, correct_department: str
32+
):
3133
"""
3234
Send an email back to the sender informing them that
3335
they have the wrong address. The email should be sent
@@ -42,7 +44,9 @@ def send_wrong_email_notification_to_sender(sender_email: str, correct_departmen
4244

4345

4446
@tool
45-
def extract_notice_data(email: str, escalation_criteria: str) -> NoticeEmailExtract:
47+
def extract_notice_data(
48+
email: str, escalation_criteria: str
49+
) -> NoticeEmailExtract:
4650
"""
4751
Extract structured fields from a regulatory notice.
4852
This should be used when the email message comes from
@@ -106,7 +110,9 @@ def determine_email_action(email: str) -> str:
106110
]
107111
tool_node = ToolNode(tools)
108112

109-
EMAIL_AGENT_MODEL = ChatOpenAI(model="gpt-4o-mini", temperature=0).bind_tools(tools)
113+
EMAIL_AGENT_MODEL = ChatOpenAI(model="gpt-4o-mini", temperature=0).bind_tools(
114+
tools
115+
)
110116

111117

112118
def call_agent_model_node(state: MessagesState) -> dict[str, list[AIMessage]]:

python-langgraph/utils/graph_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def create_legal_ticket(
3333
]
3434

3535
if current_follow_ups:
36-
follow_ups = [f for f in follow_ups if f not in current_follow_ups.keys()]
36+
follow_ups = [
37+
f for f in follow_ups if f not in current_follow_ups.keys()
38+
]
3739

3840
follow_up = random.choice(follow_ups)
3941

0 commit comments

Comments
 (0)