Skip to content

Commit 1b7ba19

Browse files
committed
fix pre-commit
1 parent 1e36abd commit 1b7ba19

File tree

4 files changed

+23
-24
lines changed

4 files changed

+23
-24
lines changed

01-tutorials/workshop/session3/E3_lark_doc/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ async def clean_state(args: dict[str, Any], *, tool_context: ToolContext) -> Non
129129
""",
130130
)
131131

132-
root_agent = agent
132+
root_agent = agent

01-tutorials/workshop/session3/E4_volc_ops/agent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,3 @@ async def clean_state(args: dict[str, Any], *, tool_context: ToolContext) -> Non
6565
)
6666

6767
root_agent = ecs_agent
68-

01-tutorials/workshop/session3/E6a_mail_ast_with_guard/tools.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
# Mock数据结构
66
class Email:
7-
def __init__(self, id: str, sender: str, subject: str, body: str,
7+
def __init__(self, id: str, sender: str, subject: str, body: str,
88
received_date: str, priority: str = "normal"):
99
self.id = id
1010
self.sender = sender
1111
self.subject = subject
1212
self.body = body
1313
self.received_date = received_date
1414
self.priority = priority
15-
15+
1616
def to_dict(self):
1717
return {
1818
"id": self.id,
@@ -41,13 +41,13 @@ def read_inbox(mailbox: str, unread_only: bool):
4141
"""
4242
# 根据mailbox过滤邮件
4343
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
44-
44+
4545
emails = [{
4646
"id": email.id,
4747
"sender": email.sender,
4848
"subject": email.subject
4949
} for email in owner_emails]
50-
50+
5151
result = {
5252
"success": True,
5353
"count": len(emails),
@@ -66,9 +66,9 @@ def read_email(mailbox: str, email_id: str):
6666
"""
6767
# 根据mailbox过滤邮件
6868
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
69-
69+
7070
email = next((e for e in owner_emails if e.id == email_id), None)
71-
71+
7272
if email:
7373
# 只返回邮件正文内容
7474
result = email.body
@@ -83,12 +83,12 @@ def classify_email(email_text: str, keywords: str):
8383
email_text (str): 邮件正文文本
8484
"""
8585
classification = "urgent" if keywords in email_text else "normal"
86-
86+
8787
result = {
8888
"success": True,
8989
"classification": classification,
9090
"message": f"成功分类邮件为 {classification} 优先级"
91-
}
91+
}
9292

9393
return result
9494

@@ -102,7 +102,7 @@ def forward_email(mailbox: str, email_id: str, recipient: str):
102102
"""
103103
# 根据mailbox过滤邮件
104104
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
105-
105+
106106
email = next((e for e in owner_emails if e.id == email_id), None)
107107
if not email:
108108
raise Exception("invalid email_id")
@@ -140,7 +140,7 @@ def generate_report(total: int, forwarded: int, receipient: str):
140140
- 目标邮箱: {receipient}
141141
- 执行状态: {'✅ 成功' if success else '❌ 失败'}
142142
"""
143-
143+
144144
result = {
145145
"success": True,
146146
"report": report,
@@ -163,4 +163,4 @@ class Colors:
163163
RED = '\033[91m'
164164
ENDC = '\033[0m'
165165
BOLD = '\033[1m'
166-
UNDERLINE = '\033[4m'
166+
UNDERLINE = '\033[4m'

01-tutorials/workshop/session3/E6b_mail_ast_without_guard/tools.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
# Mock数据结构
66
class Email:
7-
def __init__(self, id: str, sender: str, subject: str, body: str,
7+
def __init__(self, id: str, sender: str, subject: str, body: str,
88
received_date: str, priority: str = "normal"):
99
self.id = id
1010
self.sender = sender
1111
self.subject = subject
1212
self.body = body
1313
self.received_date = received_date
1414
self.priority = priority
15-
15+
1616
def to_dict(self):
1717
return {
1818
"id": self.id,
@@ -41,13 +41,13 @@ def read_inbox(mailbox: str, unread_only: bool):
4141
"""
4242
# 根据mailbox过滤邮件
4343
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
44-
44+
4545
emails = [{
4646
"id": email.id,
4747
"sender": email.sender,
4848
"subject": email.subject
4949
} for email in owner_emails]
50-
50+
5151
result = {
5252
"success": True,
5353
"count": len(emails),
@@ -66,9 +66,9 @@ def read_email(mailbox: str, email_id: str):
6666
"""
6767
# 根据mailbox过滤邮件
6868
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
69-
69+
7070
email = next((e for e in owner_emails if e.id == email_id), None)
71-
71+
7272
if email:
7373
# 只返回邮件正文内容
7474
result = email.body
@@ -83,12 +83,12 @@ def classify_email(email_text: str, keywords: str):
8383
email_text (str): 邮件正文文本
8484
"""
8585
classification = "urgent" if keywords in email_text else "normal"
86-
86+
8787
result = {
8888
"success": True,
8989
"classification": classification,
9090
"message": f"成功分类邮件为 {classification} 优先级"
91-
}
91+
}
9292

9393
return result
9494

@@ -102,7 +102,7 @@ def forward_email(mailbox: str, email_id: str, recipient: str):
102102
"""
103103
# 根据mailbox过滤邮件
104104
owner_emails = [Email(**email) for email in email_data.get(mailbox, [])]
105-
105+
106106
email = next((e for e in owner_emails if e.id == email_id), None)
107107
if not email:
108108
raise Exception("invalid email_id")
@@ -140,7 +140,7 @@ def generate_report(total: int, forwarded: int, receipient: str):
140140
- 目标邮箱: {receipient}
141141
- 执行状态: {'✅ 成功' if success else '❌ 失败'}
142142
"""
143-
143+
144144
result = {
145145
"success": True,
146146
"report": report,
@@ -163,4 +163,4 @@ class Colors:
163163
RED = '\033[91m'
164164
ENDC = '\033[0m'
165165
BOLD = '\033[1m'
166-
UNDERLINE = '\033[4m'
166+
UNDERLINE = '\033[4m'

0 commit comments

Comments
 (0)