Skip to content

Commit 9143f08

Browse files
committed
wip
1 parent 82c95c3 commit 9143f08

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.fernignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ src/hume/expression_measurement/client.py
3030
src/hume/tts/client.py
3131

3232
src/hume/expression_measurement/batch/client_with_utils.py
33+
# Backward compatibility for InferenceJob.status
34+
src/hume/expression_measurement/batch/types/inference_job.py
3335
src/hume/empathic_voice/chat/audio/microphone.py
3436
src/hume/empathic_voice/chat/audio/microphone_interface.py
3537
src/hume/empathic_voice/chat/audio/microphone_sender.py

src/hume/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
):
5656
super().__init__(api_key=api_key, headers=headers, environment=environment, timeout=timeout)
5757
self.httpx_client = HttpClient(
58-
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
58+
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout, base_url=lambda: self._environment.base
5959
)
6060

6161

@@ -71,5 +71,5 @@ def __init__(
7171
):
7272
super().__init__(api_key=api_key, headers=headers, environment=environment, timeout=timeout)
7373
self.httpx_client = AsyncHttpClient(
74-
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
74+
httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout, base_url=lambda: self._environment.base
7575
)

src/hume/expression_measurement/batch/types/inference_job.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ class InferenceJob(JobInference):
1515
Jobs created with the Expression Measurement API will have this field set to `INFERENCE`.
1616
"""
1717

18+
@property
19+
def status(self) -> str:
20+
"""
21+
Backward compatibility property for accessing job status.
22+
23+
Previously, jobs had a direct `status` attribute. Now status is accessed via `state.status`.
24+
This property provides backward compatibility for existing code that uses `job.status`.
25+
"""
26+
return self.state.status
27+
1828
if IS_PYDANTIC_V2:
1929
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
2030
else:

src/hume/expression_measurement/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def with_raw_response(self) -> RawExpressionMeasurementClient:
3333
@property
3434
def batch(self):
3535
if self._batch is None:
36-
from .batch.client import BatchClient # noqa: E402
36+
from .batch.client_with_utils import BatchClientWithUtils # noqa: E402
3737

3838
self._batch = BatchClientWithUtils(client_wrapper=self._client_wrapper)
3939
return self._batch
@@ -67,7 +67,7 @@ def with_raw_response(self) -> AsyncRawExpressionMeasurementClient:
6767
@property
6868
def batch(self):
6969
if self._batch is None:
70-
from .batch.client import AsyncBatchClient # noqa: E402
70+
from .batch.client_with_utils import AsyncBatchClientWithUtils # noqa: E402
7171

7272
self._batch = AsyncBatchClientWithUtils(client_wrapper=self._client_wrapper)
7373
return self._batch

0 commit comments

Comments
 (0)