feat: 完善子图,添加路由函数和审核节点
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 6m10s

This commit is contained in:
2026-04-25 20:46:30 +08:00
parent d05a57948c
commit e6337eb0fc
5 changed files with 139 additions and 6 deletions

View File

@@ -192,6 +192,45 @@ class ContactAPIClient:
"suggestion": "是否添加这些联系人?"
}
# 公共方法
def list_contacts(self, user_id: str = "default") -> List[Contact]:
"""查询联系人列表"""
return self.list_contacts_mock(user_id)
def add_contact(self, user_id: str, contact: Contact) -> bool:
"""添加联系人"""
return self.save_contact_mock(user_id, contact)
def list_emails(self, user_id: str = "default") -> List[Email]:
"""查询邮件列表"""
return self.list_emails_mock()
def generate_email_draft(self, query: str) -> Dict[str, str]:
"""生成邮件草稿"""
return self.generate_email_draft_mock(query)
def send_email(self, user_id: str, recipient: str, subject: str, body: str) -> bool:
"""发送邮件"""
result = self.send_email_mock(recipient, subject, body)
return result.get("success", False)
def sniff_contacts(self, query: str) -> List[Contact]:
"""智能嗅探联系人"""
result = self.sniff_contacts_mock(query)
contact_dicts = result.get("contacts", [])
return [
Contact(
id=str(i+1),
name=c.get("name", ""),
phone=c.get("phone", ""),
email=c.get("email", ""),
company="",
position="",
created_at=datetime.now().isoformat()
)
for i, c in enumerate(contact_dicts)
]
# 单例实例
contact_api = ContactAPIClient()