anthropic-sdk-python icon indicating copy to clipboard operation
anthropic-sdk-python copied to clipboard

Delta type not exported like other types

Open stevenh opened this issue 9 months ago • 3 comments

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.

stevenh avatar Mar 06 '25 19:03 stevenh

I had a look at fixing but the file looks to be generated. It mentions CONTRIBUTING.md but that doesn't seem to detail how to run the Stainless tool to regenerate.

stevenh avatar Mar 06 '25 19:03 stevenh

Workaround is to import from the respective module file:

from anthropic.types.raw_content_block_delta_event import Delta

Instead of the expected:

from anthropic.types import Delta

stevenh avatar Mar 06 '25 20:03 stevenh

Hey @stevenh, thanks for the suggestion! I've added a change that should make this easier to import in the next release: https://github.com/anthropics/anthropic-sdk-python/pull/920

dtmeadows avatar Apr 01 '25 16:04 dtmeadows