Delta type not exported like other types
Problem
When implementing a type hinted SDK I was able to import all types directly from anthropic.types with the exception of Delta. Looks like this is just missing from types.__init__.py.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Export Delta Type in anthropic.types Module
The Delta type is not exported in the __init__.py file of the anthropic.types module, which prevents it from being imported like other types. This is likely due to an oversight during the module's development or updates.
Awaiting Verification
Be the first to verify this fix
- 1
Locate __init__.py File
Navigate to the anthropic.types module directory and locate the __init__.py file where types are exported.
bashcd path/to/anthropic/types - 2
Edit __init__.py to Include Delta
Open the __init__.py file in a text editor and add the Delta type to the list of exports. This will allow it to be imported directly from the module.
pythonfrom .delta import Delta __all__ = ['Type1', 'Type2', 'Delta'] - 3
Save Changes
After editing the __init__.py file, save the changes to ensure that the Delta type is now included in the module exports.
- 4
Test Import of Delta Type
Create a test script to verify that the Delta type can now be imported successfully from anthropic.types. This will confirm that the fix is effective.
pythonfrom anthropic.types import Delta print(Delta) - 5
Document the Change
Update any relevant documentation to reflect the inclusion of the Delta type in the exports of the anthropic.types module.
Validation
Run the test script created in step 4. If it executes without errors and prints the Delta type, the fix has worked successfully.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep