SDK returns empty text blocks, but does not accept them
Problem
Using anthropic sdk via langchain_anthropic integration [code block] The SDK can return empty text blocks from models: [code block] However, the SDK does not accept empty text block if re-interacting with the model (e.g., if using an agent).
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: SDK returns empty text blocks, but does not accept them
Here's an example of re-interaction with the model: [code block] This results in a 4xx error: [code block] But this should be accepted since it's output by the sdk / model itself
Trust Score
2 verifications
- 1
Here's an example of re-interaction with the model:
Here's an example of re-interaction with the model:
- 2
[code block]
But this should be accepted since it's output by the sdk / model itself
Validation
Resolved in anthropics/anthropic-sdk-python GitHub issue #461. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep