from retab import Retab
client = Retab()
response = client.projects.documents.create(
project_id="<project_id>",
document="Invoice.pdf",
annotation={
"invoice_number": "12345"
}
)
{
"mime_data": {
"filename": "file.pdf",
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."
},
"annotation": {},
"annotation_metadata": {
"extraction_id": "<string>",
"likelihoods": {},
"field_locations": {},
"agentic_field_locations": {},
"consensus_details": [
{}
],
"api_cost": {
"value": 123,
"currency": "<string>"
}
},
"id": "<string>",
"ocr_file_id": "<string>"
}
Add a new document to an evaluation.
from retab import Retab
client = Retab()
response = client.projects.documents.create(
project_id="<project_id>",
document="Invoice.pdf",
annotation={
"invoice_number": "12345"
}
)
{
"mime_data": {
"filename": "file.pdf",
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."
},
"annotation": {},
"annotation_metadata": {
"extraction_id": "<string>",
"likelihoods": {},
"field_locations": {},
"agentic_field_locations": {},
"consensus_details": [
{}
],
"api_cost": {
"value": 123,
"currency": "<string>"
}
},
"id": "<string>",
"ocr_file_id": "<string>"
}
from retab import Retab
client = Retab()
response = client.projects.documents.create(
project_id="<project_id>",
document="Invoice.pdf",
annotation={
"invoice_number": "12345"
}
)
Successful Response
The response is of type object
.