SDK 与客户端

jev-pii-checker

@coo-quack1TypeScriptMIT更新于 2026-09-20可当场跑

基于 TypeSafe Jev 的 CLI 工具,用于检测文本中的 PII,包括存在性、敏感度和具体位置。

英文原文

CLI that finds PII in text with TypeSafe Jev: presence, sensitivity, and located spans

coo-quack/jev-pii-checker

它在哪儿调用了 Jev

import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";

src/judge.ts:1

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 src/gate.ts:35

  1. person_name是/否

    Does the text mention the name of a specific individual person?

  2. email_or_phone是/否

    Does the text contain an email address or phone number of a specific person?

  3. postal_address是/否

    Does the text contain a postal address associated with a specific person?

  4. date_of_birth是/否

    Does the text contain the date of birth of a specific person?

  5. government_id是/否

    Does the text contain a government-issued identifier of a person (e.g., マイナンバー, passport number, driver's licence number)?

  6. financial_account是/否

    Does the text contain a credit card number or bank account number of a person?

  7. health_info是/否

    Does the text contain medical information, diagnosis, or treatment details of an identifiable person?

  8. biometric是/否

    Does the text contain biometric data (fingerprint, facial recognition, iris scan) of a specific person?

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    person_name: { type: 'boolean', instructions: 'Does the text mention the name of a specific individual person?' },
    email_or_phone: { type: 'boolean', instructions: 'Does the text contain an email address or phone number of a specific person?' },
    postal_address: { type: 'boolean', instructions: 'Does the text contain a postal address associated with a specific person?' },
    date_of_birth: { type: 'boolean', instructions: 'Does the text contain the date of birth of a specific person?' },
    government_id: { type: 'boolean', instructions: 'Does the text contain a government-issued identifier of a person (e.g., マイナンバー, passport number, driver\'s licence number)?' },
    financial_account: { type: 'boolean', instructions: 'Does the text contain a credit card number or bank account number of a person?' },
    health_info: { type: 'boolean', instructions: 'Does the text contain medical information, diagnosis, or treatment details of an identifiable person?' },
    biometric: { type: 'boolean', instructions: 'Does the text contain biometric data (fingerprint, facial recognition, iris scan) of a specific person?' },
  },
});

取自 src/locate.ts:62

  1. is_personal是/否

    Is the email address "

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    is_personal: { type: 'boolean', instructions: 'Is the email address "' },
  },
});

取自 src/locate.ts:101

  1. digit_type选项

    In `text`, what kind of number is 「${match.text}」?

    • my_numberマイナンバー or Japanese My Number
    • credit_cardCredit card number
    • bank_accountBank account number
    • phonePhone number (mobile or landline)
    • driver_licence_or_passportDriver's licence or passport number
    • national_idSocial security number or other national identification number
    • order_or_tracking_numberOrder number or parcel tracking number
    • product_serialProduct serial number or SKU
    • dateDate or date-related number
    • otherOther type of number

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    digit_type: { type: 'choice', instructions: 'In `text`, what kind of number is 「${match.text}」?',
      criteria: { my_number: 'マイナンバー or Japanese My Number', credit_card: 'Credit card number', bank_account: 'Bank account number', phone: 'Phone number (mobile or landline)', driver_licence_or_passport: 'Driver\'s licence or passport number', national_id: 'Social security number or other national identification number', order_or_tracking_number: 'Order number or parcel tracking number', product_serial: 'Product serial number or SKU', date: 'Date or date-related number', other: 'Other type of number' } },
  },
});

取自 src/locate.ts:150

  1. is_personal是/否

    Is the phone number "

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    is_personal: { type: 'boolean', instructions: 'Is the phone number "' },
  },
});

同类的其他项目