Metadata-Version: 2.4
Name: anthropic-compat
Version: 0.1.0
Summary: Drop-in replacement for the Anthropic SDK that silently handles Claude 4.6 breaking changes
License-Expression: MIT
Keywords: anthropic,claude,ai,llm,compatibility
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: anthropic>=0.40.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"

# anthropic-compat

Drop-in fix for the Claude 4.6 breaking change that removed assistant message prefilling.

If your code does this and now gets a 400:

```python
response = client.messages.create(
    model="claude-opus-4-6",
    messages=[
        {"role": "user", "content": "What is 2+2?"},
        {"role": "assistant", "content": "The answer is:"},
    ],
)
```

Change one import and it works again:

```python
# before
import anthropic

# after
import anthropic_compat as anthropic
```

That's it. Everything else stays the same — client, methods, exceptions, all of it.

## Install

```
pip install anthropic-compat
```

## What it does

Intercepts prefilled assistant messages before they hit the API and converts them into system prompt instructions. The model still starts its response where your prefill left off.

Also handles the `output_format` → `output_config.format` rename so you don't have to.

## What it doesn't do

Monkey-patch anything. It wraps the official SDK and passes everything else through untouched.
