Skip to content

Commit 4b7e8b6

Browse files
committed
add no cover
1 parent 05b41f5 commit 4b7e8b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pydantic_ai_slim/pydantic_ai/models/anthropic.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,11 @@ async def _map_message( # noqa: C901
686686
content = m['content']
687687
if isinstance(content, str):
688688
# Convert string content to structured format with cache_control
689-
# This typically happens with assistant messages containing plain text
690-
m['content'] = [
691-
{'text': content, 'type': 'text', 'cache_control': BetaCacheControlEphemeralParam(type='ephemeral')}
689+
# This typically happens with tool responses
690+
m['content'] = [ # pragma: no cover
691+
BetaTextBlockParam(
692+
text=content, type='text', cache_control=BetaCacheControlEphemeralParam(type='ephemeral')
693+
)
692694
]
693695
else:
694696
# For structured content (lists), add cache_control to the last block

0 commit comments

Comments
 (0)