diff --git a/hume/__init__.py b/hume/__init__.py index d9bd9b75..e9a722c9 100644 --- a/hume/__init__.py +++ b/hume/__init__.py @@ -1,8 +1,16 @@ """Module init.""" + from importlib.metadata import version -from hume._batch import BatchJob, BatchJobDetails, BatchJobState, BatchJobStatus, HumeBatchClient, TranscriptionConfig -from hume._stream import HumeStreamClient, StreamSocket +from hume._measurement.batch import ( + BatchJob, + BatchJobDetails, + BatchJobState, + BatchJobStatus, + HumeBatchClient, + TranscriptionConfig, +) +from hume._measurement.stream import HumeStreamClient, StreamSocket from hume.error.hume_client_exception import HumeClientException __version__ = version("hume") diff --git a/hume/_batch/__init__.py b/hume/_batch/__init__.py deleted file mode 100644 index 78ac7e21..00000000 --- a/hume/_batch/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Module init.""" -from hume._batch.batch_job import BatchJob -from hume._batch.batch_job_details import BatchJobDetails -from hume._batch.batch_job_state import BatchJobState -from hume._batch.batch_job_status import BatchJobStatus -from hume._batch.hume_batch_client import HumeBatchClient -from hume._batch.transcription_config import TranscriptionConfig - -__all__ = [ - "BatchJob", - "BatchJobDetails", - "BatchJobState", - "BatchJobStatus", - "HumeBatchClient", - "TranscriptionConfig", -] diff --git a/hume/_measurement/__init__.py b/hume/_measurement/__init__.py new file mode 100644 index 00000000..26b8dab0 --- /dev/null +++ b/hume/_measurement/__init__.py @@ -0,0 +1 @@ +"""Module init.""" diff --git a/hume/_measurement/batch/__init__.py b/hume/_measurement/batch/__init__.py new file mode 100644 index 00000000..32e5396e --- /dev/null +++ b/hume/_measurement/batch/__init__.py @@ -0,0 +1,17 @@ +"""Module init.""" + +from hume._measurement.batch.batch_job import BatchJob +from hume._measurement.batch.batch_job_details import BatchJobDetails +from hume._measurement.batch.batch_job_state import BatchJobState +from hume._measurement.batch.batch_job_status import BatchJobStatus +from hume._measurement.batch.hume_batch_client import HumeBatchClient +from hume._measurement.batch.transcription_config import TranscriptionConfig + +__all__ = [ + "BatchJob", + "BatchJobDetails", + "BatchJobState", + "BatchJobStatus", + "HumeBatchClient", + "TranscriptionConfig", +] diff --git a/hume/_batch/batch_job.py b/hume/_measurement/batch/batch_job.py similarity index 95% rename from hume/_batch/batch_job.py rename to hume/_measurement/batch/batch_job.py index 3f1f587b..40ffdac5 100644 --- a/hume/_batch/batch_job.py +++ b/hume/_measurement/batch/batch_job.py @@ -1,15 +1,16 @@ """Batch job.""" + import json from pathlib import Path from typing import TYPE_CHECKING, Any, Union -from hume._batch.batch_job_details import BatchJobDetails -from hume._batch.batch_job_status import BatchJobStatus from hume._common.retry_utils import RetryIterError, retry +from hume._measurement.batch.batch_job_details import BatchJobDetails +from hume._measurement.batch.batch_job_status import BatchJobStatus from hume.error.hume_client_exception import HumeClientException if TYPE_CHECKING: - from hume._batch.hume_batch_client import HumeBatchClient + from hume._measurement.batch.hume_batch_client import HumeBatchClient class BatchJob: diff --git a/hume/_batch/batch_job_details.py b/hume/_measurement/batch/batch_job_details.py similarity index 97% rename from hume/_batch/batch_job_details.py rename to hume/_measurement/batch/batch_job_details.py index 7ca3ef7a..1c06d3e8 100644 --- a/hume/_batch/batch_job_details.py +++ b/hume/_measurement/batch/batch_job_details.py @@ -1,11 +1,12 @@ """Batch job details.""" + import json from datetime import datetime from typing import Any, Dict, List, Optional -from hume._batch.batch_job_state import BatchJobState -from hume._batch.batch_job_status import BatchJobStatus from hume._common.config_utils import config_from_model_type +from hume._measurement.batch.batch_job_state import BatchJobState +from hume._measurement.batch.batch_job_status import BatchJobStatus from hume.error.hume_client_exception import HumeClientException from hume.models import ModelType from hume.models.config.model_config_base import ModelConfigBase diff --git a/hume/_batch/batch_job_state.py b/hume/_measurement/batch/batch_job_state.py similarity index 89% rename from hume/_batch/batch_job_state.py rename to hume/_measurement/batch/batch_job_state.py index fc8e1f2c..8e4c0a80 100644 --- a/hume/_batch/batch_job_state.py +++ b/hume/_measurement/batch/batch_job_state.py @@ -1,8 +1,9 @@ """Batch job state.""" + from dataclasses import dataclass from typing import Optional -from hume._batch.batch_job_status import BatchJobStatus +from hume._measurement.batch.batch_job_status import BatchJobStatus @dataclass diff --git a/hume/_batch/batch_job_status.py b/hume/_measurement/batch/batch_job_status.py similarity index 100% rename from hume/_batch/batch_job_status.py rename to hume/_measurement/batch/batch_job_status.py diff --git a/hume/_batch/hume_batch_client.py b/hume/_measurement/batch/hume_batch_client.py similarity index 98% rename from hume/_batch/hume_batch_client.py rename to hume/_measurement/batch/hume_batch_client.py index 2c80f86d..b0ddc8ae 100644 --- a/hume/_batch/hume_batch_client.py +++ b/hume/_measurement/batch/hume_batch_client.py @@ -1,16 +1,17 @@ """Batch API client.""" + import json from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union from requests import Session -from hume._batch.batch_job import BatchJob -from hume._batch.batch_job_details import BatchJobDetails -from hume._batch.transcription_config import TranscriptionConfig from hume._common.api_type import ApiType from hume._common.client_base import ClientBase from hume._common.config_utils import serialize_configs +from hume._measurement.batch.batch_job import BatchJob +from hume._measurement.batch.batch_job_details import BatchJobDetails +from hume._measurement.batch.transcription_config import TranscriptionConfig from hume.error.hume_client_exception import HumeClientException from hume.models.config.model_config_base import ModelConfigBase diff --git a/hume/_batch/transcription_config.py b/hume/_measurement/batch/transcription_config.py similarity index 100% rename from hume/_batch/transcription_config.py rename to hume/_measurement/batch/transcription_config.py diff --git a/hume/_measurement/stream/__init__.py b/hume/_measurement/stream/__init__.py new file mode 100644 index 00000000..7b60f2e7 --- /dev/null +++ b/hume/_measurement/stream/__init__.py @@ -0,0 +1,9 @@ +"""Module init.""" + +from hume._measurement.stream.hume_stream_client import HumeStreamClient +from hume._measurement.stream.stream_socket import StreamSocket + +__all__ = [ + "HumeStreamClient", + "StreamSocket", +] diff --git a/hume/_stream/hume_stream_client.py b/hume/_measurement/stream/hume_stream_client.py similarity index 98% rename from hume/_stream/hume_stream_client.py rename to hume/_measurement/stream/hume_stream_client.py index 4bdbf242..43041641 100644 --- a/hume/_stream/hume_stream_client.py +++ b/hume/_measurement/stream/hume_stream_client.py @@ -1,11 +1,12 @@ """Streaming API client.""" + from contextlib import asynccontextmanager from typing import Any, AsyncIterator, List, Optional from hume._common.api_type import ApiType from hume._common.client_base import ClientBase from hume._common.config_utils import deserialize_configs -from hume._stream.stream_socket import StreamSocket +from hume._measurement.stream.stream_socket import StreamSocket from hume.error.hume_client_exception import HumeClientException from hume.models.config.model_config_base import ModelConfigBase diff --git a/hume/_stream/stream_socket.py b/hume/_measurement/stream/stream_socket.py similarity index 100% rename from hume/_stream/stream_socket.py rename to hume/_measurement/stream/stream_socket.py diff --git a/hume/_stream/__init__.py b/hume/_stream/__init__.py deleted file mode 100644 index 97fbdc90..00000000 --- a/hume/_stream/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Module init.""" -from hume._stream.hume_stream_client import HumeStreamClient -from hume._stream.stream_socket import StreamSocket - -__all__ = [ - "HumeStreamClient", - "StreamSocket", -]