get_document_content
¶
get_document_content(
knowledge_base_id: KnowledgeBaseIdentifier,
data_source_id: DataSourceId,
document_id: DocumentId,
*,
config_overrides: Optional[BedrockAgentRuntimeClientConfig] = None,
output_format: Optional[DocumentOutputFormat] = None,
user_context: Optional[UserContext] = None,
) -> GetDocumentContentResponse
Retrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access.
Parameters:
-
knowledge_base_id(KnowledgeBaseIdentifier) –The unique identifier of the knowledge base that contains the document.
-
data_source_id(DataSourceId) –The unique identifier of the data source that contains the document.
-
document_id(DocumentId) –The unique identifier of the document to retrieve content for.
-
output_format(Optional[DocumentOutputFormat], default:None) –The output format for the document content.
RAWreturns the original file.EXTRACTEDreturns parsed text as JSON. Defaults toRAW. -
user_context(Optional[UserContext], default:None) –Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions. Check your permissions and retry your request.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent_runtime/_services/bedrock_agent_runtime.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 | |