get_media¶
Operation¶
get_media
¶
get_media(request: GetMediaInput | GetMediaInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetMediaInputDict]) -> GetMediaOutput
Returns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses.
For more information, see Extracting semantic meaning from images and visuals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetMediaInput | GetMediaInputDict | 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[GetMediaInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetMediaOutput
|
An instance of |
get_media
async
¶
get_media(request: GetMediaInput | GetMediaInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetMediaInputDict]) -> GetMediaOutput
Returns the image bytes corresponding to a media object. If you have implemented your own application with the Chat and ChatSync APIs, and have enabled content extraction from visual data in Amazon Q Business, you use the GetMedia API operation to download the images so you can show them in your UI with responses.
For more information, see Extracting semantic meaning from images and visuals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
GetMediaInput | GetMediaInputDict | 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[GetMediaInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
GetMediaOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
GetMediaInputDict
¶
Bases: TypedDict
Dictionary form of GetMediaInput.
Attributes¶
application_id
instance-attribute
¶
The identifier of the Amazon Q Business which contains the media object.
conversation_id
instance-attribute
¶
The identifier of the Amazon Q Business conversation.
media_id
instance-attribute
¶
The identifier of the media object. You can find this in the
sourceAttributions returned by the Chat, ChatSync, and
ListMessages API responses.
GetMediaInput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetMediaInput structure.
Attributes¶
application_id
class-attribute
instance-attribute
¶
application_id: str | None = ...
The identifier of the Amazon Q Business which contains the media object.
conversation_id
class-attribute
instance-attribute
¶
conversation_id: str | None = ...
The identifier of the Amazon Q Business conversation.
Output¶
GetMediaOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetMediaOutput structure.
Attributes¶
media_bytes
class-attribute
instance-attribute
¶
media_bytes: bytes | None = ...
The base64-encoded bytes of the media object.
media_mime_type
class-attribute
instance-attribute
¶
media_mime_type: str | None = ...
The MIME type of the media object (image/png).
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.