start_medical_scribe_stream¶
Operation¶
Async only
This operation uses an event stream, so only the asynchronous client supports it.
start_medical_scribe_stream
async
¶
start_medical_scribe_stream(request: StartMedicalScribeStreamInput | StartMedicalScribeStreamInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StartMedicalScribeStreamInputDict]) -> AsyncDuplexEventStream[MedicalScribeInputStream, MedicalScribeResultStream, StartMedicalScribeStreamOutput]
Starts a bidirectional HTTP/2 stream, where audio is streamed to Amazon Web Services HealthScribe and the transcription results are streamed to your application.
When you start a stream, you first specify the stream configuration in a
MedicalScribeConfigurationEvent. This event includes channel
definitions, encryption settings, medical scribe context, and
post-stream analytics settings, such as the output configuration for
aggregated transcript and clinical note generation. These are additional
streaming session configurations beyond those provided in your initial
start request headers. Whether you are starting a new session or
resuming an existing session, your first event must be a
MedicalScribeConfigurationEvent.
After you send a MedicalScribeConfigurationEvent, you start
AudioEvents and Amazon Web Services HealthScribe responds with
real-time transcription results. When you are finished, to start
processing the results with the post-stream analytics, send a
MedicalScribeSessionControlEvent with a Type of END_OF_SESSION and
Amazon Web Services HealthScribe starts the analytics.
You can pause or resume streaming. To pause streaming, complete the
input stream without sending the MedicalScribeSessionControlEvent. To
resume streaming, call the StartMedicalScribeStream and specify the
same SessionId you used to start the stream.
The following parameters are required:
-
language-code -
media-encoding -
media-sample-rate-hertz
For more information on streaming with Amazon Web Services HealthScribe, see Amazon Web Services HealthScribe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
StartMedicalScribeStreamInput | StartMedicalScribeStreamInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[StartMedicalScribeStreamInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
AsyncDuplexEventStream[MedicalScribeInputStream, MedicalScribeResultStream, StartMedicalScribeStreamOutput]
|
An |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
StartMedicalScribeStreamInputDict
¶
Bases: TypedDict
Dictionary form of StartMedicalScribeStreamInput.
Attributes¶
language_code
instance-attribute
¶
Specify the language code for your HealthScribe streaming session.
media_encoding
instance-attribute
¶
Specify the encoding used for the input audio.
Supported formats are:
-
FLAC
-
OPUS-encoded audio in an Ogg container
-
PCM (only signed 16-bit little-endian audio formats, which does not include WAV)
For more information, see Media formats.
media_sample_rate_hertz
instance-attribute
¶
Specify the sample rate of the input audio (in hertz). Amazon Web Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The sample rate you specify must match that of your audio.
StartMedicalScribeStreamInput
dataclass
¶
Bases: _SerdeShape
Dataclass for StartMedicalScribeStreamInput structure.
Attributes¶
language_code
class-attribute
instance-attribute
¶
language_code: str | None = ...
Specify the language code for your HealthScribe streaming session.
media_encoding
class-attribute
instance-attribute
¶
media_encoding: str | None = ...
Specify the encoding used for the input audio.
Supported formats are:
-
FLAC
-
OPUS-encoded audio in an Ogg container
-
PCM (only signed 16-bit little-endian audio formats, which does not include WAV)
For more information, see Media formats.
Output¶
This operation returns an AsyncDuplexEventStream for bidirectional streaming.
Event Stream Structure¶
Input Event Type¶
Output Event Type¶
Initial Response Structure¶
StartMedicalScribeStreamOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for StartMedicalScribeStreamOutput structure.
Attributes¶
language_code
class-attribute
instance-attribute
¶
language_code: str | None = ...
The Language Code that you specified in your request. Same as provided
in the StartMedicalScribeStreamRequest.
media_encoding
class-attribute
instance-attribute
¶
media_encoding: str | None = ...
The Media Encoding you specified in your request. Same as provided in
the StartMedicalScribeStreamRequest
media_sample_rate_hertz
class-attribute
instance-attribute
¶
media_sample_rate_hertz: int | None = ...
The sample rate (in hertz) that you specified in your request. Same as
provided in the StartMedicalScribeStreamRequest
request_id
class-attribute
instance-attribute
¶
request_id: str | None = ...
The unique identifier for your streaming request.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.