Consulta detalles sobre un procesador
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Obtiene detalles sobre un procesador existente
Explora más
Para obtener documentación en la que se incluye esta muestra de código, consulta lo siguiente:
Muestra de código
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis code sample retrieves details about an existing Document AI Processor using the processor's ID, project ID, and location.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Document AI requires setting up Application Default Credentials, as detailed in the provided documentation link.\u003c/p\u003e\n"],["\u003cp\u003eThe code utilizes the Document AI Python API to communicate with the Document AI service and fetch information.\u003c/p\u003e\n"],["\u003cp\u003eTo use this code, the user needs to provide the project ID, processor location, and the processor ID to retrieve specific details about the processor.\u003c/p\u003e\n"],["\u003cp\u003eThe full resource name for the processor is provided, indicating its unique path within the project and location.\u003c/p\u003e\n"]]],[],null,["# View details about a processor\n\nGets details about an existing Processor\n\nExplore further\n---------------\n\n\nFor detailed documentation that includes this code sample, see the following:\n\n- [Creating and managing processors](/document-ai/docs/create-processor)\n\nCode sample\n-----------\n\n### Python\n\n\nFor more information, see the\n[Document AI Python API\nreference documentation](/python/docs/reference/documentai/latest).\n\n\nTo authenticate to Document AI, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n\n from google.api_core.client_options import ClientOptions\n from google.cloud import documentai # type: ignore\n\n # TODO(developer): Uncomment these variables before running the sample.\n # project_id = 'YOUR_PROJECT_ID'\n # location = 'YOUR_PROCESSOR_LOCATION' # Format is 'us' or 'eu'\n # processor_id = 'YOUR_PROCESSOR_ID'\n\n\n def get_processor_sample(project_id: str, location: str, processor_id: str) -\u003e None:\n # You must set the api_endpoint if you use a location other than 'us'.\n opts = ClientOptions(api_endpoint=f\"{location}-documentai.googleapis.com\")\n\n client = documentai.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html(client_options=opts)\n\n # The full resource name of the processor, e.g.:\n # projects/{project_id}/locations/{location}/processors/{processor_id}\n name = client.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html#google_cloud_documentai_v1_services_document_processor_service_DocumentProcessorServiceClient_processor_path(project_id, location, processor_id)\n\n # Make GetProcessor request\n processor = client.https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.services.document_processor_service.DocumentProcessorServiceClient.html#google_cloud_documentai_v1_services_document_processor_service_DocumentProcessorServiceClient_get_processor(name=name)\n\n # Print the processor information\n print(f\"Processor Name: {processor.name}\")\n print(f\"Processor Display Name: {processor.display_name}\")\n print(f\"Processor Type: {processor.type_}\")\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=documentai)."]]