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
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"cliVersion": "5.50.4",
"cliVersion": "5.64.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "5.14.13",
"generatorVersion": "5.15.2",
"generatorConfig": {
"client_class_name": "PhenomlClient",
"wire_tests": {
"enabled": true
}
},
"originGitCommit": "e2c477c4583f8f9e7d0d1a5b5591c1aa8cabef10",
"originGitCommit": "5ca96bb9b4766f13b667043f4937d5f0cea5f6a7",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "16.4.0"
"sdkVersion": "16.5.0"
}
21 changes: 14 additions & 7 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## [16.5.0] - 2026-07-02
### Added
- **`stream_reconnection_enabled` and `max_stream_reconnection_attempts`** — new optional parameters on `PhenomlClient`, `AsyncPhenomlClient`, and `RequestOptions` to configure automatic SSE stream reconnection behavior.
- **`CareSiteRow`, `DeathRow`, `LocationRow`, `ObservationPeriodRow`, `ProviderRow`** — five new OMOP CDM v5.4 row types exported from `phenoml.fhir2omop` representing care site, death, location, observation period, and provider records.
- **`OmopTables`** — now includes optional `location`, `care_site`, `provider`, `death`, and `observation_period` table lists alongside existing tables.
- **`VisitOccurrenceRow.provider_id` and `VisitOccurrenceRow.care_site_id`** — new optional fields linking visit occurrences to OMOP provider and care site records.
- **`CreateMultiResponseResourcesItem.source_pages`** — new optional `List[int]` field containing 1-indexed source document page numbers from which a FHIR resource was extracted, populated by the `/lang2fhir/document/multi` endpoint.

### Changed
- **`ConditionOccurrenceRow`, `DrugExposureRow`, `MeasurementRow`, `ObservationRow`, and `ProcedureOccurrenceRow`** — each gains an optional `provider_id` field linking the clinical event to an OMOP provider record.
- **`PersonRow`** — gains an optional `location_id` field linking the person to an OMOP location record.

## [16.4.0] - 2026-06-23
### Added
- **`client.voice.voice.transcribe(...)`** — new sync and async method that accepts raw audio bytes (WAV, FLAC, MP3, OGG/WebM Opus) and returns a `TranscribeResponse` with the full transcript, supporting up to ~5 minutes of audio per request.
Expand Down
19 changes: 14 additions & 5 deletions code-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"metadata": {
"language": "python",
"packageName": "phenoml",
"sdkVersion": "16.4.0",
"specCommit": "e2c477c4583f8f9e7d0d1a5b5591c1aa8cabef10",
"sdkVersion": "16.5.0",
"specCommit": "5ca96bb9b4766f13b667043f4937d5f0cea5f6a7",
"generatorName": "fernapi/fern-python-sdk"
},
"renderRules": {
Expand Down Expand Up @@ -2999,19 +2999,28 @@
"tempId": "urn:uuid:patient-001",
"resourceType": "Patient",
"description": "John Doe, born 1979-03-15",
"originalText": "John Doe, DOB 1979-03-15"
"originalText": "John Doe, DOB 1979-03-15",
"sourcePages": [
1
]
},
{
"tempId": "urn:uuid:condition-001",
"resourceType": "Condition",
"description": "Type 2 Diabetes Mellitus diagnosis",
"originalText": "diagnosed with Type 2 Diabetes"
"originalText": "diagnosed with Type 2 Diabetes",
"sourcePages": [
1
]
},
{
"tempId": "urn:uuid:medication-001",
"resourceType": "MedicationRequest",
"description": "Metformin 500mg prescription",
"originalText": "Prescribed Metformin 500mg"
"originalText": "Prescribed Metformin 500mg",
"sourcePages": [
2
]
}
]
}
Expand Down
20 changes: 10 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "phenoml"
version = "16.4.0"
version = "16.5.0"
description = ""
readme = "README.md"
authors = []
Expand Down Expand Up @@ -40,7 +40,7 @@ Repository = 'https://github.com/phenoml/phenoml-python-sdk'

[tool.poetry.dependencies]
python = "^3.10"
aiohttp = { version = ">=3.14.0,<4", optional = true, python = ">=3.10"}
aiohttp = { version = ">=3.14.1,<4", optional = true, python = ">=3.10"}
httpx = ">=0.21.2"
httpx-aiohttp = { version = "0.1.8", optional = true, python = ">=3.10"}
pydantic = ">= 1.9.2"
Expand All @@ -62,6 +62,7 @@ ruff = "==0.11.5"
[tool.pytest.ini_options]
testpaths = [ "tests" ]
asyncio_mode = "auto"
norecursedirs = [ "src" ]
markers = [
"aiohttp: tests that require httpx_aiohttp to be installed",
]
Expand Down
32 changes: 26 additions & 6 deletions src/phenoml/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def __init__(
headers: typing.Optional[typing.Dict[str, str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.Client] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
Expand All @@ -120,6 +122,8 @@ def __init__(
headers: typing.Optional[typing.Dict[str, str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.Client] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
Expand All @@ -138,13 +142,13 @@ def __init__(
_token_getter_override: typing.Optional[typing.Callable[[], str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.Client] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
):
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
)
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
_defaulted_max_retries = max_retries if max_retries is not None else 2
if instance_url is not None:
_instance_url = instance_url if instance_url is not None else "experiment.app.pheno.ml"
Expand All @@ -160,6 +164,8 @@ def __init__(
else httpx.Client(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
token=_token_getter_override if _token_getter_override is not None else token,
)
Expand All @@ -177,6 +183,8 @@ def __init__(
else httpx.Client(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
),
)
Expand All @@ -191,6 +199,8 @@ def __init__(
else httpx.Client(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
)
else:
Expand Down Expand Up @@ -402,6 +412,8 @@ def __init__(
headers: typing.Optional[typing.Dict[str, str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.AsyncClient] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
Expand All @@ -418,6 +430,8 @@ def __init__(
headers: typing.Optional[typing.Dict[str, str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.AsyncClient] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
Expand All @@ -436,13 +450,13 @@ def __init__(
_token_getter_override: typing.Optional[typing.Callable[[], str]] = None,
timeout: typing.Optional[float] = None,
max_retries: typing.Optional[int] = None,
stream_reconnection_enabled: typing.Optional[bool] = None,
max_stream_reconnection_attempts: typing.Optional[int] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.AsyncClient] = None,
logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
):
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
)
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
_defaulted_max_retries = max_retries if max_retries is not None else 2
if instance_url is not None:
_instance_url = instance_url if instance_url is not None else "experiment.app.pheno.ml"
Expand All @@ -456,6 +470,8 @@ def __init__(
else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
token=_token_getter_override if _token_getter_override is not None else token,
)
Expand All @@ -473,6 +489,8 @@ def __init__(
else httpx.AsyncClient(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
),
)
Expand All @@ -486,6 +504,8 @@ def __init__(
else _make_default_async_client(timeout=_defaulted_timeout, follow_redirects=follow_redirects),
timeout=_defaulted_timeout,
max_retries=_defaulted_max_retries,
stream_reconnection_enabled=stream_reconnection_enabled,
max_stream_reconnection_attempts=max_stream_reconnection_attempts,
logging=logging,
)
else:
Expand Down
Loading