You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/agent.rst
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -405,12 +405,12 @@ If you need to react more granularly to the lifecycle of individual tool calls,
405
405
// Let the client know, that the tool $event->toolCall->name failed with the exception: $event->exception
406
406
});
407
407
408
-
Keeping Tool Messages
409
-
~~~~~~~~~~~~~~~~~~~~~
408
+
Hiding Tool Messages
409
+
~~~~~~~~~~~~~~~~~~~~
410
410
411
-
Sometimes you might wish to keep the tool messages (:class:`Symfony\\AI\\Platform\\Message\\AssistantMessage` containing the ``toolCalls`` and :class:`Symfony\\AI\\Platform\\Message\\ToolCallMessage`
412
-
containing the result) in the context. Enable the ``keepToolMessages`` flag of the toolbox' :class:`Symfony\\AI\\Agent\\Toolbox\\AgentProcessor`
413
-
to ensure those messages will be added to your :class:`Symfony\\AI\\Platform\\Message\\MessageBag`::
411
+
Sometimes you might wish to hide the tool messages (:class:`Symfony\\AI\\Platform\\Message\\AssistantMessage` containing the ``toolCalls`` and :class:`Symfony\\AI\\Platform\\Message\\ToolCallMessage`
412
+
containing the result) in the context. Disable the ``keepToolMessages`` flag of the toolbox' :class:`Symfony\\AI\\Agent\\Toolbox\\AgentProcessor`
413
+
to ensure those messages will be removed from your :class:`Symfony\\AI\\Platform\\Message\\MessageBag`::
414
414
415
415
use Symfony\AI\Agent\Toolbox\AgentProcessor;
416
416
use Symfony\AI\Agent\Toolbox\Toolbox;
@@ -428,11 +428,11 @@ to ensure those messages will be added to your :class:`Symfony\\AI\\Platform\\Me
428
428
$tool = new MyTool();
429
429
430
430
$toolbox = new Toolbox([$tool]);
431
-
$toolProcessor = new AgentProcessor($toolbox, keepToolMessages: true);
431
+
$toolProcessor = new AgentProcessor($toolbox, keepToolMessages: false);
432
432
433
433
$agent = new Agent($platform, $model, inputProcessor: [$toolProcessor], outputProcessor: [$toolProcessor]);
0 commit comments