Update new_templates/vision_llm_text_extraction.py
Browse files
new_templates/vision_llm_text_extraction.py
CHANGED
|
@@ -177,4 +177,52 @@ def extract_text_from_images_deployable():
|
|
| 177 |
}]
|
| 178 |
}
|
| 179 |
|
| 180 |
-
return score
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
}]
|
| 178 |
}
|
| 179 |
|
| 180 |
+
return score
|
| 181 |
+
|
| 182 |
+
# Create the deployable score function
|
| 183 |
+
score = extract_text_from_images_deployable()
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
input_schema_example = [
|
| 187 |
+
{
|
| 188 |
+
"id": "1",
|
| 189 |
+
"type": "struct",
|
| 190 |
+
"fields": [
|
| 191 |
+
{
|
| 192 |
+
"name": "image_urls",
|
| 193 |
+
"type": "array<string>",
|
| 194 |
+
"nullable": False,
|
| 195 |
+
"metadata": {
|
| 196 |
+
"description": "List of image/PDF URLs or file paths to process"
|
| 197 |
+
},
|
| 198 |
+
},
|
| 199 |
+
{
|
| 200 |
+
"name": "extraction_prompt",
|
| 201 |
+
"type": "string",
|
| 202 |
+
"nullable": True,
|
| 203 |
+
"metadata": {
|
| 204 |
+
"description": "Optional custom extraction prompt. Uses default if null."
|
| 205 |
+
},
|
| 206 |
+
},
|
| 207 |
+
],
|
| 208 |
+
}
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
output_schema_example = [
|
| 212 |
+
{
|
| 213 |
+
"id": "1",
|
| 214 |
+
"type": "struct",
|
| 215 |
+
"fields": [
|
| 216 |
+
{
|
| 217 |
+
"name": "extracted_texts",
|
| 218 |
+
"type": "array<string>",
|
| 219 |
+
"nullable": False,
|
| 220 |
+
"metadata": {
|
| 221 |
+
"description": "Array of extracted text strings, one per input URL in same order"
|
| 222 |
+
},
|
| 223 |
+
}
|
| 224 |
+
],
|
| 225 |
+
}
|
| 226 |
+
]
|
| 227 |
+
|
| 228 |
+
|