morphik 0.2.1__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.
- {morphik-0.2.1 → morphik-0.2.3}/PKG-INFO +1 -1
- {morphik-0.2.1 → morphik-0.2.3}/morphik/__init__.py +1 -1
- {morphik-0.2.1 → morphik-0.2.3}/morphik/async_.py +4 -8
- {morphik-0.2.1 → morphik-0.2.3}/morphik/rules.py +16 -1
- {morphik-0.2.1 → morphik-0.2.3}/morphik/sync.py +3 -5
- {morphik-0.2.1 → morphik-0.2.3}/pyproject.toml +1 -1
- {morphik-0.2.1 → morphik-0.2.3}/.gitignore +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/README.md +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/_internal.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/exceptions.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/models.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/README.md +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/__init__.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/example_usage.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/test_async.py +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/test_docs/sample1.txt +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/test_docs/sample2.txt +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/test_docs/sample3.txt +0 -0
- {morphik-0.2.1 → morphik-0.2.3}/morphik/tests/test_sync.py +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
import json
|
2
2
|
import logging
|
3
|
+
from datetime import datetime
|
3
4
|
from io import BytesIO, IOBase
|
4
5
|
from pathlib import Path
|
5
6
|
from typing import Any, BinaryIO, Dict, List, Optional, Type, Union
|
6
|
-
from datetime import datetime
|
7
7
|
|
8
8
|
import httpx
|
9
9
|
from pydantic import BaseModel
|
@@ -1684,7 +1684,7 @@ class AsyncMorphik:
|
|
1684
1684
|
|
1685
1685
|
The agent can autonomously use various tools to answer complex queries including:
|
1686
1686
|
- Searching and retrieving relevant documents
|
1687
|
-
- Analyzing document content
|
1687
|
+
- Analyzing document content
|
1688
1688
|
- Performing calculations and data processing
|
1689
1689
|
- Creating summaries and reports
|
1690
1690
|
- Managing knowledge graphs
|
@@ -2650,9 +2650,7 @@ class AsyncMorphik:
|
|
2650
2650
|
params["end_user_id"] = end_user_id
|
2651
2651
|
return await self._request("GET", f"graph/{name}/visualization", params=params)
|
2652
2652
|
|
2653
|
-
async def check_workflow_status(
|
2654
|
-
self, workflow_id: str, run_id: Optional[str] = None
|
2655
|
-
) -> Dict[str, Any]:
|
2653
|
+
async def check_workflow_status(self, workflow_id: str, run_id: Optional[str] = None) -> Dict[str, Any]:
|
2656
2654
|
"""Poll the status of an async graph build/update workflow."""
|
2657
2655
|
params = {"run_id": run_id} if run_id else None
|
2658
2656
|
return await self._request("GET", f"graph/workflow/{workflow_id}/status", params=params)
|
@@ -2662,6 +2660,4 @@ class AsyncMorphik:
|
|
2662
2660
|
# ------------------------------------------------------------------
|
2663
2661
|
async def get_document_download_url(self, document_id: str, expires_in: int = 3600) -> Dict[str, Any]:
|
2664
2662
|
"""Generate a presigned download URL for a document (async)."""
|
2665
|
-
return await self._request(
|
2666
|
-
"GET", f"documents/{document_id}/download_url", params={"expires_in": expires_in}
|
2667
|
-
)
|
2663
|
+
return await self._request("GET", f"documents/{document_id}/download_url", params={"expires_in": expires_in})
|
@@ -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
|
-
|
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
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import json
|
2
2
|
import logging
|
3
|
+
from datetime import datetime
|
3
4
|
from io import BytesIO, IOBase
|
4
5
|
from pathlib import Path
|
5
6
|
from typing import Any, BinaryIO, Dict, List, Optional, Type, Union
|
6
|
-
from datetime import datetime
|
7
7
|
|
8
8
|
import httpx
|
9
9
|
from pydantic import BaseModel
|
@@ -1828,7 +1828,7 @@ class Morphik:
|
|
1828
1828
|
|
1829
1829
|
The agent can autonomously use various tools to answer complex queries including:
|
1830
1830
|
- Searching and retrieving relevant documents
|
1831
|
-
- Analyzing document content
|
1831
|
+
- Analyzing document content
|
1832
1832
|
- Performing calculations and data processing
|
1833
1833
|
- Creating summaries and reports
|
1834
1834
|
- Managing knowledge graphs
|
@@ -2854,6 +2854,4 @@ class Morphik:
|
|
2854
2854
|
# ------------------------------------------------------------------
|
2855
2855
|
def get_document_download_url(self, document_id: str, expires_in: int = 3600) -> Dict[str, Any]:
|
2856
2856
|
"""Generate a presigned download URL for a document stored remotely."""
|
2857
|
-
return self._request(
|
2858
|
-
"GET", f"documents/{document_id}/download_url", params={"expires_in": expires_in}
|
2859
|
-
)
|
2857
|
+
return self._request("GET", f"documents/{document_id}/download_url", params={"expires_in": expires_in})
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|