Core Docs

ImageToJson

Upload ảnh + AI extract thành JSON — dùng cho OCR / nhận diện form / hoá đơn.

Source: Core/Components/ImageToJson.cs · ComType: ImageToJson

Cấu hình

ComType:    ImageToJson
IsRealtime: true

Field DB dùng

FieldVai trò
EventsJSON map {"AfterChat": "OnImageParsed"} để hook handler khi AI parse xong.
IsRealtimeTrue → push update qua WebSocket khi AI xử lý xong (recommended).

Events kích hoạt

EventMethod signature
AfterChat(taskComment, result, timeLine)

Fire sau khi AI parse xong ảnh thành JSON. result chứa data extracted.

public void OnImageParsed(object taskComment, object result, object timeLine)
{
    var json = result.ToString();
    Toast.Success("Đã trích xuất: " + json);
    // populate vào field của entity
}

Khi nào dùng

  • Scan hoá đơn → auto fill form.
  • OCR tài liệu → parse meta data.
  • Đọc số xe / passport / barcode từ ảnh.

Tip

  • Pipeline backend cần wire vào AI service (OpenAI Vision, Azure Form Recognizer, …).
  • IsRealtime = true → push update qua WebSocket khi AI xử lý xong.

Core Docs · Astro · Core.API/wwwRoot/docs