interhumanai 3.2.1__tar.gz → 3.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,24 @@ All notable changes to `interhumanai` are documented here. The package follows
5
5
  the TypeScript SDK (`@interhumanai/sdk`): both packages always carry the same
6
6
  version and release together.
7
7
 
8
+ ## 3.3.1
9
+
10
+ - Documentation only: ``UploadClient.submit`` accepts files up to 100 MB, up
11
+ from 32 MB, where the deployment serves that limit; a larger file raises
12
+ ``ih4003``, whose message names the limit. ``client.upload.analyze()``
13
+ (``POST /v1/upload/analyze``) keeps its 32 MB limit.
14
+
15
+ ## 3.3.0
16
+
17
+ - Added the ``language`` argument to ``UploadClient.submit``: the spoken
18
+ language as an ISO 639 code such as ``"en"``. An ``UploadModel.INTER_2_DEEP``
19
+ job's transcript is then made in that language rather than a detected one.
20
+ Any other model raises ``ih4005``.
21
+ - Added ``UploadJobTranscript.language_source`` (``"requested"`` or
22
+ ``"detected"``) and ``UploadJobTranscript.language_probability`` (the
23
+ recognizer's 0–1 confidence in a detected language, where it reports one).
24
+ A detected ``language`` is best-effort.
25
+
8
26
  ## 3.2.1
9
27
 
10
28
  - Documentation only: when no speaker could be identified as on camera, the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: interhumanai
3
- Version: 3.2.1
3
+ Version: 3.3.1
4
4
  Summary: First-party Python SDK for the Interhuman API: upload and stream social-signal analysis.
5
5
  Project-URL: Homepage, https://docs.interhuman.ai
6
6
  Project-URL: Repository, https://github.com/interhuman-core/interhuman-api
@@ -172,11 +172,15 @@ else:
172
172
  (`text`, `start`, `end`, `speaker`, `speaker_role`) and the speaker
173
173
  segments. Check `transcript.status` first: `FAILED` means no transcript
174
174
  could be produced, carries `error`, and leaves the job completed.
175
+ `transcript.language_source` says whether `language` is the one you named
176
+ (`"requested"`) or the recognizer's guess (`"detected"`), which is
177
+ best-effort: pass `language="en"` (any ISO 639 code) to `submit` wherever
178
+ you know the spoken language. Only `INTER_2_DEEP` takes it.
175
179
  `VISUAL_CUES`, `LEXICAL_CUES` and `SPEECH_CUES` add `visual_cues`,
176
180
  `lexical_cues` and `speech_cues`: timestamped cue lists, each with its own
177
- `status`. The API defines them ahead of serving them, so a submit that names
178
- one is refused with `ih1003` until the deployment serves it. Without a flag
179
- the result has no such section.
181
+ `status`. A deployment serves each list only where it is enabled; a submit
182
+ that names a list the deployment does not serve is refused with `ih1003`. Without a flag the result has no
183
+ such section.
180
184
  - `get_job(job_id)` — one status read. Raises `InterhumanAPIError` with
181
185
  `error_id` `ih4021` once the job has expired (`job.expires_at`).
182
186
  - `wait_for_job(job_id, timeout=None, poll_interval=2.0)` — returns the
@@ -184,7 +188,7 @@ else:
184
188
  `timeout` elapses first (the job keeps running).
185
189
  - `UploadModel.INTER_2` accepts an mp4, mov, avi, mkv, webm or mpeg-ts video
186
190
  carrying both a video and an audio track and reads picture and sound
187
- together. It takes at least 3 seconds, at most 32 MB, and no longer than the
191
+ together. It takes at least 3 seconds, at most 100 MB, and no longer than the
188
192
  deployment's maximum duration (30 minutes by default), and reports one
189
193
  `UploadJobWindow` per fixed-length window, each with its span, an
190
194
  `engagement_status` and the `signals` read over it. Each signal is an
@@ -146,11 +146,15 @@ else:
146
146
  (`text`, `start`, `end`, `speaker`, `speaker_role`) and the speaker
147
147
  segments. Check `transcript.status` first: `FAILED` means no transcript
148
148
  could be produced, carries `error`, and leaves the job completed.
149
+ `transcript.language_source` says whether `language` is the one you named
150
+ (`"requested"`) or the recognizer's guess (`"detected"`), which is
151
+ best-effort: pass `language="en"` (any ISO 639 code) to `submit` wherever
152
+ you know the spoken language. Only `INTER_2_DEEP` takes it.
149
153
  `VISUAL_CUES`, `LEXICAL_CUES` and `SPEECH_CUES` add `visual_cues`,
150
154
  `lexical_cues` and `speech_cues`: timestamped cue lists, each with its own
151
- `status`. The API defines them ahead of serving them, so a submit that names
152
- one is refused with `ih1003` until the deployment serves it. Without a flag
153
- the result has no such section.
155
+ `status`. A deployment serves each list only where it is enabled; a submit
156
+ that names a list the deployment does not serve is refused with `ih1003`. Without a flag the result has no
157
+ such section.
154
158
  - `get_job(job_id)` — one status read. Raises `InterhumanAPIError` with
155
159
  `error_id` `ih4021` once the job has expired (`job.expires_at`).
156
160
  - `wait_for_job(job_id, timeout=None, poll_interval=2.0)` — returns the
@@ -158,7 +162,7 @@ else:
158
162
  `timeout` elapses first (the job keeps running).
159
163
  - `UploadModel.INTER_2` accepts an mp4, mov, avi, mkv, webm or mpeg-ts video
160
164
  carrying both a video and an audio track and reads picture and sound
161
- together. It takes at least 3 seconds, at most 32 MB, and no longer than the
165
+ together. It takes at least 3 seconds, at most 100 MB, and no longer than the
162
166
  deployment's maximum duration (30 minutes by default), and reports one
163
167
  `UploadJobWindow` per fixed-length window, each with its span, an
164
168
  `engagement_status` and the `signals` read over it. Each signal is an
@@ -1,3 +1,3 @@
1
1
  """Package version (single source of truth, read by hatchling at build time)."""
2
2
 
3
- __version__ = "3.2.1"
3
+ __version__ = "3.3.1"
@@ -444,7 +444,17 @@ class UploadJobTranscript(BaseModel):
444
444
 
445
445
  Attributes:
446
446
  status: Whether the file was transcribed.
447
- language: The language detected in the speech, as an ISO 639 code.
447
+ language: The language the speech was transcribed in, as an ISO 639
448
+ code. When ``language_source`` is ``"detected"`` it is the speech
449
+ recognizer's own guess, which is best-effort and can be wrong:
450
+ pass ``language`` to :meth:`UploadClient.submit` where you know it.
451
+ language_source: Where ``language`` came from: ``"requested"``, the
452
+ language the submit named, or ``"detected"``, the recognizer's
453
+ own guess. ``None`` when ``language`` is, or when the speech
454
+ service did not report it.
455
+ language_probability: The recognizer's confidence, from 0 to 1, in a
456
+ detected language. ``None`` for a requested language and wherever
457
+ the recognizer reports no confidence.
448
458
  speaker_roles_status: Whether the speakers could be told apart as on
449
459
  camera or off it: ``"mapped"`` when at least one speaker has a
450
460
  role, ``"unmapped"`` when none could be told, ``"no_face"`` when no
@@ -462,6 +472,8 @@ class UploadJobTranscript(BaseModel):
462
472
 
463
473
  status: UploadJobTranscriptStatus
464
474
  language: str | None = None
475
+ language_source: str | None = None
476
+ language_probability: float | None = None
465
477
  speaker_roles_status: str | None = None
466
478
  word_timing: str | None = None
467
479
  words: list[UploadJobTranscriptWord] = Field(default_factory=list)
@@ -127,6 +127,7 @@ class UploadClient:
127
127
  model: UploadModel | str,
128
128
  wait_seconds: int = 0,
129
129
  include: Sequence[UploadJobIncludeFlag | IncludeFlag | str] | None = None,
130
+ language: str | None = None,
130
131
  filename: str | None = None,
131
132
  content_type: str | None = None,
132
133
  ) -> UploadJob:
@@ -148,8 +149,9 @@ class UploadClient:
148
149
  For ``UploadModel.INTER_2`` the file is an mp4, mov, avi, mkv, webm or
149
150
  mpeg-ts video carrying both a video and an audio track (``ih5001``
150
151
  without picture, ``ih5008`` without sound), with at least 3 seconds of
151
- media, at most 32 MB, and no longer than the deployment's maximum
152
- duration (30 minutes by default; a longer file raises ``ih4004``). The
152
+ media, at most 100 MB (a larger file raises ``ih4003``), and no longer
153
+ than the deployment's maximum duration (30 minutes by default; a longer
154
+ file raises ``ih4004``). The
153
155
  job cuts it into fixed windows and analyzes each one.
154
156
 
155
157
  ``UploadModel.INTER_2_DEEP`` takes the same video files, at most two
@@ -174,6 +176,12 @@ class UploadClient:
174
176
  :meth:`analyze` takes, so :class:`IncludeFlag` members work
175
177
  too) for the quality block, and ``SIGNALS`` for the signal
176
178
  list. Omit a flag for no such section.
179
+ language: The language spoken in the file, as a two- or
180
+ three-letter ISO 639 code such as ``"en"``.
181
+ ``UploadModel.INTER_2_DEEP`` accepts it, and its transcript is
182
+ then made in that language. Without it the speech recognizer
183
+ detects the language, which is best-effort. Any other model
184
+ raises ``ih4005``.
177
185
  filename: Filename reported to the API. Defaults to the path or
178
186
  file object's name, else ``video``.
179
187
  content_type: MIME type of the file (e.g. ``video/mp4``).
@@ -194,6 +202,8 @@ class UploadClient:
194
202
  flag.value if isinstance(flag, (IncludeFlag, UploadJobIncludeFlag)) else flag
195
203
  for flag in include
196
204
  ]
205
+ if language:
206
+ data["language"] = language
197
207
  headers = {"Authorization": f"Bearer {token}"}
198
208
  url = self._base_url + "/v2/upload/analyze"
199
209
  payload = await self._request(
File without changes
File without changes