File size: 964 Bytes
e1ced8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Prompt template for the execute_crops node (Gemini code_execution)."""

CROPPER_PROMPT_TEMPLATE = """\

You are processing a construction drawing page. Your task:

{crop_instruction}



Instructions:

1. Examine the full image to orient yourself and locate the requested area.

2. Use Python with PIL/Pillow to crop the image to just the requested region.

3. Add padding of approximately 40 pixels on each side (clamped to image bounds).

4. Iterate if needed - if your first crop is too wide, too narrow, or misses the \

   target, refine it. Take up to 3 attempts to get a tight, accurate crop.

5. Output the final cropped image.



IMPORTANT RULES:

- Do NOT annotate, draw on, or modify the image content in any way.

- Just produce a clean, accurate crop of the requested area.

- The final output must be the best possible crop.

- If you cannot locate the requested area, crop to the most likely region and \

  note this in your text output.

"""