morphik 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: morphik
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Morphik Python Client
5
5
  Author-email: Morphik <founders@morphik.ai>
6
6
  Requires-Python: >=3.8
@@ -36,7 +36,22 @@ class MetadataExtractionRule(Rule):
36
36
  def to_dict(self) -> Dict[str, Any]:
37
37
  if isinstance(self.schema, type) and issubclass(self.schema, BaseModel):
38
38
  # Convert Pydantic model to dict schema
39
- schema_dict = self.schema.model_json_schema()
39
+ json_schema = self.schema.model_json_schema()
40
+ # Extract the properties from the JSON schema format
41
+ # to match the expected server format
42
+ schema_dict = {}
43
+ if "properties" in json_schema:
44
+ for field_name, field_info in json_schema["properties"].items():
45
+ # Get field description from the Pydantic field
46
+ description = field_info.get("description", f"No description for {field_name}")
47
+ field_type = field_info.get("type", "string")
48
+ schema_dict[field_name] = {
49
+ "type": field_type,
50
+ "description": description
51
+ }
52
+ else:
53
+ # Fallback if properties not found
54
+ schema_dict = json_schema
40
55
  else:
41
56
  # Assume it's already a dict schema
42
57
  schema_dict = self.schema
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "morphik"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  authors = [
9
9
  { name = "Morphik", email = "founders@morphik.ai" },
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes