File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1212namespace Symfony \AI \Platform \Message ;
1313
1414use Symfony \AI \Platform \Metadata \MetadataAwareTrait ;
15+ use Symfony \Component \Uid \AbstractUid ;
16+ use Symfony \Component \Uid \TimeBasedUidInterface ;
17+ use Symfony \Component \Uid \Uuid ;
1518
1619/**
1720 * @author Christopher Hertel <mail@christopher-hertel.de>
@@ -22,6 +25,8 @@ class MessageBag implements \Countable, \IteratorAggregate
2225{
2326 use MetadataAwareTrait;
2427
28+ private AbstractUid &TimeBasedUidInterface $ id ;
29+
2530 /**
2631 * @var list<MessageInterface>
2732 */
@@ -30,6 +35,12 @@ class MessageBag implements \Countable, \IteratorAggregate
3035 public function __construct (MessageInterface ...$ messages )
3136 {
3237 $ this ->messages = array_values ($ messages );
38+ $ this ->id = Uuid::v7 ();
39+ }
40+
41+ public function getId (): AbstractUid &TimeBasedUidInterface
42+ {
43+ return $ this ->id ;
3344 }
3445
3546 public function add (MessageInterface $ message ): void
You can’t perform that action at this time.
0 commit comments