>Khi ai đó đăng ký bằng email công việc, hãy làm phong phú công ty của họ và lưu trữ nó trên tài khoản.
- Đã đọc ninjapear Skill
- Chọn get_company_details thay vì crawl đầy đủ
- Đã viết enrichment.py với thử lại và xử lý lỗi
enrichment.py
import os
import ninjapear
config = ninjapear.Configuration(
host="https://nubela.co",
access_token=os.environ["NINJAPEAR_API_KEY"],
)
def enrich_signup(work_email: str) -> dict:
domain = work_email.split("@")[1]
with ninjapear.ApiClient(config) as client:
api = ninjapear.CompanyAPIApi(client)
return api.get_company_details(
website=domain,
include_employee_count=True,
)
Phiên tác nhân minh họa. Các lệnh gọi SDK là những lệnh được ghi chép.