partition_local_file
Convert local files into structured JSON or Markdown data using AI-powered transformation strategies for documents, PDFs, and images.
Instructions
Transform a local file into structured data using the Unstructured API.
Args:
input_file_path: The absolute path to the file.
output_file_dir: The absolute path to the directory where the output file should be saved.
strategy: The strategy for transformation.
Available strategies:
VLM - most advanced transformation suitable for difficult PDFs and Images
hi_res - high resolution transformation suitable for most document types
fast - fast transformation suitable for PDFs with extractable text
auto - automatically choose the best strategy based on the input file
vlm_model: The VLM model to use for the transformation.
vlm_model_provider: The VLM model provider to use for the transformation.
output_type: The type of output to generate. Options: 'json' for json
or 'md' for markdown.
Returns:
A string containing the structured data or a message indicating the output file
path with the structured data.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_file_path": "<input_file_path>",
"output_file_dir": "<output_file_dir>"
},
"name": "partition_local_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_file_path | Yes | ||
| output_file_dir | Yes | ||
| strategy | No | vlm | |
| vlm_model | No | claude-3-5-sonnet-20241022 | |
| vlm_model_provider | No | anthropic | |
| output_type | No | json |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |