Describes an agentic context, including its body.
Parameters:
Raises:
Examples:
Example – Getting a context
The following example gets a context, including its body.
>>> client.get_agentic_context(agentic_context_id='wsactx-a1b2c3d4')
Source code in docs_src/capo_workspaces/_services/work_spaces.py
| def get_agentic_context(
self,
agentic_context_id: "capo_workspaces.types.agentic_context_id.AgenticContextId",
*,
config_overrides: Optional[WorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.get_agentic_context_result.GetAgenticContextResult":
"""<p>Describes an agentic context, including its body.</p>
Args:
agentic_context_id: <p>The identifier of the context.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry the request with exponential backoff.</p>
capo_workspaces.errors.validation_exception.ValidationException: <p>Your request failed validation. Check the error message for the parameter that isn't valid.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Example – Getting a context
The following example gets a context, including its body.
>>> client.get_agentic_context(agentic_context_id='wsactx-a1b2c3d4')
"""
def _handler(
req: "OperationRequest[capo_workspaces.types.get_agentic_context_request.GetAgenticContextRequest]",
) -> OperationResponse[
"capo_workspaces.types.get_agentic_context_result.GetAgenticContextResult"
]:
if req.options.protocol == "awsJson1_1":
import capo_workspaces._operations.workspaces_service.aws_json1_1.get_agentic_context
output, http_response = (
capo_workspaces._operations.workspaces_service.aws_json1_1.get_agentic_context.get_agentic_context(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_workspaces._operations.workspaces_service.rpcv2_cbor.get_agentic_context
output, http_response = (
capo_workspaces._operations.workspaces_service.rpcv2_cbor.get_agentic_context.get_agentic_context(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_workspaces.types.get_agentic_context_result.GetAgenticContextResult",
) -> dict[str, Any]:
import capo_workspaces.types.get_agentic_context_result
return capo_workspaces.types.get_agentic_context_result.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetAgenticContext", redact_output=_redact_output),
)
input_: capo_workspaces.types.get_agentic_context_request.GetAgenticContextRequest = {
"agentic_context_id": agentic_context_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|