File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
pydantic_ai_slim/pydantic_ai/models Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments