from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.extract.extract_with_schema(schema_id="schema_invoice_123", model="meetkai:functionary-urdu-mini-pak", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, prompt="Extract the structured invoice fields.")
# Handle response
print(res){
"success": true,
"data": {
"invoice_number": "INV-2024-001",
"vendor_name": "Acme Corporation",
"total_amount": 1250,
"date": "2024-01-15"
},
"metadata": {
"model": "meetkai:functionary-urdu-mini-pak",
"filename": "invoice.pdf",
"fileSize": 125000,
"extractedAt": "2024-01-15T10:30:00Z",
"schemaId": "schema_invoice_123",
"schemaName": "Invoice Extraction"
}
}Extrae datos estructurados de archivos utilizando una plantilla de esquema de extracción guardada previamente.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.extract.extract_with_schema(schema_id="schema_invoice_123", model="meetkai:functionary-urdu-mini-pak", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, prompt="Extract the structured invoice fields.")
# Handle response
print(res){
"success": true,
"data": {
"invoice_number": "INV-2024-001",
"vendor_name": "Acme Corporation",
"total_amount": 1250,
"date": "2024-01-15"
},
"metadata": {
"model": "meetkai:functionary-urdu-mini-pak",
"filename": "invoice.pdf",
"fileSize": 125000,
"extractedAt": "2024-01-15T10:30:00Z",
"schemaId": "schema_invoice_123",
"schemaName": "Invoice Extraction"
}
}Documentation Index
Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
Use this file to discover all available pages before exploring further.
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Optional external end-user identifier forwarded by the API gateway.
El identificador único del esquema de extracción que se utilizará para esta extracción.
Está bien
Respuesta del punto final de extracción que contiene los datos estructurados extraídos y los metadatos sobre el proceso de extracción.
Indica si la solicitud de extracción fue exitosa.
Metadatos sobre la solicitud de extracción y la ejecución
Show child attributes
Los datos estructurados extraídos que cumplen con el esquema JSON proporcionado. Este es el resultado de analizar el archivo y extraer información de acuerdo con la definición del esquema.
¿Esta página le ayudó?