File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
pydantic_ai_slim/pydantic_ai Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 18
18
from ._run_context import AgentDepsT
19
19
from .agent import Agent
20
20
from .exceptions import UserError
21
- from .messages import ModelMessage
21
+ from .messages import ModelMessage , TextPart
22
22
from .models import KnownModelName , infer_model
23
23
from .output import OutputDataT
24
24
@@ -355,7 +355,7 @@ def handle_slash_command(
355
355
except IndexError :
356
356
console .print ('[dim]No output available to copy.[/dim]' )
357
357
else :
358
- text_to_copy = '\n ' .join (part .content for part in parts if part . part_kind == 'text' )
358
+ text_to_copy = '\n \n ' .join (part .content for part in parts if isinstance ( part , TextPart ) )
359
359
text_to_copy = text_to_copy .strip ()
360
360
if text_to_copy :
361
361
pyperclip .copy (text_to_copy )
You can’t perform that action at this time.
0 commit comments