-
-
Notifications
You must be signed in to change notification settings - Fork 113
Support mixed for getContent method
#820
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
base: main
Are you sure you want to change the base?
Conversation
mixed for getContent methodmixed for getContent method
3206ead to
6606004
Compare
2287f60 to
d3c8093
Compare
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.
Sorry for he late response, let's go with string|object here - or do we need array as well?
As the Vectorizer currently makes assumptions about having to pass string data to `PlatformInterface::invoke`, when that method can actually take about any sort of input. `Platform` implementations decide what data types they can handle through their normalizers. Therefore, it should be up to `platform` to handle types and not up to `store` to decide that it should only pass strings.
d3c8093 to
5a4473b
Compare
|
|
||
| final readonly class Vectorizer implements VectorizerInterface | ||
| final class Vectorizer implements VectorizerInterface | ||
| { | ||
| public function __construct( | ||
| private PlatformInterface $platform, | ||
| private string $model, | ||
| private LoggerInterface $logger = new NullLogger(), | ||
| private readonly PlatformInterface $platform, | ||
| private readonly string $model, | ||
| private readonly LoggerInterface $logger = new NullLogger(), | ||
| ) { | ||
| } |
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.
a bit confused about this diff, since it is already fixed on main with #829
ai/src/store/src/Document/Vectorizer.php
Lines 21 to 28 in 5f498f5
| final class Vectorizer implements VectorizerInterface | |
| { | |
| public function __construct( | |
| private readonly PlatformInterface $platform, | |
| private readonly string $model, | |
| private readonly LoggerInterface $logger = new NullLogger(), | |
| ) { | |
| } |
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.
Yeah weird, I'll try rebase although that shouldn't have any bearing on this diff... Maybe GH being buggy.
As the Vectorizer currently makes assumptions about having to pass string data to
PlatformInterface::invoke, when that method can actually take about any sort of input.Platformimplementations decide what data types they can handle through their normalizers. Therefore, it should be up toplatformto handle types and not up tostoreto decide that it should only pass strings.