Skip to content

feat: 封装飞书智能文档解析票据类接口 (DocumentAI invoice recognition)#21

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/wrap-invoice-api-in-larkapp
Draft

feat: 封装飞书智能文档解析票据类接口 (DocumentAI invoice recognition)#21
Copilot wants to merge 2 commits intomainfrom
copilot/wrap-invoice-api-in-larkapp

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

PR-21 PR-21 PR-21 Powered by Pull Request Badge

Wraps four Feishu Document AI invoice recognition endpoints into a single DocumentAIModel class, mounted on LarkApp.

New: DocumentAIModel

Extends BaseModel from mobx-restful. Each method accepts a File and POSTs multipart form-data to the respective endpoint.

Method Endpoint
recognizeVatInvoice document_ai/v1/vat_invoice/recognize
recognizeTaxiInvoice document_ai/v1/taxi_invoice/recognize
recognizeTrainInvoice document_ai/v1/train_invoice/recognize
recognizeVehicleInvoice document_ai/v1/vehicle_invoice/recognize
const vatResults = await app.documentAIStore.recognizeVatInvoice(file);
// => VatInvoice[] — each with entities: { type, value, score }[]

Types (src/module/DocumentAI/type.ts)

  • InvoiceEntity{ type, value, score }
  • Invoice{ entities: InvoiceEntity[] } — base for all four invoice type aliases (VatInvoice, TaxiInvoice, TrainInvoice, VehicleInvoice)

LarkApp changes

  • documentAIStore: DocumentAIModel mounted in constructor alongside existing stores

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • open.feishu.cn
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/MobX-Lark/MobX-Lark/node_modules/.bin/ts-node test/index.spec.ts developer-actionversion (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>封装飞书【智能文档解析】票据类接口</issue_title>
<issue_description>### Task description

接口文档

  1. 增值税发票:https://open.feishu.cn/document/ai/document_ai-v1/vat_invoice/recognize
  2. 出租车发票:https://open.feishu.cn/document/ai/document_ai-v1/taxi_invoice/recognize
  3. 火车票:https://open.feishu.cn/document/ai/document_ai-v1/train_invoice/recognize
  4. 机动车发票:https://open.feishu.cn/document/ai/document_ai-v1/vehicle_invoice/recognize

代码要求

将上述所有接口封装在同一个实现类中,并继承 mobx-restful 包的 BaseModel 基类,再将实例挂在 LarkApp 类上。

Reward currency

TQT $

Reward amount

90

Reward payer

石垚 tech-query@idea2app.cn

Task source

https://idea2app.feishu.cn/record/VhZJrYFjoe4zVfcO48tcYR1cn2Z</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Wrap Feishu smart document parsing invoice API feat: 封装飞书智能文档解析票据类接口 (DocumentAI invoice recognition) Mar 19, 2026
Copilot AI requested a review from TechQuery March 19, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

封装飞书【智能文档解析】票据类接口

2 participants