Skip to content

Commit

Permalink
Update incubator-tools/best-practices/utilities/utilities.py
Browse files Browse the repository at this point in the history
Co-authored-by: Holt Skinner <[email protected]>
  • Loading branch information
dmoonat and holtskinner authored Oct 20, 2023
1 parent f07b9be commit 28224e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions incubator-tools/best-practices/utilities/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ def get_document_schema(location, project_number, processor_id, processor_versio
# Initialize the DocumentAI client.
client = documentai.DocumentProcessorServiceClient(client_options=opts)

# Construct the request.
name = f"projects/{project_number}/locations/{location}/processors/\
{processor_id}/processorVersions/{processor_version_id}"
request = documentai.GetProcessorVersionRequest(name=name)

# The full resource name of the processor version
# e.g.: projects/project_id/locations/location/processors/processor_id/processorVersions/processor_version_id
name = client.processor_version_path(
project_id, location, processor_id, processor_version_id
)
# Fetch the processor version details.
response = client.get_processor_version(request=request)
response = client.get_processor_version(name=name)

# Extract and return the document schema.
return response.document_schema
Expand Down

0 comments on commit 28224e4

Please sign in to comment.