Skip to content

Commit

Permalink
Move measurement APIs to new directory (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybchris authored Apr 8, 2024
1 parent 3b43fe6 commit 0ceba14
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 36 deletions.
12 changes: 10 additions & 2 deletions hume/__init__.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
16 changes: 0 additions & 16 deletions hume/_batch/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions hume/_measurement/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module init."""
17 changes: 17 additions & 0 deletions hume/_measurement/batch/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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

Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions hume/_measurement/stream/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
Original file line number Diff line number Diff line change
@@ -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

Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions hume/_stream/__init__.py

This file was deleted.

0 comments on commit 0ceba14

Please sign in to comment.