Skip to content

feat(dictation): expose auth_time_ms in DictationResponse - #263

Open
pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:feat/dictation-response-auth-time
Open

pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:feat/dictation-response-auth-time

Conversation

@pylrn

@pylrn pylrn commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Exposes the auth_time_ms latency breakdown field in DictationResponse.

The AssemblyAI Dictation API returns auth_time_ms representing the authentication and token/API-key validation duration in milliseconds as a component of request_time_ms (alongside sync_time_ms). While request_time_ms and sync_time_ms were already exposed on DictationResponse, auth_time_ms was not declared and was silently dropped during parsing.

Changes

  • assemblyai/dictation/v1/models.py: Add auth_time_ms: Optional[float] = None to DictationResponse.
  • assemblyai/__version__.py: Bump version to 1.6.2 for version bump check.
  • CLAUDE.md: Update DictationResponse property documentation to include .auth_time_ms.
  • tests/unit/test_dictation.py: Add auth_time_ms to _OK_RESPONSE, verify field assertion, and add backwards-compatibility test for server responses omitting auth_time_ms.
  • tests/unit/test_dictation_async.py: Mirror auth_time_ms assertions and fallback test for the async transcriber.

Verification

  • pytest tests/unit/test_dictation.py tests/unit/test_dictation_async.py passes (107 passed).
  • Full unit test suite passes: 726 passed in 40s.
  • ruff check assemblyai --config ./ruff.toml and ruff format --check --config ./ruff.toml assemblyai pass cleanly.

…tionResponse

The AssemblyAI Dictation API returns auth_time_ms as the authentication and token/API-key validation portion of request_time_ms. While request_time_ms and sync_time_ms were already exposed, auth_time_ms was not declared on DictationResponse and was silently dropped.

Add auth_time_ms: Optional[float] = None to DictationResponse in assemblyai/dictation/v1/models.py.

- Add unit test asserting result.auth_time_ms == 24.6 in sync and async dictation tests.
- Add test for responses that predate the field (auth_time_ms is None).
- Update DictationResponse summary in CLAUDE.md.
- Bump version to 1.6.2 for version bump check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant