In this section, we will see how to use the methods of the client.processors
module.
Please check the API Reference for more details.
Introduction
A processor is a configuration that tells UiForm what to extract (via a JSON Schema) and how to extract it (model, OCR pipeline, consensus …).
Once created, a processor can be triggered directly with .submit()
or indirectly through an Automation (link, mailbox, endpoint, Outlook add-in).
You can create, monitor, update, delete, and test processors in the dashboard .
Processor
Object
A Processor object containing the extraction configuration.
The type of object. Always "processor"
.
Unique identifier for the processor, prefixed with "proc_"
.
Human-readable name of the processor.
Output schema describing the JSON you expect.
OpenAI model used for extraction (e.g. "gpt-4o-mini"
).
OCR / vision pipeline ("native"
, "vision"
…).
DPI when rasterizing PDFs.
Viewport size when rendering HTML ("A3"
, "A4"
, "A5"
).
Number of parallel runs to achieve consensus.
UTC timestamp when the processor was created.
UTC timestamp of the last update.
Create
from uiform import UiForm
uiclient = UiForm()
invoice_schema = {
"type" : "object" ,
"properties" : {
"invoice_number" : { "type" : "string" },
"total_amount" : { "type" : "number" }
},
"required" : [ "invoice_number" , "total_amount" ]
}
processor = uiclient.processors.create(
name = "Invoice Processor" ,
json_schema =invoice_schema,
model = "gpt-4o-mini" ,
modality = "native" ,
temperature = 0 ,
reasoning_effort = "medium" ,
n_consensus = 1
)
Get
from uiform import UiForm
uiclient = UiForm()
processor_obj = uiclient.processors.get(
processor_id = "proc_01G34H8J2K"
)
List
from uiform import UiForm
uiclient = UiForm()
page = uiclient.processors.list(
limit = 20 ,
order = "asc"
)
# page.data -> list[Processor]
# page.before / page.after -> cursors
Update
from uiform import UiForm
uiclient = UiForm()
processor_obj = uiclient.processors.update(
processor_id = "proc_01G34H8J2K" ,
name = "Updated Invoice Processor" ,
temperature = 0.2
)
Delete
from uiform import UiForm
uiclient = UiForm()
uiclient.processors.delete(
processor_id = "proc_01G34H8J2K"
)
Submit
Send one or more files to a processor and receive parsed JSON back.
from uiform import UiForm, MIMEData
uiclient = UiForm()
with open ( "invoice.pdf" , "rb" ) as f:
mime = MIMEData.from_bytes(f.read(), filename = "invoice.pdf" )
completion = uiclient.processors.submit(
processor_id = "proc_01G34H8J2K" ,
document =mime
)