extract_from_text
Extract structured data from unstructured text using customizable instructions and examples. Maps extracted entities to their exact source locations for precise results.
Instructions
Extract structured information from text using langextract.
Uses Large Language Models to extract structured information from unstructured text based on user-defined instructions and examples. Each extraction is mapped to its exact location in the source text for precise source grounding.
Args: text: The text to extract information from prompt_description: Clear instructions for what to extract examples: List of example extractions to guide the model config: Configuration parameters for the extraction
Returns: Dictionary containing extracted entities with source locations and metadata
Raises: ToolError: If extraction fails due to invalid parameters or API issues
Input Schema
Name | Required | Description | Default |
---|---|---|---|
config | No | ||
examples | Yes | ||
prompt_description | Yes | ||
text | Yes |