helgesverre/extractor
Extractor is a Laravel package that uses OpenAI to pull structured data out of images, PDFs, emails, Word docs, and web pages. Define fields, get arrays or Spatie data objects back—no custom parsing logic needed.
TypeError when no API key is set. Factory::withApiKey() is not nullable, so a keyless local provider (Ollama, LM Studio) previously failed to build a client.config('openai.project'), matching the behaviour of the default openai-php/laravel client.OpenAI-Beta: assistants=v2 header from the custom base URI client. The package only calls the Chat Completions API, so the header was inert; it is dropped ahead of the Assistants API removal on 2026-08-26.config('extractor.model') / EXTRACTOR_MODEL env var (defaults to gpt-4o-mini)config('extractor.system_prompt') / EXTRACTOR_SYSTEM_PROMPT env varsystemPrompt() methodEXTRACTOR_SYSTEM_PROMPT to enable)GPT_5_4, GPT_5_4_PRO, GPT_5_3, GPT_5_2, GPT_5_2_PRO, GPT_5_1, GPT_5, GPT_5_PRO, GPT_5_MINI, GPT_5_NANO (with automatic parameter handling — uses max_completion_tokens, omits temperature)GPT_4_1, GPT_4_1_MINI, GPT_4_1_NANOO4_MINI, O3, O3_MINI, O3_PRO, O1, O1_PRO (with automatic parameter handling for reasoning models)GPT_4O, GPT_4O_MINI (cleaner naming)ImageContent detail parameter for OpenAI vision API (low, high, auto)response_format now sent with all requests for more reliable structured outputUPGRADING.md migration guide for breaking changesgpt-3.5-turbo-1106 to gpt-4o-mini$model, $maxTokens, and $temperature parameters in ExtractorManager methods are now nullable with config/extractor fallback chainsEngine::extractResponseText() now accepts only ChatResponse and returns stringopenai-php/laravel constraint from ^v0.10.2|^0.11 to >=0.10.2 <1.0 for broader compatibilityTEXT_DAVINCI_002, TEXT_DAVINCI_003, GPT_3_TURBO_INSTRUCT, GPT_3_TURBO, GPT_3_TURBO_16K, GPT_3_TURBO_1106, GPT_4, GPT4_32K, GPT_4_1106_PREVIEW, GPT_4_VISION, GPT_O1_MINI, GPT_O1_PREVIEWisCompletionModel(), isJsonModeCompatibleModel(), isHybridModel(), isOhOne() methods from EngineCompletionResponse import and handling from EngineContracts\Engine interfaceEngine::GPT_4_OMNI — use Engine::GPT_4O instead (will be removed in v0.6.0)Engine::GPT_4_OMNI_MINI — use Engine::GPT_4O_MINI instead (will be removed in v0.6.0)Engine::GPT_4o alias — use Engine::GPT_4O instead (will be removed in v0.6.0)declare(strict_types=1) to all source files for improved type safetytest-laravel-install.sh)json_last_error_msg() for better debuggingFactory::fromMime() rescue fallbacks to use lazy evaluation (closures)==) to strict equality (===) in ImageContentextractor_*Extractor::prompt() to explicitly call ->render() on View objectsEngine.php for vision model errorsFactory::fromMime() fallback handlingWord.php loader implementation with PHPWord integrationgpt-4-vision-preview) that no longer workssmalot/pdfparser from v2.9.0 to ^2.10prinsfrank/standards dependencyleague/flysystem-aws-s3-v3: ^3.16 → ^3.22.0openai-php/laravel: ^0.7.0 → ^v0.8.1smalot/pdfparser: * → v2.8.0spatie/laravel-data: ^3.9 → ^3.11.0spatie/laravel-package-tools: ^1.14.0 → ^1.16.2cleanupFileUsing)generateFilePathUsing)textract_version and textract_secret in configfromMime($mime, $content) method to Text\Factory for automatic loader selection based on MIME typeImageContent class for handling image inputssymfony/dom-crawler to ^7.0.0.github folder for better visibilityHow can I help you explore Laravel packages today?