-
-
Notifications
You must be signed in to change notification settings - Fork 126
Add support for pagination #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
you mean because everything is still in the collection anyways? |
Yes, But another implementation might have 1000 items and read them from disk or database. They could benefit. |
| public function __construct( | ||
| private readonly CollectionInterface $toolCollection, | ||
| private readonly CollectionInterface $collection, | ||
| private readonly int $pageSize = 20, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that introduces paging by default without the possibility to opt out, right?
well, one could set PHP_INT_MAX here, but what about allowing null to disable it?
anyhow, totally minor thing - valid to merge anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Let's remember that we should fix this.
(I created an issue)
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks! :)
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace Symfony\AI\McpSdk\Capability\Prompt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off topic, but what about using Mcp\Sdk as namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No "Symfony" prefix?
That would be a first for Symfony organization.
I do see they are long an ugly, but it follows Symfony UX' pattern
Just following the protocol.
Note that there is no real benefit with pagination for our standard Collection implementation