Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sdks/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Restored SDK import and test collection compatibility on Python 3.9 by avoiding newer runtime annotation syntax.

## [1.2.6] - 2026-06-19

### Changed
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/morphik/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class FinalChunkResult(BaseModel):
content: str | PILImage = Field(..., description="Chunk content")
content: Union[str, PILImage] = Field(..., description="Chunk content")
score: float = Field(..., description="Relevance score")
document_id: str = Field(..., description="Parent document ID")
chunk_number: int = Field(..., description="Chunk sequence number")
Expand Down
4 changes: 2 additions & 2 deletions sdks/python/morphik/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings
from io import BytesIO
from pathlib import Path
from typing import Any, BinaryIO, Callable, Dict, List, Literal, Optional, Type, Union
from typing import Any, BinaryIO, Callable, Dict, List, Literal, Optional, Tuple, Type, Union
from urllib.parse import quote

import httpx
Expand Down Expand Up @@ -1441,7 +1441,7 @@ async def _ingest_migrated_document(
end_user_id: Optional[str],
use_colpali: bool,
on_conflict: Literal["skip", "fail"],
) -> tuple[str, Document]:
) -> Tuple[str, Document]:
serialized_metadata, inferred_types = self._logic._serialize_metadata_map(metadata)
metadata_type_payload = {**inferred_types, **(metadata_types or {})}
metadata_type_payload = {
Expand Down
4 changes: 2 additions & 2 deletions sdks/python/morphik/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings
from io import BytesIO
from pathlib import Path
from typing import Any, BinaryIO, Callable, Dict, List, Literal, Optional, Type, Union
from typing import Any, BinaryIO, Callable, Dict, List, Literal, Optional, Tuple, Type, Union
from urllib.parse import quote

import httpx
Expand Down Expand Up @@ -1483,7 +1483,7 @@ def _ingest_migrated_document(
end_user_id: Optional[str],
use_colpali: bool,
on_conflict: Literal["skip", "fail"],
) -> tuple[str, Document]:
) -> Tuple[str, Document]:
serialized_metadata, inferred_types = self._logic._serialize_metadata_map(metadata)
metadata_type_payload = {**inferred_types, **(metadata_types or {})}
metadata_type_payload = {
Expand Down
3 changes: 2 additions & 1 deletion sdks/python/morphik/tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import uuid
from pathlib import Path
from typing import List

import pytest
from morphik.async_ import AsyncMorphik
Expand All @@ -22,7 +23,7 @@

class StructuredOutputSchema(BaseModel):
summary: str = Field(..., description="A short summary of the input text")
key_points: list[str] = Field(..., description="A list of key points from the text")
key_points: List[str] = Field(..., description="A list of key points from the text")


class TestAsyncMorphik:
Expand Down
3 changes: 2 additions & 1 deletion sdks/python/morphik/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
import uuid
from pathlib import Path
from typing import List

import pytest
from morphik.sync import Morphik
Expand All @@ -22,7 +23,7 @@

class StructuredOutputSchema(BaseModel):
summary: str = Field(..., description="A short summary of the input text")
key_points: list[str] = Field(..., description="A list of key points from the text")
key_points: List[str] = Field(..., description="A list of key points from the text")


class TestMorphik:
Expand Down