Skip to content

Commit

Permalink
Validate schema on data_schema setter (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajprad authored Jan 22, 2025
1 parent 5d6f8ed commit fcb8d4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llama_extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ def data_schema(self, data_schema: SchemaInput) -> None:
raise ValueError(
"data_schema must be either a dictionary or a Pydantic model"
)
self._data_schema = processed_schema
validated_schema = self._run_in_thread(
self._client.llama_extract.validate_extraction_schema(
data_schema=processed_schema
)
)
self._data_schema = validated_schema.data_schema

@property
def config(self) -> ExtractConfig:
Expand Down

0 comments on commit fcb8d4b

Please sign in to comment.