- 
                Notifications
    
You must be signed in to change notification settings  - Fork 568
 
Closed
Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.29.1
Steps to Reproduce
When you call:
from anthropic import AsyncAnthropicVertex, omit
client = AsyncAnthropicVertex()
client.messages.create(
                    max_tokens=max_answer_tokens,
                    system=prompt if user_input else omit,
                    messages=[
                        {
                            "role": "user",
                            "content": user_input if user_input else prompt,
                        }
                    ],
                    model=model,
                    tools=omit,
                    stream=True,
                )
You get an error: "object of type 'Omit' has no len()"
The error comes from here:
https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/anthropic.py#L174-L179
Both Anthropic and OpenAI latest version defaults to Omit instead of NOT_GIVEN:
We saw some similar errors in OpenAI that might be related: NotGiven has no len()
Expected Result
Both Anthropic and OpenAI shouldn't raise when we pass the argument as Omit
Actual Result
Anthropic and OpenAI are raising when we pass the argument as Omit
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Product Owner