0

I am trying to process a pdf document in Python using the Custom Document Extractor from Doc AI. I tried using a managed version which can found in the deploy & use tab on the console. I used Google's sample code and inputted the managed version's processor ID. I then get the following error:

NotFound: 404 Processor with id 'id' not found. [reason: "PROCESSOR_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata {
  key: "processor_id"
  value: "id"
}
]

I tried using the processor's overall id, and that worked fine, the document was extracted and there was an output. I am assuming this is the out of the box version? The managed version's processor id was not found when I executed the below code:

`from google.cloud import documentai_v1

def list_processors(project_id, location):
    client = documentai_v1.DocumentProcessorServiceClient()
    parent = f"projects/{project_id}/locations/{location}"

    response = client.list_processors(parent=parent)
    for processor in response:
        print(f"Processor name: {processor.name}")
        print(f"Processor display name: {processor.display_name}\n")

project_id = "id"
location = "us"  # for example, 'us' or 'eu'
list_processors(project_id, location)`

0 Answers0