Retrieves information for a specified session.
Parameters:
-
assistant_id
(UuidOrArn)
–
The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
-
session_id
(UuidOrArn)
–
The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.
Raises:
Source code in docs_src/capo_wisdom/_services/async_wisdom.py
| async def get_session(
self,
assistant_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
session_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
*,
config_overrides: Optional[AsyncWisdomClientConfig] = None,
) -> "capo_wisdom.types.get_session_response.GetSessionResponse":
"""<p>Retrieves information for a specified session.</p>
Args:
assistant_id: <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
session_id: <p>The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
Raises:
capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_wisdom.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_wisdom.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
capo_wisdom.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_wisdom.types.get_session_request.GetSessionRequest]",
) -> AsyncOperationResponse[
"capo_wisdom.types.get_session_response.GetSessionResponse"
]:
import capo_wisdom._operations.wisdom_service.get_session
(
output,
http_response,
) = await capo_wisdom._operations.wisdom_service.get_session.async_get_session(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetSession")
)
input_: capo_wisdom.types.get_session_request.GetSessionRequest = {
"assistant_id": assistant_id,
"session_id": session_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|