-
-
Notifications
You must be signed in to change notification settings - Fork 878
Comparing changes
Open a pull request
base repository: 567-labs/instructor
base: v1.11.1
head repository: 567-labs/instructor
compare: 1.11.2
- 20 commits
- 8 files changed
- 4 contributors
Commits on Aug 2, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 8bbdc44 - Browse repository at this point
Copy the full SHA 8bbdc44View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8e9826 - Browse repository at this point
Copy the full SHA f8e9826View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ce7d9c - Browse repository at this point
Copy the full SHA 6ce7d9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for daa7d8e - Browse repository at this point
Copy the full SHA daa7d8eView commit details
Commits on Aug 6, 2025
-
feat(multimodal): implement autodetect_media function for improved meβ¦
β¦dia type detection
Configuration menu - View commit details
-
Copy full SHA for 3a99980 - Browse repository at this point
Copy the full SHA 3a99980View commit details -
Configuration menu - View commit details
-
Copy full SHA for 199e5d7 - Browse repository at this point
Copy the full SHA 199e5d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f6d1fb6 - Browse repository at this point
Copy the full SHA f6d1fb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72b8424 - Browse repository at this point
Copy the full SHA 72b8424View commit details
Commits on Aug 7, 2025
-
Configuration menu - View commit details
-
Copy full SHA for f0af294 - Browse repository at this point
Copy the full SHA f0af294View commit details
Commits on Aug 27, 2025
-
test: update gemini model from 1.5-flash-latest to 2.5-flash
Replace outdated gemini-1.5-flash-latest with gemini-2.5-flash in multimodal content tests to use the latest available model version. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 496df12 - Browse repository at this point
Copy the full SHA 496df12View commit details -
Configuration menu - View commit details
-
Copy full SHA for a67f47a - Browse repository at this point
Copy the full SHA a67f47aView commit details -
feat: add automated bi-weekly scheduled releases
This workflow automatically creates releases every 2 weeks if: - All tests pass (linting, type checking, core tests) - There are changes since the last release - Final verification tests pass after version bump Features: - Smart version bumping based on commit messages - Comprehensive test coverage before release - Auto-generated changelog from commit history - Manual trigger option for testing - Detailed logging and failure notifications - Skips release if no meaningful changes The workflow runs every Monday at 9 AM UTC and only proceeds if all safety checks pass. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 922c0ea - Browse repository at this point
Copy the full SHA 922c0eaView commit details -
fix: correct GitHub Actions YAML syntax for scheduled releases
Fixed boolean default value and secrets access pattern in workflow configuration. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2497156 - Browse repository at this point
Copy the full SHA 2497156View commit details -
feat: add dry run mode and improve LLM test handling
- Added dry_run input for testing workflow without pushing - Made LLM tests non-blocking with better error handling - Added dry run summary output for testing - Improved robustness of test execution π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for da24f61 - Browse repository at this point
Copy the full SHA da24f61View commit details -
feat: Add automated bi-weekly scheduled releases (#1787)
## π Automated Bi-weekly Releases This PR adds a GitHub Actions workflow that automatically creates releases every 2 weeks with comprehensive safety checks. ## β¨ Features ### π‘οΈ Safety First - **All tests must pass** before any release (linting, type checking, core tests) - **Smart version bumping** based on conventional commit messages - **Final verification** tests run after version bump - **Skips empty releases** - won't create releases with no meaningful changes ### π§ Smart Automation - **Cron schedule**: Every Monday at 9 AM UTC (bi-weekly) - **Manual trigger**: Can be run manually for testing - **Dry run mode**: Test the workflow without actually pushing changes - **Non-blocking LLM tests**: Runs provider tests if API keys available ### π Version Management - **Patch bump**: For bug fixes and chores (`fix:`, `chore:`) - **Minor bump**: For new features (`feat:`) or breaking changes (`BREAKING`) - **Auto-generated changelog**: Based on commit history since last release ### π Testing Strategy - Core tests (no API calls required) - Linting with Ruff - Type checking with PyRight - Optional LLM provider tests (if secrets available) - Post-bump verification tests ## π― Workflow Logic ```mermaid graph TD A[Scheduled Trigger] --> B[Install Dependencies] B --> C[Run Linting] C --> D[Run Type Checking] D --> E[Run Core Tests] E --> F[Run LLM Tests*] F --> G[Check for Changes] G --> H{Has Changes?} H -->|No| I[Skip Release] H -->|Yes| J[Determine Version Bump] J --> K[Update Version] K --> L[Update Lockfile] L --> M[Final Test Run] M --> N[Generate Changelog] N --> O[Create Commit & Tag] O --> P{Dry Run?} P -->|Yes| Q[Show Summary] P -->|No| R[Push to GitHub] R --> S[Create GitHub Release] ``` ## π§ͺ Testing You can test this workflow with: ```bash # Dry run (no changes pushed) gh workflow run scheduled-release.yml -f dry_run=true # Skip LLM tests for faster testing gh workflow run scheduled-release.yml -f skip_tests=true -f dry_run=true ``` ## π Checklist - [x] Comprehensive test coverage - [x] Smart version bumping logic - [x] Error handling and logging - [x] Dry run mode for testing - [x] Auto-generated changelogs - [x] Non-blocking LLM tests - [x] Skip logic for empty releases - [x] Detailed workflow summaries ## π Configuration The workflow will need these repository secrets for full functionality: - `OPENAI_API_KEY` (optional - for LLM tests) - `ANTHROPIC_API_KEY` (optional - for LLM tests) - `PYPI_TOKEN` (optional - for automatic PyPI publishing) ## π Benefits 1. **Consistent releases** - No more manual version management 2. **Quality assurance** - All tests must pass before release 3. **Zero surprises** - Only releases when there are actual changes 4. **Full transparency** - Detailed logs and summaries 5. **Easy testing** - Dry run mode for validation --- π€ Generated with [Claude Code](https://claude.ai/code) <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Adds a GitHub Actions workflow for automated bi-weekly releases with comprehensive safety checks and smart version management. > > - **Workflow**: > - Adds `scheduled-release.yml` for automated bi-weekly releases via GitHub Actions. > - Triggers every 2 weeks on Monday at 9 AM UTC or manually. > - Includes dry run mode and optional LLM tests. > - **Safety Checks**: > - Requires all tests (linting, type checking, core tests) to pass before release. > - Skips release if no meaningful changes are detected. > - **Version Management**: > - Smart version bumping based on commit messages (`patch` for `fix:`, `chore:`, `minor` for `feat:`, `BREAKING`). > - Auto-generates changelog from commit history. > - **Testing**: > - Core tests run without API calls. > - Optional LLM tests if API keys are available. > - Final verification tests after version bump. > - **Misc**: > - Generates detailed workflow summaries and logs. > - Provides error notifications on failure. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=567-labs%2Finstructor&utm_source=github&utm_medium=referral)<sup> for da24f61. You can [customize](https://app.ellipsis.dev/567-labs/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->Configuration menu - View commit details
-
Copy full SHA for 2669593 - Browse repository at this point
Copy the full SHA 2669593View commit details -
feat: enhance GCS multimodal support with configurable timeout and stβ¦
β¦andardized errors ## Improvements Made: - **Configurable timeout**: All `from_gs_url()` methods now accept optional `timeout` parameter (default: 30s) - **Standardized error messages**: Unified error format across Image, Audio, and PDF classes - **Enhanced documentation**: Added comprehensive GCS examples and usage notes for all media types ## Changes: - `Image.from_gs_url()`: Added timeout parameter, standardized error message - `Audio.from_gs_url()`: Added timeout parameter (error message was already correct) - `PDF.from_gs_url()`: Added timeout parameter (error message was already correct) - Updated multimodal.md with GCS examples for all three media types - Added method tables showing GCS support across providers ## Testing: - All existing tests pass (48/49, 1 skipped) - GCS functionality verified for all media types - Timeout parameter tested and working correctly π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d3f8046 - Browse repository at this point
Copy the full SHA d3f8046View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e57e9c - Browse repository at this point
Copy the full SHA 8e57e9cView commit details -
feat: Enhanced Google Cloud Storage Support for Multimodal Classes (#β¦
β¦1788) ## π **Enhanced Google Cloud Storage (GCS) Support for Multimodal Classes** This PR adds comprehensive Google Cloud Storage support to the instructor library's multimodal functionality with significant enhancements over the basic implementation. ### β¨ **Key Features** #### π§ **Configurable Timeout Support** - All `from_gs_url()` methods now accept optional `timeout` parameter - Default: 30 seconds (configurable per request) - **Usage**: `Image.from_gs_url("gs://bucket/image.jpg", timeout=60)` #### π **Standardized Error Messages** - Unified error format across all media types - Clear, user-friendly messages: "Failed to access GCS {type} (must be publicly readable)" - Consistent error handling patterns #### π **Complete Documentation** - Added comprehensive GCS examples for **all three media types** (Image, Audio, PDF) - Updated method support tables showing GCS availability across providers - Added usage notes about public accessibility requirements - Copy-paste ready examples for all providers ### π― **What's Implemented** #### **Image Class** - β `Image.from_gs_url(url, timeout=30)` - Load images from GCS - β `Image.from_url()` - Automatically handles GCS URLs - β `Image.autodetect()` - Recognizes GCS URLs - β Provider support: OpenAI, Anthropic, Google GenAI #### **Audio Class** - β `Audio.from_gs_url(url, timeout=30)` - Load audio from GCS - β `Audio.from_url()` - Automatically handles GCS URLs - β `Audio.autodetect()` - Recognizes GCS URLs - β Provider support: OpenAI, Google GenAI - β Anthropic: Correctly shows "not supported" (API limitation) #### **PDF Class** - β `PDF.from_gs_url(url, timeout=30)` - Load PDFs from GCS - β `PDF.from_url()` - Automatically handles GCS URLs - β `PDF.autodetect()` - Recognizes GCS URLs - β Provider support: OpenAI, Anthropic, Google GenAI, Mistral #### **Enhanced Message Processing** - β `autodetect_images=True` now supports all media types including GCS URLs - β New `autodetect_media()` function for unified media detection - β PDF support added to message conversion pipeline ### π **Testing Status** - β **48/49 tests passing** (1 unrelated skip) - β **All GCS functionality verified** for Image, Audio, PDF - β **Timeout parameter tested** and working correctly - β **Pre-commit hooks passed** (linting & formatting) - β **Backward compatibility maintained** ### π **Security & Reliability** - **Public Access Only**: Only supports publicly accessible GCS objects - **Proper URL Validation**: Validates GCS URL format before processing - **Timeout Protection**: Configurable timeouts prevent hanging requests - **Error Handling**: Comprehensive error messages for debugging ### π **Usage Examples** #### **Basic GCS Usage** ```python from instructor.processing.multimodal import Image, Audio, PDF # Load from GCS with default timeout (30s) image = Image.from_gs_url("gs://my-bucket/image.jpg") audio = Audio.from_gs_url("gs://my-bucket/audio.wav") pdf = PDF.from_gs_url("gs://my-bucket/document.pdf") # Load with custom timeout image = Image.from_gs_url("gs://my-bucket/large-image.jpg", timeout=60) ``` #### **Automatic Detection** ```python import instructor client = instructor.from_provider("openai/gpt-4.1-mini") # Automatic GCS detection with autodetect_images=True response = client.chat.completions.create( response_model=MyModel, autodetect_images=True, # Now detects GCS URLs automatically messages=[{ "role": "user", "content": ["Analyze this:", "gs://my-bucket/document.pdf"] }] ) ``` ### π **Relationship to Existing Work** This PR enhances and supersedes the basic GCS implementation in PR #1763 by adding: - Configurable timeouts (addresses hanging request concerns) - Standardized error messages (eliminates inconsistencies) - Complete documentation coverage (all media types documented) - Enhanced testing coverage ### π **Technical Details** - **URL Conversion**: `gs://bucket/path` β `https://storage.googleapis.com/bucket/path` - **Content Encoding**: All content is base64-encoded for API compatibility - **MIME Type Detection**: Proper Content-Type header validation - **Provider Compatibility**: Works seamlessly across all supported providers ### π **Migration Path** This implementation is fully backward compatible. Existing code will continue to work unchanged, and users can gradually adopt the new timeout parameters and enhanced features. --- **Ready for review!** This implementation provides production-ready GCS support with comprehensive documentation, testing, and error handling. π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Enhances Google Cloud Storage support for Image, Audio, and PDF classes with new methods, error handling, and documentation updates in the instructor library. > > - **Behavior**: > - Adds `from_gs_url()` method to `Image`, `Audio`, and `PDF` classes in `multimodal.py` for loading from GCS with optional `timeout` parameter (default 30s). > - Enhances `autodetect()` and `autodetect_safely()` methods to recognize GCS URLs. > - Implements `autodetect_media()` function for unified media detection. > - **Error Handling**: > - Standardizes error messages for GCS access failures across media types. > - Validates GCS URL format and ensures public accessibility. > - **Documentation**: > - Updates `multimodal.md` with GCS usage examples for Image, Audio, and PDF classes. > - Adds notes on public accessibility requirements for GCS URLs. > - **Testing**: > - Adds tests for `from_gs_url()` methods and `autodetect_media()` in `test_multimodal.py`. > - Verifies GCS functionality and timeout parameter handling. > - **Misc**: > - Maintains backward compatibility with existing code. > - Updates method support tables in documentation to reflect GCS support. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=567-labs%2Finstructor&utm_source=github&utm_medium=referral)<sup> for d3f8046. You can [customize](https://app.ellipsis.dev/567-labs/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
Configuration menu - View commit details
-
Copy full SHA for 8728751 - Browse repository at this point
Copy the full SHA 8728751View commit details -
fix(exceptions): restore backwards compatibility for instructor.excepβ¦
β¦tions imports This commit addresses a breaking change introduced in v1.11.0 where the backward compatibility module `instructor/exceptions.py` was removed, causing imports like `from instructor.exceptions import InstructorRetryException` to fail. Changes: - Restore instructor/exceptions.py with proper re-exports from instructor.core.exceptions - Add deprecation warnings to guide users to the new import path - Bump version to 1.11.2 (patch version for backwards compatibility fix) The deprecated import path will continue to work but will show a deprecation warning directing users to import from instructor.core instead. Fixes: Breaking change from v1.11.0 removal of backwards compatibility files π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ff9d88f - Browse repository at this point
Copy the full SHA ff9d88fView commit details -
fix(exceptions): restore backwards compatibility for instructor.excepβ¦
β¦tions imports (#1789) ## Summary - Restore backwards compatibility for `instructor.exceptions` imports that broke in v1.11.0 - Add deprecation warnings to guide users to new import path `instructor.core` - Bump version to 1.11.2 (patch version for backwards compatibility fix) ## Problem Version 1.11.0 introduced a breaking change by removing the backwards compatibility module `instructor/exceptions.py`. This caused imports like `from instructor.exceptions import InstructorRetryException` to fail, breaking downstream applications without warning. ## Solution - Recreated `instructor/exceptions.py` with proper re-exports from `instructor.core.exceptions` - Added deprecation warnings to guide users to the recommended import path - Used proper semantic versioning (patch bump) for a backwards compatibility fix ## Test plan - [x] Test that old import path works: `from instructor.exceptions import InstructorRetryException` - [x] Test that new import path still works: `from instructor.core import InstructorRetryException` - [x] Verify deprecation warning is shown when using old import path - [x] Run linting and type checking - [x] Version bump to 1.11.2 π€ Generated with [Claude Code](https://claude.ai/code) <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Restores backwards compatibility for `instructor.exceptions` imports with deprecation warnings and bumps version to 1.11.2. > > - **Behavior**: > - Reintroduces `instructor/exceptions.py` to restore backwards compatibility for imports like `from instructor.exceptions import InstructorRetryException`. > - Adds deprecation warning in `instructor/exceptions.py` to guide users to `instructor.core`. > - **Versioning**: > - Bumps version to 1.11.2 in `pyproject.toml` and `uv.lock` for backwards compatibility fix. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=567-labs%2Finstructor&utm_source=github&utm_medium=referral)<sup> for ff9d88f. You can [customize](https://app.ellipsis.dev/567-labs/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
Configuration menu - View commit details
-
Copy full SHA for f178806 - Browse repository at this point
Copy the full SHA f178806View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we canβt render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.11.1...1.11.2