Method
extractDataUsingLLM POST
Copy POST

Extract fields from a document using a large language model.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes fieldDescriptors list[FieldDescriptor] A list of fields to extract from the document.
No documentId str The ID of the document to query.
No documentText str The text of the document to query. Only used if document_id is not provided.
No llmName LLMName The name of the language model to use. If not provided, the default language model is used.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result ExtractedFields
KEY TYPE Description
data dict The fields/data extracted from the document.
rawLlmResponse str The raw llm response. Only returned if it could not be parsed to json dict.

Exceptions:

TYPE WHEN
DataNotFoundError

documentId is not found.

InvalidEnumParameterError

An invalid value is passed for llmName.

Language: