Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move measurement APIs to new directory #110

Merged
merged 2 commits into from
Apr 8, 2024
Merged
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
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
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
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
8 changes: 0 additions & 8 deletions hume/_stream/__init__.py

This file was deleted.

Loading