Skip to content

Conversation

chr-hertel
Copy link
Member

Q A
Bug fix? no
New feature? no
Docs? no
Issues
License MIT

Follows #357

@carsonbot carsonbot changed the title Fix doc type on FileNormalizer Fix doc type on FileNormalizer Aug 31, 2025
@chr-hertel chr-hertel added the Platform Issues & PRs about the AI Platform component label Aug 31, 2025
@carsonbot carsonbot changed the title Fix doc type on FileNormalizer [Platform] Fix doc type on FileNormalizer Aug 31, 2025
@chr-hertel chr-hertel merged commit 8c640f1 into main Aug 31, 2025
13 checks passed
@xabbuh xabbuh deleted the fix-filenormalizer-phpstan branch September 1, 2025 06:16
derrabus pushed a commit to derrabus/symfony-ai that referenced this pull request Sep 12, 2025
…lexible message IDs (symfony#384)

This PR updates the message ID type from `TimeBasedUidInterface` to
`AbstractUid&TimeBasedUidInterface` using PHP's intersection types. This
change provides more flexibility while maintaining type safety.

Using the intersection type `AbstractUid&TimeBasedUidInterface` ensures
that:
- ✅ Both `toRfc4122()` (from AbstractUid) and `getDateTime()` (from
TimeBasedUidInterface) are available
- ✅ Implementations can use any time-based UID type (UUID v1/v6/v7 or
ULID)
- ✅ Type safety is maintained
- ✅ All existing tests pass without modification

- Updated `MessageInterface::getId()` return type
- Updated all message implementations (AssistantMessage, SystemMessage,
UserMessage, ToolCallMessage)
- Updated anonymous class in tests

1. **Flexibility**: Users can now implement messages with either UUID or
ULID
2. **Type Safety**: The intersection type guarantees all necessary
methods are available
3. **Future Proof**: Any new Symfony UID types that extend AbstractUid
and implement TimeBasedUidInterface will work

None - this is backwards compatible since all existing UUID
implementations already satisfy the new type constraint.

All existing tests pass. The implementation has been verified to work
with both UUID and ULID.
derrabus pushed a commit to derrabus/symfony-ai that referenced this pull request Sep 12, 2025
…eBasedUidInterface` for flexible message IDs (OskarStark)

This PR was merged into the main branch.

Discussion
----------

[Platform] Use intersection type `AbstractUid&TimeBasedUidInterface` for flexible message IDs

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#384

Commits
-------

115a9e1 feat: use intersection type `AbstractUid&TimeBasedUidInterface` for flexible message IDs (symfony#384)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform Issues & PRs about the AI Platform component Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants