FG
💻 Software🤖 AI & LLMsAnthropic

SDK returns empty text blocks, but does not accept them

Freshalmost 2 years ago
Mar 14, 20260 views
Confidence Score86%
86%

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

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: SDK returns empty text blocks, but does not accept them

Low Risk

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

84

Trust Score

2 verifications

100% success
  1. 1

    Here's an example of re-interaction with the model:

    Here's an example of re-interaction with the model:

  2. 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

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

claudeanthropicllmapi